-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
54 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
export declare const Alphabet: { | ||
readonly numbers: string; | ||
readonly hexadecimalLowercase: string; | ||
readonly hexadecimalUppercase: string; | ||
readonly lowercase: string; | ||
readonly uppercase: string; | ||
readonly alphanumeric: string; | ||
readonly url: string; | ||
readonly base64: string; | ||
readonly noDoppelganger: string; | ||
}; | ||
|
||
export interface TempoIdOptions { | ||
/** | ||
* Length of the time part. Defaults to 8. | ||
*/ | ||
timeLength?: number; | ||
|
||
/** | ||
* Length of the random part. Defaults to 13. | ||
*/ | ||
randomLength?: number; | ||
|
||
/** | ||
* Custom time value in milliseconds. | ||
*/ | ||
time?: number; | ||
|
||
/** | ||
* Custom start time. | ||
*/ | ||
startTime?: Date; | ||
|
||
/** | ||
* Whether to pad the time part on the left. Defaults to true. | ||
*/ | ||
padLeft?: boolean; | ||
|
||
/** | ||
* Custom alphabet to use. | ||
*/ | ||
alphabet?: string; | ||
} | ||
|
||
/** | ||
* Generates a new TempoId with a time part and a random part. | ||
* The total length of the ID will be the sum of `timeLength` | ||
* and `randomLength`. Both default to 8 for `timeLength` and 13 for `randomLength`. | ||
* | ||
* @param options - The options for generating the TempoId. | ||
* @returns The generated TempoId. | ||
*/ | ||
export declare function tempoId(options?: TempoIdOptions): string; |