matches/beliefs#

Interfaces#

ClaimBeliefs#

Defined in: matches/beliefs.ts:34

Every MatchClaim’s beliefs: those of offsets[row] up to offsets[row + 1] in actor (an index into actors) and word (an index into BELIEFS). offsets has one entry more than there are rows.

Properties#

actor#

readonly actor: Uint32Array

Defined in: matches/beliefs.ts:37

actors#

readonly actors: readonly string[]

Defined in: matches/beliefs.ts:35

offsets#

readonly offsets: Uint32Array

Defined in: matches/beliefs.ts:36

word#

readonly word: Uint8Array

Defined in: matches/beliefs.ts:38

Type Aliases#

AnchorBelief#

AnchorBelief = typeof ANCHOR_BELIEFS[number]

Defined in: matches/beliefs.ts:88

A belief an alignment anchor is drawn by.

Variables#

ANCHOR_BELIEFS#

const ANCHOR_BELIEFS: readonly ["false", "unlikely", "undecided", "true"]

Defined in: matches/beliefs.ts:86

The beliefs an alignment anchor of a shown MatchStamp is drawn by, the most critical first: an anchor stated by several MatchClaims takes the first of their beliefs in this order, undecided where the believer states none.

Functions#

actorIri()#

actorIri(context, actor): string

Defined in: matches/beliefs.ts:48

The IRI an actor stands for under context (a manifest’s @context, or any object of prefixes; null declares none): a compact IRI expanded by its prefix (TimeToShare’s expandIri), else the actor as written. Two actors are one when their IRIs are equal, so a compact and an absolute IRI of one person name the same actor.

Parameters#

context#

unknown

actor#

string

Returns#

string


anchorBelief()#

anchorBelief(believed, rows): "true" | "undecided" | "unlikely" | "false"

Defined in: matches/beliefs.ts:138

The belief an alignment anchor stated by the MatchClaims of rows is drawn by, believed the believer’s per row (believedBy): the most critical among them, undecided for none.

Parameters#

believed#

Uint8Array

rows#

ArrayLike<number>

Returns#

"true" | "undecided" | "unlikely" | "false"


beliefMask()#

beliefMask(beliefs, believer, kept?, context?): Uint8Array<ArrayBufferLike> | null

Defined in: matches/beliefs.ts:63

The belief filter’s row mask, which the anchor index takes: 1 for every row whose state for the believer (believedBy: the believer’s belief, the most critical of several, undecided where the believer holds none) is one of kept. null (nothing filtered) without a believer, and when kept holds all four states. The believer and every actor compare as their IRIs under context (actorIri).

Parameters#

beliefs#

ClaimBeliefs

believer#

string | null

kept?#

readonly BeliefState[] = DEFAULT_BELIEFS

context?#

unknown = null

Returns#

Uint8Array<ArrayBufferLike> | null

Throws#

Error for a word of kept that is no belief state (TimeToShare’s checkBeliefFilter, its message).


believedBy()#

believedBy(beliefs, believer, context?): Uint8Array

Defined in: matches/beliefs.ts:107

The believer’s belief in every MatchClaim, per row its number in ANCHOR_BELIEFS: undecided where the believer states none, the most critical where the believer states several (two actors standing for the believer’s IRI); actors compare as their IRIs under context (actorIri), as everywhere the editor compares actors. The same array for the same beliefs, believer and context, made again only when one of them changes.

Parameters#

beliefs#

ClaimBeliefs

believer#

string

context?#

unknown = null

Returns#

Uint8Array