UNPKG

@bimdata/viewer

Version:

A customizable BIM viewer.

205 lines (196 loc) • 5.38 kB
/// <reference types="./types/api"/> /// <reference types="./types/models"/> /// <reference types="./types/plugins"/> /// <reference types="./types/state"/> /// <reference types="./types/window"/> declare module "@bimdata/viewer" { /** See: https://developers.bimdata.io/viewer/reference/makeBIMDataViewer.html */ export default function makeBIMDataViewer(cfg: BDV.ViewerConfig): BDV.Viewer; } declare namespace BDV { interface Viewer { /** See: https://developers.bimdata.io/viewer/reference/mount.html#mount */ mount(container: HTMLElement | string, layout?: any): any; destroy(): void; setAccessToken(token: string): void; setLocale(lang: ViewerLocale): void; registerPlugin(plugin: PluginDefinition): void; registerWindow(window: Object): void; unregisterWindow(name: string): void; loadModels(modelIds: number[]): Promise<StateModel[]>; } type ViewerLocale = "de" | "en" | "es" | "fr" | "it"; interface ViewerConfig { ui?: ViewerConfigUI; api: ViewerConfigApi; plugins?: ViewerConfigPlugins; locale?: ViewerLocale; } interface ViewerConfigUI { bimdataLogo?: boolean; contextMenu?: boolean; header?: boolean; resizable?: boolean; style?: { backgroundColor?: string; colorPrimary?: string; colorPrimaryLighter?: string; colorPrimaryLight?: string; colorPrimaryDark?: string; colorSecondary?: string; colorSecondaryLight?: string; colorSecondaryLighter?: string; colorSecondaryDark?: string; colorSilverLight?: string; colorSilver?: string; colorSilverDark?: string; colorGraniteLight?: string; colorGranite?: string; colorSuccess?: string; colorSuccessLight?: string; colorSuccessLighter?: string; colorSuccessDark?: string; colorWarning?: string; colorWarningLight?: string; colorWarningLighter?: string; colorWarningDark?: string; colorHigh?: string; colorHighLight?: string; colorHighLighter?: string; colorHighDark?: string; colorText?: string; headerHeight?: string; }; version?: boolean; } interface ViewerConfigApi { apiUrl?: string; archiveUrl?: string; pdfBackendUrl?: string; accessToken: string; cloudId: number; projectId: number; modelIds?: number[]; offline?: { enabled: boolean; data: string | Blob; }; } interface ViewerConfigPlugins { accessMarketplace: boolean; alerts?: boolean; bcf?: boolean; bcfManager?: | boolean | { topicGuid?: string; }; buildingMaker?: boolean; "drawing-tools"?: boolean; dwg?: | boolean | { help?: boolean; modelLoader?: "hidden" | "disabled"; }; "dwg-layer"?: boolean; dxf?: | boolean | { help?: boolean; modelLoader?: "hidden" | "disabled"; }; firstPersonView?: boolean; fullscreen?: boolean; ged?: boolean; measure2d?: boolean; measure3d?: boolean; metaBuildingStructure?: boolean; miniMap2d?: boolean; mobile?: boolean; navigationVersionsModel?: boolean; pdf?: boolean; pdfExport?: boolean; photosphere?: | boolean | { modelLoader?: "hidden" | "disabled"; }; plan?: | boolean | { help?: boolean; metaBuildingStructure?: boolean; modelLoader?: "hidden" | "disabled"; storeySelector?: boolean; storeySelectorAutoOpen?: boolean; }; pointCloud?: | boolean | { help?: boolean; modelLoader?: "hidden" | "disabled"; navCube?: boolean; pivotMarker?: boolean; }; pointCloudParameters?: boolean; properties?: | boolean | { editProperties?: boolean; }; "right-angled"?: boolean; search?: boolean; section?: boolean; smartview?: boolean; split?: boolean; structure?: | boolean | { export?: boolean; merge?: boolean; translateIfcEntities?: boolean; customTranslations?: Object; }; "structure-properties"?: | boolean | { editProperties?: boolean; export?: boolean; merge?: boolean; translateIfcEntities?: boolean; customTranslations?: Object; }; synchronization?: boolean; viewer2d?: | boolean | { compass?: boolean; help?: boolean; modelLoader?: "hidden" | "disabled"; storeySelector?: boolean; storeySelectorAutoOpen?: boolean; }; "viewer2d-background"?: boolean; "viewer2d-parameters"?: boolean; "viewer2d-screenshot"?: boolean; viewer3d?: | boolean | { edges?: boolean; enableDynamicLOD?: boolean; enableOffsets?: boolean; home?: boolean; help?: boolean; modelLoader?: "hidden" | "disabled"; navCube?: boolean; navigationVersionsModel?: boolean; pivotMarker?: boolean; }; "viewer3d-parameters"?: boolean; "window-manager"?: boolean; "window-selector"?: boolean; "zone-editor"?: boolean; "zone-editor-button"?: boolean; } }