Editor Extension SDK Reference
The Editor Extension SDK is a TypeScript library that provides access to Lucid's core application for editor extensions built using the Extension API.
Classes
BaseFieldTypeArray<Type>
core/data/fieldtypedefinition/fieldtypearray.BaseFieldTypeArray
Type parameters
Name |
---|
|
Hierarchy
-
BaseFieldTypeArray
Constructors
constructor
• new BaseFieldTypeArray<
Type parameters
Name |
---|
|
Parameters
Name | Type |
---|---|
|
|
Properties
validTypesArray
•
Methods
getInnerNonArrayTypes
▸ getInnerNonArrayTypes():
Returns
getInnerTypes
▸ getInnerTypes():
Returns
serialize
▸ serialize():
Returns
serializeType
▸
Parameters
Name | Type |
---|---|
|
|
Returns
BlockProxy
document/blockproxy.BlockProxy
A block is a single shape on the document. A BlockProxy provides an interface to read and write the content of an existing block, and is typically accessed through PageProxy.blocks or another similar mechanism.
Hierarchy
-
↳
BlockProxy
Constructors
constructor
• new BlockProxy(
Parameters
Name | Type | Description |
---|---|---|
|
|
ID of this item |
|
|
Inherited from
Properties
allShapeData
•
All shape data accessible on this element, including shape data inherited from the page or a containing group. This collection is read-only.
Inherited from
client
•
Inherited from
id
•
Inherited from
properties
•
All properties available on this element, organized by name. Not all properties are writeable (e.g. "ClassName" on a block). To move or resize elements, use setLocation() or setBoundingBox() or offset() instead.
Inherited from
referenceKeys
•
The set of reference keys, organized by their ID, which can be either a string or number.
For more information, see the Developer Guide.
Inherited from
shapeData
•
The shape data set directly on this element (not including any shape data inherited from the page or a containing group).
Inherited from
textAreas
•
The plain text in each of the text areas on this item, organized by text area name.
Inherited from
textStyles
•
The text style in each of the text areas on this item, organized by text area name.
Inherited from
Methods
changeZOrder
▸ changeZOrder(
Parameters
Name | Type | Description |
---|---|---|
|
|
How to adjust the Z order of this item relative to the other items it overlaps on the page |
Returns
Inherited from
delete
▸ delete():
Delete this item from the document
Returns
Inherited from
executeFormula
▸ executeFormula(
Execute a formula in the context of this element
Parameters
Name | Type | Description |
---|---|---|
|
|
The formula text, e.g. "@a + @b" to add together the shape data values a and b. |
Returns
The result of the formula, or an error.
Inherited from
exists
▸ exists():
Returns
Inherited from
getBoundingBox
▸ getBoundingBox():
Returns
The bounding box of this item relative to its containing page. As pages may change size to fit the content on them, note that these coordinates may be negative or very large.
If this is a rotated block, the bounding box returned here is where the block would be if it were unrotated.
Inherited from
getClassName
▸ getClassName():
Returns
The class name of this block. This name is not necessarily human-readable, and will remain consistent over time, e.g. "ProcessBlock"..
getConnectedLines
▸ getConnectedLines():
Returns
An array of lines that have one or both endpoints connected to this block.
getContainers
▸ getContainers():
Returns
An array of blocks whose bounding boxes contain this item's upper-left corner
Inherited from
getLineWidth
▸ getLineWidth():
Returns
The line width used by most kinds of blocks to render their outline.
getLocation
▸ getLocation():
Returns
The x/y location of this item
Name | Type |
---|---|
|
|
|
|
Inherited from
getPage
▸ getPage():
Returns
The page containing this item
Inherited from
getRotation
▸ getRotation():
Returns
The amount this block is rotated around its own center, in radians.
getShadow
▸ getShadow():
Returns
The current drop shadow on this block, or undefined if no shadow is set
getSimpleStaticDataGraphic
▸ getSimpleStaticDataGraphic():
Returns
Settings for the simple static data graphic currently set on this block, or undefined if no simple data graphic is currently set. Note that if a data graphic exists that is not an icon, this will return undefined. This function will not consider data graphics set via conditional formatting rules.
linkText
▸ linkText(
Link a text area to a data field, so that editing the text area will also update the associated data, and vice versa.
To use this, first establish a reference key on this block with setReferenceKey.
Parameters
Name | Type |
---|---|
|
|
|
|
|
|
Returns
lockAspectRatio
▸ lockAspectRatio():
Lock this block's aspect ratio to its current value. This can be reversed with unlockAspectRatio.
Returns
offset
▸ offset(
Offset this item in the given direction by the given amount.
Parameters
Name | Type | Description |
---|---|---|
|
|
The type of offset to apply to this item |
|
|
The amount to offset |
Returns
Inherited from
removeReferenceKey
▸ removeReferenceKey(
Remove the specified reference key from this element.
Parameters
Name | Type |
---|---|
|
|
Returns
Inherited from
setBoundingBox
▸ setBoundingBox(
Attempts to move and resize this item to fit into the given bounding box. If this item (or another item it contains) has size or aspect ratio restrictions, it may not be possible to fit the requested location exactly.
This is done by moving this item to the requested location, then attempting to resize it from the bottom-right corner to the requested size.
Parameters
Name | Type | Description |
---|---|---|
|
|
The bounding box to attempt to make this item fill |
Returns
Inherited from
setDataSyncStateIconPosition
▸ setDataSyncStateIconPosition(
Parameters
Name | Type | Description |
---|---|---|
|
|
The postion where the data sync state icon should be displayed on the block. If this position is set to undefined then the state icon position will fallback to the default position for the block. |
Returns
setFillStyle
▸ setFillStyle(
Set the fill style used (by most kinds of blocks) to fill in their main opaque areas. This can be a string color (e.g.
Parameters
Name | Type |
---|---|
|
|
Returns
setLineWidth
▸ setLineWidth(
Parameters
Name | Type | Description |
---|---|---|
|
|
The line width to be used (by most kinds of blocks) to render this block's outline |
Returns
setLocation
▸ setLocation(
Moves this item so that its upper-left corner is positioned at the given location (prior to any rotation)
Parameters
Name | Type | Description |
---|---|---|
|
|
The target location |
Returns
Inherited from
setReferenceKey
▸ setReferenceKey(
Set a reference key on this element, replacing any existing reference at the specified key.
Parameters
Name | Type |
---|---|
|
|
|
|
Returns
Inherited from
setRotation
▸ setRotation(
Parameters
Name | Type | Description |
---|---|---|
|
|
Angle the block should be rotated |
Returns
setShadow
▸ setShadow(
Parameters
Name | Type | Description |
---|---|---|
|
|
The drop shadow to set on the block, or undefined to clear the drop shadow |
Returns
setSimpleStaticDataGraphic
▸ setSimpleStaticDataGraphic(
Parameters
Name | Type | Description |
---|---|---|
|
|
Information about the static data graphic icon to set on this block. |
Returns
unlockAspectRatio
▸ unlockAspectRatio():
Unlock the aspect ratio of this block, allowing it to be stretched vertically or horizontally independently.
Returns
CardBlockProxy
document/blockclasses/cardblockproxy.CardBlockProxy
A block is a single shape on the document. A BlockProxy provides an interface to read and write the content of an existing block, and is typically accessed through PageProxy.blocks or another similar mechanism.
Hierarchy
-
↳
CardBlockProxy
Constructors
constructor
• new CardBlockProxy(
Parameters
Name | Type | Description |
---|---|---|
|
|
ID of this item |
|
|
Inherited from
Properties
allShapeData
•
All shape data accessible on this element, including shape data inherited from the page or a containing group. This collection is read-only.
Inherited from
client
•
Inherited from
id
•
Inherited from
properties
•
All properties available on this element, organized by name. Not all properties are writeable (e.g. "ClassName" on a block). To move or resize elements, use setLocation() or setBoundingBox() or offset() instead.
Inherited from
referenceKeys
•
The set of reference keys, organized by their ID, which can be either a string or number.
For more information, see the Developer Guide.
Inherited from
shapeData
•
The shape data set directly on this element (not including any shape data inherited from the page or a containing group).
Inherited from
textAreas
•
The plain text in each of the text areas on this item, organized by text area name.
Inherited from
textStyles
•
The text style in each of the text areas on this item, organized by text area name.
Inherited from
classNameRegex
▪
Methods
changeZOrder
▸ changeZOrder(
Parameters
Name | Type | Description |
---|---|---|
|
|
How to adjust the Z order of this item relative to the other items it overlaps on the page |
Returns
Inherited from
delete
▸ delete():
Delete this item from the document
Returns
Inherited from
executeFormula
▸ executeFormula(
Execute a formula in the context of this element
Parameters
Name | Type | Description |
---|---|---|
|
|
The formula text, e.g. "@a + @b" to add together the shape data values a and b. |
Returns
The result of the formula, or an error.
Inherited from
exists
▸ exists():
Returns
Inherited from
getBoundingBox
▸ getBoundingBox():
Returns
The bounding box of this item relative to its containing page. As pages may change size to fit the content on them, note that these coordinates may be negative or very large.
If this is a rotated block, the bounding box returned here is where the block would be if it were unrotated.
Inherited from
getClassName
▸ getClassName():
Returns
The class name of this block. This name is not necessarily human-readable, and will remain consistent over time, e.g. "ProcessBlock"..
Inherited from
getConnectedLines
▸ getConnectedLines():
Returns
An array of lines that have one or both endpoints connected to this block.
Inherited from
getContainers
▸ getContainers():
Returns
An array of blocks whose bounding boxes contain this item's upper-left corner
Inherited from
getLineWidth
▸ getLineWidth():
Returns
The line width used by most kinds of blocks to render their outline.
Inherited from
getLocation
▸ getLocation():
Returns
The x/y location of this item
Name | Type |
---|---|
|
|
|
|
Inherited from
getPage
▸ getPage():
Returns
The page containing this item
Inherited from
getRotation
▸ getRotation():
Returns
The amount this block is rotated around its own center, in radians.
Inherited from
getShadow
▸ getShadow():
Returns
The current drop shadow on this block, or undefined if no shadow is set
Inherited from
getSimpleStaticDataGraphic
▸ getSimpleStaticDataGraphic():
Returns
Settings for the simple static data graphic currently set on this block, or undefined if no simple data graphic is currently set. Note that if a data graphic exists that is not an icon, this will return undefined. This function will not consider data graphics set via conditional formatting rules.
Inherited from
BlockProxy.getSimpleStaticDataGraphic
linkText
▸ linkText(
Link a text area to a data field, so that editing the text area will also update the associated data, and vice versa.
To use this, first establish a reference key on this block with setReferenceKey.
Parameters
Name | Type |
---|---|
|
|
|
|
|
|
Returns
Inherited from
lockAspectRatio
▸ lockAspectRatio():
Lock this block's aspect ratio to its current value. This can be reversed with unlockAspectRatio.
Returns
Inherited from
offset
▸ offset(
Offset this item in the given direction by the given amount.
Parameters
Name | Type | Description |
---|---|---|
|
|
The type of offset to apply to this item |
|
|
The amount to offset |
Returns
Inherited from
removeReferenceKey
▸ removeReferenceKey(
Remove the specified reference key from this element.
Parameters
Name | Type |
---|---|
|
|
Returns
Inherited from
setBoundingBox
▸ setBoundingBox(
Attempts to move and resize this item to fit into the given bounding box. If this item (or another item it contains) has size or aspect ratio restrictions, it may not be possible to fit the requested location exactly.
This is done by moving this item to the requested location, then attempting to resize it from the bottom-right corner to the requested size.
Parameters
Name | Type | Description |
---|---|---|
|
|
The bounding box to attempt to make this item fill |
Returns
Inherited from
setDataSyncStateIconPosition
▸ setDataSyncStateIconPosition(
Parameters
Name | Type | Description |
---|---|---|
|
|
The postion where the data sync state icon should be displayed on the block. If this position is set to undefined then the state icon position will fallback to the default position for the block. |
Returns
Inherited from
BlockProxy.setDataSyncStateIconPosition
setFillStyle
▸ setFillStyle(
Set the fill style used (by most kinds of blocks) to fill in their main opaque areas. This can be a string color (e.g.
Parameters
Name | Type |
---|---|
|
|
Returns
Inherited from
setLineWidth
▸ setLineWidth(
Parameters
Name | Type | Description |
---|---|---|
|
|
The line width to be used (by most kinds of blocks) to render this block's outline |
Returns
Inherited from
setLocation
▸ setLocation(
Moves this item so that its upper-left corner is positioned at the given location (prior to any rotation)
Parameters
Name | Type | Description |
---|---|---|
|
|
The target location |
Returns
Inherited from
setReferenceKey
▸ setReferenceKey(
Set a reference key on this element, replacing any existing reference at the specified key.
Parameters
Name | Type |
---|---|
|
|
|
|
Returns
Inherited from
setRotation
▸ setRotation(
Parameters
Name | Type | Description |
---|---|---|
|
|
Angle the block should be rotated |
Returns
Inherited from
setShadow
▸ setShadow(
Parameters
Name | Type | Description |
---|---|---|
|
|
The drop shadow to set on the block, or undefined to clear the drop shadow |
Returns
Inherited from
setSimpleStaticDataGraphic
▸ setSimpleStaticDataGraphic(
Parameters
Name | Type | Description |
---|---|---|
|
|
Information about the static data graphic icon to set on this block. |
Returns
Inherited from
BlockProxy.setSimpleStaticDataGraphic
unlockAspectRatio
▸ unlockAspectRatio():
Unlock the aspect ratio of this block, allowing it to be stretched vertically or horizontally independently.
Returns
Inherited from
CardConfigProxy
document/documentelement/cardconfigproxy.CardConfigProxy
Base class for anything on a Lucid document that has an ID and properties.
Hierarchy
-
↳
CardConfigProxy
Constructors
constructor
• new CardConfigProxy(
Parameters
Name | Type | Description |
---|---|---|
|
|
The ID of this card config element |
|
|
Overrides
DocumentElementProxy.constructor
Properties
client
•
Inherited from
id
•
Inherited from
properties
•
All properties available on this element, organized by name. Not all properties are writeable (e.g. "ClassName" on a block). To move or resize elements, use setLocation() or setBoundingBox() or offset() instead.
Inherited from
DocumentElementProxy.properties
CollectionEnumFieldType
core/data/fieldtypedefinition/collectionenumfieldtype.CollectionEnumFieldType
Constructors
constructor
• new CollectionEnumFieldType(
Parameters
Name | Type |
---|---|
|
|
Properties
collectionId
•
PRIMARY_KEY
▪
Specifies which groovy field name is used as the primary key.
This should be kept in sync with GroovyFieldNames in FieldType.scala
Methods
serialize
▸ serialize():
Returns
CollectionProxy
data/collectionproxy.CollectionProxy
A collection is a set of data items, each with the same set of fields (though some data items may not have all fields defined).
Hierarchy
-
↳
CollectionProxy
Constructors
constructor
• new CollectionProxy(
Parameters
Name | Type | Description |
---|---|---|
|
|
ID of this collection on the current document |
|
|
Overrides
PropertyStoreProxy.constructor
Properties
client
•
Inherited from
id
•
Inherited from
items
•
The data items in this collection, organized by their primary key. The primary key is usually calculated from the content of the data item, but may differ from the expected value in some circumstances, e.g. if there are two data items that would have the same primary key.
properties
•
All properties available on this element, organized by name. Not all properties are writeable (e.g. "ClassName" on a block). To move or resize elements, use setLocation() or setBoundingBox() or offset() instead.
Inherited from
Methods
getBranchedFrom
▸ getBranchedFrom():
Some data collections may have local branches on the document, to store the set of changes that have been made by the user since the time the data was last refreshed from its source. For those collections, you can use this method to get the original data collection as it was last imported or refreshed.
Returns
the original collection from which this collection was branched, or undefined if this collection is not a branch
getFields
▸ getFields():
Returns
an array of field names that are accessible on the items in this collection
getLocalChanges
▸ getLocalChanges():
Returns
information about any changes made locally to the collection that have not been synchronized with the external data source.
getName
▸ getName():
Returns
a human-readable name for this collection
getSchema
▸ getSchema():
Returns
getSyncCollectionId
▸ getSyncCollectionId():
Returns
patchItems
▸ patchItems(
Parameters
Name | Type |
---|---|
|
|
|
|
|
|
|
|
Returns
CustomBlockProxy
document/blockclasses/customblockproxy.CustomBlockProxy
Custom shapes defined in extension packages (or other stencil-providing means like Visio stencil imports) are represented by a CustomBlockProxy.
Hierarchy
-
↳
CustomBlockProxy
Constructors
constructor
• new CustomBlockProxy(
Parameters
Name | Type | Description |
---|---|---|
|
|
ID of this item |
|
|
Inherited from
Properties
allShapeData
•
All shape data accessible on this element, including shape data inherited from the page or a containing group. This collection is read-only.
Inherited from
client
•
Inherited from
id
•
Inherited from
properties
•
All properties available on this element, organized by name. Not all properties are writeable (e.g. "ClassName" on a block). To move or resize elements, use setLocation() or setBoundingBox() or offset() instead.
Inherited from
referenceKeys
•
The set of reference keys, organized by their ID, which can be either a string or number.
For more information, see the Developer Guide.
Inherited from
shapeData
•
The shape data set directly on this element (not including any shape data inherited from the page or a containing group).
Inherited from
textAreas
•
The plain text in each of the text areas on this item, organized by text area name.
Inherited from
textStyles
•
The text style in each of the text areas on this item, organized by text area name.
Inherited from
classNameRegex
▪
Methods
changeZOrder
▸ changeZOrder(
Parameters
Name | Type | Description |
---|---|---|
|
|
How to adjust the Z order of this item relative to the other items it overlaps on the page |
Returns
Inherited from
delete
▸ delete():
Delete this item from the document
Returns
Inherited from
executeFormula
▸ executeFormula(
Execute a formula in the context of this element
Parameters
Name | Type | Description |
---|---|---|
|
|
The formula text, e.g. "@a + @b" to add together the shape data values a and b. |
Returns
The result of the formula, or an error.
Inherited from
exists
▸ exists():
Returns
Inherited from
getBoundingBox
▸ getBoundingBox():
Returns
The bounding box of this item relative to its containing page. As pages may change size to fit the content on them, note that these coordinates may be negative or very large.
If this is a rotated block, the bounding box returned here is where the block would be if it were unrotated.
Inherited from
getClassName
▸ getClassName():
Returns
The class name of this block. This name is not necessarily human-readable, and will remain consistent over time, e.g. "ProcessBlock"..
Inherited from
getConnectedLines
▸ getConnectedLines():
Returns
An array of lines that have one or both endpoints connected to this block.
Inherited from
getContainers
▸ getContainers():
Returns
An array of blocks whose bounding boxes contain this item's upper-left corner
Inherited from
getLineWidth
▸ getLineWidth():
Returns
The line width used by most kinds of blocks to render their outline.
Inherited from
getLocation
▸ getLocation():
Returns
The x/y location of this item
Name | Type |
---|---|
|
|
|
|
Inherited from
getPage
▸ getPage():
Returns
The page containing this item
Inherited from
getRotation
▸ getRotation():
Returns
The amount this block is rotated around its own center, in radians.
Inherited from
getShadow
▸ getShadow():
Returns
The current drop shadow on this block, or undefined if no shadow is set
Inherited from
getSimpleStaticDataGraphic
▸ getSimpleStaticDataGraphic():
Returns
Settings for the simple static data graphic currently set on this block, or undefined if no simple data graphic is currently set. Note that if a data graphic exists that is not an icon, this will return undefined. This function will not consider data graphics set via conditional formatting rules.
Inherited from
BlockProxy.getSimpleStaticDataGraphic
getStencilTextAreaName
▸ getStencilTextAreaName(
Parameters
Name | Type |
---|---|
|
|
Returns
isFromStencil
▸ isFromStencil(
Parameters
Name | Type |
---|---|
|
|
|
|
Returns
linkText
▸ linkText(
Link a text area to a data field, so that editing the text area will also update the associated data, and vice versa.
To use this, first establish a reference key on this block with setReferenceKey.
Parameters
Name | Type |
---|---|
|
|
|
|
|
|
Returns
Inherited from
lockAspectRatio
▸ lockAspectRatio():
Lock this block's aspect ratio to its current value. This can be reversed with unlockAspectRatio.
Returns
Inherited from
offset
▸ offset(
Offset this item in the given direction by the given amount.
Parameters
Name | Type | Description |
---|---|---|
|
|
The type of offset to apply to this item |
|
|
The amount to offset |
Returns
Inherited from
removeReferenceKey
▸ removeReferenceKey(
Remove the specified reference key from this element.
Parameters
Name | Type |
---|---|
|
|
Returns
Inherited from
setBoundingBox
▸ setBoundingBox(
Attempts to move and resize this item to fit into the given bounding box. If this item (or another item it contains) has size or aspect ratio restrictions, it may not be possible to fit the requested location exactly.
This is done by moving this item to the requested location, then attempting to resize it from the bottom-right corner to the requested size.
Parameters
Name | Type | Description |
---|---|---|
|
|
The bounding box to attempt to make this item fill |
Returns
Inherited from
setDataSyncStateIconPosition
▸ setDataSyncStateIconPosition(
Parameters
Name | Type | Description |
---|---|---|
|
|
The postion where the data sync state icon should be displayed on the block. If this position is set to undefined then the state icon position will fallback to the default position for the block. |
Returns
Inherited from
BlockProxy.setDataSyncStateIconPosition
setFillStyle
▸ setFillStyle(
Set the fill style used (by most kinds of blocks) to fill in their main opaque areas. This can be a string color (e.g.
Parameters
Name | Type |
---|---|
|
|
Returns
Inherited from
setLineWidth
▸ setLineWidth(
Parameters
Name | Type | Description |
---|---|---|
|
|
The line width to be used (by most kinds of blocks) to render this block's outline |
Returns
Inherited from
setLocation
▸ setLocation(
Moves this item so that its upper-left corner is positioned at the given location (prior to any rotation)
Parameters
Name | Type | Description |
---|---|---|
|
|
The target location |
Returns
Inherited from
setReferenceKey
▸ setReferenceKey(
Set a reference key on this element, replacing any existing reference at the specified key.
Parameters
Name | Type |
---|---|
|
|
|
|
Returns
Inherited from
setRotation
▸ setRotation(
Parameters
Name | Type | Description |
---|---|---|
|
|
Angle the block should be rotated |
Returns
Inherited from
setShadow
▸ setShadow(
Parameters
Name | Type | Description |
---|---|---|
|
|
The drop shadow to set on the block, or undefined to clear the drop shadow |
Returns
Inherited from
setSimpleStaticDataGraphic
▸ setSimpleStaticDataGraphic(
Parameters
Name | Type | Description |
---|---|---|
|
|
Information about the static data graphic icon to set on this block. |
Returns
Inherited from
BlockProxy.setSimpleStaticDataGraphic
unlockAspectRatio
▸ unlockAspectRatio():
Unlock the aspect ratio of this block, allowing it to be stretched vertically or horizontally independently.
Returns
Inherited from
registerCustomBlockClass
▸
Parameters
Name | Type |
---|---|
|
|
Returns
DataConnector
dataconnector/dataconnector.DataConnector
Factory class to define a bunch of action handlers.
Constructors
constructor
• new DataConnector(
Parameters
Name | Type |
---|---|
|
|
Properties
actions
• actions:
routes
• routes:
Methods
defineAction
▸ defineAction<
Factory to define an action request handler
Type parameters
Name | Type |
---|---|
|
extends |
Parameters
Name | Type | Default value |
---|---|---|
|
|
|
|
|
|
|
|
|
Returns
defineAsynchronousAction
▸ defineAsynchronousAction<
Factory to define an asynchronous action request handler
Type parameters
Name | Type |
---|---|
|
extends |
Parameters
Name | Type |
---|---|
|
|
|
|
Returns
defineRoute
▸ defineRoute(
Factory to define a route handler
Parameters
Name | Type |
---|---|
|
|
|
|
Returns
routeDebugServer
▸ routeDebugServer(
Add a route to the given express app (or generate a new app) to serve this data connector
Parameters
Name | Type |
---|---|
|
|
Returns
runAction
▸ runAction(
Call a defined action handler and gather its serialized response
Parameters
Name | Type |
---|---|
|
|
|
|
|
|
Returns
runDebugServer
▸ runDebugServer(
Serve this data connector as a simple express app for debugging purposes
Parameters
Name | Type |
---|---|
|
|
Returns
DataConnectorAction
dataconnector/actions/action.DataConnectorAction
Base class for actions to be performed by data connectors
Hierarchy
-
DataConnectorAction ↳
DataConnectorAsynchronousAction
Constructors
constructor
• new DataConnectorAction(
Parameters
Name | Type |
---|---|
|
|
|
|
Properties
context
• context:
name
• name:
DataConnectorActionContext
dataconnector/actions/action.DataConnectorActionContext
This holds all the contextual information about a give data action.
Constructors
constructor
• new DataConnectorActionContext(
Parameters
Name | Type | Description |
---|---|---|
|
|
The package ID of the extension that triggered this action |
|
|
The version of the extension that triggered this action |
|
|
The authorized OAuth2 credential that Lucid has for the 3rd party this extension works with |
|
|
The data connector name from manifest.json that triggered this action |
|
|
The installation id of the extension/user that triggered this action |
|
|
Set of items this document is tracking as a |
|
|
Update filter type for this document |
Properties
dataConnectorName
• dataConnectorName:
The data connector name from manifest.json that triggered this action
documentCollections
• documentCollections:
Set of items this document is tracking as a
Index signature
▪ [collectionId:
installationId
• installationId:
The installation id of the extension/user that triggered this action
packageId
•
The package ID of the extension that triggered this action
packageVersion
• packageVersion:
The version of the extension that triggered this action
updateFilterType
• updateFilterType:
Update filter type for this document
userCredential
• userCredential:
The authorized OAuth2 credential that Lucid has for the 3rd party this extension works with
DataConnectorAsynchronousAction
dataconnector/actions/action.DataConnectorAsynchronousAction
A generic "asynchronous" action to be performed by the data connector. This is an action that reports back to Lucid by calling back in the DataSourceClient rather than returning a meaningful value.
Hierarchy
-
↳
DataConnectorAsynchronousAction
Constructors
constructor
• new DataConnectorAsynchronousAction(
Parameters
Name | Type |
---|---|
|
|
|
|
|
|
|
|
Overrides
DataConnectorAction.constructor
Properties
client
• client:
context
• context:
Inherited from
data
• data:
name
• name:
Inherited from
DataConnectorClient
dataconnector/dataconnectorclient.DataConnectorClient
Client for requests to and from Lucid
Hierarchy
-
DataConnectorClient
Constructors
constructor
• new DataConnectorClient(
Parameters
Name | Type | Default value |
---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Properties
urls
• urls:
Type declaration
Name | Type |
---|---|
|
|
|
|
Methods
getDataSourceClient
▸ getDataSourceClient(
Get a client for DataSource related requests to Lucid
Parameters
Name | Type |
---|---|
|
|
Returns
getPublicKey
▸ getPublicKey():
Get Lucid's public key to verify requests came from Lucid if you don't want to use the SignatureValidator. Maybe you're not running in a NodeJS environment
Returns
getSignatureValidator
▸ getSignatureValidator():
Get a validator to prove a given request came from Lucid
Returns
parseActions
▸ parseActions(
Validate and parse an action request from Lucid
Parameters
Name | Type |
---|---|
|
|
|
|
|
|
Returns
DataConnectorManageWebhookAction
dataconnector/actions/action.DataConnectorManageWebhookAction
A "synchronous" style action indicating that Lucid would like to setup a webhook in the third party.
Hierarchy
-
↳
DataConnectorManageWebhookAction
Constructors
constructor
• new DataConnectorManageWebhookAction(
Parameters
Name | Type | Description |
---|---|---|
|
|
- |
|
|
Token to be added to the newly created webhook so that when it fires it will have permissions to make changes to Lucid documents. |
|
|
A list of existing webhooks so you can be more granular about what you track. You may also find it useful to delete some of the existing webhooks. The response back to Lucid should include all existing webhooks (newly created or any of these that were not deleted). |
Overrides
DataConnectorAction.constructor
Properties
context
• context:
Inherited from
name
• name:
Inherited from
webhookToken
• webhookToken:
Token to be added to the newly created webhook so that when it fires it will have permissions to make changes to Lucid documents.
webhooks
• webhooks:
A list of existing webhooks so you can be more granular about what you track. You may also find it useful to delete some of the existing webhooks. The response back to Lucid should include all existing webhooks (newly created or any of these that were not deleted).
DataConnectorPatchAction
dataconnector/actions/action.DataConnectorPatchAction
A patch action is a kind of synchronous style action. It occurs when data is changed in the Lucid editor. All the changes are collected in the patches field.
Hierarchy
-
↳
DataConnectorPatchAction
Constructors
constructor
• new DataConnectorPatchAction(
Parameters
Name | Type | Default value | Description |
---|---|---|---|
|
|
|
- |
|
|
|
changes applied by Lucid |
|
|
|
- |
Overrides
DataConnectorAction.constructor
Properties
context
• context:
Inherited from
name
• name:
Inherited from
patches
• patches:
changes applied by Lucid
DataConnectorRequestError
dataconnector/dataconnector.DataConnectorRequestError
Thrown by any failable http APIs
Hierarchy
-
Error ↳
DataConnectorRequestError
Constructors
constructor
• new DataConnectorRequestError(
Parameters
Name | Type |
---|---|
|
|
|
|
|
|
|
|
Overrides
Error.constructor
Properties
message
• message:
Inherited from
Error.message
name
• name:
Inherited from
Error.name
response
• response:
stack
•
Inherited from
Error.stack
status
• status:
statusText
•
Methods
toString
▸ toString():
Returns
DataConnectorResponseError
dataconnector/dataconnector.DataConnectorResponseError
Thrown by any APIs the client didn't recognize when parsing
Hierarchy
-
Error ↳
DataConnectorResponseError
Constructors
constructor
• new DataConnectorResponseError(
Parameters
Name | Type |
---|---|
|
|
|
|
Overrides
Error.constructor
Properties
message
• message:
Inherited from
Error.message
name
• name:
Inherited from
Error.name
response
• response:
stack
•
Inherited from
Error.stack
DataConnectorRunError
dataconnector/dataconnector.DataConnectorRunError
Throw this from an action request handler to produce a non-200 response code and not have to return the expected result type
Hierarchy
-
Error ↳
DataConnectorRunError
Constructors
constructor
• new DataConnectorRunError(
Parameters
Name | Type |
---|---|
|
|
|
|
|
|
Overrides
Error.constructor
Properties
body
• body:
message
• message:
Inherited from
Error.message
name
• name:
Inherited from
Error.name
stack
•
Inherited from
Error.stack
status
• status:
Methods
withMessage
▸
Parameters
Name | Type |
---|---|
|
|
|
|
Returns
DataConnectorSynchronousAction
dataconnector/actions/action.DataConnectorSynchronousAction
A generic "synchronous" action to be performed by the data connector.
Hierarchy
-
↳
DataConnectorSynchronousAction
Constructors
constructor
• new DataConnectorSynchronousAction(
Parameters
Name | Type |
---|---|
|
|
|
|
|
|
Overrides
DataConnectorAction.constructor
Properties
context
• context:
Inherited from
data
• data:
name
• name:
Inherited from
DataError
data/dataerror.DataError
The requested data or formula result couldn't be calculated.
Constructors
constructor
• new DataError(
Parameters
Name | Type | Description |
---|---|---|
|
|
A human-readable description of the reason why the error occurred |
|
|
The kind of error that occurred |
Properties
error
•
type
•
DataItemProxy
data/dataitemproxy.DataItemProxy
One data item in a collection, consisting of key-value pairs
Hierarchy
-
DataItemProxy
Constructors
constructor
• new DataItemProxy(
Parameters
Name | Type | Description |
---|---|---|
|
|
The current primary key of the data item. This may change if the fields on the data item change, rendering this proxy inoperable. |
|
|
The collection that contains this data item. |
|
|
Properties
collection
•
fields
•
The fields on this data item, organized by their name.
primaryKey
•
Methods
exists
▸ exists():
Returns
True if a data item exists in this collection at this primary key
DataProxy
data/dataproxy.DataProxy
The DataProxy class gives access to the tabular and graph data on the current Lucid document.
Data collections are organized into data sources. One data sources is typically produced for each data import, and may contain multiple collections.
Constructors
constructor
• new DataProxy(
Parameters
Name | Type |
---|---|
|
|
Properties
dataSources
•
Data sources on the current document, organized by their ID on this document. The ID will remain stable for as long as the data source exists on this document, but will vary from the data source ID on other documents if the same data is imported there.
Methods
addDataSource
▸ addDataSource(
Creates a new empty data source, which you can then add collections of data to.
Parameters
Name | Type | Description |
---|---|---|
|
|
Human-readable name of the new data source |
|
|
Any configuration values that might be useful to reference later, such as the upstream origin of this data source |
Returns
the newly created data source
DataSourceClient
dataconnector/datasourceclient.DataSourceClient
Authenticated client for DataSource related requests to Lucid.
Hierarchy
-
DataSourceClient
Constructors
constructor
• new DataSourceClient(
Parameters
Name | Type | Default value |
---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Methods
update
▸ update(
Create or update a datasource. If you create a new collection it must be fully specified in terms of schema and and items. If it's just an update then the schema can be omitted (if unchanged) and items that already exist can be partial.
Parameters
Name | Type |
---|---|
|
|
Returns
DataSourceProxy
data/datasourceproxy.DataSourceProxy
A data source represents a set of related data collections on a document. Typically one data source is produced for each data import.
Hierarchy
-
↳
DataSourceProxy
Constructors
constructor
• new DataSourceProxy(
Parameters
Name | Type | Description |
---|---|---|
|
|
ID of the dataSource on the current document |
|
|
Overrides
PropertyStoreProxy.constructor
Properties
client
•
Inherited from
collections
•
The set of data collections in this data source, organized by ID on this document. The IDs will remain stable for as long as the collection exists on this document, but will vary from the collection ID on other documents if the same data is imported there.
id
•
Inherited from
properties
•
All properties available on this element, organized by name. Not all properties are writeable (e.g. "ClassName" on a block). To move or resize elements, use setLocation() or setBoundingBox() or offset() instead.
Inherited from
Methods
addCollection
▸ addCollection(
Create a new collection as part of this data source.
Parameters
Name | Type |
---|---|
|
|
|
|
Returns
The newly created collection
getName
▸ getName():
Returns
A human-readable name for this data source
getSourceConfig
▸ getSourceConfig():
Returns
The source configuration values set when this data source was created
DocumentElementProxy
document/documentelement/documentelementproxy.DocumentElementProxy
Base class for anything on a Lucid document that has an ID and properties.
Hierarchy
-
↳
DocumentElementProxy
Constructors
constructor
• new DocumentElementProxy(
Parameters
Name | Type | Description |
---|---|---|
|
|
The ID of this document element |
|
|
Overrides
PropertyStoreProxy.constructor
Properties
client
•
Inherited from
id
•
Inherited from
properties
•
All properties available on this element, organized by name. Not all properties are writeable (e.g. "ClassName" on a block). To move or resize elements, use setLocation() or setBoundingBox() or offset() instead.
Inherited from
DocumentProxy
document/documentproxy.DocumentProxy
The currently-open Lucid document
Hierarchy
-
↳
DocumentProxy
Constructors
constructor
• new DocumentProxy(
Parameters
Name | Type |
---|---|
|
|
Overrides
Properties
allShapeData
•
All shape data accessible on this element, including shape data inherited from the page or a containing group. This collection is read-only.
Inherited from
cardIntegrationConfigs
•
client
•
Inherited from
id
•
Inherited from
pages
•
The set of pages on this document, organized by ID
properties
•
All properties available on this element, organized by name. Not all properties are writeable (e.g. "ClassName" on a block). To move or resize elements, use setLocation() or setBoundingBox() or offset() instead.
Inherited from
referenceKeys
•
The set of reference keys, organized by their ID, which can be either a string or number.
For more information, see the Developer Guide.
Inherited from
shapeData
•
The shape data set directly on this element (not including any shape data inherited from the page or a containing group).
Inherited from
Methods
addPage
▸ addPage(
Add a new page to the current document
Parameters
Name | Type | Description |
---|---|---|
|
|
Definition of the page to add |
Returns
The created page
allBlocks
▸ allBlocks():
An iterator over all blocks on all pages of the document
Returns
executeFormula
▸ executeFormula(
Execute a formula in the context of this element
Parameters
Name | Type | Description |
---|---|---|
|
|
The formula text, e.g. "@a + @b" to add together the shape data values a and b. |
Returns
The result of the formula, or an error.
Inherited from
exists
▸ exists():
Returns
Inherited from
getTitle
▸ getTitle():
Returns
The title of this document
hookCreateItems
▸ hookCreateItems(
Watch for new blocks, lines, or groups added to this document. The callback will be called with new items created by the current user, but will not be called with items created
- As part of a generated diagram, e.g. org chart
- By another user on the same document
Parameters
Name | Type |
---|---|
|
( |
Returns
A handle that can be passed to
hookDeleteItems
▸ hookDeleteItems(
Watch for new blocks, lines, or groups deleted from this document. The callback will be called with items deleted by the current user, but will not be called with items deleted
- As part of a generated diagram, e.g. org chart
- By another user on the same document
Parameters
Name | Type |
---|---|
|
( |
Returns
A handle that can be passed to
removeReferenceKey
▸ removeReferenceKey(
Remove the specified reference key from this element.
Parameters
Name | Type |
---|---|
|
|
Returns
Inherited from
ElementProxy.removeReferenceKey
setReferenceKey
▸ setReferenceKey(
Set a reference key on this element, replacing any existing reference at the specified key.
Parameters
Name | Type |
---|---|
|
|
|
|
Returns
Inherited from
setTitle
▸ setTitle(
Updates the title of this document
Parameters
Name | Type | Description |
---|---|---|
|
|
The new title for this document |
Returns
unhookCreateItems
▸ unhookCreateItems(
Parameters
Name | Type | Description |
---|---|---|
|
|
Return value from |
Returns
unhookDeleteItems
▸ unhookDeleteItems(
Parameters
Name | Type | Description |
---|---|---|
|
|
Return value from |
Returns
EditorClient
editorclient.EditorClient
Constructors
constructor
• new EditorClient()
Methods
actionExists
▸ actionExists(
Parameters
Name | Type | Description |
---|---|---|
|
|
name of the action to check |
Returns
true if a callback has been registered for this action; false otherwise
alert
▸ alert(
Display an alert modal to the user
Parameters
Name | Type | Description |
---|---|---|
|
|
Body text to display in the alert modal |
|
|
Title of the alert modal; defaults to the extension title specified in manifest.json |
|
|
Text for the OK button; defaults to "OK" (or a translation) |
Returns
a Promise that resolves true if the user clicks OK, false if they otherwise dismiss the modal
asyncOAuthXhr
▸ asyncOAuthXhr(
Make an asyncronous OAuth network request. The request is enqueued to eventually execute. The request may be attempted multiple times with an overall timeout of 120 seconds.
Parameters
Name | Type | Description |
---|---|---|
|
|
Name of the OAuth provider |
|
|
Settings for the request |
Returns
A promise that will either resolve or reject with an XHRResponse. If the HTTP status code is not 2xx, the promise will reject.
▸ asyncOAuthXhr(
Parameters
Name | Type |
---|---|
|
|
|
|
Returns
▸ asyncOAuthXhr(
Parameters
Name | Type |
---|---|
|
|
|
|
Returns
awaitDataImport
▸ awaitDataImport(
Parameters
Name | Type | Default value |
---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Returns
canEditPackageSettings
▸ canEditPackageSettings():
Returns
True if the current user is allowed to edit package settings on this installation of this extension (if any settings exist), or false otherwise.
confirm
▸ confirm(
Display a confirm modal to the user
Parameters
Name | Type | Description |
---|---|---|
|
|
Body text to display in the alert modal |
|
|
Title of the alert modal; defaults to the extension title specified in manifest.json |
|
|
Text for the OK button; defaults to "OK" (or a translation) |
|
|
Text for the Cancel button; defaults to "Cancel" (or a translation) |
Returns
a Promise that resolves true if the user clicks OK, false if they click Cancel or otherwise dismiss the modal
createUserImage
▸ createUserImage(
Upload an image and return a URL that can be used for displaying that image on the canvas. Note: the URL is public - anyone with the URL can access the image.
Parameters
Name | Type | Description |
---|---|---|
|
|
The media type, e.g. 'image/png' |
|
|
The binary image contents, or a base64-encoded string |
Returns
A promise that resolves with the URL of the created image.
deleteAction
▸ deleteAction(
Remove the callback for a given action. If the action is later invoked, nothing will happen.
Parameters
Name | Type | Description |
---|---|---|
|
|
name of the action to unregister |
Returns
download
▸ download(
Initiate a browser file download of custom content
Parameters
Name | Type | Description |
---|---|---|
|
|
Filename of the downloaded file |
|
|
The content to put into the file, either in plain text or as base64-encoded binary data |
|
|
The MIME type to tell the browser it is downloading |
|
|
If true, base64 decode the data before downloading it |
Returns
getBlockProxy
▸ getBlockProxy(
Create and return a proxy for accessing a block with the given ID. If the block is of a type that has a specific proxy implementation (e.g. an ERD block) then a specialized subclass of BlockProxy may be returned.
Parameters
Name | Type | Description |
---|---|---|
|
|
ID of the block to create a proxy for |
Returns
the given block
getCustomShapeDefinition
▸ getCustomShapeDefinition(
Load the requested shape library's content, and if it was found, return a block definition ready to be created.
Example usage:
const client = new EditorClient();
const viewport = new Viewport(client);
const page = viewport.getCurrentPage();
if (page) {
const def = await page.getCustomShapeDefinition('libraryName', 'shapeName');
if (def) {
//Customize the shape about to be created
def.boundingBox.x = 500;
def.boundingBox.y = 500;
//Create the shape itself
const block = page.addBlock(def);
//Set any data fields on the shape as needed
block.shapeData.set('Value', 50);
}
}
Parameters
Name | Type | Description |
---|---|---|
|
|
Name of the shape library in this extension to search for |
|
|
Name of the shape within that library to search for |
Returns
getElementProxy
▸ getElementProxy(
Parameters
Name | Type | Description |
---|---|---|
|
|
ID of the element to create a proxy for |
Returns
the given element
getItemProxy
▸ getItemProxy(
Parameters
Name | Type | Description |
---|---|---|
|
|
ID of the item to create a proxy for |
Returns
the given item
getLineProxy
▸ getLineProxy(
Parameters
Name | Type | Description |
---|---|---|
|
|
ID of the line to create a proxy for |
Returns
the given line
getPackageSettings
▸ getPackageSettings():
If the extension package containing this editor extension has configurable settings, fetch the current values of those settings for this installation of this extension.
Only settings that have been set by the installing user will have a value in the map, other settings will be missing.
Returns
A promise that resolves to a map of setting names to current setting values
getPageProxy
▸ getPageProxy(
Parameters
Name | Type | Description |
---|---|---|
|
|
ID of the page to create a proxy for |
Returns
the given page
getProduct
▸ getProduct():
Get which Lucid product this editor extension has been loaded in.
Returns
killExtension
▸ killExtension():
Unload this extension immediately, removing any custom menu items etc., until the user refreshes the browser tab.
Returns
loadBlockClasses
▸ loadBlockClasses(
Because code for block classes are loaded incrementally, you MUST call loadBlockClasses with the given block class name (and wait for it to resolve) before attempting to create a block. If you don't, an error will be thrown.
Parameters
Name | Type | Description |
---|---|---|
|
|
the block classes to load |
Returns
a promise that resolves when the block classes can be used to create new blocks on the document
oauthXhr
▸ oauthXhr(
Make an OAuth network request. Make the request immediately and only once with a 10 second timeout.
Parameters
Name | Type | Description |
---|---|---|
|
|
Name of the OAuth provider |
|
|
Settings for the request |
Returns
A promise that will either resolve or reject with an XHRResponse. If the HTTP status code is not 2xx, the promise will reject.
▸ oauthXhr(
Parameters
Name | Type |
---|---|
|
|
|
|
Returns
▸ oauthXhr(
Parameters
Name | Type |
---|---|
|
|
|
|
Returns
performDataAction
▸ performDataAction(
Parameters
Name | Type |
---|---|
|
|
Returns
permanentTokenXhr
▸ permanentTokenXhr(
Parameters
Name | Type |
---|---|
|
|
|
|
Returns
▸ permanentTokenXhr(
Parameters
Name | Type |
---|---|
|
|
|
|
Returns
processAndClearBootstrapData
▸ processAndClearBootstrapData(
Parameters
Name | Type | Description |
---|---|---|
|
( |
A callback that processes the bootstrap data, if any, stored on the document and associated with this editor extension. If this callback is async (returns a promise), then the bootstrap data is not cleared off of the document until that promise resolves. |
|
|
If bootstrap data is available for this editor extension, this will mark the document as requiring the extension. Once marked, if the extension is not installed the user will be notified about the extension being required on document load. The minimum extension version required by the document is the version provided in the request body when creating the document. |
Returns
a promise that resolves immediately if there is no available bootstrap data, or else after the callback successfully completes. This promise will reject/throw if the callback throws or returns a promise that rejects, or if there is another editor session processing the same bootstrap data at the same time.
prompt
▸ prompt(
Display a prompt modal to the user
Parameters
Name | Type | Description |
---|---|---|
|
|
Body text to display in the alert modal |
|
|
Title of the alert modal; defaults to the extension title specified in manifest.json |
Returns
a Promise that resolves to a string if a user enters one, or undefined if they cancel
registerAction
▸ registerAction(
Register a named action. These actions can be triggered from custom UI, for example as the action of a custom menu item.
Some actions may return a value that is used by the core application, e.g. a
Throws an error if the same action name is registered multiple times.
Parameters
Name | Type | Description |
---|---|---|
|
|
name of the action |
|
( |
function to execute when this action is invoked |
Returns
registerFileUploadAction
▸ registerFileUploadAction(
Register a named action that receives file upload data. These callbacks can be used in Menu.addMenuItem as the file action.
Parameters
Name | Type | Description |
---|---|---|
|
|
The name of the action |
|
( |
Function to execute when this action is invoked |
Returns
registerUnfurlHandler
▸ registerUnfurlHandler(
Registers a handler for link unfurling.
Parameters
Name | Type | Description |
---|---|---|
|
|
The domain |
|
|
The callbacks to call when a link matching the domain is pasted. |
Returns
reloadExtension
▸ reloadExtension():
Unload this extension, and then re-execute it.
Returns
sendCommand
▸ sendCommand<
Execute an API command. This is the low-level API that most of this SDK wraps. It is not expected that you should ever need to use this directly.
Type parameters
Name | Type |
---|---|
|
extends
|
Parameters
Name | Type | Description |
---|---|---|
|
|
name of the API command to execute |
|
|
data to pass to the API command |
Returns
the output of the given API command
showPackageSettingsModal
▸ showPackageSettingsModal():
If the extension package containing this editor extension has configurable settings, show a standard modal allowing the user to view or change those settings.
If the user does not have permission to change settings on this installation of this extension, or if no settings exist, an error is thrown.
Returns
A promise that resolves when the user closes the settings modal.
triggerAuthFlow
▸ triggerAuthFlow(
Parameters
Name | Type |
---|---|
|
|
Returns
xhr
▸ xhr(
Make a network request
Parameters
Name | Type | Description |
---|---|---|
|
|
Settings for the network request |
Returns
A promise that will either resolve or reject with an XHRResponse. If the HTTP status code is not 2xx, the promise will reject.
▸ xhr(
Parameters
Name | Type |
---|---|
|
|
Returns
▸ xhr(
Parameters
Name | Type |
---|---|
|
|
Returns
ElementProxy
document/elementproxy.ElementProxy
An element is anything on a Lucid document that can have properties and shape data:
Hierarchy
Constructors
constructor
• new ElementProxy(
Parameters
Name | Type | Description |
---|---|---|
|
|
ID of this element |
|
|
Overrides
PropertyStoreProxy.constructor
Properties
allShapeData
•
All shape data accessible on this element, including shape data inherited from the page or a containing group. This collection is read-only.
client
•
Inherited from
id
•
Inherited from
properties
•
All properties available on this element, organized by name. Not all properties are writeable (e.g. "ClassName" on a block). To move or resize elements, use setLocation() or setBoundingBox() or offset() instead.
Inherited from
referenceKeys
•
The set of reference keys, organized by their ID, which can be either a string or number.
For more information, see the Developer Guide.
shapeData
•
The shape data set directly on this element (not including any shape data inherited from the page or a containing group).
Methods
executeFormula
▸ executeFormula(
Execute a formula in the context of this element
Parameters
Name | Type | Description |
---|---|---|
|
|
The formula text, e.g. "@a + @b" to add together the shape data values a and b. |
Returns
The result of the formula, or an error.
exists
▸ exists():
Returns
removeReferenceKey
▸ removeReferenceKey(
Remove the specified reference key from this element.
Parameters
Name | Type |
---|---|
|
|
Returns
setReferenceKey
▸ setReferenceKey(
Set a reference key on this element, replacing any existing reference at the specified key.
Parameters
Name | Type |
---|---|
|
|
|
|
Returns
ERDBlockProxy
document/blockclasses/erdblockproxy.ERDBlockProxy
A block is a single shape on the document. A BlockProxy provides an interface to read and write the content of an existing block, and is typically accessed through PageProxy.blocks or another similar mechanism.
Hierarchy
-
↳
ERDBlockProxy
Constructors
constructor
• new ERDBlockProxy(
Parameters
Name | Type | Description |
---|---|---|
|
|
ID of this item |
|
|
Inherited from
Properties
allShapeData
•
All shape data accessible on this element, including shape data inherited from the page or a containing group. This collection is read-only.
Inherited from
client
•
Inherited from
id
•
Inherited from
properties
•
All properties available on this element, organized by name. Not all properties are writeable (e.g. "ClassName" on a block). To move or resize elements, use setLocation() or setBoundingBox() or offset() instead.
Inherited from
referenceKeys
•
The set of reference keys, organized by their ID, which can be either a string or number.
For more information, see the Developer Guide.
Inherited from
shapeData
•
The shape data set directly on this element (not including any shape data inherited from the page or a containing group).
Inherited from
textAreas
•
The plain text in each of the text areas on this item, organized by text area name.
Inherited from
textStyles
•
The text style in each of the text areas on this item, organized by text area name.
Inherited from
classNameRegex
▪
Methods
changeZOrder
▸ changeZOrder(
Parameters
Name | Type | Description |
---|---|---|
|
|
How to adjust the Z order of this item relative to the other items it overlaps on the page |
Returns
Inherited from
delete
▸ delete():
Delete this item from the document
Returns
Inherited from
executeFormula
▸ executeFormula(
Execute a formula in the context of this element
Parameters
Name | Type | Description |
---|---|---|
|
|
The formula text, e.g. "@a + @b" to add together the shape data values a and b. |
Returns
The result of the formula, or an error.
Inherited from
exists
▸ exists():
Returns
Inherited from
getBoundingBox
▸ getBoundingBox():
Returns
The bounding box of this item relative to its containing page. As pages may change size to fit the content on them, note that these coordinates may be negative or very large.
If this is a rotated block, the bounding box returned here is where the block would be if it were unrotated.
Inherited from
getClassName
▸ getClassName():
Returns
The class name of this block. This name is not necessarily human-readable, and will remain consistent over time, e.g. "ProcessBlock"..
Inherited from
getConnectedLines
▸ getConnectedLines():
Returns
An array of lines that have one or both endpoints connected to this block.
Inherited from
getContainers
▸ getContainers():
Returns
An array of blocks whose bounding boxes contain this item's upper-left corner
Inherited from
getFieldCount
▸ getFieldCount():
Returns
getFields
▸ getFields():
Returns
getLineWidth
▸ getLineWidth():
Returns
The line width used by most kinds of blocks to render their outline.
Inherited from
getLocation
▸ getLocation():
Returns
The x/y location of this item
Name | Type |
---|---|
|
|
|
|
Inherited from
getName
▸ getName():
Returns
getPage
▸ getPage():
Returns
The page containing this item
Inherited from
getRotation
▸ getRotation():
Returns
The amount this block is rotated around its own center, in radians.
Inherited from
getShadow
▸ getShadow():
Returns
The current drop shadow on this block, or undefined if no shadow is set
Inherited from
getSimpleStaticDataGraphic
▸ getSimpleStaticDataGraphic():
Returns
Settings for the simple static data graphic currently set on this block, or undefined if no simple data graphic is currently set. Note that if a data graphic exists that is not an icon, this will return undefined. This function will not consider data graphics set via conditional formatting rules.
Inherited from
BlockProxy.getSimpleStaticDataGraphic
linkText
▸ linkText(
Link a text area to a data field, so that editing the text area will also update the associated data, and vice versa.
To use this, first establish a reference key on this block with setReferenceKey.
Parameters
Name | Type |
---|---|
|
|
|
|
|
|
Returns
Inherited from
lockAspectRatio
▸ lockAspectRatio():
Lock this block's aspect ratio to its current value. This can be reversed with unlockAspectRatio.
Returns
Inherited from
offset
▸ offset(
Offset this item in the given direction by the given amount.
Parameters
Name | Type | Description |
---|---|---|
|
|
The type of offset to apply to this item |
|
|
The amount to offset |
Returns
Inherited from
removeReferenceKey
▸ removeReferenceKey(
Remove the specified reference key from this element.
Parameters
Name | Type |
---|---|
|
|
Returns
Inherited from
setBoundingBox
▸ setBoundingBox(
Attempts to move and resize this item to fit into the given bounding box. If this item (or another item it contains) has size or aspect ratio restrictions, it may not be possible to fit the requested location exactly.
This is done by moving this item to the requested location, then attempting to resize it from the bottom-right corner to the requested size.
Parameters
Name | Type | Description |
---|---|---|
|
|
The bounding box to attempt to make this item fill |
Returns
Inherited from
setDataSyncStateIconPosition
▸ setDataSyncStateIconPosition(
Parameters
Name | Type | Description |
---|---|---|
|
|
The postion where the data sync state icon should be displayed on the block. If this position is set to undefined then the state icon position will fallback to the default position for the block. |
Returns
Inherited from
BlockProxy.setDataSyncStateIconPosition
setFillStyle
▸ setFillStyle(
Set the fill style used (by most kinds of blocks) to fill in their main opaque areas. This can be a string color (e.g.
Parameters
Name | Type |
---|---|
|
|
Returns
Inherited from
setLineWidth
▸ setLineWidth(
Parameters
Name | Type | Description |
---|---|---|
|
|
The line width to be used (by most kinds of blocks) to render this block's outline |
Returns
Inherited from
setLocation
▸ setLocation(
Moves this item so that its upper-left corner is positioned at the given location (prior to any rotation)
Parameters
Name | Type | Description |
---|---|---|
|
|
The target location |
Returns
Inherited from
setReferenceKey
▸ setReferenceKey(
Set a reference key on this element, replacing any existing reference at the specified key.
Parameters
Name | Type |
---|---|
|
|
|
|
Returns
Inherited from
setRotation
▸ setRotation(
Parameters
Name | Type | Description |
---|---|---|
|
|
Angle the block should be rotated |
Returns
Inherited from
setShadow
▸ setShadow(
Parameters
Name | Type | Description |
---|---|---|
|
|
The drop shadow to set on the block, or undefined to clear the drop shadow |
Returns
Inherited from
setSimpleStaticDataGraphic
▸ setSimpleStaticDataGraphic(
Parameters
Name | Type | Description |
---|---|---|
|
|
Information about the static data graphic icon to set on this block. |
Returns
Inherited from
BlockProxy.setSimpleStaticDataGraphic
unlockAspectRatio
▸ unlockAspectRatio():
Unlock the aspect ratio of this block, allowing it to be stretched vertically or horizontally independently.
Returns
Inherited from
ERDFieldProxy
document/blockclasses/erdblockproxy.ERDFieldProxy
Constructors
constructor
• new ERDFieldProxy(
Parameters
Name | Type |
---|---|
|
|
|
|
Methods
getKey
▸ getKey():
Returns
getName
▸ getName():
Returns
getType
▸ getType():
Returns
FieldTypeArray<SubTypes>
core/data/fieldtypedefinition/fieldtypearray.FieldTypeArray
Type parameters
Name | Type |
---|---|
|
extends
|
Hierarchy
-
BaseFieldTypeArray <SubTypes >↳
FieldTypeArray
Constructors
constructor
• new FieldTypeArray<
Type parameters
Name | Type |
---|---|
|
extends
|
Parameters
Name | Type |
---|---|
|
|
Inherited from
BaseFieldTypeArray.constructor
Properties
validTypesArray
•
Inherited from
BaseFieldTypeArray.validTypesArray
Methods
getInnerNonArrayTypes
▸ getInnerNonArrayTypes():
Returns
Inherited from
BaseFieldTypeArray.getInnerNonArrayTypes
getInnerTypes
▸ getInnerTypes():
Returns
Inherited from
BaseFieldTypeArray.getInnerTypes
serialize
▸ serialize():
Returns
Inherited from
serializeType
▸
Parameters
Name | Type |
---|---|
|
|
Returns
Overrides
BaseFieldTypeArray.serializeType
FormattedPrimaryKey<Fields, PrimaryKey>
core/data/fieldspecification.FormattedPrimaryKey
Generates a mapper that, given a primary key definition is able to produce the primary key for that item.
Type parameters
Name | Type |
---|---|
|
extends |
|
extends keyof |
Constructors
constructor
• new FormattedPrimaryKey<
Type parameters
Name | Type |
---|---|
|
extends |
|
extends |
Parameters
Name | Type |
---|---|
|
|
Properties
elements
•
Methods
forItem
▸ forItem(
Generate the serialized form of the item's primary key.
For single value primary keys, the encoded values are just the json representation of the primary key. For example, if the primary key is ['id'] the following table shows encodings:
type | value | encoded |
---|---|---|
number |
|
|
boolean |
|
|
string |
|
|
Take note of the extra quotes in the string case.
For primary keys with multiple values, first sort the array of primary keys then join the json encoded values from of the keys with commas. For example:
primary key = ["lastName", "firstName"]
sorted key = ["firstName", "lastName"]
row = {"lastName": "Smith", "firstName": "John", "age": 42}
row key = '"John","Smith"'
items = new Map([['"John","Smith"', {"lastName": "Smith", "firstName": "John", "age": 42}]])
Parameters
Name | Type |
---|---|
|
|
Returns
GroupProxy
document/groupproxy.GroupProxy
A group of items on a page.
Hierarchy
-
↳
GroupProxy
Constructors
constructor
• new GroupProxy(
Parameters
Name | Type | Description |
---|---|---|
|
|
ID of this item |
|
|
Inherited from
Properties
allBlocks
•
The blocks that are contained in this group, including those nested in deeper groups, organized by ID.
allGroups
•
The groups that are contained in this group, including those nested in deeper groups, organized by ID.
allLines
•
The lines that are contained in this group, including those nested in deeper groups, organized by ID.
allShapeData
•
All shape data accessible on this element, including shape data inherited from the page or a containing group. This collection is read-only.
Inherited from
blocks
•
The blocks that are directly contained in this group, organized by ID.
client
•
Inherited from
groups
•
The groups that are directly contained in this group, organized by ID.
id
•
Inherited from
lines
•
The lines that are directly contained in this group, organized by ID.
properties
•
All properties available on this element, organized by name. Not all properties are writeable (e.g. "ClassName" on a block). To move or resize elements, use setLocation() or setBoundingBox() or offset() instead.
Inherited from
referenceKeys
•
The set of reference keys, organized by their ID, which can be either a string or number.
For more information, see the Developer Guide.
Inherited from
shapeData
•
The shape data set directly on this element (not including any shape data inherited from the page or a containing group).
Inherited from
textAreas
•
The plain text in each of the text areas on this item, organized by text area name.
Inherited from
textStyles
•
The text style in each of the text areas on this item, organized by text area name.
Inherited from
Methods
changeZOrder
▸ changeZOrder(
Parameters
Name | Type | Description |
---|---|---|
|
|
How to adjust the Z order of this item relative to the other items it overlaps on the page |
Returns
Inherited from
delete
▸ delete():
Delete this item from the document
Returns
Inherited from
executeFormula
▸ executeFormula(
Execute a formula in the context of this element
Parameters
Name | Type | Description |
---|---|---|
|
|
The formula text, e.g. "@a + @b" to add together the shape data values a and b. |
Returns
The result of the formula, or an error.
Inherited from
exists
▸ exists():
Returns
Inherited from
getBoundingBox
▸ getBoundingBox():
Returns
The bounding box of this item relative to its containing page. As pages may change size to fit the content on them, note that these coordinates may be negative or very large.
If this is a rotated block, the bounding box returned here is where the block would be if it were unrotated.
Inherited from
getContainers
▸ getContainers():
Returns
An array of blocks whose bounding boxes contain this item's upper-left corner
Inherited from
getLocation
▸ getLocation():
Returns
The x/y location of this item
Name | Type |
---|---|
|
|
|
|
Inherited from
getPage
▸ getPage():
Returns
The page containing this item
Inherited from
offset
▸ offset(
Offset this item in the given direction by the given amount.
Parameters
Name | Type | Description |
---|---|---|
|
|
The type of offset to apply to this item |
|
|
The amount to offset |
Returns
Inherited from
removeReferenceKey
▸ removeReferenceKey(
Remove the specified reference key from this element.
Parameters
Name | Type |
---|---|
|
|
Returns
Inherited from
setBoundingBox
▸ setBoundingBox(
Attempts to move and resize this item to fit into the given bounding box. If this item (or another item it contains) has size or aspect ratio restrictions, it may not be possible to fit the requested location exactly.
This is done by moving this item to the requested location, then attempting to resize it from the bottom-right corner to the requested size.
Parameters
Name | Type | Description |
---|---|---|
|
|
The bounding box to attempt to make this item fill |
Returns
Inherited from
setLocation
▸ setLocation(
Moves this item so that its upper-left corner is positioned at the given location (prior to any rotation)
Parameters
Name | Type | Description |
---|---|---|
|
|
The target location |
Returns
Inherited from
setReferenceKey
▸ setReferenceKey(
Set a reference key on this element, replacing any existing reference at the specified key.
Parameters
Name | Type |
---|---|
|
|
|
|
Returns
Inherited from
HumanReadableError
core/humanreadableerror.HumanReadableError
An error carrying a message that is good to be shown directly in the UI. These can be thrown from extensions and caught in core code.
Hierarchy
-
Error ↳
HumanReadableError
Constructors
constructor
• new HumanReadableError(
Parameters
Name | Type |
---|---|
|
|
Inherited from
Error.constructor
Properties
message
• message:
Inherited from
Error.message
name
• name:
Overrides
Error.name
stack
•
Inherited from
Error.stack
I18nFormattedNumber
interop.I18nFormattedNumber
Constructors
constructor
• new I18nFormattedNumber()
I18nSafeString
interop.I18nSafeString
Constructors
constructor
• new I18nSafeString(
Parameters
Name | Type |
---|---|
|
|
Properties
value
• value:
IframeUI
ui/iframeui.IframeUI
Base class for defining and interacting with custom UI elements whose contents are displayed in an iframe.
Hierarchy
Constructors
constructor
• new IframeUI(
Parameters
Name | Type |
---|---|
|
|
Properties
client
•
framePosition
•
The location of this frame within the top-level browser window. This is always updated immediately before
Type declaration
Name | Type |
---|---|
|
|
|
|
|
|
|
|
loaded
•
True after the iframe has fired an onload event (not all scripts are necessarily finished executing)
messageActionName
•
Methods
frameClosed
▸
Called when the iframe has been removed from the DOM
Returns
frameLoaded
▸
Called when the iframe has been constructed, its srcdoc set, and the window loaded event has fired
Returns
hookMessages
▸
Subclasses must call hookMessages some time before the UI is displayed. A Modal will call this when the open() method is called, where a Panel will need to do this in the constructor to watch for the user opening the panel.
Returns
messageFromFrame
▸
Receives messages sent from the iframe via parent.postMessage(, '*')
Parameters
Name | Type | Description |
---|---|---|
|
|
data sent from the iframe |
Returns
sendMessage
▸ sendMessage(
Send a message to this UI component's iframe via window.postMessage.
Parameters
Name | Type | Description |
---|---|---|
|
|
Data to send to the iframe |
Returns
unhookMessages
▸
Subclasses must call unhookMessages to allow them to be garbage collected.
Returns
ItemProxy
document/itemproxy.ItemProxy
A block, line, or group on a page of the current document.
Hierarchy
-
↳
ItemProxy ↳↳
BlockProxy ↳↳
GroupProxy ↳↳
LineProxy
Constructors
constructor
• new ItemProxy(
Parameters
Name | Type | Description |
---|---|---|
|
|
ID of this item |
|
|
Overrides
Properties
allShapeData
•
All shape data accessible on this element, including shape data inherited from the page or a containing group. This collection is read-only.
Inherited from
client
•
Inherited from
id
•
Inherited from
properties
•
All properties available on this element, organized by name. Not all properties are writeable (e.g. "ClassName" on a block). To move or resize elements, use setLocation() or setBoundingBox() or offset() instead.
Inherited from
referenceKeys
•
The set of reference keys, organized by their ID, which can be either a string or number.
For more information, see the Developer Guide.
Inherited from
shapeData
•
The shape data set directly on this element (not including any shape data inherited from the page or a containing group).
Inherited from
textAreas
•
The plain text in each of the text areas on this item, organized by text area name.
textStyles
•
The text style in each of the text areas on this item, organized by text area name.
Methods
changeZOrder
▸ changeZOrder(
Parameters
Name | Type | Description |
---|---|---|
|
|
How to adjust the Z order of this item relative to the other items it overlaps on the page |
Returns
delete
▸ delete():
Delete this item from the document
Returns
executeFormula
▸ executeFormula(
Execute a formula in the context of this element
Parameters
Name | Type | Description |
---|---|---|
|
|
The formula text, e.g. "@a + @b" to add together the shape data values a and b. |
Returns
The result of the formula, or an error.
Inherited from
exists
▸ exists():
Returns
Inherited from
getBoundingBox
▸ getBoundingBox():
Returns
The bounding box of this item relative to its containing page. As pages may change size to fit the content on them, note that these coordinates may be negative or very large.
If this is a rotated block, the bounding box returned here is where the block would be if it were unrotated.
getContainers
▸ getContainers():
Returns
An array of blocks whose bounding boxes contain this item's upper-left corner
getLocation
▸ getLocation():
Returns
The x/y location of this item
Name | Type |
---|---|
|
|
|
|
getPage
▸ getPage():
Returns
The page containing this item
offset
▸ offset(
Offset this item in the given direction by the given amount.
Parameters
Name | Type | Description |
---|---|---|
|
|
The type of offset to apply to this item |
|
|
The amount to offset |
Returns
removeReferenceKey
▸ removeReferenceKey(
Remove the specified reference key from this element.
Parameters
Name | Type |
---|---|
|
|
Returns
Inherited from
ElementProxy.removeReferenceKey
setBoundingBox
▸ setBoundingBox(
Attempts to move and resize this item to fit into the given bounding box. If this item (or another item it contains) has size or aspect ratio restrictions, it may not be possible to fit the requested location exactly.
This is done by moving this item to the requested location, then attempting to resize it from the bottom-right corner to the requested size.
Parameters
Name | Type | Description |
---|---|---|
|
|
The bounding box to attempt to make this item fill |
Returns
setLocation
▸ setLocation(
Moves this item so that its upper-left corner is positioned at the given location (prior to any rotation)
Parameters
Name | Type | Description |
---|---|---|
|
|
The target location |
Returns
setReferenceKey
▸ setReferenceKey(
Set a reference key on this element, replacing any existing reference at the specified key.
Parameters
Name | Type |
---|---|
|
|
|
|
Returns
Inherited from
LineProxy
document/lineproxy.LineProxy
A line on the current Lucid document
Hierarchy
-
↳
LineProxy
Constructors
constructor
• new LineProxy(
Parameters
Name | Type | Description |
---|---|---|
|
|
ID of this item |
|
|
Inherited from
Properties
allShapeData
•
All shape data accessible on this element, including shape data inherited from the page or a containing group. This collection is read-only.
Inherited from
client
•
Inherited from
id
•
Inherited from
properties
•
All properties available on this element, organized by name. Not all properties are writeable (e.g. "ClassName" on a block). To move or resize elements, use setLocation() or setBoundingBox() or offset() instead.
Inherited from
referenceKeys
•
The set of reference keys, organized by their ID, which can be either a string or number.
For more information, see the Developer Guide.
Inherited from
shapeData
•
The shape data set directly on this element (not including any shape data inherited from the page or a containing group).
Inherited from
textAreas
•
The plain text in each of the text areas on this item, organized by text area name.
Inherited from
textStyles
•
The text style in each of the text areas on this item, organized by text area name.