commands/mutations#

Interfaces#

ChangeSet#

Defined in: commands/mutations.ts:52

What a command changed. blocks are the blocks it added, removed or changed; manifests those of them whose manifest changed, which settle completes, orders and checks; paths the [<target's address key>, property] of every value a set stored that differs from the one stored before, and for the other commands the path each acted on; targets the address of every target a change was made at. written holds, by path, each value a set wrote that reaches no further than its path; reaching the blocks a change reached past its path in (a whole manifest replaced, a timeline moved, placed or grouped), which only the whole block compares. ids gives the ID of every element the command creates, in order.

Properties#

blocks#

readonly blocks: Set<string>

Defined in: commands/mutations.ts:53

ids#

readonly ids: IdSource

Defined in: commands/mutations.ts:59

manifests#

readonly manifests: Set<string>

Defined in: commands/mutations.ts:54

paths#

readonly paths: PathSegment[][]

Defined in: commands/mutations.ts:55

reaching#

readonly reaching: Set<string>

Defined in: commands/mutations.ts:58

targets#

readonly targets: Address[]

Defined in: commands/mutations.ts:56

written#

readonly written: Map<string, Written>

Defined in: commands/mutations.ts:57


Written#

Defined in: commands/mutations.ts:34

A value a set wrote at one path: the value stored before its first write, and its last.

Properties#

block#

readonly block: string | null

Defined in: commands/mutations.ts:35

stored#

readonly stored: unknown

Defined in: commands/mutations.ts:36

value#

readonly value: unknown

Defined in: commands/mutations.ts:37

Functions#

elisionsAtEnd()#

elisionsAtEnd(manifest, timeline): readonly object[]

Defined in: commands/mutations.ts:185

The stored elisions lying on timeline that end exactly at its end, in canonical order; none where its length is unknown.

Parameters#

manifest#

Manifest

timeline#

{ }

Returns#

readonly object[]


emptyChanges()#

emptyChanges(ids): ChangeSet

Defined in: commands/mutations.ts:74

A change set recording nothing yet, the IDs of what the command creates taken from ids.

Parameters#

ids#

IdSource

Returns#

ChangeSet


entryAt()#

entryAt<K>(timeline, kind, index): EntryTypes[K] | undefined

Defined in: commands/mutations.ts:242

The entry index of kind kind in timeline.

Type Parameters#

K#

K extends keyof EntryTypes

Parameters#

timeline#

{ }

kind#

K

index#

number

Returns#

EntryTypes[K] | undefined


record()#

record(changes, path, block, manifest?): void

Defined in: commands/mutations.ts:103

Record a change at path that may reach past the value there: of the workspace when block is null, of the block otherwise, and with manifest of its manifest too.

Parameters#

changes#

ChangeSet

path#

readonly PathSegment[]

block#

string | null

manifest?#

boolean = false

Returns#

void


recordValue()#

recordValue(changes, path, block, manifest, stored, value): void

Defined in: commands/mutations.ts:118

Record a set that wrote value at path where stored was, and changed nothing else: of the workspace when block is null, of the block otherwise, and with manifest of its manifest too.

Parameters#

changes#

ChangeSet

path#

readonly PathSegment[]

block#

string | null

manifest#

boolean

stored#

unknown

value#

unknown

Returns#

void


replaceTimeline()#

replaceTimeline(manifest, at, timeline): Manifest

Defined in: commands/mutations.ts:202

manifest with the timeline at locates replaced by timeline. Where the new timeline’s length is known and another than the old one’s, the named timestamps lying at the old end move to the new one, and the stored elisions ending there end at the new one: what lies at a timeline’s end stays at its end whatever changes the length (lengthProblem refuses a length at or before such an elision’s start).

Parameters#

manifest#

Manifest

at#

Located

timeline#

{ }

Returns#

Manifest


sameJson()#

sameJson(stored, value): boolean

Defined in: commands/mutations.ts:67

Whether a stored value and a value to store are the same JSON, either of them possibly absent: a setter that would store what is stored writes nothing.

Parameters#

stored#

unknown

value#

unknown

Returns#

boolean


timestampsAtEnd()#

timestampsAtEnd(manifest, timeline): readonly object[]

Defined in: commands/mutations.ts:168

The named timestamps of timeline lying exactly at its end, in canonical order, but its match timestamps, which stand for a coordinate the MatchClaims give and never follow a length; none where its length is unknown.

Parameters#

manifest#

Manifest

timeline#

{ }

Returns#

readonly object[]


withBlock()#

withBlock(view, block): View

Defined in: commands/mutations.ts:133

view with block stored under its ID, added or replacing the block there.

Parameters#

view#

View

block#

Block

Returns#

View


withElisions()#

withElisions(manifest, elisions): Manifest

Defined in: commands/mutations.ts:307

manifest with its stored elisions replaced by elisions, its graphical object’s other members kept (and created when it has none).

Parameters#

manifest#

Manifest

elisions#

readonly object[]

Returns#

Manifest


withEntryAdded()#

withEntryAdded<K>(timeline, kind, entry): object

Defined in: commands/mutations.ts:283

timeline with entry appended to its list of kind kind.

Type Parameters#

K#

K extends keyof EntryTypes

Parameters#

timeline#

{ }

kind#

K

entry#

EntryTypes[K]

Returns#

object


withEntryAt()#

withEntryAt<K>(timeline, kind, index, entry): object

Defined in: commands/mutations.ts:251

timeline with the entry index of kind kind replaced by entry.

Type Parameters#

K#

K extends keyof EntryTypes

Parameters#

timeline#

{ }

kind#

K

index#

number

entry#

EntryTypes[K]

Returns#

object


withEntryMember()#

withEntryMember<K, M>(timeline, kind, index, member, value): object

Defined in: commands/mutations.ts:268

timeline with member of the entry index of kind kind set to value; timeline itself when the entry holds that value already.

Type Parameters#

K#

K extends keyof EntryTypes

M#

M extends string

Parameters#

timeline#

{ }

kind#

K

index#

number

member#

M

value#

EntryTypes[K][M]

Returns#

object


withKey()#

withKey<T>(object, key, value): object

Defined in: commands/mutations.ts:324

object with key set to value, or without key when value is undefined.

Type Parameters#

T#

T

Parameters#

object#

{[key: string]: T; }

key#

string

value#

T | undefined

Returns#

object


withMatchStamps()#

withMatchStamps(manifest, timestamps, matchstamps): Manifest

Defined in: commands/mutations.ts:315

manifest with its named timestamps and its named MatchStamps replaced, its graphical object’s other members kept (and created when it has none).

Parameters#

manifest#

Manifest

timestamps#

readonly object[]

matchstamps#

readonly object[]

Returns#

Manifest


withTimeline()#

withTimeline(view, block, at, timeline): View

Defined in: commands/mutations.ts:232

The view with the timeline at locates in block’s manifest replaced by timeline.

Parameters#

view#

View

block#

Block

at#

Located

timeline#

{ }

Returns#

View


withTimestamps()#

withTimestamps(manifest, timestamps): Manifest

Defined in: commands/mutations.ts:296

manifest with its named timestamps replaced by timestamps, its graphical object’s other members kept (and created when it has none).

Parameters#

manifest#

Manifest

timestamps#

readonly object[]

Returns#

Manifest