Interface Typing

This interface is used to interact with typing in a chat room including subscribing to typing events and fetching the current set of typing clients.

Get an instance via Room.typing.

interface Typing {
    channel: RealtimeChannel;
    get(): Promise<Set<string>>;
    onDiscontinuity(listener: DiscontinuityListener): OnDiscontinuitySubscriptionResponse;
    start(): Promise<void>;
    stop(): Promise<void>;
    subscribe(listener: TypingListener): TypingSubscriptionResponse;
    unsubscribeAll(): void;
}

Hierarchy

  • EmitsDiscontinuities
    • Typing

Properties

Get the Ably realtime channel underpinning typing events.

The Ably realtime channel.

Methods

  • Get the current typers, a set of clientIds.

    Returns Promise<Set<string>>

    A Promise of a set of clientIds that are currently typing.

  • Start indicates that the current user is typing. This will emit a typingStarted event to inform listening clients and begin a timer, once the timer expires, a typingStopped event will be emitted. The timeout is configurable through the typingTimeoutMs parameter. If the current user is already typing, it will reset the timer and being counting down again without emitting a new event.

    Returns Promise<void>

    A promise which resolves upon success of the operation and rejects with an ErrorInfo object upon its failure.

  • Stop indicates that the current user has stopped typing. This will emit a typingStopped event to inform listening clients, and immediately clear the typing timeout timer.

    Returns Promise<void>

    A promise which resolves upon success of the operation and rejects with an ErrorInfo object upon its failure.

  • Unsubscribe all listeners from receiving typing events.

    Returns void