HookOptions
The options that every hook of ctx.hooks accepts. They state for which changes the app calls the hook, and what happens when the hook itself fails.
Example
Section titled “Example”// Called for every deletion of a row. The deletion is refused if the hook fails.ctx.hooks.shouldDelete({ on: 'row', onTimeout: 'veto' }, hook);
// Called only for the deletion of rows and of outlines.ctx.hooks.shouldDelete({ topics: ['row.delete', 'outline.delete'] }, hook);Properties
Section titled “Properties”readonly on?: string;A kind of thing: row, outline, area or search. The hook receives every topic that concerns this kind of thing.
onTimeout?
Section titled “onTimeout?”readonly onTimeout?: "allow" | "veto";What happens when the hook throws an error or takes too long: allow lets the change go through, and veto refuses it. The default is allow.
topics?
Section titled “topics?”readonly topics?: readonly string[];The topics that the hook listens to, for example row.delete, row.* or *. A topic names a kind of change to a kind of thing. When neither topics nor on is given, the hook receives every topic (*).
