@inweb/client 25.8.16 → 25.8.19

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.
@@ -1,10 +1,11 @@
1
1
  import { IHttpClient } from "./IHttpClient";
2
- import { IAssociatedFileData, IAssemblyVersionInfo } from "./IAssembly";
2
+ import { IAssociatedFileData, IAssemblyVersionInfo, IModelTransformMatrix } from "./IAssembly";
3
3
  import { IShortUserDescription } from "./IUser";
4
4
  import { Model } from "./Model";
5
5
  import { ClashTest } from "./ClashTest";
6
6
  /**
7
- * The class representing a `assembly` entity.
7
+ * Provides properties and methods for obtaining information about an assembly on the server
8
+ * and managing its data.
8
9
  */
9
10
  export declare class Assembly {
10
11
  private _data;
@@ -12,8 +13,8 @@ export declare class Assembly {
12
13
  httpClient: IHttpClient;
13
14
  path: string;
14
15
  /**
15
- * @param data - An object that implements assembly data storage.
16
- * @param httpClient - Http client.
16
+ * @param data - Raw assembly data received from the server.
17
+ * @param httpClient - HTTP client instance used to send REST API requests to the server.
17
18
  */
18
19
  constructor(data: any, httpClient: IHttpClient);
19
20
  appendVersionParam(relativePath: string): string;
@@ -51,9 +52,9 @@ export declare class Assembly {
51
52
  /**
52
53
  * Assembly geometry data type:
53
54
  *
54
- * - `vsfx` - VSFX, assembly can be opened in `VisualizeJS` viewer.
55
+ * - `vsfx` - `VSFX` format, assembly can be opened in `VisualizeJS` viewer.
55
56
  *
56
- * Returns an empty string if geometry data has not yet been extracted.
57
+ * Returns an empty string if the geometry data is not yet ready.
57
58
  */
58
59
  get geometryType(): string;
59
60
  /**
@@ -106,7 +107,7 @@ export declare class Assembly {
106
107
  get version(): number;
107
108
  get versions(): IAssemblyVersionInfo[];
108
109
  /**
109
- * Refresh assembly data.
110
+ * Reloads assembly data from the server.
110
111
  */
111
112
  checkout(): Promise<this>;
112
113
  /**
@@ -116,14 +117,14 @@ export declare class Assembly {
116
117
  */
117
118
  update(data: any): Promise<this>;
118
119
  /**
119
- * Delete the assembly from the server.
120
+ * Deletes an assembly from the server.
120
121
  *
121
122
  * @returns Returns the raw data of a deleted assembly.
122
123
  */
123
124
  delete(): Promise<any>;
124
125
  /**
125
- * Save assembly data changes to the server. Call this method to update assembly data on the
126
- * server after any changes.
126
+ * Saves assembly properties changes to the server. Call this method to update assembly data
127
+ * on the server after any property changes.
127
128
  */
128
129
  save(): Promise<this>;
129
130
  setPreview(image?: BodyInit | null): Promise<this>;
@@ -132,40 +133,24 @@ export declare class Assembly {
132
133
  * Returns list of assembly models.
133
134
  */
134
135
  getModels(): Promise<Model[]>;
135
- /**
136
- * Transformation matrix.
137
- *
138
- * @typedef {any} Transform
139
- * @property {any} translate - Translation part, move along the X, Y, Z axes.
140
- * @property {number} translate.x - The value for substruct for X axes.
141
- * @property {number} translate.y - The value for substruct for Y axes.
142
- * @property {number} translate.z - The value for substruct for Z axes.
143
- * @property {any} rotation - Rotation part, rotate by the specified angle, around the
144
- * specified vector.
145
- * @property {number} rotation.x - X coordinate of the rotation vector.
146
- * @property {number} rotation.y - Y coordinate of the rotation vector.
147
- * @property {number} rotation.z - Z coordinate of the rotation vector.
148
- * @property {number} rotation.angle - The angle of rotation.
149
- * @property {number} scale - Scaling part, scale with multiplier, from center of extends.
150
- */
151
136
  /**
152
137
  * Returns a model transformation.
153
138
  *
154
- * @param handle - Model handle.
139
+ * @param handle - Model original handle.
155
140
  */
156
- getModelTransformMatrix(handle: string): any;
141
+ getModelTransformMatrix(handle: string): IModelTransformMatrix;
157
142
  /**
158
- * Set or delete a model transformation.
143
+ * Sets or removes a model transformation.
159
144
  *
160
- * @param handle - Model handle.
161
- * @param transform - Transformation matrix. To delete transformation provide this to `undefined`.
145
+ * @param handle - Model original handle.
146
+ * @param transform - Transformation matrix. Specify `undefined` to remove transformation.
162
147
  */
163
- setModelTransformMatrix(handle: string, transform: any): Promise<this>;
148
+ setModelTransformMatrix(handle: string, transform: IModelTransformMatrix): Promise<this>;
164
149
  /**
165
150
  * Returns the properties for an objects in the assembly.
166
151
  *
167
- * @param handles - Object original handle or handles array. Leave this parameter undefined
168
- * to get properties for all objects in the assembly.
152
+ * @param handles - Object original handle or handles array. Specify `undefined` to get
153
+ * properties for all objects in the assembly.
169
154
  * @returns {Promise<any>}
170
155
  */
171
156
  getProperties(handles?: string | string[]): Promise<any[]>;
@@ -196,7 +181,7 @@ export declare class Assembly {
196
181
  */
197
182
  searchProperties(searchPattern: any): Promise<any[]>;
198
183
  /**
199
- * Returns the cda.json for an assembly.
184
+ * Returns the CDA tree for an assembly.
200
185
  */
201
186
  getCdaTree(): Promise<any[]>;
202
187
  /**
@@ -204,13 +189,13 @@ export declare class Assembly {
204
189
  */
205
190
  getViewpoints(): Promise<any[]>;
206
191
  /**
207
- * Add new assembly viewpoint. To create a viewpoint use `Viewer.createViewpoint()`.
192
+ * Adds a new viewpoint to the assembly. To create a viewpoint use `Viewer.createViewpoint()`.
208
193
  *
209
194
  * @param viewpoint - Viewpoint.
210
195
  */
211
196
  saveViewpoint(viewpoint: any): Promise<any>;
212
197
  /**
213
- * Delete assembly viewpoint.
198
+ * Deletes the specified assembly viewpoint.
214
199
  *
215
200
  * @param guid - Viewpoint GUID.
216
201
  * @returns Returns the raw data of a deleted viewpoint.
@@ -231,7 +216,7 @@ export declare class Assembly {
231
216
  */
232
217
  getSnapshotData(guid: any, bitmapGuid: any): Promise<string>;
233
218
  /**
234
- * Download assembly resource file. Resource files are files that contain model scene
219
+ * Downloads an assembly resource file. Resource files are files that contain model scene
235
220
  * descriptions, or geometry data.
236
221
  *
237
222
  * @param dataId - Resource file name.
@@ -242,7 +227,7 @@ export declare class Assembly {
242
227
  */
243
228
  downloadResource(dataId: string, onProgress?: (progress: number, chunk: Uint8Array) => void, signal?: AbortSignal): Promise<ArrayBuffer>;
244
229
  /**
245
- * Download a part of assembly resource file. Resource files are files that contain model
230
+ * Downloads a part of assembly resource file. Resource files are files that contain model
246
231
  * scene descriptions, or geometry data.
247
232
  *
248
233
  * @param dataId - Resource file name.
@@ -270,7 +255,7 @@ export declare class Assembly {
270
255
  downloadFileRange(requestId: number, records: any | null, dataId: string, onProgress?: (progress: number, chunk: Uint8Array, requestId: number) => void, signal?: AbortSignal): Promise<void>;
271
256
  getReferences(signal?: AbortSignal): Promise<any>;
272
257
  /**
273
- * Wait for assembly to be created. Assembly is created when it changes to `done` or `failed` status.
258
+ * Waits for assembly to be created. Assembly is created when it changes to `done` or `failed` status.
274
259
  *
275
260
  * @param params - An object containing waiting parameters.
276
261
  * @param params.timeout - The time, in milliseconds that the function should wait assembly.
@@ -291,15 +276,13 @@ export declare class Assembly {
291
276
  /**
292
277
  * Returns a list of assembly clash tests.
293
278
  *
294
- * @param {number} start - The starting index in the test list. Used for paging.
295
- * @param {number} limit - The maximum number of tests that should be returned per request.
296
- * Used for paging.
297
- * @param {string} name - Filter the tests by part of the name.
298
- * @param {string | string[]} ids - List of tests IDs to return. You can specify multiple IDs
299
- * on one `string` by separating them with a "|".
300
- * @param {bool} sortByDesc - Allows to specify the descending order of the result. By
301
- * default tests are sorted by name in ascending order.
302
- * @param {string} sortField - Allows to specify sort field.
279
+ * @param start - The starting index in the test list. Used for paging.
280
+ * @param limit - The maximum number of tests that should be returned per request. Used for paging.
281
+ * @param name - Filter the tests by part of the name. Case sensitive.
282
+ * @param ids - List of tests IDs to return.
283
+ * @param sortByDesc - Allows to specify the descending order of the result. By default tests
284
+ * are sorted by name in ascending order.
285
+ * @param sortField - Allows to specify sort field.
303
286
  */
304
287
  getClashTests(start?: number, limit?: number, name?: string, ids?: string | string[], sortByDesc?: boolean, sortField?: string): Promise<{
305
288
  allSize: number;
@@ -309,26 +292,45 @@ export declare class Assembly {
309
292
  size: number;
310
293
  }>;
311
294
  /**
312
- * Returns the assembly clash test information.
295
+ * Returns information about the specified assembly clash test.
313
296
  *
314
297
  * @param testId - Test ID.
315
298
  */
316
299
  getClashTest(testId: string): Promise<ClashTest>;
317
300
  /**
318
- * Create assembly clash test. Assembly must be in a `done` state, otherwise the test will fail.
301
+ * Creates an assembly clash test. Assembly must be in a `done` state, otherwise the test will fail.
319
302
  *
320
303
  * @param name - Test name.
321
- * @param selectionTypeA - The type of first selection set for clash detection. Can be `all`,
322
- * `handles`, `models` or `searchquery`.
323
- * @param selectionTypeB - The type of second selection set for clash detection. Can be
324
- * `all`, `handles`, `models` or `searchquery`.
325
- * @param selectionSetA - First selection set for clash detection.
326
- * @param selectionSetB - Second selection set for clash detection.
304
+ * @param selectionTypeA - The type of first selection set for clash detection. Can be one of:
305
+ *
306
+ * - `all` - All file/assembly objects.
307
+ * - `handle` - Objects with original handles specified in the `selectionSetA`.
308
+ * - `models` - All objects of the models with original handles specified in the `selectionSetA`.
309
+ * - `searchquery` - Objects retrieved by the search queries specified in `selectionSetA`.
310
+ *
311
+ * @param selectionTypeB - The type of second selection set for clash detection. Can be one of:
312
+ *
313
+ * - `all` - All file/assembly objects.
314
+ * - `handle` - Objects with original handles specified in the `selectionSetB`.
315
+ * - `models` - All objects of the models with original handles specified in the `selectionSetB`.
316
+ * - `searchquery` - Objects retrieved by the search queries specified in `selectionSetB`.
317
+ *
318
+ * @param selectionSetA - First selection set for clash detection. Objects from
319
+ * `selectionSetA` will be tested against each others by objects from the `selectionSetB`
320
+ * during the test.
321
+ * @param selectionSetB - Second selection set for clash detection. Objects from
322
+ * `selectionSetB` will be tested against each others by objects from the `selectionSetA`
323
+ * during the test.
327
324
  * @param params - An object containing test parameters.
328
- * @param params.tolerance - The distance of separation between entities at which test begins
325
+ * @param params.tolerance - The distance of separation between objects at which test begins
329
326
  * detecting clashes.
330
- * @param params.clearance - The type of the clashes that the test detects: `true` for
331
- * `Сlearance clash` or `false` for `Hard clash`.
327
+ * @param params.clearance - The type of the clashes that the test detects:
328
+ *
329
+ * - `true` - Сlearance clash. A clash in which the object A may or may not intersect with
330
+ * object B, but comes within a distance of less than the `tolerance`.
331
+ * - `false` - Hard clash. A clash in which the object A intersects with object B by a distance
332
+ * of more than the `tolerance`.
333
+ *
332
334
  * @param params.waitForDone - Wait for test to complete.
333
335
  * @param params.timeout - The time, in milliseconds that the function should wait test. If
334
336
  * test is not complete during this time, the `TimeoutError` exception will be thrown.
@@ -347,7 +349,7 @@ export declare class Assembly {
347
349
  signal?: AbortSignal;
348
350
  }): Promise<ClashTest>;
349
351
  /**
350
- * Delete assembly clash test.
352
+ * Deletes the specified assembly clash test.
351
353
  *
352
354
  * @param testId - Test ID.
353
355
  * @returns Returns the raw data of a deleted test.
@@ -1,16 +1,16 @@
1
1
  import { IHttpClient } from "./IHttpClient";
2
2
  import { IShortUserDescription } from "./IUser";
3
3
  /**
4
- * The base class provides information about the file/assembly clash detection test and test results.
4
+ * Provides properties and methods for obtaining information about a file/assembly clash detection test.
5
5
  */
6
6
  export declare class ClashTest {
7
7
  private _data;
8
8
  basePath: string;
9
9
  httpClient: IHttpClient;
10
10
  /**
11
- * @param data - Raw test data.
12
- * @param basePath - Clash tests API base path for the owner file/assembly.
13
- * @param httpClient - Http client.
11
+ * @param data - Raw test data received from the server.
12
+ * @param basePath - The clash test API base path of the file/assembly that owns the test.
13
+ * @param httpClient - HTTP client instance used to send REST API requests to the server.
14
14
  */
15
15
  constructor(data: any, basePath: string, httpClient: IHttpClient);
16
16
  protected internalGet(relativePath: string): Promise<Response>;
@@ -19,10 +19,10 @@ export declare class ClashTest {
19
19
  /**
20
20
  * The type of the clashes that the test detects:
21
21
  *
22
- * - `Сlearance clash` (true) - a clash in which the entity A may or may not intersect with
23
- * entity B, but comes within a distance of less than the `tolerance`.
24
- * - `Hard clash` (false) - a clash in which the entity A intersects with entity B by a
25
- * distance of more than the `tolerance`.
22
+ * - `true` - Сlearance clash. A clash in which the object A may or may not intersect with
23
+ * object B, but comes within a distance of less than the {@link tolerance}.
24
+ * - `false` - Hard clash. A clash in which the object A intersects with object B by a distance
25
+ * of more than the {@link tolerance}.
26
26
  *
27
27
  * @readonly
28
28
  */
@@ -74,8 +74,8 @@ export declare class ClashTest {
74
74
  */
75
75
  get owner(): IShortUserDescription;
76
76
  /**
77
- * First selection set for clash detection. Entities from `selectionSetA` will be tested
78
- * against each others by entities from the `selectionSetB` during the test.
77
+ * First selection set for clash detection. Objects from `selectionSetA` will be tested
78
+ * against each others by objects from the `selectionSetB` during the test.
79
79
  *
80
80
  * @readonly
81
81
  */
@@ -83,17 +83,17 @@ export declare class ClashTest {
83
83
  /**
84
84
  * The type of first selection set for clash detection. Can be one of:
85
85
  *
86
- * - `all` - All file/assembly entities.
87
- * - `handle` - Entities with handles specified in the `selectionSetA`.
88
- * - `models` - Entities of file/assembly models specified in `selectionSetA`.
89
- * - `searchquery` - Entities retrieved by the search queries specified in `selectionSetA`.
86
+ * - `all` - All file/assembly objects.
87
+ * - `handle` - Objects with original handles specified in the `selectionSetA`.
88
+ * - `models` - All objects of the models with original handles specified in the `selectionSetA`.
89
+ * - `searchquery` - Objects retrieved by the search queries specified in `selectionSetA`.
90
90
  *
91
91
  * @readonly
92
92
  */
93
93
  get selectionTypeA(): string;
94
94
  /**
95
- * Second selection set for clash detection. Entities from `selectionSetB` will be tested
96
- * against each others by entities from the `selectionSetA` during the test.
95
+ * Second selection set for clash detection. Objects from `selectionSetB` will be tested
96
+ * against each others by objects from the `selectionSetA` during the test.
97
97
  *
98
98
  * @readonly
99
99
  */
@@ -101,10 +101,10 @@ export declare class ClashTest {
101
101
  /**
102
102
  * The type of second selection set for clash detection. Can be one of:
103
103
  *
104
- * - `all` - All file/assembly entities.
105
- * - `handle` - Entities with handles specified in the `selectionSetB`.
106
- * - `models` - Entities of file/assembly models specified in `selectionSetB`.
107
- * - `searchquery` - Entities retrieved by the search queries specified in `selectionSetB`.
104
+ * - `all` - All file/assembly objects.
105
+ * - `handle` - Objects with original handles specified in the `selectionSetB`.
106
+ * - `models` - All objects of the models with original handles specified in the `selectionSetB`.
107
+ * - `searchquery` - Objects retrieved by the search queries specified in `selectionSetB`.
108
108
  *
109
109
  * @readonly
110
110
  */
@@ -116,34 +116,34 @@ export declare class ClashTest {
116
116
  */
117
117
  get status(): string;
118
118
  /**
119
- * The distance of separation between entities at which test begins detecting clashes.
119
+ * The distance of separation between objects at which test begins detecting clashes.
120
120
  *
121
121
  * @readonly
122
122
  */
123
123
  get tolerance(): number;
124
124
  /**
125
- * Refresh test data.
125
+ * Reloads test data from the server.
126
126
  */
127
127
  checkout(): Promise<this>;
128
128
  /**
129
- * Update test data on the server.
129
+ * Updates test data on the server.
130
130
  *
131
131
  * @param data - Raw test data.
132
132
  */
133
133
  update(data: any): Promise<this>;
134
134
  /**
135
- * Remove a test from a file.
135
+ * Deletes a test and its results report from the server.
136
136
  *
137
137
  * @returns Returns the raw data of a deleted test.
138
138
  */
139
139
  delete(): Promise<any>;
140
140
  /**
141
- * Save test data changes to the server. Call this method to update test data on the server
142
- * after any changes.
141
+ * Saves test properties changes to the server. Call this method to update test data on the
142
+ * server after any property changes.
143
143
  */
144
144
  save(): Promise<this>;
145
145
  /**
146
- * Wait for test to complete. Test is done when it changes to `done` or `failed` status.
146
+ * Waits for test to complete. Test is done when it changes to `done` or `failed` status.
147
147
  *
148
148
  * @param params - An object containing waiting parameters.
149
149
  * @param params.timeout - The time, in milliseconds that the function should wait test. If
@@ -153,11 +153,13 @@ export declare class ClashTest {
153
153
  * @param params.signal - An
154
154
  * {@link https://developer.mozilla.org/docs/Web/API/AbortController | AbortController}
155
155
  * signal, which can be used to abort waiting as desired.
156
+ * @param params.onCheckout - Waiting progress callback. Return `true` to cancel waiting.
156
157
  */
157
158
  waitForDone(params?: {
158
159
  timeout?: number;
159
160
  interval?: number;
160
161
  signal?: AbortSignal;
162
+ onCheckout?: (test: ClashTest, ready: boolean) => boolean;
161
163
  }): Promise<this>;
162
164
  /**
163
165
  * Returns a report with the clash detection results for this test.