Skip to content

code/editor/edit-session

import { … } from 'zidane-ui/code/editor'ui/src/code/editor/edit-session.ts

Functions#

editSessionKeyFunction#

The retained-session key of one draft generation of a file.

TypeScript
function editSessionKey(cwd: string, path: string, generation: number): string
Parameters
NameTypeDescription
cwdstring

The folder.

pathstring

The file, relative to it.

generationnumber

Bumped whenever the path's draft is reset.

string

ui/src/code/editor/edit-session.ts:20

forgetEditSessionFunction#

Drop a retained session. Safe to call while it is still active: the clear is deferred until it is dormant.

TypeScript
function forgetEditSession(key: string): void
Parameters
NameTypeDescription
keystring

Its key (editSessionKey).

ui/src/code/editor/edit-session.ts:29