interface PapiBackendProjectDataProviderService {
    get: (<ProjectInterface>(projectInterface: ProjectInterface, projectId: string, pdpFactoryId?: string) => Promise<ProjectDataProviderInterfaces[ProjectInterface]>);
    registerProjectDataProviderEngineFactory: (<SupportedProjectInterfaces>(pdpFactoryId: string, projectInterfaces: SupportedProjectInterfaces, pdpEngineFactory: IProjectDataProviderEngineFactory<SupportedProjectInterfaces>) => Promise<Dispose>);
}

Properties

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

Type declaration

    • <ProjectInterface>(projectInterface, projectId, pdpFactoryId?): 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(new VerseRef('JHN', '1', '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>(pdpFactoryId: string, projectInterfaces: SupportedProjectInterfaces, pdpEngineFactory: IProjectDataProviderEngineFactory<SupportedProjectInterfaces>) => Promise<Dispose>)

Type declaration

    • <SupportedProjectInterfaces>(pdpFactoryId, projectInterfaces, pdpEngineFactory): 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

      Returns Promise<Dispose>

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