papi-dts
    Preparing search index...
    interface PapiBackendProjectDataProviderService {
        get: <ProjectInterface extends keyof ProjectDataProviderInterfaces>(
            projectInterface: ProjectInterface,
            projectId: string,
            pdpFactoryId?: string,
        ) => Promise<ProjectDataProviderInterfaces[ProjectInterface]>;
        registerProjectDataProviderEngineFactory: <
            SupportedProjectInterfaces extends
                (keyof ProjectDataProviderInterfaces)[],
        >(
            pdpFactoryId: string,
            projectInterfaces: SupportedProjectInterfaces,
            pdpEngineFactory: IProjectDataProviderEngineFactory<
                SupportedProjectInterfaces,
            >,
            attributes?: { [property: string]: unknown },
            documentation?: NetworkObjectDocumentation,
        ) => Promise<Dispose>;
    }
    Index

    Properties

    get: <ProjectInterface extends keyof ProjectDataProviderInterfaces>(
        projectInterface: ProjectInterface,
        projectId: string,
        pdpFactoryId?: string,
    ) => Promise<ProjectDataProviderInterfaces[ProjectInterface]>

    Type declaration

      • <ProjectInterface extends keyof ProjectDataProviderInterfaces>(
            projectInterface: ProjectInterface,
            projectId: string,
            pdpFactoryId?: string,
        ): Promise<ProjectDataProviderInterfaces[ProjectInterface]>
      • Get a Project Data Provider for the given project ID.

        Type Parameters

        Parameters

        • projectInterface: ProjectInterface

          projectInterface that the project to load must support. The TypeScript type for the returned project data provider will have the project data provider interface type associated with this projectInterface. If the project does not implement this projectInterface (according to its metadata), an error will be thrown.

        • projectId: string

          ID for the project to load

        • OptionalpdpFactoryId: string

          Optional ID of the PDP factory from which to get the project data provider if the PDP factory supports this project id and project interface. If not provided, then look in all available PDP factories for the given project ID.

        Returns Promise<ProjectDataProviderInterfaces[ProjectInterface]>

        Project data provider with types that are associated with the given projectInterface

        const pdp = await get('platformScripture.USFM_Verse', 'ProjectID12345');
        pdp.getVerseUSFM({ book: 'JHN', chapterNum: 1, verseNum: 1 });

        If did not find a project data provider for the project id that supports the requested projectInterface (and from the requested PDP factory if specified)

    registerProjectDataProviderEngineFactory: <
        SupportedProjectInterfaces extends
            (keyof ProjectDataProviderInterfaces)[],
    >(
        pdpFactoryId: string,
        projectInterfaces: SupportedProjectInterfaces,
        pdpEngineFactory: IProjectDataProviderEngineFactory<
            SupportedProjectInterfaces,
        >,
        attributes?: { [property: string]: unknown },
        documentation?: NetworkObjectDocumentation,
    ) => Promise<Dispose>

    Type declaration

      • <SupportedProjectInterfaces extends (keyof ProjectDataProviderInterfaces)[]>(
            pdpFactoryId: string,
            projectInterfaces: SupportedProjectInterfaces,
            pdpEngineFactory: IProjectDataProviderEngineFactory<
                SupportedProjectInterfaces,
            >,
            attributes?: { [property: string]: unknown },
            documentation?: NetworkObjectDocumentation,
        ): Promise<Dispose>
      • Add a new Project Data Provider Factory to PAPI that uses the given engine.

        Type Parameters

        Parameters

        • pdpFactoryId: string

          Unique id for this PDP factory.

        • projectInterfaces: SupportedProjectInterfaces

          The standardized sets of methods (projectInterfaces) supported by the Project Data Provider Engines produced by this factory. Indicates what sort of project data should be available on the PDPEs created by this factory.

        • pdpEngineFactory: IProjectDataProviderEngineFactory<SupportedProjectInterfaces>

          Used in a ProjectDataProviderFactory to create ProjectDataProviders.

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

          Optional registration-level attributes. The platform overwrites the projectInterfaces field — that field is always the platform-canonical value.

        • Optionaldocumentation: NetworkObjectDocumentation

          Optional NetworkObjectDocumentation for the factory itself. Set documentation['x-experimental']: true to mark all methods on this factory as experimental.

        Returns Promise<Dispose>

        Promise that resolves to a disposable object when the registration operation completes.