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#
message#
string
path#
readonly PathSegment[]
Returns#
Overrides#
Error.constructor
Properties#
code#
readonlycode:FlowMapErrorCode
Defined in: manifest/flowmaps.ts:68
path#
readonlypath: readonlyPathSegment[]
Defined in: manifest/flowmaps.ts:69
Interfaces#
Axis#
Defined in: manifest/flowmaps.ts:155
An axis: a unit and a number type.
Properties#
numberType#
readonlynumberType:NumberType
Defined in: manifest/flowmaps.ts:157
unit#
readonlyunit:TimeUnit
Defined in: manifest/flowmaps.ts:156
FlowChunk#
Defined in: manifest/flowmaps.ts:89
One entry of a FlowMap’s chunks, resolved.
Properties#
index#
readonlyindex:number
Defined in: manifest/flowmaps.ts:92
Its index in the FlowMap’s chunks.
kind#
readonlykind:FlowChunkKind
Defined in: manifest/flowmaps.ts:90
played#
readonlyplayed:Stretch
Defined in: manifest/flowmaps.ts:101
Where it lies on the virtual axis.
source#
readonlysource:string|null
Defined in: manifest/flowmaps.ts:94
The ID it names; null for a gap.
written#
readonlywritten: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#
readonlychunk:FlowChunk
Defined in: manifest/flowmaps.ts:122
count#
readonlycount: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#
readonlychunk:number|null
Defined in: manifest/flowmaps.ts:151
The index of the chunk it lies in; null through a conversion map.
occurrence#
readonlyoccurrence:number
Defined in: manifest/flowmaps.ts:148
of#
readonlyof:number
Defined in: manifest/flowmaps.ts:149
played#
readonlyplayed: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#
readonlychunk:number
Defined in: manifest/flowmaps.ts:113
The index of its chunk in chunks.
played#
readonlyplayed:Stretch
Defined in: manifest/flowmaps.ts:111
written#
readonlywritten: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#
readonlychunks: readonlyFlowChunk[]
Defined in: manifest/flowmaps.ts:136
flowMap#
readonlyflowMap:string
Defined in: manifest/flowmaps.ts:129
The FlowMap’s ID.
length#
readonlylength:Coordinate
Defined in: manifest/flowmaps.ts:142
The length of the virtual axis: the chunks and gaps together.
numberType#
readonlynumberType:NumberType
Defined in: manifest/flowmaps.ts:135
The number type of both axes, the root’s.
runs#
readonlyruns: readonlyFlowRun[]
Defined in: manifest/flowmaps.ts:140
The runs of chunks naming one ID, in order: every chunk lies in exactly one.
stretches#
readonlystretches: readonlyPlayedStretch[]
Defined in: manifest/flowmaps.ts:138
The stretches in the order played, each placed where the one before it ends.
timeline#
readonlytimeline:string
Defined in: manifest/flowmaps.ts:131
The root timeline’s ID.
unit#
readonlyunit: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#
readonlyend:Coordinate
Defined in: manifest/flowmaps.ts:82
start#
readonlystart: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#
constZERO: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#
virtual#
{ }
rootId#
string
visiting#
readonly string[]
at#
readonly PathSegment[]
Returns#
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#
played#
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#
value#
Returns#
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#
position#
what#
string
Returns#
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#
flowMapId#
string
Returns#
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#
written#
Returns#
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#
id#
string
path#
readonly PathSegment[]
Returns#
number