@duplicis/types - v1.0.0
    Preparing search index...

    Interface PluginBinding<Type>

    plugin configuration binding

    interface PluginBinding<Type extends Type> {
        key: string;
        options: Map[Type];
        t: TypedTranslationFunctions<BindTranslations>;
        type: Type;
        emit(event: string, ...arguments_: any[]): Emitter;
        get(): Promise<Value[Type]>;
        hasListeners(event: string): boolean;
        hasListeners(): boolean;
        listenerCount(event: string): number;
        listenerCount(): number;
        listeners(event: string): ((...arguments_: any[]) => void)[];
        off(event: string, listener: (...arguments_: any[]) => void): Emitter;
        off(event: string): Emitter;
        off(): Emitter;
        on(event: string, listener: (...arguments_: any[]) => void): Emitter;
        once(event: string, listener: (...arguments_: any[]) => void): Emitter;
        set(value: Value[Type]): Promise<Value[Type]>;
        update(
            callback: (value: Value[Type]) => Awaitable<Value[Type]>,
        ): Promise<Value[Type]>;
    }

    Type Parameters

    Hierarchy

    • InstanceType<typeof Emitter>
      • PluginBinding
    Index

    Properties

    key: string

    config key

    options: Map[Type]

    config options

    t: TypedTranslationFunctions<BindTranslations>

    Translation functions.

    type: Type

    config type-name

    Methods

    • Emit an event, invoking all handlers registered for it.

      Parameters

      • event: string

        The name of the event to emit.

      • ...arguments_: any[]

        Arguments to pass to the event handlers.

      Returns Emitter

      The Emitter instance for method chaining.

    • Check if there are any handlers registered for a specific event.

      Parameters

      • event: string

        The name of the event.

      Returns boolean

      true if there are one or more handlers, false otherwise.

    • Check if there are any handlers registered for any event.

      Returns boolean

      true if there are one or more handlers for any event, false otherwise.

    • Get the count of listeners for a specific event.

      Parameters

      • event: string

        The name of the event.

      Returns number

      The number of listeners for the event.

    • Get the count of all event handlers in total.

      Returns number

      The total number of event handlers.

    • Retrieve the event handlers registered for a specific event.

      Parameters

      • event: string

        The name of the event.

      Returns ((...arguments_: any[]) => void)[]

      An array of functions registered as handlers for the event.

    • Remove a specific event handler for a specified event.

      Parameters

      • event: string

        The name of the event.

      • listener: (...arguments_: any[]) => void

        The specific handler function to remove.

      Returns Emitter

      The Emitter instance for method chaining.

    • Remove all event handlers for a specified event.

      Parameters

      • event: string

        The name of the event for which to remove all handlers.

      Returns Emitter

      The Emitter instance for method chaining.

    • Remove all event handlers for all events.

      Returns Emitter

      The Emitter instance for method chaining.

    • Register an event handler that listens to a specified event.

      Parameters

      • event: string

        The name of the event to listen to.

      • listener: (...arguments_: any[]) => void

        The function to execute when the event is emitted.

      Returns Emitter

      The Emitter instance for method chaining.

    • Register a one-time event handler for a specified event.

      Parameters

      • event: string

        The name of the event to listen to.

      • listener: (...arguments_: any[]) => void

        The function to execute once when the event is emitted.

      Returns Emitter

      The Emitter instance for method chaining.