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
packages/core/src/core/store.ts:46
Properties
history
history:
Transform
History
Source
packages/core/src/core/store.ts:31
idIndex
idIndex:
Record
<string
,Obj
>
Index for object.id
Source
packages/core/src/core/store.ts:36
instantiator
instantiator:
Instantiator
Shape instantiator
Source
packages/core/src/core/store.ts:26
options
options:
StoreOptions
Store options
Source
packages/core/src/core/store.ts:21
root
root:
null
|Obj
the root object
Source
packages/core/src/core/store.ts:41
Methods
addToIndex()
addToIndex(
obj
):void
Add to index for the object (with all descendants)
Parameters
• obj: Obj
Returns
void
Source
packages/core/src/core/store.ts:65
clear()
clear():
void
Clear the store
Returns
void
Source
packages/core/src/core/store.ts:57
fromJSON()
fromJSON(
json
):void
Set the root from JSON
Parameters
• json: any
Returns
void
Source
packages/core/src/core/store.ts:124
getById()
getById(
id
):null
|Obj
Get an object by id
Parameters
• id: string
Returns
null
| Obj
Source
packages/core/src/core/store.ts:102
has()
has(
obj
):boolean
Test shape is exists in the store or not
Parameters
• obj: Obj
Returns
boolean
Source
packages/core/src/core/store.ts:109
removeFromIndex()
removeFromIndex(
obj
):void
Remove from index for the object (with all descendants)
Parameters
• obj: Obj
Returns
void
Source
packages/core/src/core/store.ts:79
setRoot()
setRoot(
doc
):void
Set the root object
Parameters
• doc: Obj
Returns
void
Source
packages/core/src/core/store.ts:137
toJSON()
toJSON():
any
Return JSON of the root
Returns
any
Source
packages/core/src/core/store.ts:117
update()
update(
obj
):void
Update obj
Parameters
• obj: Obj
Returns
void