@opentui/core
Version:
OpenTUI is a TypeScript library on a native Zig core for building terminal user interfaces (TUIs)
9 lines (8 loc) • 376 B
TypeScript
/**
* Ensures a value is initialized once per process,
* persists across Bun hot reloads, and is type-safe.
*/
export declare function singleton<T>(key: string, factory: () => T): T;
export declare function getSingleton<T>(key: string): T | undefined;
export declare function destroySingleton(key: string): void;
export declare function hasSingleton(key: string): boolean;