Interface IChatInstanceCallbacks

IChatInstanceCallbacks

Callback interface for chat instance events

interface IChatInstanceCallbacks {
    onBeginChat(clientId: string, swarmName: string): void;
    onCheckActivity(
        clientId: string,
        swarmName: string,
        isActive: boolean,
        lastActivity: number,
    ): void;
    onDispose(
        clientId: string,
        swarmName: string,
        instance: IChatInstance,
    ): void;
    onInit(clientId: string, swarmName: string, instance: IChatInstance): void;
    onSendMessage(clientId: string, swarmName: string, content: string): void;
}

Methods

  • Called when chat begins

    Parameters

    • clientId: string
    • swarmName: string

    Returns void

  • Called when checking activity status

    Parameters

    • clientId: string
    • swarmName: string
    • isActive: boolean
    • lastActivity: number

    Returns void

  • Called when instance is disposed

    Parameters

    Returns void

  • Called when instance is initialized

    Parameters

    Returns void

  • Called when message is sent

    Parameters

    • clientId: string
    • swarmName: string
    • content: string

    Returns void