# registerType() function · @imqueue/rpc

Source: https://imqueue.org/api/rpc/latest/rpc.registertype/
Published: 2026-08-04
Author: @imqueue maintainers (https://github.com/imqueue)
Package: @imqueue/rpc 3.5.3 — generated reference, not hand-written

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:**

```typescript
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()](https://imqueue.org/api/rpc/latest/rpc.classtype/) or [indexed()](https://imqueue.org/api/rpc/latest/rpc.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.

