@itwin/presentation-testing
Version:
Testing utilities for iTwin.js Presentation library
60 lines • 2.19 kB
TypeScript
/** @packageDocumentation
* @module Helpers
*/
import { IModelHostOptions } from "@itwin/core-backend";
import { RpcInterfaceDefinition } from "@itwin/core-common";
import { IModelApp, IModelAppOptions } from "@itwin/core-frontend";
import { HierarchyCacheMode, PresentationManagerProps as PresentationBackendProps } from "@itwin/presentation-backend";
import { PresentationProps as PresentationFrontendProps } from "@itwin/presentation-frontend";
export { HierarchyCacheMode, PresentationBackendProps };
/** @public */
export interface PresentationTestingInitProps {
/**
* RPC interfaces to enable. Defaults to `[IModelReadRpcInterface, PresentationRpcInterface]`.
*
* Note: Implementations for these interfaces are **not** automatically registered on the backend - that has to be done manually.
*/
rpcs?: RpcInterfaceDefinition[];
/** Properties for backend initialization */
backendProps?: PresentationBackendProps & {
id?: string;
requestTimeout?: number;
};
/** Properties for `IModelHost` */
backendHostProps?: IModelHostOptions;
/** Properties for frontend initialization */
frontendProps?: PresentationFrontendProps;
/** IModelApp implementation */
frontendApp?: {
startup: (opts?: IModelAppOptions) => Promise<void>;
};
/** `IModelApp` options */
frontendAppOptions?: IModelAppOptions;
/** Custom test output directory. Defaults to temporary directory provided by the OS. */
testOutputDir?: string;
}
/**
* Initialize the framework for presentation testing. The function sets up backend,
* frontend and RPC communication between them.
*
* @see `terminate`
*
* @public
*/
export declare const initialize: (props?: PresentationTestingInitProps) => Promise<void>;
/**
* Undoes the setup made by `initialize`.
* @param frontendApp IModelApp implementation
*
* @see `initialize`
*
* @public
*/
export declare const terminate: (frontendApp?: typeof IModelApp) => Promise<void>;
/** @internal */
export declare function safeDispose(disposable: {} | {
[Symbol.dispose]: () => void;
} | {
dispose: () => void;
}): void;
//# sourceMappingURL=Helpers.d.ts.map