new File(impl)
Parameters:
| Name | Type | Description | 
|---|---|---|
| impl | FileImpl | An object that implements file data storage and server requests. | 
Members
- 
    <readonly> created :string
- 
    
    File creation time (UTC) in the format specified in ISO 8601. Type:- string
 
- 
    <readonly> customFields :Object
- 
    
    File custom fields object, to store custom data. Type:- Object
 
- 
    <readonly> data :Object
- 
    
    Raw file data received from the server. Type:- Object
 
- 
    <readonly> exports :Array.<string>
- 
    
    Returns an array of types the file can be exported to. Type:- Array.<string>
 
- 
    <readonly> geometryStatus :string
- 
    
    Geometry data extracting status. Can be none,waiting,inprogress,doneorfailed.Type:- string
 
- 
    <readonly> id :string
- 
    
    Unique file ID. Type:- string
 
- 
    <readonly> metadata :boolean
- 
    
    truewhen file have geometry data.Type:- boolean
 
- 
    name :string
- 
    
    File name, including the extension. Type:- string
 
- 
    <readonly> owner :string
- 
    
    File owner ID. Use Client.getUser() to obtain detailed owner information. Type:- string
 
- 
    <readonly> previewUrl :string
- 
    
    File preview image URL. Use setPreview() to change preview image. Type:- string
 
- 
    <readonly> properties :boolean
- 
    
    truewhen file have properties.Type:- boolean
 
- 
    <readonly> propertiesStatus :string
- 
    
    Properties extracting status. Can be none,waiting,inprogress,doneorfailed.Type:- string
 
- 
    <readonly> size :number
- 
    
    File size in bytes. Type:- number
 
- 
    <readonly> type :string
- 
    
    File type, matches the file extension. Type:- string
 
- 
    <readonly> validationStatus :string
- 
    
    File validation status. Can be none,waiting,inprogress,doneorfailed.Type:- string
 
Methods
- 
    <async> checkout()
- 
    
    Refresh file data. Returns:- Type
- Promise.<File>
 
- 
    <async> createPermission(actions, grantedTo, public)
- 
    
    Create a new file permission. Parameters:Name Type Default Description actionsstring | Array.<string> Actions are allowed to be performed on a file with this permission. See Permission.actions for more details. grantedToArray.<Principial> A collection of principials that will get access to the file. publicBoolean false Specifies whether all users have access to the file or not. Returns:- Type
- Promise.<Permission>
 
- 
    <async> delete()
- 
    
    Delete the file from the server. Returns:- Returns the raw data of a deleted file.
 - Type
- Promise.<Object>
 
- 
    <async> deletePermission(permissionId)
- 
    
    Delete file permission. Parameters:Name Type Description permissionIdstring Permission ID. Returns:- Returns the raw data of a deleted permission.
 - Type
- Promise.<Object>
 
- 
    <async> deleteViewpoint(guid)
- 
    
    Delete file viewpoint. Parameters:Name Type Description guidstring Viewpoint GUID. Returns:- Returns the raw data of a deleted viewpoint.
 - Type
- Promise.<Object>
 
- 
    <async> downloadResource(dataId, onProgress, signal)
- 
    
    Download file resource data, such as geometry database or geometry data. Parameters:Name Type Description dataIdstring Resource ID. onProgressProgressCallback Download progress callback. signalAbortSignal An AbortSignal object instance. Allows to communicate with a fetch request and abort it if desired. Returns:- Type
- Promise.<ArrayBuffer>
 
- 
    <async> extractGeometry()
- 
    
    Create job for extract file geometry data. Returns:- Type
- Promise.<Job>
 
- 
    <async> extractProperties()
- 
    
    Create job for extract file properties. Returns:- Type
- Promise.<Job>
 
- 
    <async> getModels()
- 
    
    Returns list of file models. Returns:- Type
- Promise.<Array.<Model>>
 
- 
    <async> getPermission(permissionId)
- 
    
    Returns the permission information. Parameters:Name Type Description permissionIdstring Permission ID. Returns:- Type
- Promise.<Permission>
 
- 
    <async> getPermissions()
- 
    
    Returns a list of file permissions. Returns:- Type
- Promise.<Array.<Permission>>
 
- 
    <async> getProperties( [handle])
- 
    
    Returns the properties for an object in the file. Parameters:Name Type Argument Description handlestring <optional> 
 Object original handle. Leave this parameter undefinedto get properties for all objects in the file.Returns:- Type
- Promise.<Array.<Properties>> | Promise.<Properties>
 
- 
    <async> getReferences( [signal])
- 
    
    Returns a file references. Parameters:Name Type Argument Description signalAbortSignal <optional> 
 Returns:- Type
- Promise.<FileReferences>
 
- 
    <async> getSnapshot(guid)
- 
    
    Returns viewpoint preview image as Data URL. Parameters:Name Type Description guidstring Viewpoint GUID. Returns:- Type
- Promise.<string>
 
- 
    <async> getSnapshotData(guid, bitmapGuid)
- 
    
    Returns viewpoint preview data. Parameters:Name Type Description guidstring Viewpoint GUID. bitmapGuidstring Bitmap GUID. Returns:- Type
- Promise.<string>
 
- 
    <async> getViewpoints()
- 
    
    Returns a list of file viewpoints. Returns:- Type
- Promise.<Array.<Object>>
 
- 
    <async> save()
- 
    
    Save file data changes to the server. Call this method to update file data on the server after any changes. Returns:- Type
- Promise.<File>
 
- 
    <async> saveViewpoint(viewpoint)
- 
    
    Add new file viewpoint. To create a new viewpoint use Viewer.createViewpoint(). Parameters:Name Type Description viewpointObject Viewpoint. Returns:- Type
- Promise.<Object>
 
- 
    <async> searchProperties(searchPattern)
- 
    
    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. Parameters:Name Type Description searchPatternSearchPattern | QueryOperator Search pattern or combination of the patterns, see example below. Returns:- Type
- Promise.<Array.<Properties>>
 ExamplesSimple search pattern. searchPattern = { key: "Category", value: "OST_Stairs", };Search patterns combination. searchPattern = { $or: [ { $and: [ { key: "Category", value: "OST_GenericModel" }, { key: "Level", value: "03 - Floor" }, ], }, { key: "Category", value: "OST_Stairs" }, ], };
- 
    <async> setPreview(image)
- 
    
    Set or remove the file preview. Parameters:Name Type Description imagestring | ArrayBuffer | Blob | file | null Preview image. Can be a Data URL string, ArrayBuffer, Blob or Web API File object. Setting the imagetonullwill remove the preview.Returns:- Type
- Promise.<File>
 
- 
    <async> setReferences(references)
- 
    
    Set the file references. Parameters:Name Type Description referencesFileReferences File references. Returns:- Type
- Promise.<FileReferences>
 
- 
    <async> update(data)
- 
    
    Update file data on the server. Parameters:Name Type Description dataObject Raw file data. Returns:- Type
- Promise.<File>
 
- 
    <async> validate()
- 
    
    Create a job to validate the file. Returns:- Type
- Promise.<Job>
 
- 
    <async> waitForDone(job [, waitAll] [, params])
- 
    
    Wait until file jobs is done. File job is done when it changes to none,doneorfailedstatus.Parameters:Name Type Argument Description jobstring | Array.<string> Job or job array to wait on. Can be geometry,propertiesorvalidation.waitAllBoolean <optional> 
 If this parameter is true, the function returns when all the specified jobs have done. Iffalse, the function returns when any one of the jobs are done.paramsObject <optional> 
 An object containing waiting parameters. PropertiesName Type Argument Description timeoutNumber <optional> 
 The time, in milliseconds that the function should wait jobs. If no one jobs are done during this time, the TimeoutErrorexception will be thrown.intervalNumber <optional> 
 The time, in milliseconds, the function should delay in between checking jobs status. signalAbortSignal <optional> 
 An AbortController signal object instance, which can be used to abort waiting as desired. Returns:- Type
- Promise.<File>
 
 Client.js
Client.js