Skip to main content

local-storage-api

Documentation / lib/components/Editor/storage/local-storage-api

savedDocuments​

const savedDocuments: Readable<{
}>;

Defined in: apps/web/src/lib/components/Editor/storage/local-storage-api.js:24

Export read-only versions of the stores


documentIndex​

const documentIndex: Readable<any[]>;

Defined in: apps/web/src/lib/components/Editor/storage/local-storage-api.js:25


saveDocument()​

function saveDocument(document: any, parentId: any): Promise<string>;

Defined in: apps/web/src/lib/components/Editor/storage/local-storage-api.js:83

Function to save a document and update the index

Parameters​

ParameterTypeDefault value

document

any

undefined

parentId

any

null

Returns​

Promise<string>


getDocument()​

function getDocument(key: any): Promise<any>;

Defined in: apps/web/src/lib/components/Editor/storage/local-storage-api.js:131

Function to retrieve a document

Parameters​

ParameterType

key

any

Returns​

Promise<any>


updateDocument()​

function updateDocument(key: any, updates: any): Promise<void>;

Defined in: apps/web/src/lib/components/Editor/storage/local-storage-api.js:137

Function to update a document and its index entry

Parameters​

ParameterType

key

any

updates

any

Returns​

Promise<void>


deleteDocument()​

function deleteDocument(key: any): Promise<void>;

Defined in: apps/web/src/lib/components/Editor/storage/local-storage-api.js:172

Function to delete a document and its index entry

Parameters​

ParameterType

key

any

Returns​

Promise<void>


listDocuments()​

function listDocuments(): object;

Defined in: apps/web/src/lib/components/Editor/storage/local-storage-api.js:191

Function to list all documents

Returns​

object


getDocumentIndex()​

function getDocumentIndex(): any[];

Defined in: apps/web/src/lib/components/Editor/storage/local-storage-api.js:196

Function to get the document index

Returns​

any[]


addFolder()​

function addFolder(name: any, parentId: any): Promise<string>;

Defined in: apps/web/src/lib/components/Editor/storage/local-storage-api.js:201

Function to add a folder to the index

Parameters​

ParameterTypeDefault value

name

any

undefined

parentId

any

null

Returns​

Promise<string>


updateFolder()​

function updateFolder(id: any, updates: any): Promise<void>;

Defined in: apps/web/src/lib/components/Editor/storage/local-storage-api.js:219

Function to update a folder in the index

Parameters​

ParameterType

id

any

updates

any

Returns​

Promise<void>


deleteFolder()​

function deleteFolder(id: any): Promise<void>;

Defined in: apps/web/src/lib/components/Editor/storage/local-storage-api.js:230

Function to delete a folder and its contents from the index

Parameters​

ParameterType

id

any

Returns​

Promise<void>