UNPKG

@itwin/presentation-backend

Version:

Backend of iTwin.js Presentation library

89 lines 3.92 kB
/** @packageDocumentation * @module Core */ import { IModelDb, IModelJsNative } from "@itwin/core-backend"; import { BeEvent } from "@itwin/core-bentley"; import { FormatProps } from "@itwin/core-quantity"; import { DiagnosticsScopeLogs, NodeKey, PresentationError, UpdateInfo, VariableValue, VariableValueTypes } from "@itwin/presentation-common"; /** @internal */ export declare enum NativePlatformRequestTypes { GetRootNodes = "GetRootNodes", GetRootNodesCount = "GetRootNodesCount", GetChildren = "GetChildren", GetChildrenCount = "GetChildrenCount", GetNodesDescriptor = "GetNodesDescriptor", GetNodePaths = "GetNodePaths", GetFilteredNodePaths = "GetFilteredNodePaths", GetContentSources = "GetContentSources", GetContentDescriptor = "GetContentDescriptor", GetContentSetSize = "GetContentSetSize", GetContentSet = "GetContentSet", GetContent = "GetContent", GetPagedDistinctValues = "GetPagedDistinctValues", GetDisplayLabel = "GetDisplayLabel", CompareHierarchies = "CompareHierarchies" } /** * Enumeration of unit systems supported by native presentation manager. * @internal */ export declare enum NativePresentationUnitSystem { Metric = "metric", BritishImperial = "british-imperial", UsCustomary = "us-customary", UsSurvey = "us-survey" } /** @internal */ export interface NativePresentationDefaultUnitFormats { [phenomenon: string]: Array<{ unitSystems: NativePresentationUnitSystem[]; format: FormatProps; }>; } /** @internal */ export interface NativePresentationKeySetJSON { instanceKeys: Array<[string, string[]]>; nodeKeys: NodeKey[]; } /** @internal */ export interface NativePlatformResponse<TResult> { result: TResult; diagnostics?: DiagnosticsScopeLogs; } /** @internal */ export interface NativePlatformDefinition extends Disposable { getImodelAddon(imodel: IModelDb): any; setupRulesetDirectories(directories: string[]): NativePlatformResponse<void>; setupSupplementalRulesetDirectories(directories: string[]): NativePlatformResponse<void>; forceLoadSchemas(db: any): Promise<NativePlatformResponse<void>>; registerSupplementalRuleset(serializedRulesetJson: string): NativePlatformResponse<string>; getRulesets(rulesetId: string): NativePlatformResponse<string>; addRuleset(serializedRulesetJson: string): NativePlatformResponse<string>; removeRuleset(rulesetId: string, hash: string): NativePlatformResponse<boolean>; clearRulesets(): NativePlatformResponse<void>; handleRequest(db: any, options: string, cancelEvent?: BeEvent<() => void>): Promise<NativePlatformResponse<string>>; getRulesetVariableValue(rulesetId: string, variableId: string, type: VariableValueTypes): NativePlatformResponse<VariableValue>; setRulesetVariableValue(rulesetId: string, variableId: string, type: VariableValueTypes, value: VariableValue): NativePlatformResponse<void>; unsetRulesetVariableValue(rulesetId: string, variableId: string): NativePlatformResponse<void>; } /** @internal */ export interface DefaultNativePlatformProps { id: string; taskAllocationsMap: { [priority: number]: number; }; updateCallback: (info: UpdateInfo | undefined) => void; cacheConfig?: IModelJsNative.ECPresentationHierarchyCacheConfig; contentCacheSize?: number; workerConnectionCacheSize?: number; defaultFormats?: NativePresentationDefaultUnitFormats; useMmap?: boolean | number; } /** @internal */ export declare class PresentationNativePlatformResponseError extends PresentationError { readonly diagnostics?: DiagnosticsScopeLogs; constructor(errorResponse: IModelJsNative.ECPresentationManagerResponse<unknown>); } /** @internal */ export declare const createDefaultNativePlatform: (props: DefaultNativePlatformProps) => new () => NativePlatformDefinition; //# sourceMappingURL=NativePlatform.d.ts.map