charton API / @chart-on/ui / index / CommandPaletteOptions
Interface: CommandPaletteOptions
Defined in: ui/src/command-palette.ts:19
Options for createCommandPalette: entry sources, which chart.actions to list, its shortcut and where it is heard, search debounce, and an open/close callback.
Properties
actions?
optionalactions?:boolean
Defined in: ui/src/command-palette.ts:23
List the commands on chart.actions under Actions. Default true.
debounce?
optionaldebounce?:number
Defined in: ui/src/command-palette.ts:37
Wait this long after the last keystroke before asking the sources, in ms. Default 0.
hiddenActions?
optionalhiddenActions?: readonlystring[]
Defined in: ui/src/command-palette.ts:25
Ids of actions to leave out of the list. The palette's own action is never listed.
keys?
optionalkeys?: readonlystring[]
Defined in: ui/src/command-palette.ts:30
Default shortcuts of the command-palette action. Default ['Mod+K']. Users and apps rebind it like any action, with chart.actions.setKeys or the keymap.
shortcutScope?
optionalshortcutScope?:"shell"|"document"
Defined in: ui/src/command-palette.ts:35
Where the shortcut is heard besides the focused chart: 'shell' (default) anywhere in host, 'document' anywhere on the page.
sources?
optionalsources?: readonlyCommandSource[]
Defined in: ui/src/command-palette.ts:21
More entries, e.g. symbols or indicators; add or remove them later with addSource.
Methods
onOpenChange()?
optionalonOpenChange(open):void
Defined in: ui/src/command-palette.ts:39
Called after the palette opened or closed, e.g. to refresh a toolbar button's pressed state.
Parameters
open
boolean
Returns
void