Comunica
    Preparing search index...

    Interface IStatisticBase<T>

    Statistics are able to track specific types of information during query execution. It is possible to listen to events that are produced by each specific statistic.

    interface IStatisticBase<T> {
        emit: (data: T) => boolean;
        getListeners: () => ((data: T) => any)[];
        on: (fn: (data: T) => any) => IStatisticBase<T>;
        removeListener: (fn: (data: T) => any) => IStatisticBase<T>;
        updateStatistic: (...data: any[]) => void;
    }

    Type Parameters

    • T

    Implemented by

    Index

    Properties

    emit: (data: T) => boolean

    Emits a new statistic event to all listeners

    Type declaration

      • (data: T): boolean
      • Parameters

        • data: T

          Statistic data to emit

        Returns boolean

    getListeners: () => ((data: T) => any)[]

    Type declaration

      • (): ((data: T) => any)[]
      • Returns ((data: T) => any)[]

        All listeners on statistic

    on: (fn: (data: T) => any) => IStatisticBase<T>

    Attaches a listener to the statistic to listen for new statistic events

    Type declaration

    removeListener: (fn: (data: T) => any) => IStatisticBase<T>

    Removes a listener from the statistic

    Type declaration

    updateStatistic: (...data: any[]) => void

    Updates the statistic with new information from query processing

    Type declaration

      • (...data: any[]): void
      • Parameters

        • ...data: any[]

          Statistic data to process

        Returns void