papi-dts
    Preparing search index...

    Type Alias IBaseProjectDataProvider<TProjectDataTypes>

    IBaseProjectDataProvider: IProjectDataProvider<
        TProjectDataTypes & MandatoryProjectDataTypes,
    > & WithProjectDataProviderEngineSettingMethods<TProjectDataTypes> & WithProjectDataProviderEngineExtensionDataMethods<
        TProjectDataTypes,
    > & {
        subscribeSetting: <ProjectSettingName extends ProjectSettingNames>(
            key: ProjectSettingName,
            callback: (
                value: ProjectSettingTypes[ProjectSettingName] | PlatformError,
            ) => void,
            options?: DataProviderSubscriberOptions,
        ) => Promise<UnsubscriberAsync>;
        subscribeExtensionData(
            dataScope: ExtensionDataScope,
            callback: (extensionData: undefined | string | PlatformError) => void,
            options?: DataProviderSubscriberOptions,
        ): Promise<UnsubscriberAsync>;
    }

    An object on the papi for interacting with that project data. Created by the papi and layers over an IBaseProjectDataProviderEngine provided by an extension. Sometimes returned from getting a project data provider with papi.projectDataProviders.get (depending on if the PDP supports the platform.base projectInterface).

    Project Data Providers are a specialized version of IDataProvider that work with projects by exposing methods according to a set of projectInterfaces. For each project available, a Project Data Provider Factory that supports that project with some set of projectInterfaces creates a new instance of a PDP with the supported projectInterfaces.

    Every Base PDP must fulfill the requirements of this interface in order to support the methods the PAPI requires for interacting with project data.

    See more information, including the difference between Base and Layering PDPs, at ProjectDataProviderInterfaces.

    Type Parameters

    Type declaration

    • subscribeSetting: <ProjectSettingName extends ProjectSettingNames>(
          key: ProjectSettingName,
          callback: (
              value: ProjectSettingTypes[ProjectSettingName] | PlatformError,
          ) => void,
          options?: DataProviderSubscriberOptions,
      ) => Promise<UnsubscriberAsync>

      Subscribe to receive updates to the specified project setting.

      Note: By default, this subscribeSetting function automatically retrieves the current project setting value and runs the provided callback as soon as possible. That way, if you want to keep your data up-to-date, you do not also have to run getSetting. You can turn this functionality off in the options parameter.

    • subscribeExtensionData: function
      • Subscribe to receive updates to an extension's project data identified by dataScope in this project

        Parameters

        • dataScope: ExtensionDataScope

          Information about what data is being referenced by the calling extension given to this Project Data Provider

        • callback: (extensionData: undefined | string | PlatformError) => void

          Function to run with the updated data corresponding to the dataScope. If there is an error while retrieving the updated data, the function will run with a PlatformError instead of the data. You can call isPlatformError on this value to check if it is an error.

        • Optionaloptions: DataProviderSubscriberOptions

          Various options to adjust how the subscriber emits updates

        Returns Promise<UnsubscriberAsync>

        Unsubscriber to stop listening for updates