@bimdata/viewer 2.7.0-beta.4 → 2.7.0-beta.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bimdata-viewer.esm.min.js +8 -5
- package/dist/bimdata-viewer.offline.esm.min.js +5 -5
- package/dist/bimdata-viewer.runtime.esm.min.js +5 -5
- package/dist/bimdata-viewer.umd.cjs +4 -4
- package/index.d.ts +6 -1
- package/package.json +2 -2
- package/types/api.d.ts +4 -9
- package/types/plugins.d.ts +47 -0
- package/types/state.d.ts +25 -30
- package/types/window.d.ts +16 -0
package/index.d.ts
CHANGED
|
@@ -1,18 +1,22 @@
|
|
|
1
1
|
/// <reference types="./types/api"/>
|
|
2
2
|
/// <reference types="./types/models"/>
|
|
3
|
+
/// <reference types="./types/plugins"/>
|
|
3
4
|
/// <reference types="./types/state"/>
|
|
5
|
+
/// <reference types="./types/window"/>
|
|
4
6
|
|
|
5
7
|
declare module "@bimdata/viewer" {
|
|
8
|
+
/** See: https://developers.bimdata.io/viewer/reference/makeBIMDataViewer.html */
|
|
6
9
|
export default function makeBIMDataViewer(cfg: BDV.ViewerConfig): BDV.Viewer;
|
|
7
10
|
}
|
|
8
11
|
|
|
9
12
|
declare namespace BDV {
|
|
10
13
|
interface Viewer {
|
|
14
|
+
/** See: https://developers.bimdata.io/viewer/reference/mount.html#mount */
|
|
11
15
|
mount(container: HTMLElement | string, layout?: any): any;
|
|
12
16
|
destroy(): void;
|
|
13
17
|
setAccessToken(token: string): void;
|
|
14
18
|
setLocale(lang: ViewerLocale): void;
|
|
15
|
-
registerPlugin(plugin: PluginDefinition
|
|
19
|
+
registerPlugin(plugin: PluginDefinition): void;
|
|
16
20
|
registerWindow(window: Object): void;
|
|
17
21
|
unregisterWindow(name: string): void;
|
|
18
22
|
loadModels(modelIds: number[]): Promise<StateModel[]>;
|
|
@@ -60,6 +64,7 @@ declare namespace BDV {
|
|
|
60
64
|
colorHighLighter?: string;
|
|
61
65
|
colorHighDark?: string;
|
|
62
66
|
colorText?: string;
|
|
67
|
+
headerHeight?: string;
|
|
63
68
|
};
|
|
64
69
|
version?: boolean;
|
|
65
70
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bimdata/viewer",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.7.0-beta.
|
|
4
|
+
"version": "2.7.0-beta.6",
|
|
5
5
|
"description": "A customizable BIM viewer.",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"bim",
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
"babel-jest": "^29.7.0",
|
|
85
85
|
"conventional-changelog-eslint": "^6.0.0",
|
|
86
86
|
"cypress": "^13.16.0",
|
|
87
|
-
"esbuild": "^0.
|
|
87
|
+
"esbuild": "^0.25.0",
|
|
88
88
|
"eslint": "9.15.0",
|
|
89
89
|
"eslint-config-prettier": "9.1.0",
|
|
90
90
|
"eslint-plugin-cypress": "4.1.0",
|
package/types/api.d.ts
CHANGED
|
@@ -17,13 +17,6 @@ declare namespace BDV {
|
|
|
17
17
|
createStoreyPlan(modelId: number, storeyUuid: string, docId: number): Promise<ApiPlan>;
|
|
18
18
|
deleteStoreyPlan(modelId: number, storeyUuid: string, planId: number): Promise<void>;
|
|
19
19
|
updatePlanPositioning(modelId: number, storeyUuid: string, planId: number, positioning: ApiPositionning): Promise<ApiPositionning>;
|
|
20
|
-
|
|
21
|
-
// ---
|
|
22
|
-
|
|
23
|
-
/** @deprecated use `getModel` instead */
|
|
24
|
-
getIfc(modelId: number): Promise<ApiModel>;
|
|
25
|
-
/** @deprecated use `getModelStructure` instead */
|
|
26
|
-
getIfcStructure(model: ApiModel): Promise<any>;
|
|
27
20
|
}
|
|
28
21
|
|
|
29
22
|
interface ApiDocument {
|
|
@@ -50,7 +43,8 @@ declare namespace BDV {
|
|
|
50
43
|
// Model files
|
|
51
44
|
preview_file?: string;
|
|
52
45
|
structure_file?: string;
|
|
53
|
-
|
|
46
|
+
/** @deprecated use `xkt_files` instead */
|
|
47
|
+
xkt_file?: string;
|
|
54
48
|
xkt_files?: { version: number; file: string }[];
|
|
55
49
|
gltf_file?: string;
|
|
56
50
|
map_file?: string;
|
|
@@ -62,8 +56,9 @@ declare namespace BDV {
|
|
|
62
56
|
recommanded_2d_angle?: number;
|
|
63
57
|
size_ratio?: number;
|
|
64
58
|
|
|
65
|
-
// Multi-page PDF
|
|
59
|
+
// Multi-page PDF / Multi layout DWG
|
|
66
60
|
page_number?: number;
|
|
61
|
+
layout_name?: string;
|
|
67
62
|
parent_id?: number;
|
|
68
63
|
children?: ApiModel[];
|
|
69
64
|
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
declare namespace BDV {
|
|
2
|
+
interface PluginDefinition {
|
|
3
|
+
name: string;
|
|
4
|
+
isViewer?: boolean;
|
|
5
|
+
/** Plugin settings */
|
|
6
|
+
settings?: any;
|
|
7
|
+
/** See: https://developers.bimdata.io/viewer/reference/plugin.html#i18n */
|
|
8
|
+
i18n?: any;
|
|
9
|
+
i18nTokenPrefix?: string;
|
|
10
|
+
addToWindows?: string[];
|
|
11
|
+
|
|
12
|
+
/** Vue 3 component */
|
|
13
|
+
component?: Object;
|
|
14
|
+
|
|
15
|
+
/** See: https://developers.bimdata.io/viewer/reference/plugin.html#startupscript */
|
|
16
|
+
startupScript?: ($viewer: any) => void;
|
|
17
|
+
|
|
18
|
+
/** Window plugin definition (see: https://developers.bimdata.io/viewer/reference/window.html#window-api) */
|
|
19
|
+
window?: Window;
|
|
20
|
+
|
|
21
|
+
/** Button plugin definition (see: https://developers.bimdata.io/viewer/reference/plugin.html#plugin-as-button) */
|
|
22
|
+
button?: {
|
|
23
|
+
position: string;
|
|
24
|
+
content: string;
|
|
25
|
+
icon?: { imgUri: string; };
|
|
26
|
+
iconOpen?: { imgUri: string; };
|
|
27
|
+
tooltip?: string;
|
|
28
|
+
keepOpen?: boolean;
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
interface PluginInstance extends PluginDefinition {
|
|
33
|
+
/** Vue component instance */
|
|
34
|
+
componentInstance: Object | null;
|
|
35
|
+
|
|
36
|
+
shown: boolean;
|
|
37
|
+
show(): void;
|
|
38
|
+
hide(): void;
|
|
39
|
+
|
|
40
|
+
// Button plugin instance
|
|
41
|
+
loading: boolean;
|
|
42
|
+
buttonText: string;
|
|
43
|
+
isOpen: boolean;
|
|
44
|
+
open(options?: any): Promise<void>;
|
|
45
|
+
close(options?: any): Promise<void>;
|
|
46
|
+
}
|
|
47
|
+
}
|
package/types/state.d.ts
CHANGED
|
@@ -92,19 +92,6 @@ declare namespace BDV {
|
|
|
92
92
|
addAnnotation(annotation: StateAnnotation, options?: any): StateAnnotation;
|
|
93
93
|
removeAnnotation(annotation: StateAnnotation, options?: any): boolean;
|
|
94
94
|
clearAnnotations(): void;
|
|
95
|
-
|
|
96
|
-
// ---
|
|
97
|
-
|
|
98
|
-
/** @deprecated use `models` instead */
|
|
99
|
-
readonly ifcs: StateModel[];
|
|
100
|
-
/** @deprecated use `modelsMap` instead */
|
|
101
|
-
readonly ifcsMap: Map<number, StateModel>;
|
|
102
|
-
/** @deprecated use `loadModels` instead */
|
|
103
|
-
loadIfcs(ifcIds: string[]): Promise<StateModel[]>;
|
|
104
|
-
/** @deprecated use `unloadModels` instead */
|
|
105
|
-
unloadIfcs(ifcIds: string[]): void;
|
|
106
|
-
/** @deprecated use `getModel` instead */
|
|
107
|
-
getIfc(id: number): StateModel;
|
|
108
95
|
}
|
|
109
96
|
|
|
110
97
|
type StateEvents = {
|
|
@@ -180,17 +167,6 @@ declare namespace BDV {
|
|
|
180
167
|
annotation: StateAnnotation;
|
|
181
168
|
options?: any;
|
|
182
169
|
};
|
|
183
|
-
|
|
184
|
-
// ---
|
|
185
|
-
|
|
186
|
-
/** @deprecated use `models-loaded` instead */
|
|
187
|
-
"ifcs-loaded": {
|
|
188
|
-
ifcs: StateModel[];
|
|
189
|
-
};
|
|
190
|
-
/** @deprecated use `models-unloaded` instead */
|
|
191
|
-
"ifcs-unloaded": {
|
|
192
|
-
ifcs: StateModel[];
|
|
193
|
-
};
|
|
194
170
|
};
|
|
195
171
|
|
|
196
172
|
interface StateModel extends ApiModel {
|
|
@@ -220,12 +196,7 @@ declare namespace BDV {
|
|
|
220
196
|
readonly storey: StateObject;
|
|
221
197
|
readonly layout: StateObject;
|
|
222
198
|
readonly space: StateObject;
|
|
223
|
-
getFirstAncestorWithType
|
|
224
|
-
|
|
225
|
-
// ---
|
|
226
|
-
|
|
227
|
-
/** @deprecated use `model` instead */
|
|
228
|
-
ifc: StateModel;
|
|
199
|
+
getFirstAncestorWithType(type: string): StateObject;
|
|
229
200
|
}
|
|
230
201
|
|
|
231
202
|
interface StateStorey {
|
|
@@ -261,10 +232,34 @@ declare namespace BDV {
|
|
|
261
232
|
}
|
|
262
233
|
|
|
263
234
|
interface StateAnnotation {
|
|
235
|
+
id: number;
|
|
236
|
+
draggable: boolean;
|
|
264
237
|
x: number;
|
|
265
238
|
y: number;
|
|
266
239
|
z: number;
|
|
267
240
|
component: any;
|
|
268
241
|
props?: any;
|
|
269
242
|
}
|
|
243
|
+
|
|
244
|
+
// ---
|
|
245
|
+
|
|
246
|
+
type Events = {
|
|
247
|
+
[eventName: string]: Object;
|
|
248
|
+
};
|
|
249
|
+
|
|
250
|
+
interface EventHandler<T extends Events> {
|
|
251
|
+
on<N extends keyof T>(
|
|
252
|
+
eventName: N,
|
|
253
|
+
callback: (arg: T[N]) => void,
|
|
254
|
+
options?: any
|
|
255
|
+
): number;
|
|
256
|
+
once<N extends keyof T>(
|
|
257
|
+
eventName: N,
|
|
258
|
+
callback: (arg: T[N]) => void,
|
|
259
|
+
options?: any
|
|
260
|
+
): number;
|
|
261
|
+
off(subscriptionId: number): void;
|
|
262
|
+
emit<N extends keyof T>(eventName: N, payload: T[N]): void;
|
|
263
|
+
clear(): void;
|
|
264
|
+
}
|
|
270
265
|
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
declare namespace BDV {
|
|
2
|
+
interface Window {
|
|
3
|
+
name: string;
|
|
4
|
+
label: string;
|
|
5
|
+
icon: { imgUri: string; };
|
|
6
|
+
plugins?: string[];
|
|
7
|
+
modelTypes?: string[];
|
|
8
|
+
multiModel?: boolean;
|
|
9
|
+
noModel?: boolean;
|
|
10
|
+
defaultWindow?: boolean;
|
|
11
|
+
displayedInWindowSelector?: boolean;
|
|
12
|
+
|
|
13
|
+
header?: boolean;
|
|
14
|
+
logoAndVersion?: boolean;
|
|
15
|
+
}
|
|
16
|
+
}
|