Class: SharedLinksExtension
Class: SharedLinksExtension
An extension to manage models sharing.
Hierarchy
↳
SharedLinksExtension
Constructors
constructor
• new SharedLinksExtension(viewerName
): SharedLinksExtension
Parameters
Name | Type | Description |
---|---|---|
viewerName | string | Owner viewer name. |
Returns
Overrides
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
helpDesc
• Readonly
helpDesc: string
Optional description for placing on HelpToolbar.
Inherited from
helpIcon
• Readonly
helpIcon: string
Optional icon for placing on HelpToolbar.
Inherited from
hideToolbar
• hideToolbar: boolean
Is extension need to hide toolbar or not.
Inherited from
isActive
• isActive: any
Whether the measurement command is active or not.
isHidden
• isHidden: any
Whether the command is hidden 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
token
• token: string
Token for authentication.
type
• Readonly
type: string
Extension type (ext, mode, control).
Inherited from
viewerName
• Readonly
viewerName: string
Owner viewer name.
Inherited from
Methods
createLink
▸ createLink(modelIds
, daysOfLife?
): Promise
<string
>
Creates new shared link for set of open models.
Parameters
Name | Type | Description |
---|---|---|
modelIds | any | set of model ids. |
daysOfLife? | number | days of life for link. |
Returns
Promise
<string
>
shared link id.
deleteLink
▸ deleteLink(linkId
): Promise
<void
>
Deletes exist shared link by link id.
Parameters
Name | Type | Description |
---|---|---|
linkId | string | link id. |
Returns
Promise
<void
>
getAllLinks
▸ 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
Inherited from
ExtensionBase.getRenderManager
restoreState
▸ restoreState(): void
Restore extension state from the local storage.
Returns
void
Inherited from
saveState
▸ saveState(): void
Save extension state in the local storage.
Returns
void
Inherited from
setAuthServer
▸ setAuthServer(server
): void
Sets Tangl auth server URL.
Parameters
Name | Type | Description |
---|---|---|
server | string | server URL. |
Returns
void
setPlatformServer
▸ setPlatformServer(server
): void
Sets Tangl platform server URL.
Parameters
Name | Type | Description |
---|---|---|
server | string | server URL. |
Returns
void
setRestoreStateHandler
▸ setRestoreStateHandler(handler
): this
Sets external hook handler for restoring extension state in the local storage.
Parameters
Name | Type | Description |
---|---|---|
handler | Function | handler hook function. |
Returns
this
Inherited from
ExtensionBase.setRestoreStateHandler
setSaveStateHandler
▸ setSaveStateHandler(handler
): this
Sets external hook handler for storing extension state in the local storage.
Parameters
Name | Type | Description |
---|---|---|
handler | Function | handler hook function. |
Returns
this
Inherited from
ExtensionBase.setSaveStateHandler
setToken
▸ setToken(token
): void
Sets Tangl auth bearer token.
Parameters
Name | Type | Description |
---|---|---|
token | string | Bearer token string. |
Returns
void
updateLink
▸ updateLink(linkId
, value
): Promise
<void
>
Updates exist shared link days of life.
Parameters
Name | Type | Description |
---|---|---|
linkId | string | link id. |
value | number | new 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
Name | Type |
---|---|
newCommand | ExtensionBase |
Returns
void
Inherited from
dedicatedToolbarRender
▸ dedicatedToolbarRender(container
): void
Render function for rendering dedicated toolbar content.
Parameters
Name | Type | Description |
---|---|---|
container | HTMLElement | Parent DOM container. |
Returns
void
Inherited from
ExtensionBase.dedicatedToolbarRender
sharedToolbarRender
▸ sharedToolbarRender(container
): void
Render function for rendering shared toolbar content.
Parameters
Name | Type | Description |
---|---|---|
container | HTMLElement | Parent DOM container. |
Returns
void
Inherited from
ExtensionBase.sharedToolbarRender
uiRender
▸ uiRender(container
): void
Render function for rendering additional UI above viewer canvas.
Parameters
Name | Type | Description |
---|---|---|
container | HTMLElement | Parent DOM container. |
Returns
void