VariabledefaultConst

default: {
    commands: typeof "shared/services/command.service";
    dataProviders: DataProviderService;
    dialogs: DialogService;
    fetch: typeof __type;
    internet: InternetService;
    localization: ILocalizationService;
    logger: MainLogger & {
        default: MainLogger;
    };
    menuData: IMenuDataService;
    network: PapiNetworkService;
    projectDataProviders: PapiFrontendProjectDataProviderService;
    projectLookup: ProjectLookupServiceType;
    react: typeof "@papi/frontend/react";
    scrollGroups: IScrollGroupService;
    settings: ISettingsService;
    WebSocket: typeof "renderer/services/renderer-web-socket.service".default;
    webViews: WebViewServiceType;
    XMLHttpRequest: typeof "renderer/services/renderer-xml-http-request.service".default;
}

Type declaration

  • 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.

  • 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

  • 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

  • projectDataProviders: PapiFrontendProjectDataProviderService

    Service that 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.

  • react: typeof "@papi/frontend/react"

    React hooks that enable interacting with the papi in React components more easily.

  • scrollGroups: IScrollGroupService

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

  • settings: ISettingsService
  • WebSocket: typeof "renderer/services/renderer-web-socket.service".default

    This wraps the browser's WebSocket implementation to provide better control over internet access. It is isomorphic with the standard WebSocket, so it should act as a drop-in replacement.

    Note that the Node WebSocket implementation is different and not wrapped here.

  • 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.

  • XMLHttpRequest: typeof "renderer/services/renderer-xml-http-request.service".default

    This wraps the browser's XMLHttpRequest implementation to provide better control over internet access. It is isomorphic with the standard XMLHttpRequest, so it should act as a drop-in replacement.

    Note that Node doesn't have a native implementation, so this is only for the renderer.