@itwin/presentation-backend
Version:
Backend of iTwin.js Presentation library
50 lines • 2.01 kB
TypeScript
/** @packageDocumentation
* @module Core
*/
import { IModelDb } from "@itwin/core-backend";
import { Id64String } from "@itwin/core-bentley";
import { Diagnostics, DiagnosticsOptions, InstanceKey } from "@itwin/presentation-common";
/** @internal */
export declare function getLocalizedStringEN(key: string): string;
/** @internal */
export declare function getElementKey(imodel: IModelDb, id: Id64String): InstanceKey | undefined;
/** @internal */
export declare function normalizeVersion(version?: string): string;
/**
* A function that received request diagnostics and, optionally, request context.
* @public
*/
export type BackendDiagnosticsHandler<TContext = any> = (logs: Diagnostics, requestContext?: TContext) => void;
/**
* Data structure for backend diagnostics options.
* @public
*/
export interface BackendDiagnosticsOptions<TContext = any> extends DiagnosticsOptions {
/**
* An optional function to supply request context that'll be passed to [[handler]] when
* it's called after the request is fulfilled.
*/
requestContextSupplier?: () => TContext;
/**
* Request diagnostics handler function that is called after the request is fulfilled. The handler
* receives request diagnostics as the first argument and, optionally, request context as the
* second (see [[requestContextSupplier]]).
*/
handler: BackendDiagnosticsHandler<TContext>;
}
/**
* Data structure which contains backend diagnostics options.
* @public
*/
export interface BackendDiagnosticsAttribute {
/**
* Backend diagnostics options.
* @public
*/
diagnostics?: BackendDiagnosticsOptions;
}
/** @internal */
export declare function combineDiagnosticsOptions(...options: Array<BackendDiagnosticsOptions | undefined>): DiagnosticsOptions | undefined;
/** @internal */
export declare function reportDiagnostics<TContext>(diagnostics: Diagnostics, options: BackendDiagnosticsOptions<TContext>, context?: TContext): void;
//# sourceMappingURL=Utils.d.ts.map