API reference / @chanx-js/client / core / TopicDescriptor
Interface: TopicDescriptor<ToServer, ToClient, Pattern>
Defined in: packages/client/src/core/descriptor.ts:33
Type Parameters
| Type Parameter | Default type |
|---|---|
ToServer extends ChanxMessage | ChanxMessage |
ToClient extends ChanxMessage | ChanxMessage |
Pattern extends string | string |
Properties
kind
ts
readonly kind: "topic";Defined in: packages/client/src/core/descriptor.ts:38
name
ts
readonly name: string;Defined in: packages/client/src/core/descriptor.ts:39
pattern
ts
readonly pattern: Pattern;Defined in: packages/client/src/core/descriptor.ts:40
types?
ts
readonly optional types?: object;Defined in: packages/client/src/core/descriptor.ts:43
Phantom: carries message types through inference, never present at runtime.
toClient
ts
toClient: ToClient;toServer
ts
toServer: ToServer;validators?
ts
readonly optional validators?: Validators<ToServer, ToClient>;Defined in: packages/client/src/core/descriptor.ts:41
Methods
with()
ts
with(...args): TopicRef<ToServer, ToClient, Pattern>;Defined in: packages/client/src/core/descriptor.ts:49
The topic with its params filled in, ready to join: roomTopic.with({ room_name: 'lobby' }). A missing or misspelled param is a compile error.
Parameters
| Parameter | Type |
|---|---|
...args | TopicParamsArgs<Pattern> |
Returns
TopicRef<ToServer, ToClient, Pattern>