Skip to content

ViewDeclaration

How a plugin computes a view: a function that produces the list, and the conditions under which the list must be computed again. A view is an ordered list of plain items, each identified by a key. The screen opens it by name, and then receives each change to it as it happens.

Type Parameter Default type Description
A unknown the type of the arguments that the view accepts
readonly byText?: boolean;

When false, the rows that the list contains never depend on words, as is the case for a tag or for Today. An edited title or note then affects the list only where that row appears.


readonly time?: boolean;

When true, the list depends on the time of day, so the app computes it again when the clock advances.

compute(args, context): PluginViewItem[];

Produces the items of the list.

Parameter Type Description
args A the arguments with which the screen opened the view
context ViewContext the state of the library and the means to search

PluginViewItem[]

the items, in order


touches?(change): boolean;

Says whether a change could alter the view. Without it, every change to a row, an outline or a search counts. A view that returns false for changes that cannot alter it is not worked out again for them.

Parameter Type Description
change Change the change to examine

boolean

true when the change could alter the view