contexify
Version:
A TypeScript library providing a powerful dependency injection container with context-based IoC capabilities, inspired by LoopBack's Context system.
36 lines (34 loc) • 1.1 kB
TypeScript
/**
* Create a function that generates unique identifiers in an extremely fast way.
* This produces a hexadecimal format string (e.g. '52032fedb951da00').
*
* @param size - The length of the ID to generate (default: 16)
* @returns A function that generates unique IDs
* @internal
*/
declare function createIdGenerator(size?: number): () => string;
/**
* Generate a unique identifier in an extremely fast way.
* This produces a hexadecimal format string (e.g. '52032fedb951da00').
*
* @internal
*/
declare const generateUniqueId: () => string;
/**
* Generate a UUID-like identifier.
* This produces a standard UUID format string (e.g. '9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d').
*
* @internal
*/
declare function generateUUID(): string;
/**
* A regular expression for testing values generated by generateUniqueId.
* @internal
*/
declare const UNIQUE_ID_PATTERN: RegExp;
/**
* A regular expression for testing standard UUID format.
* @internal
*/
declare const UUID_PATTERN: RegExp;
export { UNIQUE_ID_PATTERN, UUID_PATTERN, createIdGenerator, generateUUID, generateUniqueId };