Function: createEditorSessionAdapter()
ts
function createEditorSessionAdapter(params): object;Defined in: application/services/adapters/editor-session-adapter.ts:16
Creates the editor session helpers that keep a shadow copy of the selected document and persist path-based edits through backend.documentService.
The ref-like parameters ({ value } objects, such as Vue refs) are read and written in place. refreshShadow(doc) rebuilds the shadow from the document and clears tempValueInputs when a different document is selected.
Parameters
| Parameter | Type |
|---|---|
params | { backend: any; documents: RefValue<any[]>; selectedDocument: RefValue<any>; shadowDoc: RefValue<any>; shadowService: any; tempValueInputs: Record<string, any>; workspace: RefValue<any>; } |
params.backend | any |
params.documents | RefValue<any[]> |
params.selectedDocument | RefValue<any> |
params.shadowDoc | RefValue<any> |
params.shadowService | any |
params.tempValueInputs | Record<string, any> |
params.workspace | RefValue<any> |
Returns
object
addArrayItemAtPath
ts
addArrayItemAtPath: (path, schemaNode) => Promise<void>;Parameters
| Parameter | Type | Default value |
|---|---|---|
path | (string | number)[] | undefined |
schemaNode? | any | null |
Returns
Promise<void>
cloneValue
ts
cloneValue: <T>(value) => T;Type Parameters
| Type Parameter |
|---|
T |
Parameters
| Parameter | Type |
|---|---|
value | T |
Returns
T
deleteShadowAtPath
ts
deleteShadowAtPath: (path) => Promise<void>;Parameters
| Parameter | Type |
|---|---|
path | (string | number)[] |
Returns
Promise<void>
getByPath
ts
getByPath: (obj, path) => any;Parameters
| Parameter | Type |
|---|---|
obj | any |
path | (string | number)[] |
Returns
any
refreshShadow
ts
refreshShadow: (doc) => void;Parameters
| Parameter | Type |
|---|---|
doc | any |
Returns
void
removeArrayItemAtPath
ts
removeArrayItemAtPath: (path, index) => Promise<void>;Parameters
| Parameter | Type |
|---|---|
path | (string | number)[] |
index | number |
Returns
Promise<void>
setByPath
ts
setByPath: (obj, path, value) => void;Parameters
| Parameter | Type |
|---|---|
obj | any |
path | (string | number)[] |
value | any |
Returns
void
updateShadowAtPath
ts
updateShadowAtPath: (path, value) => Promise<void>;Parameters
| Parameter | Type |
|---|---|
path | (string | number)[] |
value | any |
Returns
Promise<void>