workspace/sessions#

Interfaces#

CommandEntry#

Defined in: workspace/sessions.ts:41

One command as it was applied: by whom and when (ISO 8601 UTC with milliseconds).

Properties#

author#

readonly author: string

Defined in: workspace/sessions.ts:43

command#

readonly command: Command

Defined in: workspace/sessions.ts:42

time#

readonly time: string

Defined in: workspace/sessions.ts:44


ListedEntry#

Defined in: workspace/sessions.ts:113

One entry of a level with its undo state, as the Journal tab lists it.

Properties#

applied#

readonly applied: number

Defined in: workspace/sessions.ts:118

How many of them are applied: all, some (a partly undone session) or none (undone).

changes#

readonly changes: number

Defined in: workspace/sessions.ts:116

The changes it holds: 1 for a command, a session’s commands at every depth.

children#

readonly children: readonly ListedEntry[]

Defined in: workspace/sessions.ts:120

A session entry’s entries, listed the same way in order; [] for a command.

entry#

readonly entry: Entry

Defined in: workspace/sessions.ts:114


OpenEditor#

Defined in: workspace/sessions.ts:72

One editor of the editing path.

Properties#

earlier#

readonly earlier: string | null

Defined in: workspace/sessions.ts:78

The latest earlier session of the same target at the level it opened on, listed read only; null when there is none or it was unfolded.

kind#

readonly kind: EditorKind

Defined in: workspace/sessions.ts:76

session#

readonly session: string

Defined in: workspace/sessions.ts:73

target#

readonly target: Address

Defined in: workspace/sessions.ts:75

A block’s address {block}, a group’s or a timeline’s {block, id}.


OwnedChange#

Defined in: workspace/sessions.ts:124

One change: a command entry at any depth, and the session that owns it.

Properties#

entry#

readonly entry: CommandEntry

Defined in: workspace/sessions.ts:125

owner#

readonly owner: string | null

Defined in: workspace/sessions.ts:127

The innermost session whose own entries hold the command; null for the main journal’s own.


Session#

Defined in: workspace/sessions.ts:62

One closed session: the element it edited, its entries in order, and, for a flow-control editor’s, its kind (every other kind follows from the target, editorKindOf).

Properties#

entries#

readonly entries: readonly Entry[]

Defined in: workspace/sessions.ts:65

kind?#

readonly optional kind?: "flow"

Defined in: workspace/sessions.ts:64

target#

readonly target: Address

Defined in: workspace/sessions.ts:63


SessionEntry#

Defined in: workspace/sessions.ts:48

One closed session: by whom and when it was closed with Done.

Properties#

author#

readonly author: string

Defined in: workspace/sessions.ts:50

session#

readonly session: string

Defined in: workspace/sessions.ts:49

time#

readonly time: string

Defined in: workspace/sessions.ts:51

Type Aliases#

EditorKind#

EditorKind = "bundle" | "group" | "timeline" | "flow"

Defined in: workspace/sessions.ts:35

The editor of an element: of a block, of a group, of a root or child timeline, and the flow-control editor (kind flow) of a root timeline, which edits the flow control of its tree, its FlowMaps and the virtual timelines applying them, and is the one editor whose canvas folds the FlowMaps out.


Entry#

Defined in: workspace/sessions.ts:55

One entry of a journal or of a session.


SessionId#

SessionId = string

Defined in: workspace/sessions.ts:23

A session id: ten characters of base 36 (mintSessionId).


Sessions#

Sessions = object

Defined in: workspace/sessions.ts:69

The closed sessions of a workspace, by id.

Index Signature#

[id: string]: Session


StatedEditorKind#

StatedEditorKind = Extract<EditorKind, "flow">

Defined in: workspace/sessions.ts:38

The kind of editor a session’s target does not tell: the flow-control editor, on a root timeline’s address.

Variables#

SESSION_ID#

const SESSION_ID: RegExp = BLOCK_ID

Defined in: workspace/sessions.ts:26

A session id is minted as a block id is, so it is checked by the same pattern.

Functions#

changesOf()#

changesOf(entries, sessions): OwnedChange[]

Defined in: workspace/sessions.ts:135

The changes of entries in order: their commands, a session’s expanded from sessions recursively, each with its owner (null for a command of entries itself).

Parameters#

entries#

readonly Entry[]

sessions#

Sessions

Returns#

OwnedChange[]


editorKindOf()#

editorKindOf(view, address, kind?): Problem | EditorKind

Defined in: workspace/sessions.ts:223

The editor an address opens (resolveAddress): a block the bundle editor, a group the group editor, a root or child timeline the timeline editor; no_editor for the workspace and any other element or part; unknown_target for an address naming nothing. Asked for kind, the editor of that kind: the flow-control editor opens on a root timeline only (no_editor for any other address), any other kind where the address opens it.

Parameters#

view#

View

address#

Address

kind?#

EditorKind

Returns#

Problem | EditorKind


isSessionEntry()#

isSessionEntry(entry): entry is SessionEntry

Defined in: workspace/sessions.ts:87

Whether an entry is a closed session rather than a command.

Parameters#

entry#

Entry

Returns#

entry is SessionEntry


keepChanges()#

keepChanges(entries, count, sessions): object

Defined in: workspace/sessions.ts:183

The first count changes of entries: the entries holding them, and sessions with each session that holds only some of them rebuilt under its id with those (at every depth) and without the sessions left with none. A session entry that is kept is the same object.

Parameters#

entries#

readonly Entry[]

count#

number

sessions#

Sessions

Returns#

object

entries#

entries: Entry[]

sessions#

sessions: Sessions


listEntries()#

listEntries(entries, sessions, applied?): ListedEntry[]

Defined in: workspace/sessions.ts:152

entries listed with their undo state: the first applied of their changes applied (all of them by default), the others undone.

Parameters#

entries#

readonly Entry[]

sessions#

Sessions

applied?#

number = Number.POSITIVE_INFINITY

Returns#

ListedEntry[]


mintSessionId()#

mintSessionId(fill?): string

Defined in: workspace/sessions.ts:82

A fresh session id: ten random base-36 characters, drawn as a block id is (mintBlockId).

Parameters#

fill?#

(bytes) => void

Returns#

string


opensIn()#

opensIn(view, outer, target, kind): boolean

Defined in: workspace/sessions.ts:285

Whether the editor of kind on target opens inside the open editor outer: never inside a flow-control editor; a flow-control editor inside the timeline editor of its own root too; else where target lies inside outer’s target (opensInside), so a root’s flow-control editor opens inside the bundle editor of its block and the group editor of a group holding the root.

Parameters#

view#

View

outer#

OpenEditor

target#

Address

kind#

EditorKind

Returns#

boolean


opensInside()#

opensInside(view, container, target): boolean

Defined in: workspace/sessions.ts:302

Whether target lies inside the editor of container, a block’s, a group’s or a timeline’s address: target is another element of the same block, and container is that block or contains it (contains).

Parameters#

view#

View

container#

Address

target#

Address

Returns#

boolean


reachedSessions()#

reachedSessions(journal, sessions): Sessions

Defined in: workspace/sessions.ts:97

The sessions a journal reaches: those its session entries name, and those their sessions’ entries name, recursively. Each is visited once, so sessions that name each other end the walk; a name of no session is passed over.

Parameters#

journal#

readonly Entry[]

sessions#

Sessions

Returns#

Sessions


statedKind()#

statedKind(kind): "flow" | undefined

Defined in: workspace/sessions.ts:293

The kind a session states: flow for a flow-control editor’s, none for another’s (Session.kind).

Parameters#

kind#

EditorKind

Returns#

"flow" | undefined