algopat
Version:
Utility library for implementing common design patterns and algorithms
17 lines • 748 B
TypeScript
declare abstract class Prototype {
abstract clone(): Prototype;
abstract initialize(..._args: any[]): void;
}
declare abstract class AbstractPrototypeRegistry {
abstract register<P extends Prototype>(id: string, prototype: P): void;
abstract unregister<P extends Prototype>(id: string, prototype: P): void;
abstract get<P extends Prototype>(id: string): P | void;
}
declare class PrototypeRegistry extends AbstractPrototypeRegistry {
private prototypes;
register<P extends Prototype>(id: string, prototype: P): void;
unregister(id: string): void;
get<P extends Prototype>(id: string): P | void;
}
export { Prototype, AbstractPrototypeRegistry, PrototypeRegistry };
//# sourceMappingURL=prototype.pattern.d.ts.map