/** * ID Generation Utilities * * Provides consistent ID generation across the application. * Uses globalThis.crypto when available, with a fallback for environments without it. * * @fileoverview ID generation utility functions */ /** * Generate a UUID v4 string. * Uses crypto.randomUUID when available, otherwise falls back to a timestamp-based ID. * * @returns A UUID v4 string or fallback ID * * @example * ```typescript * const id = generateId(); * // => 'a1b2c3d4-e5f6-7890-abcd-ef1234567890' (crypto available) * // => '1701475200000-x7k9m2' (fallback) * ``` */ export declare function generateId(): string; /** * Generate a short random ID (8 characters). * Useful for correlation IDs, short references, etc. * * @returns A short random string * * @example * ```typescript * const shortId = generateShortId(); * // => 'x7k9m2ab' * ``` */ export declare function generateShortId(): string; /** * Generate a correlation ID for tracing. * Format: timestamp-randomString * * @returns A correlation ID string * * @example * ```typescript * const correlationId = generateCorrelationId(); * // => '1701475200000-x7k9m2' * ``` */ export declare function generateCorrelationId(): string; /** * Generate a trace ID for distributed tracing (32 hex characters / 128 bits). * * @returns A 32-character hex string * * @example * ```typescript * const traceId = generateTraceId(); * // => 'a1b2c3d4e5f67890abcdef1234567890' * ``` */ export declare function generateTraceId(): string; /** * Generate a span ID for distributed tracing (16 hex characters / 64 bits). * * @returns A 16-character hex string * * @example * ```typescript * const spanId = generateSpanId(); * // => 'a1b2c3d4e5f67890' * ``` */ export declare function generateSpanId(): string; /** * Check if a string is a valid UUID v4. * * @param value - The string to check * @returns true if the string is a valid UUID * * @example * ```typescript * isValidUUID('a1b2c3d4-e5f6-4890-abcd-ef1234567890'); // true * isValidUUID('not-a-uuid'); // false * isValidUUID('bulk-upload-123456'); // false * ``` */ export declare function isValidUUID(value: string | null | undefined): boolean; /** * ID generation utilities object for convenient access. */ export declare const IdUtils: { readonly generate: typeof generateId; readonly generateShort: typeof generateShortId; readonly generateCorrelation: typeof generateCorrelationId; readonly generateTraceId: typeof generateTraceId; readonly generateSpanId: typeof generateSpanId; readonly isValidUUID: typeof isValidUUID; }; //# sourceMappingURL=id.d.ts.map