Reference·JavaScript · @bimworks/jssdkJavaScript

BimWorksClient

Class in @bimworks/jssdk.

API catalogue · @bimworks/jssdk · Class

TypeScript#
class BimWorksClient<TClient extends Client | null | undefined = Client | null | undefined>

The main entry point to the BIM.works API. This is usually a short-lived object, but there is no reason to not use it for longer. For better organization, the BIM.works API is namespaced in about a dozen different namespaces. These namespaces are also used in the JS SDK. Each namespaced API is available as a readonly attribute on the BimWorksClient.

Type parameters#

Name Constraint Description
TClient Client | null | undefined

Members#

Member Kind Description
constructor Method
ai Property Natural-language actions on servers with AI enabled.
auth Property Account registration. Authentication is configured by the client factory.
bim Property
checks Property
client Property
fs Property
geometry3d Property
gis Property
ifc Property
info Property General server information, including the application version.
linkedData Property Files, URLs, texts and identifiers linked to objects.
registerExpiredTokenHandler Property
render Property
tokens Property
upload Property
addConnectionRestoredListener Method Register a callback invoked when the transport restores its connection.
addPart Method Names a BIM.works package that uses this client, e.g. a viewer (parts of the X-BIMworks-Client header).
close Method This method should be called as soon as you are done using the BimWorksClient
executePreSignedDownload Method Runs a pre-signed download (a token from Tokens) and resolves with its URL

constructor#

TypeScript#
constructor(client: TClient, settings?: TClient extends Client ? null | undefined : ClientFactorySettings, modelUploadFactory?: ModelUploaderFactory)

Type parameters#

Name Constraint Description
TClient Client | null | undefined

Parameters#

Name Type Description
client TClient
settings TClient extends Client ? null | undefined : ClientFactorySettings
modelUploadFactory ModelUploaderFactory

ai#

TypeScript#
readonly ai: Ai

Natural-language actions on servers with AI enabled.

auth#

TypeScript#
readonly auth: Auth

Account registration. Authentication is configured by the client factory.

bim#

TypeScript#
readonly bim: Bim

checks#

TypeScript#
readonly checks: Checks

client#

TypeScript#
readonly client: Client

fs#

TypeScript#
readonly fs: Fs

geometry3d#

TypeScript#
readonly geometry3d: Geometry3d

gis#

TypeScript#
readonly gis: Gis

ifc#

TypeScript#
readonly ifc: Ifc

info#

TypeScript#
readonly info: Info

General server information, including the application version.

linkedData#

TypeScript#
readonly linkedData: LinkedData

Files, URLs, texts and identifiers linked to objects.

registerExpiredTokenHandler#

TypeScript#
public registerExpiredTokenHandler: (handler: (oldAuth: AuthToken) => Promise<AuthToken | undefined>) => void

render#

TypeScript#
readonly render: Render

tokens#

TypeScript#
readonly tokens: Tokens

upload#

TypeScript#
readonly upload: Upload

addConnectionRestoredListener#

TypeScript#
public addConnectionRestoredListener(listener: () => void): void

Register a callback invoked when the transport restores its connection.

Parameters#

Name Type Description
listener () => void

addPart#

TypeScript#
public addPart(name: string, version?: string | null): void

Names a BIM.works package that uses this client, e.g. a viewer (parts of the X-BIMworks-Client header).

Parameters#

Name Type Description
name string
version string | null

close#

TypeScript#
public close(): void

This method should be called as soon as you are done using the BimWorksClient

executePreSignedDownload#

TypeScript#
public executePreSignedDownload(token: unknown): Promise<string>

Runs a pre-signed download (a token from Tokens) and resolves with its URL

Parameters#

Name Type Description
token unknown