import { IHttpClient } from "./IHttpClient"; import { IAssociatedFileData, IAssemblyVersionInfo } from "./IAssembly"; import { IShortUserDescription } from "./IUser"; import { Model } from "./Model"; import { ClashTest } from "./ClashTest"; /** * The class representing a `assembly` entity. */ export declare class Assembly { private _data; private _useVersion; httpClient: IHttpClient; path: string; /** * @param data - An object that implements assembly data storage. * @param httpClient - Http client. */ constructor(data: any, httpClient: IHttpClient); appendVersionParam(relativePath: string): string; protected internalGet(relativePath: string, signal?: AbortSignal): Promise; protected internalPost(relativePath: string, body?: ArrayBuffer | Blob | globalThis.File | FormData | object | string | null): Promise; protected internalPut(relativePath: string, body?: ArrayBuffer | Blob | globalThis.File | FormData | object | string | null): Promise; protected internalDelete(relativePath: string): Promise; partialDownloadResource(dataId: string, onProgress?: (progress: number, downloaded: Uint8Array) => void, signal?: AbortSignal): Promise; downloadFileRange(requestId: number, records: any | null, dataId: string, onProgress?: (progress: number, downloaded: Uint8Array, requestId: number) => void, signal?: AbortSignal): Promise; get activeVersion(): number; /** * List of unique files from which the assembly was created. * * @readonly */ get associatedFiles(): IAssociatedFileData[]; /** * Assembly creation time (UTC) in the format specified in ISO 8601. * * @readonly */ get created(): string; /** * Raw assembly data received from the server. * * @readonly */ get data(): any; private set data(value); /** * List of file IDs from which the assembly was created. * * @readonly */ get files(): string[]; /** * Assembly geometry data type: * * - `vsfx` - VSFX, assembly can be opened in `VisualizeJS` viewer. * * Returns an empty string if geometry data has not yet been extracted. */ get geometryType(): string; /** * Unique assembly ID. * * @readonly */ get id(): string; /** * Assembly name. */ get name(): string; set name(value: string); get originalAssemblyId(): string; /** * Assembly owner information. * * @property {string} userId - User ID. * @property {string} userName - User name. * @property {string} name - First name. * @property {string} lastName - Last name. * @property {string} fullName - Full name. * @property {string} initials - Initials. * @property {string} email - User email. * @property {string} avatarUrl - User avatar image URL. * @readonly */ get owner(): IShortUserDescription; get previewUrl(): string; /** * List of assembly related job IDs. * * @readonly */ get relatedJobs(): string[]; /** * Assembly geometry data and properties status. Can be `waiting`, `inprogress`, `done` or `failed`. * * An assemblies without geometry data cannot be opened in viewer. * * @readonly */ get status(): string; /** * Assembly type. Returns an `assembly`. * * @readonly */ get type(): string; get version(): number; get versions(): IAssemblyVersionInfo[]; /** * Refresh assembly data. * * @async */ checkout(): Promise; /** * Updates assembly data on the server. * * @async * @param data - Raw assembly data. */ update(data: any): Promise; /** * Delete the assembly from the server. * * @async * @returns Returns the raw data of a deleted assembly. */ delete(): Promise; /** * Save assembly data changes to the server. Call this method to update assembly data on the * server after any changes. * * @async */ save(): Promise; setPreview(image?: ArrayBuffer | Blob | globalThis.File | FormData | string | null): Promise>; /** * Returns list of assembly models. * * @async */ getModels(): Promise; /** * Transformation matrix. * * @typedef {any} Transform * @property {any} translate - Translation part, move along the X, Y, Z axes. * @property {number} translate.x - The value for substruct for X axes. * @property {number} translate.y - The value for substruct for Y axes. * @property {number} translate.z - The value for substruct for Z axes. * @property {any} rotation - Rotation part, rotate by the specified angle, around the * specified vector. * @property {number} rotation.x - X coordinate of the rotation vector. * @property {number} rotation.y - Y coordinate of the rotation vector. * @property {number} rotation.z - Z coordinate of the rotation vector. * @property {number} rotation.angle - The angle of rotation. * @property {number} scale - Scaling part, scale with multiplier, from center of extends. */ /** * Returns a model transformation. * * @param handle - Model handle. */ getModelTransformMatrix(handle: string): any; /** * Set or delete a model transformation. * * @async * @param handle - Model handle. * @param transform - Transformation matrix. To delete transformation provide this to `undefined`. */ setModelTransformMatrix(handle: string, transform: any): Promise; /** * Returns the properties for an objects in the assembly. * * @async * @param handles - Object original handle or handles array. Leave this parameter undefined * to get properties for all objects in the assembly. * @returns {Promise} */ getProperties(handles?: string | string[]): Promise; /** * Returns the list of original handles for an objects in the file that match the specified * patterns. Search patterns may be combined using query operators. * * @async * @example Simple search pattern. * searchPattern = { * key: "Category", * value: "OST_Stairs", * }; * * @example Search patterns combination. * searchPattern = { * $or: [ * { * $and: [ * { key: "Category", value: "OST_GenericModel" }, * { key: "Level", value: "03 - Floor" }, * ], * }, * { key: "Category", value: "OST_Stairs" }, * ], * }; * * @param searchPattern - Search pattern or combination of the patterns, see example below. */ searchProperties(searchPattern: any): Promise; /** * Returns the cda.json for an assembly. * * @async */ getCdaTree(): Promise; getViewpoints(): Promise<[]>; saveViewpoint(viewpoint: any): Promise; deleteViewpoint(guid: any): Promise; getSnapshot(guid: any): Promise; getSnapshotData(guid: any, bitmapGuid: any): Promise; /** * Download assembly resource data, such as geometry data. * * @async * @param dataId - Resource ID. * @param onProgress - Download progress callback. * @param signal - An AbortSignal object instance. Allows to communicate with a fetch request * and abort it if desired. */ downloadResource(dataId: string, onProgress?: (progress: number) => void, signal?: AbortSignal): Promise; getReferences(signal?: AbortSignal): Promise<{ fileId: string; references: any[]; }>; /** * Wait for assembly to be created. Assembly is created when it changes to `done` or `failed` status. * * @async * @param params - An object containing waiting parameters. * @param params.timeout - The time, in milliseconds that the function should wait assembly. * If assembly is not created during this time, the `TimeoutError` exception will be thrown. * @param params.interval - The time, in milliseconds, the function should delay in between * checking assembly status. * @param params.signal- An AbortController * signal object instance, which can be used to abort waiting as desired. * @param params.onCheckout - Waiting progress callback. Return `true` to cancel waiting. * @returns {Promise} */ waitForDone(params?: { timeout?: number; interval?: number; signal?: AbortSignal; onCheckout?: (assembly: Assembly, ready: boolean) => boolean; }): Promise; /** * Returns a list of assembly clash tests. * * @async * @param {number} start - The starting index in the test list. Used for paging. * @param {number} limit - The maximum number of tests that should be returned per request. * Used for paging. * @param {string} name - Filter the tests by part of the name. * @param {string | string[]} ids - List of tests IDs to return. You can specify multiple IDs * on one `string` by separating them with a "|". * @param {bool} sortByDesc - Allows to specify the descending order of the result. By * default tests are sorted by name in ascending order. * @param {string} sortField - Allows to specify sort field. */ getClashTests(start?: number, limit?: number, name?: string, ids?: string | string[], sortByDesc?: boolean, sortField?: string): Promise<{ allSize: number; start: number; limit: number; result: ClashTest[]; size: number; }>; /** * Returns the assembly clash test information. * * @async * @param testId - Test ID. */ getClashTest(testId: string): Promise; /** * Create assembly clash test. Assembly must be in a `done` state, otherwise the test will fail. * * @async * @param name - Test name. * @param selectionTypeA - The type of first selection set for clash detection. Can be `all`, * `handles`, `models` or `searchquery`. * @param selectionTypeB - The type of second selection set for clash detection. Can be * `all`, `handles`, `models` or `searchquery`. * @param selectionSetA - First selection set for clash detection. * @param selectionSetB - Second selection set for clash detection. * @param params - An object containing test parameters. * @param params.tolerance - The distance of separation between entities at which test begins * detecting clashes. * @param params.clearance - The type of the clashes that the test detects: `true` for * `Сlearance clash` or `false` for `Hard clash`. * @param params.waitForDone - Wait for test to complete. * @param params.timeout - The time, in milliseconds that the function should wait test. If * test is not complete during this time, the `TimeoutError` exception will be thrown. * @param params.interval - The time, in milliseconds, the function should delay in between * checking test status. * @param params.signal- An AbortController * signal object instance, which can be used to abort waiting as desired. */ createClashTest(name: string, selectionTypeA: string, selectionTypeB: string, selectionSetA?: string | string[], selectionSetB?: string | string[], params?: { tolerance?: number | string; clearance?: boolean; waitForDone?: boolean; timeout?: number; interval?: number; signal?: AbortSignal; }): Promise; /** * Delete assembly clash test. * * @async * @param testId - Test ID. * @returns Returns the raw data of a deleted test. */ deleteClashTest(testId: string): Promise; updateVersion(files?: string[], params?: { waitForDone?: boolean; timeout?: number; interval?: number; signal?: AbortSignal; onProgress?: (progress: number, file: globalThis.File) => void; }): Promise; getVersions(): Promise; getVersion(version: number): Promise; deleteVersion(version: number): Promise; setActiveVersion(version: number): Promise; useVersion(version?: number): this; } //# sourceMappingURL=Assembly.d.ts.map