VariabledefaultConst

default: {
    BaseProjectDataProviderEngine: typeof "shared/models/base-project-data-provider-engine.model".BaseProjectDataProviderEngine;
    commands: typeof "shared/services/command.service";
    DataProviderEngine: typeof "shared/models/data-provider-engine.model".DataProviderEngine;
    dataProviders: DataProviderService;
    dialogs: DialogService;
    fetch: typeof __type;
    internet: InternetService;
    LayeringProjectDataProviderEngineFactory: typeof "shared/models/project-data-provider-engine-factory.model".LayeringProjectDataProviderEngineFactory;
    localization: ILocalizationService;
    logger: MainLogger & {
        default: MainLogger;
    };
    menuData: IMenuDataService;
    network: PapiNetworkService;
    networkObjects: MinimalNetworkObjectService;
    networkObjectStatus: NetworkObjectStatusServiceType;
    ProjectDataProviderEngine: typeof "shared/models/project-data-provider-engine.model".ProjectDataProviderEngine;
    projectDataProviders: PapiBackendProjectDataProviderService;
    projectLookup: ProjectLookupServiceType;
    projectSettings: IProjectSettingsService;
    scrollGroups: IScrollGroupService;
    settings: ISettingsService;
    storage: ExtensionStorageService;
    WebViewFactory: typeof "shared/models/web-view-factory.model".WebViewFactory;
    webViewProviders: PapiWebViewProviderService;
    webViews: WebViewServiceType;
}

Type declaration

  • BaseProjectDataProviderEngine: typeof "shared/models/base-project-data-provider-engine.model".BaseProjectDataProviderEngine

    Abstract class that provides a placeholder notifyUpdate for Base Project Data Provider Engine classes. If a Base Project Data Provider Engine class extends this class, it doesn't have to specify its own notifyUpdate function in order to use notifyUpdate.

    Additionally, extending this class informs Intellisense that you can run notifyUpdate with the Setting data type if needed like so:

    this.notifyUpdate('Setting');
    

    IBaseProjectDataProviderEngine for more information on extending this class.

  • commands: typeof "shared/services/command.service"

    The command service allows you to exchange messages with other components in the platform. You can register a command that other services and extensions can send you. You can send commands to other services and extensions that have registered commands.

  • DataProviderEngine: typeof "shared/models/data-provider-engine.model".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.

  • dataProviders: DataProviderService

    Service that allows extensions to send and receive data to/from other extensions

  • dialogs: DialogService

    Prompt the user for responses with dialogs

  • fetch: typeof __type

    This is just an alias for internet.fetch

  • internet: InternetService

    Service that provides a way to call fetch since the original function is not available

  • LayeringProjectDataProviderEngineFactory: typeof "shared/models/project-data-provider-engine-factory.model".LayeringProjectDataProviderEngineFactory

    Abstract class with partial implementation of IProjectDataProviderEngineFactory specifically for Layering PDPFs. You can extend this class to make creating a Layering PDPF easier.

    Extending this class automatically fulfills the special requirements for Layering PDPfs, so we highly recommend extending this class. Please see IProjectDataProviderEngineFactory.getAvailableProjects for more information on the requirements.

  • localization: ILocalizationService

    Service that allows to get and store localizations

  • logger: MainLogger & {
        default: MainLogger;
    }

    All extensions and services should use this logger to provide a unified output of logs

  • menuData: IMenuDataService

    Service that allows to get and store menu data

  • network: PapiNetworkService

    Service that provides a way to send and receive network events

  • networkObjects: MinimalNetworkObjectService

    Network objects are distributed objects within PAPI for TS/JS objects.

    https://en.wikipedia.org/wiki/Distributed_object

    Objects registered via networkObjectService.set are retrievable using networkObjectService.get.

    Function calls made on network objects retrieved via networkObjectService.get are proxied and sent to the original objects registered via networkObjectService.set. All functions on the registered object are proxied except for constructors, dispose, and functions starting with on since those should be events (which are not intended to be proxied) based on our naming convention. If you don't want a function to be proxied, don't make it a property of the registered object.

    Functions on a network object will be called asynchronously by other processes regardless of whether the functions are synchronous or asynchronous, so it is best to make them all asynchronous. All shared functions' arguments and return values must be serializable to be called across processes.

    When a service registers an object via networkObjectService.set, it is the responsibility of that service, and only that service, to call dispose on that object when it is no longer intended to be shared with other services.

    When an object is disposed by calling dispose, all functions registered with the onDidDispose event handler will be called. After an object is disposed, calls to its functions will no longer be proxied to the original object.

  • networkObjectStatus: NetworkObjectStatusServiceType

    Provides functions related to the set of available network objects

  • ProjectDataProviderEngine: typeof "shared/models/project-data-provider-engine.model".ProjectDataProviderEngine

    Abstract class that provides a placeholder notifyUpdate for Project Data Provider Engine classes. If a Project Data Provider Engine class extends this class, it doesn't have to specify its own notifyUpdate function in order to use notifyUpdate.

    Additionally, extending this class informs Intellisense that you can run notifyUpdate with the Setting data type if needed like so:

    this.notifyUpdate('Setting');
    

    IProjectDataProviderEngine for more information on extending this class.

  • projectDataProviders: PapiBackendProjectDataProviderService

    Service that registers and gets project data providers

  • projectLookup: ProjectLookupServiceType

    Provides metadata for projects known by the platform

    Note: this service runs locally everywhere in the TypeScript processes. It is also exposed on the PAPI websocket. Note these functions are all asynchronous on the PAPI websocket regardless of if their types are synchronous locally.

  • projectSettings: IProjectSettingsService

    Provides utility functions that project data providers should call when handling project settings

  • scrollGroups: IScrollGroupService

    Provides functions related to scroll groups and Scripture references at those scroll groups

  • settings: ISettingsService
  • storage: ExtensionStorageService

    This service provides extensions in the extension host the ability to read/write data based on the extension identity and current user (as identified by the OS). This service will not work within the renderer.

  • WebViewFactory: typeof "shared/models/web-view-factory.model".WebViewFactory

    A partial implementation of IWebViewProvider that includes creating WebViewControllers for each web view served by the web view provider. This class handles registering, disposing, and making sure there is only one web view controller for each web view for you.

    You can create a new class extending this abstract class to create a web view provider that serves web views and web view controllers of a specific webViewType to facilitate interaction between those web views and other extensions. You can register it with the PAPI using papi.webViewProviders.register.

    If you want to change your existing IWebViewProvider from a plain object to extending this class, you will need to change your object's existing method named getWebView (IWebViewProvider.getWebView) to be named getWebViewDefinition (WebViewFactory.getWebViewDefinition), which is a drop-in replacement. You likely do NOT want to overwrite this class's getWebView because that will eliminate most of the benefits associated with using this class.

    IWebViewProvider for more information on extending this class.

  • webViewProviders: PapiWebViewProviderService

    Interface for registering webView providers, registering webView controllers, and performing privileged interactions with web views

  • webViews: WebViewServiceType

    Service exposing various functions related to using webViews

    WebViews are iframes in the Platform.Bible UI into which extensions load frontend code, either HTML or React components.