API reference / @chanx-js/client / core / TopicDescriptor
Interface: TopicDescriptor<ToServer, ToClient, Pattern, Replies>
Defined in: packages/client/src/core/descriptor.ts:45
Type Parameters
| Type Parameter | Default type |
|---|---|
ToServer extends ChanxMessage | ChanxMessage |
ToClient extends ChanxMessage | ChanxMessage |
Pattern extends string | string |
Replies | NoReplies |
Properties
kind
ts
readonly kind: "topic";Defined in: packages/client/src/core/descriptor.ts:51
name
ts
readonly name: string;Defined in: packages/client/src/core/descriptor.ts:52
pattern
ts
readonly pattern: Pattern;Defined in: packages/client/src/core/descriptor.ts:53
types?
ts
readonly optional types?: object;Defined in: packages/client/src/core/descriptor.ts:56
Phantom: carries message types through inference, never present at runtime.
replies
ts
replies: Replies;toClient
ts
toClient: ToClient;toServer
ts
toServer: ToServer;validators?
ts
readonly optional validators?: Validators<ToServer, ToClient>;Defined in: packages/client/src/core/descriptor.ts:54
Methods
with()
ts
with(...args): TopicRef<ToServer, ToClient, Pattern, Replies>;Defined in: packages/client/src/core/descriptor.ts:62
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, Replies>