alinea
Version:
[](https://npmjs.org/package/alinea) [](https://packagephobia.com/result?p=alinea)
21 lines (20 loc) • 869 B
TypeScript
export declare const BASE_62_DIGITS = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
export declare function validateOrderKey(key: string): void;
export declare function isValidOrderKey(key: string): boolean;
/**
* @param {string | null} a
* @param {string | null} b
* @param {string=} digits
* @return {string}
*/
export declare function generateKeyBetween(a: string | null, b: string | null, digits?: string): string;
/**
* same preconditions as generateKeysBetween.
* n >= 0.
* Returns an array of n distinct keys in sorted order.
* If a and b are both null, returns [a0, a1, ...]
* If one or the other is null, returns consecutive "integer"
* keys. Otherwise, returns relatively short keys between
* a and b.
*/
export declare function generateNKeysBetween(a: string | null, b: string | null, n: number, digits?: string): string[];