papi-dts
    Preparing search index...
    interface DataProviderService {
        DataProviderEngine: typeof DataProviderEngine;
        decorators: {
            doNotNotify: {
                (method: Function & { doNotNotify?: boolean }): void;
                (target: object, member: string): void;
            };
            ignore: {
                (method: Function & { isIgnored?: boolean }): void;
                (target: object, member: string): void;
            };
        };
        get: <DataProviderName extends keyof DataProviders>(
            providerName: DataProviderName,
        ) => Promise<undefined | DataProviders[DataProviderName]>;
        hasKnown: (providerName: string) => boolean;
        registerEngine: <DataProviderName extends keyof DataProviders>(
            providerName: DataProviderName,
            dataProviderEngine: IDataProviderEngine<
                DataProviderTypes[DataProviderName],
            >,
            dataProviderType?: string,
            dataProviderAttributes?: { [property: string]: unknown },
        ) => Promise<DisposableDataProviders[DataProviderName]>;
    }
    Index

    Properties

    DataProviderEngine: typeof DataProviderEngine

    Abstract class that provides a placeholder notifyUpdate for data provider engine classes. If a data provider engine class extends this class, it doesn't have to specify its own notifyUpdate function in order to use notifyUpdate.

    IDataProviderEngine for more information on extending this class.

    decorators: {
        doNotNotify: {
            (method: Function & { doNotNotify?: boolean }): void;
            (target: object, member: string): void;
        };
        ignore: {
            (method: Function & { isIgnored?: boolean }): void;
            (target: object, member: string): void;
        };
    }

    A collection of decorators to be used with the data provider service

    Type declaration

    • doNotNotify: {
          (method: Function & { doNotNotify?: boolean }): void;
          (target: object, member: string): void;
      }

      Decorator function that marks a data provider engine set<data_type> method not to automatically emit an update and notify subscribers of a change to the data. papi will still consider the set<data_type> method to be a data type method, but it will not layer over it to emit updates.

      class MyDataProviderEngine {
      papi.dataProviders.decorators.doNotNotify
      async setVerse() {}
      }

      WARNING: Do not copy and paste this example. The @ symbol does not render correctly in JSDoc code blocks, so a different unicode character was used. Please use a normal @ when using a decorator.

      OR

      const myDataProviderEngine = {
      async setVerse() {},
      };
      papi.dataProviders.decorators.ignore(dataProviderEngine.setVerse);

      The method not to layer over to send an automatic update

    • ignore: {
          (method: Function & { isIgnored?: boolean }): void;
          (target: object, member: string): void;
      }

      Decorator function that marks a data provider engine set___ or get___ method to be ignored. papi will not layer over these methods or consider them to be data type methods

      class MyDataProviderEngine {
      papi.dataProviders.decorators.ignore
      async getInternal() {}
      }

      WARNING: Do not copy and paste this example. The @ symbol does not render correctly in JSDoc code blocks, so a different unicode character was used. Please use a normal @ when using a decorator.

      OR

      const myDataProviderEngine = {
      async getInternal() {},
      };
      papi.dataProviders.decorators.ignore(dataProviderEngine.getInternal);

      The method to ignore

    class MyDataProviderEngine {
    papi.dataProviders.decorators.ignore
    async getInternal() {}
    }

    WARNING: Do not copy and paste this example. The @ symbol does not render correctly in JSDoc code blocks, so a different unicode character was used. Please use a normal @ when using a decorator.

    get: <DataProviderName extends keyof DataProviders>(
        providerName: DataProviderName,
    ) => Promise<undefined | DataProviders[DataProviderName]>

    Get a data provider that has previously been set up

    Type declaration

      • <DataProviderName extends keyof DataProviders>(
            providerName: DataProviderName,
        ): Promise<undefined | DataProviders[DataProviderName]>
      • Get a data provider that has previously been set up

        Type Parameters

        • DataProviderName extends keyof DataProviders

        Parameters

        • providerName: DataProviderName

          Name of the desired data provider

        Returns Promise<undefined | DataProviders[DataProviderName]>

        The data provider with the given name if one exists, undefined otherwise

    Name of the desired data provider

    The data provider with the given name if one exists, undefined otherwise

    hasKnown: (providerName: string) => boolean

    Indicate if we are aware of an existing data provider with the given name. If a data provider with the given name is somewhere else on the network, this function won't tell you about it unless something else in the existing process is subscribed to it.

    Type declaration

      • (providerName: string): boolean
      • Indicate if we are aware of an existing data provider with the given name. If a data provider with the given name is somewhere else on the network, this function won't tell you about it unless something else in the existing process is subscribed to it.

        Parameters

        • providerName: string

        Returns boolean

    registerEngine: <DataProviderName extends keyof DataProviders>(
        providerName: DataProviderName,
        dataProviderEngine: IDataProviderEngine<
            DataProviderTypes[DataProviderName],
        >,
        dataProviderType?: string,
        dataProviderAttributes?: { [property: string]: unknown },
    ) => Promise<DisposableDataProviders[DataProviderName]>

    Creates a data provider to be shared on the network layering over the provided data provider engine.

    Type declaration

      • <DataProviderName extends keyof DataProviders>(
            providerName: DataProviderName,
            dataProviderEngine: IDataProviderEngine<
                DataProviderTypes[DataProviderName],
            >,
            dataProviderType?: string,
            dataProviderAttributes?: { [property: string]: unknown },
        ): Promise<DisposableDataProviders[DataProviderName]>
      • Creates a data provider to be shared on the network layering over the provided data provider engine.

        Type Parameters

        • DataProviderName extends keyof DataProviders

        Parameters

        • providerName: DataProviderName

          Name this data provider should be called on the network

        • dataProviderEngine: IDataProviderEngine<DataProviderTypes[DataProviderName]>

          The object to layer over with a new data provider object

        • OptionaldataProviderType: string

          String to send in a network event to clarify what type of data provider is represented by this engine. For generic data providers, the default value of dataProvider can be used. For data provider types that have multiple instances (e.g., project data providers), a unique type name should be used to distinguish from generic data providers.

        • OptionaldataProviderAttributes: { [property: string]: unknown }

          Optional object that will be sent in a network event to provide additional metadata about the data provider represented by this engine.

          WARNING: registering a dataProviderEngine mutates the provided object. Its notifyUpdate and set methods are layered over to facilitate data provider subscriptions.

        Returns Promise<DisposableDataProviders[DataProviderName]>

        The data provider including control over disposing of it. Note that this data provider is a new object distinct from the data provider engine passed in.

    Name this data provider should be called on the network

    The object to layer over with a new data provider object

    String to send in a network event to clarify what type of data provider is represented by this engine. For generic data providers, the default value of dataProvider can be used. For data provider types that have multiple instances (e.g., project data providers), a unique type name should be used to distinguish from generic data providers.

    Optional object that will be sent in a network event to provide additional metadata about the data provider represented by this engine.

    WARNING: registering a dataProviderEngine mutates the provided object. Its notifyUpdate and set methods are layered over to facilitate data provider subscriptions.

    The data provider including control over disposing of it. Note that this data provider is a new object distinct from the data provider engine passed in.