matchClaims.svelte#

Classes#

MatchClaimTables#

Defined in: editor/src/matchClaims.svelte.ts:348

The MatchClaim tables held for the open workspace’s blocks, one per block, read through a server.

Constructors#

Constructor#

new MatchClaimTables(server, options?): MatchClaimTables

Defined in: editor/src/matchClaims.svelte.ts:376

The tables read through server (null: no server, so no table is ever read), as options say what is known of it now: whether it computes, the user’s files it offers, why its health check failed. A table is read only through a server that computes; where it offers no files, the files a manifest names are not looked for beside it.

Parameters#
server#

MatchClaimServer | null

options?#

TablesOptions = {}

Returns#

MatchClaimTables

Accessors#

blocks#
Get Signature#

get blocks(): readonly string[]

Defined in: editor/src/matchClaims.svelte.ts:423

The blocks holding a table, in the order their tables were loaded.

Returns#

readonly string[]

changed#
Get Signature#

get changed(): readonly ChangedTable[]

Defined in: editor/src/matchClaims.svelte.ts:428

The tables holding beliefs not saved yet, in the order they were loaded.

Returns#

readonly ChangedTable[]

unavailable#
Get Signature#

get unavailable(): string | null

Defined in: editor/src/matchClaims.svelte.ts:391

Why no server can read a table now, HOW_TO_START_A_SERVER after the failure of the server’s health check where it failed: no server is given, or it has not answered its health check; null while one can, whether or not it offers the user’s files. Nothing asks the user for a table then.

Returns#

string | null

waiting#
Get Signature#

get waiting(): boolean

Defined in: editor/src/matchClaims.svelte.ts:399

Whether the server given has not answered its health check yet, nor failed it: nobody can tell yet whether it will read tables.

Returns#

boolean

Methods#

believe()#

believe(block, manifest, belief): Promise<string | null>

Defined in: editor/src/matchClaims.svelte.ts:740

Record belief in block block’s table through the server, checked against manifest: the server answers the new file, which is read again and held as the block’s table, marked changed. null once it is held, else why not (the table is kept): while no server reads tables, asking nothing, unavailable.

Parameters#
block#

string

manifest#

Manifest

belief#

StatedBelief

Returns#

Promise<string | null>

choose()#

choose(block, manifest): Promise<TableMessages>

Defined in: editor/src/matchClaims.svelte.ts:543

Let the user choose the MatchClaim table of block block’s manifest manifest (Load MatchClaims…): its file, located in the file dialog (picked in the browser’s picker where the server offers no files), or a URL; then load it as loadNamed loads it. While no server can read a table nothing is asked and unavailable is the failure.

Parameters#
block#

string

manifest#

Manifest

Returns#

Promise<TableMessages>

clear()#

clear(): void

Defined in: editor/src/matchClaims.svelte.ts:501

Forget every table and where every manifest came from: another workspace was opened.

Returns#

void

events()#

events(block, manifest, claims): Promise<readonly ClaimEvents[]> | null

Defined in: editor/src/matchClaims.svelte.ts:708

The events on both sides of the MatchClaims claims of block block’s table, in that order (ClaimEvents: each side’s timeline, event ID and name; the certainty; whether it states synchrony), read through the server with manifest: asked once per table and list of claims, the promise kept while the table is held (a failed one is let go, so asking again asks the server again; eventsFailure words its error). null, asking nothing, while no server reads tables (unavailable says why) or without a table.

Parameters#
block#

string

manifest#

Manifest

claims#

readonly string[]

Returns#

Promise<readonly ClaimEvents[]> | null

hold()#

hold(block, loaded): void

Defined in: editor/src/matchClaims.svelte.ts:435

Hold loaded as the table of block block, replacing any held.

Parameters#
block#

string

loaded#

LoadedTable

Returns#

void

load()#

load(block, manifest, file, name): Promise<string | null>

Defined in: editor/src/matchClaims.svelte.ts:654

Read the MatchClaim table file, called name, through the server, checked against manifest (written as its file writes it), as the table of block block: null once it is held, else why not (HOW_TO_START_A_SERVER without a server, loadFailure when the server refuses it or fails).

Parameters#
block#

string

manifest#

Manifest

file#

Blob

name#

string

Returns#

Promise<string | null>

loadNamed()#

loadNamed(block, manifest): Promise<TableMessages>

Defined in: editor/src/matchClaims.svelte.ts:517

Load the MatchClaim table block block’s manifest manifest names, when it names one and the block holds none (what Show matches asks): named by an absolute http or https URL, fetched from there; otherwise from where the manifest came from (#sourceOf) where it lies there; either silently, else as the user chooses it in one question (#tableQuestion after a URL, else #question; cancelled, it is left), read through the server (load). While no server can read a table (unavailable) nothing is asked and nothing said: the caller says it once (WorkspaceSession.loadNamedTables).

Parameters#
block#

string

manifest#

Manifest

Returns#

Promise<TableMessages>

locate()#

locate(block, source): void

Defined in: editor/src/matchClaims.svelte.ts:441

Block block’s manifest came from source (an example): the files it names are read from there.

Parameters#
block#

string

source#

ManifestSource

Returns#

void

of()#

of(block): LoadedTable | null

Defined in: editor/src/matchClaims.svelte.ts:418

The table of block block; null while none is loaded.

Parameters#
block#

string

Returns#

LoadedTable | null

provenance()#

provenance(block, manifest, claims): Promise<readonly ClaimProvenance[]> | null

Defined in: editor/src/matchClaims.svelte.ts:673

The provenance of the MatchClaims claims of block block’s table, in that order, read through the server with manifest: asked once per table and list of claims, the promise kept while the table is held (a failed one is let go, so asking again asks the server again). null, asking nothing, while no server reads tables (unavailable says why) or without a table.

Parameters#
block#

string

manifest#

Manifest

claims#

readonly string[]

Returns#

Promise<readonly ClaimProvenance[]> | null

save()#

save(block): Promise<string | null>

Defined in: editor/src/matchClaims.svelte.ts:763

Save block block’s changed table, offered under its file’s name: the name it was saved under, after which it is no longer changed (if still held); null when it is not changed or the viewer cancelled. A failure to write throws.

Parameters#
block#

string

Returns#

Promise<string | null>

Interfaces#

ChangedTable#

Defined in: editor/src/matchClaims.svelte.ts:69

A block’s table holding beliefs the user has not saved yet.

Properties#

block#

readonly block: string

Defined in: editor/src/matchClaims.svelte.ts:70

loaded#

readonly loaded: LoadedTable

Defined in: editor/src/matchClaims.svelte.ts:71


LoadedTable#

Defined in: editor/src/matchClaims.svelte.ts:59

What a block’s table is read from: its file’s name, the server’s answer and the file.

Properties#

changed#

readonly changed: boolean

Defined in: editor/src/matchClaims.svelte.ts:65

Whether file holds beliefs the user has not saved yet.

file#

readonly file: Blob

Defined in: editor/src/matchClaims.svelte.ts:63

The Parquet file the table was read from: the picked one, or the server’s after a belief.

name#

readonly name: string

Defined in: editor/src/matchClaims.svelte.ts:60

table#

readonly table: MatchClaimTable

Defined in: editor/src/matchClaims.svelte.ts:61


ManifestPlaces#

Defined in: editor/src/matchClaims.svelte.ts:114

The user’s files on the server, as the tables reach them: read by path from the server’s root, the path of the file each block’s manifest came from (the workspace states it), and the editor’s file dialog.

Properties#

files#

readonly files: FileReader

Defined in: editor/src/matchClaims.svelte.ts:115

Methods#

choose()#

choose(kinds, near): Promise<string | null>

Defined in: editor/src/matchClaims.svelte.ts:125

Let the user choose a file of one of kinds in the editor’s file dialog, starting in the folder of the file near (else where the dialog starts); its path, null when they cancel.

Parameters#
kinds#

readonly FileKind[]

near#

string | null

Returns#

Promise<string | null>

located()#

located(block, path): void

Defined in: editor/src/matchClaims.svelte.ts:119

The user located block block’s manifest at the file path: the workspace keeps it.

Parameters#
block#

string

path#

string

Returns#

void

pathOf()#

pathOf(block): string | null

Defined in: editor/src/matchClaims.svelte.ts:117

The path of the file block block’s manifest came from; null where the workspace states none.

Parameters#
block#

string

Returns#

string | null


ManifestSource#

Defined in: editor/src/matchClaims.svelte.ts:90

Where a block’s manifest came from, as far as the files it names can be read from there: a served example, or the folder of its file on the server. A manifest picked from the user’s system has none.

Methods#

read()#

read(url): Promise<Blob | null>

Defined in: editor/src/matchClaims.svelte.ts:96

The file at url, a location as the manifest’s resources state it (relative to the manifest); null when it cannot be reached from there. Rejects when reading it failed.

Parameters#
url#

string

Returns#

Promise<Blob | null>


NamedTable#

Defined in: editor/src/matchClaims.svelte.ts:81

The MatchClaim table a manifest names: its location (null where it names none).

Properties#

url#

readonly url: string | null

Defined in: editor/src/matchClaims.svelte.ts:82


TableMessages#

Defined in: editor/src/matchClaims.svelte.ts:156

What a load has to say in the message bar: information, and the failures, shown as errors.

Properties#

failed#

readonly failed: readonly string[]

Defined in: editor/src/matchClaims.svelte.ts:158

informed#

readonly informed: readonly string[]

Defined in: editor/src/matchClaims.svelte.ts:157


TableRequest#

Defined in: editor/src/matchClaims.svelte.ts:146

What the user is asked to choose: the MatchClaim table of the manifest called manifest.

Properties#

manifest#

readonly manifest: string

Defined in: editor/src/matchClaims.svelte.ts:147

question#

readonly question: TableQuestion

Defined in: editor/src/matchClaims.svelte.ts:149

table#

readonly table: NamedTable

Defined in: editor/src/matchClaims.svelte.ts:148


TablesOptions#

Defined in: editor/src/matchClaims.svelte.ts:330

What the tables know of their server now, and how they ask the user; every member optional.

Properties#

ask?#

readonly optional ask?: AskTables | null

Defined in: editor/src/matchClaims.svelte.ts:332

Ask the user for the files of tables; without it never asked, as if they cancelled.

computes?#

readonly optional computes?: () => boolean

Defined in: editor/src/matchClaims.svelte.ts:337

Whether the server answered its health check now, so it computes: a table is read through it only then. Without it, never.

Returns#

boolean

failure?#

readonly optional failure?: () => string | null

Defined in: editor/src/matchClaims.svelte.ts:344

Why the server’s health check failed now, null while it has not. Without it, never.

Returns#

string | null

places?#

readonly optional places?: () => ManifestPlaces | null

Defined in: editor/src/matchClaims.svelte.ts:342

The user’s files on the server as far as it offers them now (null: it offers none, or has not answered yet). Without it, never.

Returns#

ManifestPlaces | null

Type Aliases#

AskTables#

AskTables = (request) => Promise<TableChoice | null>

Defined in: editor/src/matchClaims.svelte.ts:153

Ask the user for the file of request’s table: what they chose, null when they cancel.

Parameters#

request#

TableRequest

Returns#

Promise<TableChoice | null>


Located#

Located = { path: string; } | { file: File; }

Defined in: editor/src/matchClaims.svelte.ts:104

A file the user located: the path of a file on the server, the manifest’s or the table’s as the question asked (TableQuestion), or a table’s file picked in the browser, which has no path.


MatchClaimServer#

MatchClaimServer = Pick<Server, "matchClaims" | "matchClaimProvenance" | "believeMatchClaim" | "matchClaimEvents">

Defined in: editor/src/matchClaims.svelte.ts:75

What the tables need of a server: the table route, the provenance routes and the events route.


TableChoice#

TableChoice = { url: string; } | Located

Defined in: editor/src/matchClaims.svelte.ts:107

What the user chose: a URL of the table, or a file located (Located).


TableQuestion#

TableQuestion = { kind: "manifest"; locate: () => Promise<Located | null>; } | { kind: "table"; locate: () => Promise<Located | null>; missing: string | null; }

Defined in: editor/src/matchClaims.svelte.ts:137

The question the user is asked: where the manifest lies (manifest, for a block whose manifest’s file the workspace does not state), or the table’s file (table; missing the manifest’s path where the table is not beside it, null when the user asked to load one or no path is known). locate lets the user locate the file asked for: in the editor’s file dialog where the server offers the user’s files, else, for a table, in the browser’s picker; null when they cancel.

Variables#

HOW_TO_START_A_SERVER#

const HOW_TO_START_A_SERVER: string

Defined in: editor/src/matchClaims.svelte.ts:245

While no server can read a table, what is said wherever matches are asked for (Show matches turned on, Load MatchClaims… without a server, the disabled controls’ hints): that sentence, then how to start the server (the command the repository’s README starts it from the source tree with). Plain text: every place shows it as such.


MATCHES_NEED_A_SERVER#

const MATCHES_NEED_A_SERVER: "Matches need a running tilie-server." = "Matches need a running tilie-server."

Defined in: editor/src/matchClaims.svelte.ts:233

The first sentence of HOW_TO_START_A_SERVER: why matches cannot be shown.


NO_MATCHES#

const NO_MATCHES: "No MatchClaim table loaded." = "No MatchClaim table loaded."

Defined in: editor/src/matchClaims.svelte.ts:236

The information turning Show matches on gives where no block holds a MatchClaim table then.

Functions#

beliefFailure()#

beliefFailure(claim, error): string

Defined in: editor/src/matchClaims.svelte.ts:279

Why the belief in claim was not recorded, from the server’s failure error.

Parameters#

claim#

string

error#

unknown

Returns#

string


eventsFailure()#

eventsFailure(error): string

Defined in: editor/src/matchClaims.svelte.ts:293

Why the events of MatchClaims were not read, from the server’s failure error.

Parameters#

error#

unknown

Returns#

string


fileNameOf()#

fileNameOf(url): string

Defined in: editor/src/matchClaims.svelte.ts:178

The last part of a location: the file name a picker gives for it.

Parameters#

url#

string

Returns#

string


loadFailure()#

loadFailure(name, error): string

Defined in: editor/src/matchClaims.svelte.ts:270

Why name was not loaded, from the server’s failure error.

Parameters#

name#

string

error#

unknown

Returns#

string


manifestTitle()#

manifestTitle(manifest): string

Defined in: editor/src/matchClaims.svelte.ts:183

How a manifest is called in a message or the dialog’s title: its name, else its ID, else “The manifest”.

Parameters#

manifest#

Manifest

Returns#

string


namedTable()#

namedTable(manifest): string | null

Defined in: editor/src/matchClaims.svelte.ts:167

The location of the MatchClaim table manifest names in its resources (the first resource of type MatchClaim), null where it names none.

Parameters#

manifest#

Manifest

Returns#

string | null


provenanceFailure()#

provenanceFailure(error): string

Defined in: editor/src/matchClaims.svelte.ts:288

Why the provenance was not read, from the server’s failure error.

Parameters#

error#

unknown

Returns#

string


saveFailure()#

saveFailure(error): string

Defined in: editor/src/matchClaims.svelte.ts:302

Why a table was not saved, from the failure error.

Parameters#

error#

unknown

Returns#

string


unsavedQuestion()#

unsavedQuestion(workspace, tables): string

Defined in: editor/src/matchClaims.svelte.ts:318

The one question asked before unsaved work is dropped, naming it: the workspace’s file workspace when the workspace has unsaved changes (null when it has none), then the changed MatchClaim tables tables by their file names, in the order they were loaded. At least one of the two names something.

Parameters#

workspace#

string | null

tables#

readonly string[]

Returns#

string