manifest/segments#

Interfaces#

Gap#

Defined in: manifest/segments.ts:38

How the gap a removed segment leaves is closed. left extend: the segment before it grows by its length. right extend: the segment after it starts where it started and grows by its length. right shift: every later segment moves back by its length and the segment line shortens by it. left shift: every earlier segment moves on by its length, which the segment line’s offset in its parent grows by while the line shortens by it, so the later segments keep their place in the parent.

Properties#

side#

readonly side: GapSide

Defined in: manifest/segments.ts:39

verb#

readonly verb: GapVerb

Defined in: manifest/segments.ts:40


GapOption#

Defined in: manifest/segments.ts:52

One way of closing a gap, and why it is refused, or null when it is permitted.

Properties#

gap#

readonly gap: Gap

Defined in: manifest/segments.ts:53

refused#

readonly refused: string | null

Defined in: manifest/segments.ts:54

Type Aliases#

GapSide#

GapSide = "left" | "right"

Defined in: manifest/segments.ts:25

The side whose neighbour closes the gap.


GapVerb#

GapVerb = "extend" | "shift"

Defined in: manifest/segments.ts:27

How the gap is closed: by growing a neighbour or by moving one side’s segments.

Variables#

GAPS#

const GAPS: readonly Gap[]

Defined in: manifest/segments.ts:44

The four ways of closing a gap, in the order they are preferred.

Functions#

movedBy()#

movedBy(manifest, id, gap): ReadonlySet<string>

Defined in: manifest/segments.ts:243

The timelines that closing the gap of segment id as gap moves or resizes: those whose start on their root’s axis or whose length changes (a timeline below a moved one moves with it); none when that way is not permitted.

Parameters#

manifest#

Manifest

id#

string

gap#

Gap

Returns#

ReadonlySet<string>


segmentGaps()#

segmentGaps(manifest, id): readonly GapOption[] | undefined

Defined in: manifest/segments.ts:229

The four ways of closing the gap removing segment id leaves, in the order of GAPS, each with why it is refused or null when it is permitted; undefined when id is no segment. Extending needs a neighbour on that side whose length may change (one not locked, or of unknown length; a segment that is no segment line itself is never locked); shifting needs the segment line not locked, and shifting left needs it to be a child. A way whose result the manifest’s rules refuse (a segment line that is itself a segment changing its length, a child leaving its parent) is refused with that rule’s message. A way is named by the neighbour that moves: “left shifts” moves the line’s offset in its parent.

Parameters#

manifest#

Manifest

id#

string

Returns#

readonly GapOption[] | undefined


withoutSegment()#

withoutSegment(manifest, id, gap): string | Manifest

Defined in: manifest/segments.ts:202

manifest without segment id (and everything removedBy names with it), its gap closed as gap says; or why that way is not permitted. The result has not been checked; segmentGaps checks it.

Parameters#

manifest#

Manifest

id#

string

gap#

Gap

Returns#

string | Manifest