Store
Object store
- access to all objects
- manage index for objects
Constructors
new Store()
new Store(
instantiator
,options
?):Store
Constructor
Parameters
• instantiator: Instantiator
• options?: StoreOptions
Returns
Source
Properties
history
history:
Transform
History
Source
idIndex
idIndex:
Record
<string
,Obj
>
Index for object.id
Source
instantiator
instantiator:
Instantiator
Shape instantiator
Source
options
options:
StoreOptions
Store options
Source
root
root:
null
|Obj
the root object
Source
Methods
addToIndex()
addToIndex(
obj
):void
Add to index for the object (with all descendants)
Parameters
• obj: Obj
Returns
void
Source
clear()
clear():
void
Clear the store
Returns
void
Source
fromJSON()
fromJSON(
json
):void
Set the root from JSON
Parameters
• json: any
Returns
void
Source
getById()
getById(
id
):null
|Obj
Get an object by id
Parameters
• id: string
Returns
null
| Obj
Source
has()
has(
obj
):boolean
Test shape is exists in the store or not
Parameters
• obj: Obj
Returns
boolean
Source
removeFromIndex()
removeFromIndex(
obj
):void
Remove from index for the object (with all descendants)
Parameters
• obj: Obj
Returns
void
Source
setRoot()
setRoot(
doc
):void
Set the root object
Parameters
• doc: Obj
Returns
void
Source
toJSON()
toJSON():
any
Return JSON of the root
Returns
any
Source
update()
update(
obj
):void
Update obj
Parameters
• obj: Obj
Returns
void