Skip to main content
Version: v2.10.5

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): T

Replaces 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
namestringThe name of the structure to replace. Must be a key of Extendable.
extenderFunctionA function that receives the current class and returns the extended version.

Returns​

Type Description
TThe 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
namestringThe name of the structure to retrieve. Must be a key of Extendable.

Returns​

Type Description
Extendable[K]The registered class for the given key.