Перейти к основному содержанию

Class: SharedLinksExtension

Около 2 мин

Class: SharedLinksExtension

An extension to manage models sharing.

Hierarchy

Constructors

constructor

new SharedLinksExtension(viewerName): SharedLinksExtension

Parameters

NameTypeDescription
viewerNamestringOwner viewer name.

Returns

SharedLinksExtension

Overrides

ExtensionBase.constructor

Properties

authServer

authServer: string

Tangl auth server URL.


getName

getName: () => string

Get unique extension name.

Type declaration

▸ (): string

Get unique extension name.

Returns

string

Inherited from

ExtensionBase.getName


helpDesc

Readonly helpDesc: string

Optional description for placing on HelpToolbar.

Inherited from

ExtensionBase.helpDesc


helpIcon

Readonly helpIcon: string

Optional icon for placing on HelpToolbar.

Inherited from

ExtensionBase.helpIcon


hideToolbar

hideToolbar: boolean

Is extension need to hide toolbar or not.

Inherited from

ExtensionBase.hideToolbar


isActive

isActive: any

Whether the measurement command is active or not.


platformServer

platformServer: string

Tangl platform server URL.


state

state: any

Any extension data which can be stored in browser local storage and restored after (any extension settings, buttons state and so one). State will be saved in local storage with 'tangl-ext-extensionName' key.

Inherited from

ExtensionBase.state


token

token: string

Token for authentication.


type

Readonly type: string

Extension type (ext, mode, control).

Inherited from

ExtensionBase.type


viewerName

Readonly viewerName: string

Owner viewer name.

Inherited from

ExtensionBase.viewerName

Methods

createLink(modelIds, daysOfLife?): Promise<string>

Creates new shared link for set of open models.

Parameters

NameTypeDescription
modelIdsanyset of model ids.
daysOfLife?numberdays of life for link.

Returns

Promise<string>

shared link id.


deleteLink(linkId): Promise<void>

Deletes exist shared link by link id.

Parameters

NameTypeDescription
linkIdstringlink id.

Returns

Promise<void>


getAllLinks(): Promise<any>

Gets all exist shared links for current set of open models.

Returns

Promise<any>


getRenderManager

getRenderManager(): RenderManager

Get current RenderManager instance.

Returns

RenderManager

Inherited from

ExtensionBase.getRenderManager


restoreState

restoreState(): void

Restore extension state from the local storage.

Returns

void

Inherited from

ExtensionBase.restoreState


saveState

saveState(): void

Save extension state in the local storage.

Returns

void

Inherited from

ExtensionBase.saveState


setAuthServer

setAuthServer(server): void

Sets Tangl auth server URL.

Parameters

NameTypeDescription
serverstringserver URL.

Returns

void


setPlatformServer

setPlatformServer(server): void

Sets Tangl platform server URL.

Parameters

NameTypeDescription
serverstringserver URL.

Returns

void


setRestoreStateHandler

setRestoreStateHandler(handler): void

Sets external hook handler for restoring extension state in the local storage.

Parameters

NameTypeDescription
handlerFunctionhandler hook function.

Returns

void

Inherited from

ExtensionBase.setRestoreStateHandler


setSaveStateHandler

setSaveStateHandler(handler): void

Sets external hook handler for storing extension state in the local storage.

Parameters

NameTypeDescription
handlerFunctionhandler hook function.

Returns

void

Inherited from

ExtensionBase.setSaveStateHandler


setToken

setToken(token): void

Sets Tangl auth bearer token.

Parameters

NameTypeDescription
tokenstringBearer token string.

Returns

void


updateLink(linkId, value): Promise<void>

Updates exist shared link days of life.

Parameters

NameTypeDescription
linkIdstringlink id.
valuenumbernew days of life.

Returns

Promise<void>

Hooks

commandChanged

commandChanged(newCommand): void

Hook when current extension command is changed or finished. Called by ExtensionManager.setCurrentCommandExtension().

Parameters

NameType
newCommandExtensionBase

Returns

void

Inherited from

ExtensionBase.commandChanged


dedicatedToolbarRender

dedicatedToolbarRender(container): void

Render function for rendering dedicated toolbar content.

Parameters

NameTypeDescription
containerHTMLElementParent DOM container.

Returns

void

Inherited from

ExtensionBase.dedicatedToolbarRender


sharedToolbarRender

sharedToolbarRender(container): void

Render function for rendering shared toolbar content.

Parameters

NameTypeDescription
containerHTMLElementParent DOM container.

Returns

void

Inherited from

ExtensionBase.sharedToolbarRender


uiRender

uiRender(container): void

Render function for rendering additional UI above viewer canvas.

Parameters

NameTypeDescription
containerHTMLElementParent DOM container.

Returns

void

Inherited from

ExtensionBase.uiRender