Skip to content

charton API


charton API / @chart-on/ui / index / CommandSource

Interface: CommandSource ​

Defined in: ui/src/command-palette-model.ts:30

Where the palette's entries come from. The palette lists chart.actions itself; an app adds sources for anything else, e.g. symbols or indicators.

Properties ​

id ​

id: string

Defined in: ui/src/command-palette-model.ts:32

Unique among the palette's sources.


label ​

label: string

Defined in: ui/src/command-palette-model.ts:34

Category name in the palette, e.g. Symbols.


ranked? ​

optional ranked?: boolean

Defined in: ui/src/command-palette-model.ts:42

The source already filtered and ordered its entries for the query; the palette keeps them as they are. Default false.

Methods ​

entries() ​

entries(query, signal): readonly CommandEntry[] | Promise<readonly CommandEntry[]>

Defined in: ui/src/command-palette-model.ts:40

The entries for query (empty when nothing is typed). A list the palette filters and ranks itself, or a promise for a server-side search; signal aborts when the query changes or the palette closes.

Parameters ​

query ​

string

signal ​

AbortSignal

Returns ​

readonly CommandEntry[] | Promise<readonly CommandEntry[]>