@eklabdev/blingts4
Version:
A comprehensive TypeScript decorators library implementing Stage 2 decorators for TS 4.9+
16 lines (15 loc) • 471 B
TypeScript
/**
* Ensures a class has only one instance
*/
export declare function Singleton(): <T extends new (...args: any[]) => Object>(target: T) => {
new (...args: any[]): {
constructor: Function;
toString(): string;
toLocaleString(): string;
valueOf(): Object;
hasOwnProperty(v: PropertyKey): boolean;
isPrototypeOf(v: Object): boolean;
propertyIsEnumerable(v: PropertyKey): boolean;
};
instance: T;
} & T;