| 1 | export const FIRST_KEY_INDEX = 1; |
| 2 | |
| 3 | export const IS_READ_ONLY = true; |
| 4 | |
| 5 | interface ReserveOptions { |
| 6 | width: number; |
| 7 | depth: number; |
| 8 | decay: number; |
| 9 | } |
| 10 | |
| 11 | export function transformArguments( |
| 12 | key: string, |
| 13 | topK: number, |
| 14 | options?: ReserveOptions |
| 15 | ): Array<string> { |
| 16 | const args = ['TOPK.RESERVE', key, topK.toString()]; |
| 17 | |
| 18 | if (options) { |
| 19 | args.push( |
| 20 | options.width.toString(), |
| 21 | options.depth.toString(), |
| 22 | options.decay.toString() |
| 23 | ); |
| 24 | } |
| 25 | |
| 26 | return args; |
| 27 | } |
| 28 | |
| 29 | export declare function transformReply(): 'OK'; |