//#region src/generator.d.ts declare class UUIDv7 { #private; /** * Generates a new `UUIDv7` instance. * @param encodeAlphabet Alphabet used for encoding. Defaults to the * [Base58](https://www.cs.utexas.edu/users/moore/acl2/manuals/current/manual/index-seo.php/BITCOIN_____A2BASE58-CHARACTERS_A2) * alphabet. ASCII, 16-64 characters, no duplicates. * @param blockOnBackwardsClock When `true`, `gen()` synchronously busy-waits * when the system clock goes backwards relative to the last observed * timestamp, until the clock catches up. Embedded UUID timestamps will * always reflect the actual wall clock at the cost of blocking the event * loop for the duration of any backwards skew. When `false` (default), the * timestamp is pinned to the last observed value and the monotonic counter * advances — RFC 9562 §6.2 permits both strategies. Has no effect on the * custom-timestamp path. */ constructor(opts?: { encodeAlphabet?: string; blockOnBackwardsClock?: boolean; }); /** * Generates a new UUIDv7. * * The two branches (custom-timestamp and runtime) share intent but are * written out separately rather than via a shared helper — V8's call-frame * overhead measurably regresses throughput on the regen branch. * * @param customTimestamp Custom timestamp in milliseconds. If omitted, uses `Date.now()`. */ gen(customTimestamp?: number): string; /** * Generates an array of new UUIDv7s. */ genMany(amount: number, customTimestamp?: number): string[]; /** * Encodes a UUIDv7 with the instance's alphabet. */ encode(id: string): string; /** * Decodes an encoded UUIDv7. Returns `null` if invalid. */ decode(encodedId: string): string | null; /** * Decodes an encoded UUIDv7. Throws if invalid. */ decodeOrThrow(encodedId: string): string; static isValid(id: string): boolean; static timestamp(id: string): number | null; static date(id: string): Date | null; } //#endregion //#region src/index.d.ts /** * Generates a new UUIDv7 using the shared default instance. */ declare function uuidv7(customTimestamp?: number): string; /** * Encodes a UUIDv7 with the default Base58 alphabet. */ declare function encodeUUIDv7(id: string): string; /** * Decodes an encoded UUIDv7. Returns `null` if invalid. */ declare function decodeUUIDv7(encodedId: string): string | null; /** * Decodes an encoded UUIDv7. Throws if invalid. */ declare function decodeOrThrowUUIDv7(encodedId: string): string; //#endregion export { UUIDv7, decodeOrThrowUUIDv7, decodeUUIDv7, encodeUUIDv7, uuidv7 }; //# sourceMappingURL=index.d.ts.map