Skip to content

Interface: EventsNamespace\<TPresence\>

@roomful/svelte


@roomful/svelte / EventsNamespace

Defined in: packages/svelte/src/index.ts:742

Exposes event helpers for the adapter.

TPresence extends PresenceData = PresenceData

The room presence shape.

channel<TPayload>(name): EventChannelStore<TPayload, TPresence>

Defined in: packages/svelte/src/index.ts:750

Creates a readable store for a custom event channel.

TPayload = unknown

The event payload type.

string

The custom event channel name.

EventChannelStore<TPayload, TPresence>

The bound event channel store.


emit<TPayload>(name, payload): void

Defined in: packages/svelte/src/index.ts:760

Broadcasts a custom event.

TPayload = unknown

The event payload type.

string

The custom event channel name.

TPayload

The payload to send.

void

Nothing.


emitTo<TPayload>(peerId, name, payload): void

Defined in: packages/svelte/src/index.ts:771

Sends a custom event to a specific peer.

TPayload = unknown

The event payload type.

string

The target peer identifier.

string

The custom event channel name.

TPayload

The payload to send.

void

Nothing.


on<TPayload>(name, handler): Unsubscribe

Defined in: packages/svelte/src/index.ts:781

Subscribes to a custom event channel.

TPayload = unknown

The event payload type.

string

The custom event channel name.

(payload, from) => void

The callback invoked for incoming events.

Unsubscribe

A function that removes the listener.