ShapeDataProxy

The shape data fields on a single element of the current document

Extends


Constructors

new ShapeDataProxy()

new ShapeDataProxy(id, client): ShapeDataProxy

Parameters

ParameterTypeDescription
idundefined | stringThe ID of the element, or undefined for the document itself
clientEditorClient

Returns

ShapeDataProxy

Overrides

WriteableMapProxy.constructor


Properties

client

protected readonly client: EditorClient;

id

readonly id: undefined | string;

The ID of the element, or undefined for the document itself


Accessors

size

get size(): number

Returns

number


Methods

addInheritable()

addInheritable(name, value): void

Add shape data to this element that is inherited by its descendants.

If you add an inheritable shape data to a page, whose formula is "=@Cost * 4", then
each item on that page will have a new shape data entry (in allShapeData) by that
name with the value calculated in the context of that individual item.

Inheritable shape data on a page affects all items on the page. Inheritable shape
data on a group affects all items inside that group.

Parameters

ParameterTypeDescription
namestringName of the new shape data
valuestringValue (or formula, if starting with "=") of the new shape data

Returns

void


delete()

delete(key): void

Delete the specified shape data from this element

Parameters

ParameterTypeDescription
keystring

Returns

void


filter()

filter(filter): (SerializedFieldType | SerializedDataError)[]

Parameters

ParameterType
filter(item, key) => boolean

Returns

(SerializedFieldType | SerializedDataError)[]

Inherited from

WriteableMapProxy.filter


find()

find(filter): SerializedFieldType | SerializedDataError

Parameters

ParameterType
filter(item, key) => boolean

Returns

SerializedFieldType | SerializedDataError

Inherited from

WriteableMapProxy.find


first()

first(): SerializedFieldType | SerializedDataError

Returns

SerializedFieldType | SerializedDataError

Inherited from

WriteableMapProxy.first


get()

get(key): SerializedFieldType | SerializedDataError

Parameters

ParameterType
keystring

Returns

SerializedFieldType | SerializedDataError

Inherited from

WriteableMapProxy.get


getString()

getString(key): string

Parameters

ParameterTypeDescription
keystringName of the shape data to read

Returns

string

The value if it is a string, or an empty string if it does not exist or is not a string.


keys()

keys(): string[]

Returns

string[]

Inherited from

WriteableMapProxy.keys


map()

map<T>(callback): T[]

Type parameters

Type parameter
T

Parameters

ParameterType
callback(item, key) => T

Returns

T[]

Inherited from

WriteableMapProxy.map


set()

set(
   key, 
   value, 
   options): void

Parameters

ParameterType
keystring
valueSerializedFieldType | SerializedDataError
optionsSetterOptions

Returns

void

Inherited from

WriteableMapProxy.set


values()

values(): Generator<
  | null
  | string
  | number
  | boolean
  | SerializedMillisecondsDateObject
  | SerializedIsoDateObject
  | SerializedTimeObject
  | SerializedColorObjectFieldType
  | NestedSerializedLucidDictionary
  | JSONSerializedLucidDictionary
  | SerializedLucidCurrency
  | SerializedFieldType[]
| SerializedDataError, void, unknown>

Returns

Generator<
| null
| string
| number
| boolean
| SerializedMillisecondsDateObject
| SerializedIsoDateObject
| SerializedTimeObject
| SerializedColorObjectFieldType
| NestedSerializedLucidDictionary
| JSONSerializedLucidDictionary
| SerializedLucidCurrency
| SerializedFieldType[]
| SerializedDataError, void, unknown>

Inherited from

WriteableMapProxy.values