Skip to content

ViewContext

What the compute function of a view receives, besides the arguments of the view: the state of the library, the current time, and the means to search.

readonly lookup: QueryLookup;

What a search can look up in the indexes.


readonly now: number;

The current time, in milliseconds.


readonly state: StateView;

The state of the library.

order(ids, options?): QueryHit[];

Puts rows in the order of the library. Rows that a filter hides for this person, such as the rows of other people, are left out unless unfiltered is true.

Parameter Type Description
ids Iterable<string> the ids of the rows
options? { unfiltered?: boolean; } unfiltered keeps the rows that a filter would hide
options.unfiltered? boolean -

QueryHit[]

the rows, in order


parseDay(text): string | null;

Reads a day that is written as a date or in words.

Parameter Type Description
text string the text, for example 2026-11-24 or friday

string | null

the day, or null when the text is not a day


run(query, options?): QueryHit[];

Runs a search.

Parameter Type Description
query string the text of the search
options? QueryOptions the options of the search

QueryHit[]

the rows that match