autosaving#

Interfaces#

Autosaving#

Defined in: editor/src/autosaving.ts:38

A running autosave.

Methods#

flush()#

flush(): Promise<void>

Defined in: editor/src/autosaving.ts:40

Write the pending snapshot now and wait for every write; a failure is shown, never thrown.

Returns#

Promise<void>

stop()#

stop(): void

Defined in: editor/src/autosaving.ts:42

Write the pending snapshot, give back the lock and follow the workspace no more.

Returns#

void


AutosavingOptions#

Defined in: editor/src/autosaving.ts:22

What startAutosave is given: the slot, the delay, and how to post messages and ask questions.

Properties#

ask#

readonly ask: <A>(question, answers, focused) => Promise<A | null>

Defined in: editor/src/autosaving.ts:30

Ask question with answers, the focus on focused: the answer chosen, null when dismissed.

Type Parameters#
A#

A extends string

Parameters#
question#

string

answers#

readonly A[]

focused#

NoInfer<A>

Returns#

Promise<A | null>

delayMs#

readonly delayMs: number

Defined in: editor/src/autosaving.ts:26

How long a change waits for a later one before it is written.

post#

readonly post: Post

Defined in: editor/src/autosaving.ts:28

Show a message at its level (Messages.post).

slot#

readonly slot: string

Defined in: editor/src/autosaving.ts:24

The slot’s name; the Web Lock is tilie-autosave/<slot>.

Functions#

autosaveLock()#

autosaveLock(slot): string

Defined in: editor/src/autosaving.ts:46

The Web Lock an editor holds on a slot while it autosaves into it.

Parameters#

slot#

string

Returns#

string


startAutosave()#

startAutosave(session, options): Autosaving

Defined in: editor/src/autosaving.ts:51

Start autosaving session into options.slot.

Parameters#

session#

WorkspaceSession

options#

AutosavingOptions

Returns#

Autosaving