UNPKG

@itwin/presentation-backend

Version:

Backend of iTwin.js Presentation library

97 lines 3.74 kB
/** @packageDocumentation * @module Core */ import { PresentationManager, PresentationManagerProps } from "./PresentationManager.js"; /** * Properties that can be used to configure [[Presentation]] API. * @public */ export interface PresentationProps extends Omit<PresentationManagerProps, "enableSchemasPreload"> { /** * Time in milliseconds after which the request will timeout. */ requestTimeout?: number; /** * Should schemas preloading be enabled. If true, [[Presentation]] library listens * for `BriefcaseDb.onOpened` event and force pre-loads all ECSchemas. */ enableSchemasPreload?: boolean; /** * How much time should an unused client manager be stored in memory * before it's disposed. */ unusedClientLifetime?: number; } /** * Props for initializing the [[Presentation]] library for using multiple [[PresentationManager]] * instances, one for each frontend. * * @public * @deprecated in 4.8 - will not be removed until after 2026-06-13. Use [[PresentationProps]] instead. */ export type MultiManagerPresentationProps = PresentationProps; /** * Base props for initializing the [[Presentation]] library. * * @public * @deprecated in 4.8 - will not be removed until after 2026-06-13. Use [[PresentationProps]] instead. */ export type PresentationPropsBase = PresentationProps; /** * Props for initializing the [[Presentation]] library with ability to use a single * [[PresentationManager]] instance for handling all requests. * * @public * @deprecated in 4.8 - will not be removed until after 2026-06-13. Use [[PresentationProps]] instead. */ export type SingleManagerPresentationProps = Omit<PresentationProps, "unusedClientLifetime">; /** * Static class used to statically set up Presentation library for the backend. * Basically what it does is: * - Register a RPC implementation * - Create a singleton [[PresentationManager]] instance * - Subscribe for [IModelHost.onBeforeShutdown]($core-backend) event and terminate * the presentation manager when that happens. * * @public */ export declare class Presentation { private static _initProps; private static _clientsStorage; private static _disposeIpcHandler; private static _shutdownListener; private static _disposeIModelOpenedListener; private static _rpcImpl; private constructor(); /** Properties used to initialize the presentation framework */ static get initProps(): PresentationProps | undefined; /** * Initializes Presentation library for the backend. * * See [Setting up iTwin.js Presentation library documentation page]($docs/presentation/setup/index.md#backend) for an example. * * **Important:** The method should be called after a call to [IModelHost.startup]($core-backend) * * @param props Optional properties for [[PresentationManager]] */ static initialize(props?: PresentationProps): void; /** * Terminates Presentation. Consumers don't need to call this as it's automatically * called on [IModelHost.onBeforeShutdown]($core-backend) event. */ static terminate(): void; private static createClientManager; private static disposeClientManager; /** * Get an instance of [[PresentationManager]] for specific client * @param clientId ID of the client requesting presentation data. If no * ID is provided, the default [[PresentationManager]] is returned. */ static getManager(clientId?: string): PresentationManager; /** * Get the time in milliseconds that backend should respond in . */ static getRequestTimeout(): number; private static onIModelOpened; } //# sourceMappingURL=Presentation.d.ts.map