workspace/view#
Interfaces#
CanvasArrangement#
Defined in: workspace/view.ts:120
How the blocks of a workspace are arranged instead of standing at their
places: packed one under another, side by side, or in a matrix of
columns columns, in the order of their index.
Properties#
columns?#
readonlyoptionalcolumns?:number
Defined in: workspace/view.ts:123
A matrix’s number of columns, a positive integer; columnsOf where not stated. Only a matrix states it.
direction#
readonlydirection:"vertical"|"horizontal"|"matrix"
Defined in: workspace/view.ts:121
Granularity#
Defined in: workspace/view.ts:44
How finely a position on a timeline is picked and a float shown: a
fraction axis picks multiples of 1 / denominator at the finest, a float
axis decimals of at most decimals places, and a float is shown with
decimals places. An int axis picks integers at the finest and has no
setting.
Properties#
decimals#
readonlydecimals:number
Defined in: workspace/view.ts:48
The most decimal places a float is picked or shown with; an integer from 0 to 15.
denominator#
readonlydenominator:number
Defined in: workspace/view.ts:46
The finest fraction step is 1 / denominator; a positive safe integer.
ManifestFile#
Defined in: workspace/view.ts:77
How a block’s manifest is written to a file (FileForm) and, where the
editor knows it, where that file lies: location, its path relative to
the folder of the workspace’s own file (POSIX, as a manifest states its
resources relative to itself; .. leads out of that folder). A setting
of the workspace, never part of the manifest.
Extends#
FileForm
Properties#
location?#
readonlyoptionallocation?:string
Defined in: workspace/view.ts:78
MatchClaimFilter#
Defined in: workspace/view.ts:57
Which MatchClaims of a block’s MatchClaim table are shown: those between
two of the timelines timelines lists (every timeline where it is
null) whose state for the user is one of beliefs (the belief
filter, beliefMask).
Properties#
beliefs#
readonlybeliefs: readonlyBeliefState[]
Defined in: workspace/view.ts:61
The belief states kept, each once, in the order of BELIEF_STATES.
timelines#
readonlytimelines: readonlystring[] |null
Defined in: workspace/view.ts:59
The IDs of the timelines whose MatchClaims are shown, by code point; null for every timeline.
View#
Defined in: workspace/view.ts:135
A workspace: its name, settings, default rules, block arrangement and blocks by ID, an immutable plain-JavaScript value.
Properties#
arrangement?#
readonlyoptionalarrangement?:CanvasArrangement
Defined in: workspace/view.ts:146
How the blocks are arranged; absent where they stand at their places, as
a file without the member and a set of null leave it.
blocks#
readonlyblocks:object
Defined in: workspace/view.ts:147
Index Signature#
[id: string]: Block
graphical#
readonlygraphical:Graphical
Defined in: workspace/view.ts:141
The workspace’s default rules, between the built-in defaults and each manifest’s own.
meta#
readonlymeta:WorkspaceMeta
Defined in: workspace/view.ts:136
name#
readonlyname:string
Defined in: workspace/view.ts:138
The workspace’s name, the default name of its file (<name>.tle.json); never empty.
settings#
readonlysettings:WorkspaceSettings
Defined in: workspace/view.ts:139
WorkspaceMeta#
Defined in: workspace/view.ts:32
The format and version a workspace file states: the only ones this editor reads.
Properties#
format#
readonlyformat:"tilie-workspace"
Defined in: workspace/view.ts:33
version#
readonlyversion:8
Defined in: workspace/view.ts:34
WorkspaceSettings#
Defined in: workspace/view.ts:89
How the editor is used on this workspace: the canvas’s snapping grid, the
placement of new blocks, the granularity of positions on timelines, how
each block’s manifest is written to a file and which of its MatchClaims
are shown. The MatchClaim table itself is never held. No command changes a
setting, so the journal neither records nor undoes them
(Store.configure).
Properties#
blockDefaults#
readonlyblockDefaults:BlockPlacement
Defined in: workspace/view.ts:91
granularity#
readonlygranularity:Granularity
Defined in: workspace/view.ts:92
grid#
readonlygrid:object
Defined in: workspace/view.ts:90
size#
readonlysize:number
snap#
readonlysnap:boolean
manifests#
readonlymanifests:object
Defined in: workspace/view.ts:99
How the manifest of a block is written to a file and where that file
lies, by block ID; a block without an entry as NEW_MANIFEST_FILE
(manifestFileOf). An entry outlives its block, which the journal may
bring back.
Index Signature#
[block: string]: ManifestFile
matchClaimFilters#
readonlymatchClaimFilters:object
Defined in: workspace/view.ts:106
The MatchClaim filter of a block, by block ID; a block without an entry
as DEFAULT_MATCH_CLAIM_FILTER (matchClaimFilterOf). An entry
outlives its block, and its timelines may name timelines its manifest
no longer holds.
Index Signature#
[block: string]: MatchClaimFilter
Type Aliases#
CanvasDirection#
CanvasDirection = typeof
CANVAS_DIRECTIONS[number]
Defined in: workspace/view.ts:113
A direction the blocks of a workspace may be arranged in.
Variables#
CANVAS_DIRECTIONS#
constCANVAS_DIRECTIONS: readonly ["vertical","horizontal","matrix"]
Defined in: workspace/view.ts:110
The directions the blocks of a workspace may be arranged in.
DEFAULT_GRANULARITY#
constDEFAULT_GRANULARITY:Granularity
Defined in: workspace/view.ts:161
The default granularity: 2520 = lcm(1, …, 10) reaches every tuplet up to tens; floats to three places.
DEFAULT_MATCH_CLAIM_FILTER#
constDEFAULT_MATCH_CLAIM_FILTER:MatchClaimFilter
Defined in: workspace/view.ts:65
The filter of a block that states none: every timeline, every belief state but false.
DEFAULT_SETTINGS#
constDEFAULT_SETTINGS:WorkspaceSettings
Defined in: workspace/view.ts:171
The settings of a new workspace: an 8-unit grid that snaps, new blocks at
scale 1 and length 400 with spacing 8, no margin and no width or height,
DEFAULT_GRANULARITY, and no manifest file or MatchClaim filter entries.
MAX_DECIMALS#
constMAX_DECIMALS:15=15
Defined in: workspace/view.ts:164
The most decimal places decimals may state.
PLACEMENT_READERS#
constPLACEMENT_READERS: { readonly [M in keyof BlockPlacement]-?: (value: unknown, path: readonly PathSegment[]) => BlockPlacement[M] | Problem }
Defined in: workspace/view.ts:195
The reader of each member of a block’s placement, as a block and the block defaults store it.
UNTITLED_WORKSPACE#
constUNTITLED_WORKSPACE:"untitled"="untitled"
Defined in: workspace/view.ts:158
The name of a new workspace, and of one read from a file that states none.
WORKSPACE_META#
constWORKSPACE_META:WorkspaceMeta
Defined in: workspace/view.ts:155
The format and version of the workspaces this editor reads and writes.
Version 8 journals the ID of every element a command creates in the
command (ids); an older journal lacks them, so its file is refused.
Functions#
checkWorkspace()#
checkWorkspace(
view):Problem[]
Defined in: workspace/view.ts:629
Every problem of a view, block by block in id order, at its path in the view.
Parameters#
view#
Returns#
Problem[]
columnsOf()#
columnsOf(
arrangement,count):number
Defined in: workspace/view.ts:127
The number of columns of a matrix of count blocks: the stated one, else the smallest whose square holds them (at least 1).
Parameters#
arrangement#
count#
number
Returns#
number
createView()#
createView(
settings?):View
Defined in: workspace/view.ts:190
An empty workspace with the given settings, named untitled.
Parameters#
settings?#
WorkspaceSettings = DEFAULT_SETTINGS
Returns#
isRelativeLocation()#
isRelativeLocation(
location):boolean
Defined in: workspace/view.ts:328
Whether location is a relative POSIX path, the one form a file’s location
takes: non-empty, no leading /, no scheme or drive such as file: or
C: (a URL is no location), no backslash.
Parameters#
location#
string
Returns#
boolean
manifestFileOf()#
manifestFileOf(
settings,block):ManifestFile
Defined in: workspace/view.ts:180
How the manifest of block block is written to a file: its entry in settings, else NEW_MANIFEST_FILE.
Parameters#
settings#
block#
string
Returns#
matchClaimFilterOf()#
matchClaimFilterOf(
settings,block):MatchClaimFilter
Defined in: workspace/view.ts:185
Which MatchClaims of block block are shown: its entry in settings, else DEFAULT_MATCH_CLAIM_FILTER.
Parameters#
settings#
block#
string
Returns#
placeMemberProblem()#
placeMemberProblem(
ref,place,path,code?):Problem|undefined
Defined in: workspace/view.ts:547
The first member place, the place of ref (a frame’s or a card’s),
states beyond those placeMembersOf(ref) allows, as a problem of code
at path followed by that member; undefined when it states only those.
Only a member’s card is so limited: to its size, spacing and margin.
Parameters#
ref#
place#
object
path#
readonly PathSegment[]
code?#
ErrorCode = ErrorCode.unknownMember
Returns#
Problem | undefined
placeProblems()#
placeProblems(
block,path):Problem[]
Defined in: workspace/view.ts:575
The problems of a block’s places, in code-point order of its keys and
then of each entry’s cards, each at path followed by places, the key
and below: a key naming no group and no ungrouped root
(unknown_place; a member’s card lies in its group’s cards, never at
the top under the member’s ID), cards on an entry that is no group’s
(unknown_member), a key of cards naming no member of the group
(unknown_place), and a place stating a member its container may not
state (placeMemberProblem).
Parameters#
block#
Pick<Block, "id" | "places" | "manifest">
path#
readonly PathSegment[]
Returns#
Problem[]
readCanvasArrangement()#
readCanvasArrangement(
value,path):Problem|CanvasArrangement|null
Defined in: workspace/view.ts:273
The workspace’s arrangement as a set gives it or a file states it:
null for none, else {direction, columns?}, direction "vertical",
"horizontal" or "matrix", columns a positive integer that only a
matrix states.
Parameters#
value#
unknown
path#
readonly PathSegment[]
Returns#
Problem | CanvasArrangement | null
readItemArrangement()#
readItemArrangement(
value,path):Problem|ItemArrangement|null
Defined in: workspace/view.ts:251
A block’s arrangement as a set gives it or a file states it: null
for none, else {direction, order}, direction "vertical" or
"horizontal", order a list of IDs, kept as given: an ID naming no
item or named again is valid (itemOrder passes over the one and takes
the other at its first mention).
Parameters#
value#
unknown
path#
readonly PathSegment[]
Returns#
Problem | ItemArrangement | null
readSettings()#
readSettings(
value,path,problems,lenient?):WorkspaceSettings|undefined
Defined in: workspace/view.ts:457
Read workspace settings, every member required and none unknown; the
problems go to problems and the result is undefined when there are any.
With lenient, as a workspace file is read, a granularity that does not
read as one (missing, or of another shape) is read as DEFAULT_GRANULARITY,
a manifests or matchClaimFilters that is missing or no object as none
and each of its entries that does not read is left out, without a problem: settings lie outside the
journal, so nothing a replay needs is lost. Every other member is read
strictly either way.
Parameters#
value#
unknown
path#
readonly PathSegment[]
problems#
Problem[]
lenient?#
boolean = false
Returns#
WorkspaceSettings | undefined
structureProblems()#
structureProblems(
view,manifests?):Problem[]
Defined in: workspace/view.ts:638
The problems of a view’s blocks, in id order: their ids, parents,
indices and placement, the keys of their places, and with
manifests their manifests too.
Parameters#
view#
manifests?#
boolean = false
Returns#
Problem[]