Structure
Table of Contentsโ
Class Definitionโ
export abstract class Structure {}
info
Structure is an abstract utility class. All members are static โ it cannot be instantiated directly.
Methodsโ
extend()โ
static extend<K extends keyof Extendable, T extends Extendable[K]>(name: K, extender: (target: Extendable[K]) => T): TReplaces a built-in class with an extended version. The extender function receives the current class and must return a subclass of it.
Parametersโ
Parameter Type Description Optional namestring The name of the structure to replace. Must be a key of Extendable.extenderFunction A function that receives the current class and returns the extended version. Returnsโ
Type Description T The extended class.
get()โ
static get<K extends keyof Extendable>(name: K): Extendable[K]Returns the current class registered under the given name โ either the built-in or a previously extended version.
Parametersโ
Parameter Type Description Optional namestring The name of the structure to retrieve. Must be a key of Extendable.Returnsโ
Type Description Extendable[K]The registered class for the given key.