Skip to content

Instantly share code, notes, and snippets.

View acutmore's full-sized avatar

Ashley Claymore acutmore

View GitHub Profile
@mhofman
mhofman / wrapper-registry.d.ts
Last active December 8, 2021 18:42
Wrap any value into a registered object
export declare class Wrapper<Kind, Value = any> {
private kind: Kind;
private value: Value;
}
export interface WrapperRegistry<Kind> extends Function {
constructor: WrapperRegistryConstructor;
wrap<T>(value: T): Wrapper<Kind, T>;
unwrap<T>(wrapped: Wrapper<Kind, T>): T;
}