@aurbi/tiny-composite-builder
Version:
Small framework for taking base objects and adding extensions using a builder pattern, but with full and strict compile-time type support.
12 lines (10 loc) • 338 B
TypeScript
import { IBaseHint } from "./IBase";
/**
* Represents an extension class that can be added to TBase.
*
* Suggested: in your implementing extension class, assign base as a constructor parameter:
*
* `constructor(public Base: TBase, ...otherArgs: any){ ... }`
*/
export type IExtension<TBase extends IBaseHint> =
{ Base: TBase }