import { BufferError, InvalidInputError, ParseError, UniqueIdError } from "../errors.mjs"; //#region src/uuid/v7.d.ts type UuidV7Options = { /** * 16 bytes of random data to use for UUID generation. * Note: Several bytes will be overwritten with timestamp, version, and variant data. */ random?: Uint8Array; msecs?: number; seq?: number; }; type UuidV7 = { (): string; (options: UuidV7Options | undefined, buf: TBuf, offset?: number): TBuf; (options?: UuidV7Options, buf?: undefined, offset?: number): string; toBytes(id: string): Uint8Array; fromBytes(bytes: Uint8Array): string; timestamp(id: string): number; isValid(id: unknown): id is string; /** The nil UUID (all zeros) */ NIL: string; /** The max UUID (all ones) */ MAX: string; }; /** * Generate a UUID v7 string or write the bytes into a buffer. * * UUID v7 is a time-ordered UUID that embeds a Unix timestamp in milliseconds, * making IDs naturally sortable by creation time. Ideal for database primary keys * where chronological ordering improves index performance. * * @example * ```ts * import { uuidv7 } from 'uniku/uuid/v7' * * const id = uuidv7() * // => "018e5e5c-7c8a-7000-8000-000000000000" * * // Extract timestamp * const ts = uuidv7.timestamp(id) * console.log(new Date(ts)) * * // Validate * uuidv7.isValid(id) // true * * // Convert to/from bytes * const bytes = uuidv7.toBytes(id) * const restored = uuidv7.fromBytes(bytes) * ``` */ declare const uuidv7: UuidV7; //#endregion export { BufferError, InvalidInputError, ParseError, UniqueIdError, UuidV7, UuidV7Options, uuidv7 }; //# sourceMappingURL=v7.d.mts.map