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).
Extends
Constructors
new CollectionProxy()
new CollectionProxy(id, client): CollectionProxyParameters
| Parameter | Type | Description |
|---|---|---|
id | string | ID of this collection on the current document |
client | EditorClient |
Returns
Overrides
PropertyStoreProxy.constructor
Properties
client
protected readonly client: EditorClient;Inherited from
id
readonly id: string;ID of this collection on the current document
Inherited from
items
readonly items: MapProxy<string, DataItemProxy>;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
readonly properties: WriteableMapProxy<string, UnsafeJsonSerializableOrUndefined, void, UnsafeJsonSerializableOrUndefined>;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(): undefined | CollectionProxySome 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
undefined | CollectionProxy
the original collection from which this collection was branched, or undefined if this collection
is not a branch
getFields()
getFields(): string[]Returns
string[]
an array of field names that are accessible on the items in this collection
getLocalChanges()
getLocalChanges(): undefined | PatchCollectionProxyReturns
undefined | PatchCollectionProxy
information about any changes made locally to the collection that have not been synchronized
with the external data source.
getName()
getName(): stringReturns
string
a human-readable name for this collection
getSchema()
getSchema(): SchemaDefinitionReturns
getSyncCollectionId()
getSyncCollectionId(): undefined | stringReturns
undefined | string
isHiddenFromDataPanel()
isHiddenFromDataPanel(): booleanCertain collections, such as metadata collections, may be hidden from the data panel with the hideFromDataPanel
argument of CollectionPatch. This method identifies whether this collection has been hidden from the data panel
via this mechanism.
Returns
boolean
patchItems()
patchItems(patch): PatchDataItemsResultParameters
| Parameter | Type |
|---|---|
patch | object |
patch.added? | Record<string, SerializedFieldType>[] |
patch.changed? | Map<string, Record<string, SerializedFieldType>> |
patch.deleted? | string[] |