@ma3-pro-plugins/ma3-pro-plugins-lib
Version:
TSTL Library for grandMA3 plugins
13 lines (12 loc) • 588 B
TypeScript
/**
* Creates an instance of a singleton object.
* This singleton object is stored in a global variable.
* If a new show is loaded, and the singleton is accessed again,
* then the existing singleton is destroyed, and a new instance will be created.
*/
export declare function getOrCreateShowSingleton<T extends ShowSingleton>(globalId: string, create: () => T): T;
export interface ShowSingleton {
destroy(): void;
}
export declare function isShowSingletonExists(globalId: string): boolean;
export declare function getShowSingleton<T extends ShowSingleton>(globalId: string): T;