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.