manifest/flowmaps#

Classes#

FlowMapError#

Defined in: manifest/flowmaps.ts:67

A FlowMap or a virtual timeline that cannot be resolved, or a position that cannot be converted.

Extends#

  • Error

Constructors#

Constructor#

new FlowMapError(code, message, path): FlowMapError

Defined in: manifest/flowmaps.ts:71

Parameters#
code#

FlowMapErrorCode

message#

string

path#

readonly PathSegment[]

Returns#

FlowMapError

Overrides#

Error.constructor

Properties#

code#

readonly code: FlowMapErrorCode

Defined in: manifest/flowmaps.ts:68

path#

readonly path: readonly PathSegment[]

Defined in: manifest/flowmaps.ts:69

Interfaces#

Axis#

Defined in: manifest/flowmaps.ts:155

An axis: a unit and a number type.

Properties#

numberType#

readonly numberType: NumberType

Defined in: manifest/flowmaps.ts:157

unit#

readonly unit: TimeUnit

Defined in: manifest/flowmaps.ts:156


FlowChunk#

Defined in: manifest/flowmaps.ts:89

One entry of a FlowMap’s chunks, resolved.

Properties#

index#

readonly index: number

Defined in: manifest/flowmaps.ts:92

Its index in the FlowMap’s chunks.

kind#

readonly kind: FlowChunkKind

Defined in: manifest/flowmaps.ts:90

played#

readonly played: Stretch

Defined in: manifest/flowmaps.ts:101

Where it lies on the virtual axis.

source#

readonly source: string | null

Defined in: manifest/flowmaps.ts:94

The ID it names; null for a gap.

written#

readonly written: Stretch | null

Defined in: manifest/flowmaps.ts:99

What it plays: a Region’s or a timeline’s stretch on the root’s axis; a virtual timeline’s whole axis, from 0 to its length; null for a gap.


FlowRun#

Defined in: manifest/flowmaps.ts:121

A run of count consecutive chunks (section 8.10, Runs), named by its first: a longest sequence of chunks naming one ID, gaps forming none, so that a gap is a run of its own of count 1.

Properties#

chunk#

readonly chunk: FlowChunk

Defined in: manifest/flowmaps.ts:122

count#

readonly count: number

Defined in: manifest/flowmaps.ts:123


Occurrence#

Defined in: manifest/flowmaps.ts:146

One played position of a written position: occurrence occurrence of of, in the order played.

Properties#

chunk#

readonly chunk: number | null

Defined in: manifest/flowmaps.ts:151

The index of the chunk it lies in; null through a conversion map.

occurrence#

readonly occurrence: number

Defined in: manifest/flowmaps.ts:148

of#

readonly of: number

Defined in: manifest/flowmaps.ts:149

played#

readonly played: Coordinate

Defined in: manifest/flowmaps.ts:147


PlayedStretch#

Defined in: manifest/flowmaps.ts:109

One stretch of the virtual axis: the root’s stretch played there (null for a gap) and the chunk it belongs to; a virtual timeline chunk gives one per stretch of the FlowMap it applies.

Properties#

chunk#

readonly chunk: number

Defined in: manifest/flowmaps.ts:113

The index of its chunk in chunks.

played#

readonly played: Stretch

Defined in: manifest/flowmaps.ts:111

written#

readonly written: Stretch | null

Defined in: manifest/flowmaps.ts:110


ResolvedFlowMap#

Defined in: manifest/flowmaps.ts:127

A FlowMap read against its root: its chunks laid end to end on the virtual axis.

Properties#

chunks#

readonly chunks: readonly FlowChunk[]

Defined in: manifest/flowmaps.ts:136

flowMap#

readonly flowMap: string

Defined in: manifest/flowmaps.ts:129

The FlowMap’s ID.

length#

readonly length: Coordinate

Defined in: manifest/flowmaps.ts:142

The length of the virtual axis: the chunks and gaps together.

numberType#

readonly numberType: NumberType

Defined in: manifest/flowmaps.ts:135

The number type of both axes, the root’s.

runs#

readonly runs: readonly FlowRun[]

Defined in: manifest/flowmaps.ts:140

The runs of chunks naming one ID, in order: every chunk lies in exactly one.

stretches#

readonly stretches: readonly PlayedStretch[]

Defined in: manifest/flowmaps.ts:138

The stretches in the order played, each placed where the one before it ends.

timeline#

readonly timeline: string

Defined in: manifest/flowmaps.ts:131

The root timeline’s ID.

unit#

readonly unit: TimeUnit

Defined in: manifest/flowmaps.ts:133

The unit of both axes, the root’s.


Stretch#

Defined in: manifest/flowmaps.ts:80

A half-open stretch of one axis, [start, end), both ends on that axis.

Properties#

end#

readonly end: Coordinate

Defined in: manifest/flowmaps.ts:82

start#

readonly start: Coordinate

Defined in: manifest/flowmaps.ts:81

Type Aliases#

FlowChunkKind#

FlowChunkKind = "region" | "timeline" | "virtual" | "gap"

Defined in: manifest/flowmaps.ts:86

What a chunk names: a Region, a child timeline, a virtual timeline, or a gap.


FlowMapErrorCode#

FlowMapErrorCode = "unknown_flow_map" | "unknown_virtual_timeline" | "flow_map_timeline" | "flow_map_chunk" | "gap_number_type" | "unknown_length" | "flow_map_cycle" | "virtual_unresolved" | "map_not_evaluated" | "unit_mismatch" | "outside_virtual_axis"

Defined in: manifest/flowmaps.ts:42

Why a FlowMap or a virtual timeline cannot be resolved, or a position not converted.

Variables#

ZERO#

const ZERO: MapValue = 0n

Defined in: manifest/flowmaps.ts:168

Zero, written in any number type through onAxis.

Functions#

appliedFlowMap()#

appliedFlowMap(manifest, virtual, rootId, visiting, at): ResolvedFlowMap

Defined in: manifest/flowmaps.ts:414

The FlowMap a virtual timeline applies, resolved: refused where it is no FlowMap of rootId applied to rootId itself without through.

Parameters#

manifest#

Manifest

virtual#

{ }

rootId#

string

visiting#

readonly string[]

at#

readonly PathSegment[]

Returns#

ResolvedFlowMap


fold()#

fold(resolved, played): Coordinate | null

Defined in: manifest/flowmaps.ts:486

The written position (on the root’s axis) played at played, a position of the virtual axis; null inside a gap.

Parameters#

resolved#

ResolvedFlowMap

played#

Coordinate

Returns#

Coordinate | null

Throws#

outside_virtual_axis where played lies outside [0, length), unit_mismatch where it is on another unit.


onAxis()#

onAxis(axis, value): Coordinate

Defined in: manifest/flowmaps.ts:161

A value on an axis, written in its number type.

Parameters#

axis#

Axis

value#

CoordinateValue

Returns#

Coordinate


positionOn()#

positionOn(axis, position, what): Coordinate

Defined in: manifest/flowmaps.ts:171

A position of axis, given on its unit, read in its number type.

Parameters#

axis#

Axis

position#

Coordinate

what#

string

Returns#

Coordinate


quoted()#

quoted(id): string

Defined in: manifest/flowmaps.ts:183

An ID as a message quotes it.

Parameters#

id#

string

Returns#

string


resolveFlowMap()#

resolveFlowMap(manifest, flowMapId): ResolvedFlowMap

Defined in: manifest/flowmaps.ts:191

The FlowMap flowMapId of manifest resolved against its root: its chunks as stretches of the root’s axis, laid end to end from 0.

Parameters#

manifest#

Manifest

flowMapId#

string

Returns#

ResolvedFlowMap

Throws#

when it cannot be read, with the path of the entry at fault.


unfold()#

unfold(resolved, written): Occurrence[]

Defined in: manifest/flowmaps.ts:460

Every played position of the written position written (on the root’s axis), in the order played: one per stretch covering it, the stretch half-open, its end excluded; none where it is never played.

Parameters#

resolved#

ResolvedFlowMap

written#

Coordinate

Returns#

Occurrence[]

Throws#

unit_mismatch where written is on another unit.


virtualIndex()#

virtualIndex(manifest, id, path): number

Defined in: manifest/flowmaps.ts:362

The index of the virtual timeline id, or a refusal at path.

Parameters#

manifest#

Manifest

id#

string

path#

readonly PathSegment[]

Returns#

number