peerix - v0.6.0
    Preparing search index...

    Class Addon

    Base class for Peerix addons.

    Index
    • Attaches the addon to a Room instance. This method is called when the addon is added using room.attach(addon).

      Parameters

      • room: Room

        The Room instance to attach to.

      Returns Promise<void>

    • Detaches the addon from a Room instance. This method is called when the addon is removed using room.detach(addon).

      Parameters

      • room: Room

        The Room instance to detach from.

      Returns Promise<void>

    • Emits one or more events from the addon.

      Parameters

      • event: string

        Event name or list of event names.

      • ...args: any[]

        Arguments to pass to the event handlers.

      Returns void

    • Unsubscribes from one or more events emitted by the addon.

      Parameters

      • event: string

        Event name or list of event names.

      • Optionalhandler: (...args: any[]) => void

        Optional event handler to remove. If not provided, all handlers for the event(s) will be removed.

      Returns void

    • Subscribes to one or more events emitted by the addon.

      Parameters

      • event: string

        Event name or list of event names.

      • handler: (...args: any[]) => void

        Event handler.

      Returns void

    • Subscribes to one or more events emitted by the addon for a single invocation.

      Parameters

      • event: string

        Event name or list of event names.

      • handler: (...args: any[]) => void

        Event handler.

      Returns void