registerType() function
Flushes @property definitions collected on a class into the RPC type description. Invoked by class-level decorators once the class (and hence its name) is available.
Signature:
export declare function registerType(ctor: Function, metadata: DecoratorMetadata | undefined, indexType?: string): void;
Parameters
|
Parameter |
Type |
Description |
|---|---|---|
|
ctor |
Function |
the decorated class constructor |
|
metadata |
DecoratorMetadata | undefined |
shared decorator metadata carrying the collected properties |
|
indexType |
string |
(Optional) optional index signature definition, as raw source text |
Returns:
void
Remarks
Only the class's own collected properties are flushed — fields inherited from a base class are not copied, and are represented solely by inherits. So every class in a hierarchy that declares @property fields needs its own classType() or indexed(), or those fields are lost.
inherits is re-derived from the runtime prototype chain on every call, and is the empty string for a class with no extends.
Each property is installed as an accessor whose type is a memoising getter, so the type argument is resolved on first read rather than at decoration time. Existing entries are merged into, never cleared.
Read this page as plain markdown — no HTML, no navigation. For pasting into an LLM, or for an agent to fetch.