/** * UUID version 7 (RFC 9562 §5.7): a 48-bit Unix millisecond timestamp, then * randomness, so ids sort by creation time as plain strings. * * Every `generate*Id` mints through here. A session log names its records, * turns and child sessions by these ids, and a directory listing or an index * ordered by id is then ordered by time with no second column. * * **Monotonic within one process.** RFC 9562 §6.2 method 3: inside one * millisecond, or when the wall clock steps backwards, the 42 bits after the * version are treated as a counter and incremented, so every id this * generator returns sorts strictly after the one before it. When that counter * would overflow, the timestamp field advances by one millisecond rather than * wrapping. The 32 bits after the counter stay random on every call, which is * what keeps two processes minting in the same millisecond apart. * * Layout (hex digits): `tttttttt-tttt-7ccc-Vccc-cccrrrrrrrr`, where `t` is * the timestamp, `c` the 42-bit counter (12 bits in `rand_a`, 30 at the top of * `rand_b`), `V` the RFC variant nibble `8`–`b`, and `r` fresh randomness. */ export interface UuidV7Source { /** Current time in Unix milliseconds. */ readonly now?: () => number; /** Fills the buffer with cryptographically strong random bytes. */ readonly random?: (bytes: Uint8Array) => void; } /** A generator with its own monotonic state. Tests inject the clock and the randomness. */ export declare function createUuidV7Generator(source?: UuidV7Source): () => string; /** The process-wide generator every id factory shares. */ export declare const uuidv7: () => string; /** The Unix millisecond timestamp a UUIDv7 carries, or `undefined` for any other spelling. */ export declare function uuidv7Timestamp(value: string): number | undefined; //# sourceMappingURL=uuidv7.d.ts.map