Skip to content

charton API


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? ​

optional actions?: boolean

Defined in: ui/src/command-palette.ts:23

List the commands on chart.actions under Actions. Default true.


debounce? ​

optional debounce?: 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? ​

optional hiddenActions?: readonly string[]

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? ​

optional keys?: readonly string[]

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? ​

optional shortcutScope?: "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? ​

optional sources?: readonly CommandSource[]

Defined in: ui/src/command-palette.ts:21

More entries, e.g. symbols or indicators; add or remove them later with addSource.

Methods ​

onOpenChange()? ​

optional onOpenChange(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