Skip to content

charton API


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

Interface: SymbolSearchOptions<T> ​

Defined in: ui/src/symbol-search.ts:24

Options for createSymbolSearch: the result source, the pick callback, search debounce and page size, type-to-open, and where its shortcut is heard.

Type Parameters ​

T ​

T extends SymbolSearchResult = SymbolSearchResult

Properties ​

chart? ​

optional chart?: Pick<Chart, "localization">

Defined in: ui/src/symbol-search.ts:49

The chart whose localization option sets the dialog's language, read each time it opens. The shell passes its chart. Default: built-in English.


debounce? ​

optional debounce?: number

Defined in: ui/src/symbol-search.ts:30

Wait this long after the last keystroke before searching, in ms. Default 200.


favorites? ​

optional favorites?: FavoritesList | null

Defined in: ui/src/symbol-search.ts:57

Starred symbols (by symbol), e.g. the shell's favorites.of('symbol'), which the shell passes when it has the favorites part. Each result gets a star, and with an empty search box and no filters the starred symbols are listed first. Each is looked up through source; one it no longer finds shows as unavailable and stays starred.


onSelect ​

onSelect: (result) => void

Defined in: ui/src/symbol-search.ts:28

Called with the picked result after the dialog has closed.

Parameters ​

result ​

T

Returns ​

void


openOnTyping? ​

optional openOnTyping?: false | HTMLElement

Defined in: ui/src/symbol-search.ts:39

Typing a letter or digit while this element has focus opens the dialog with that character. In a shell, by default, typing on the chart or elsewhere in the shell outside text fields does, except keys bound to an action; false turns this off.


pageSize? ​

optional pageSize?: number

Defined in: ui/src/symbol-search.ts:32

Results per page. Default 50.


shortcutScope? ​

optional shortcutScope?: "shell" | "document"

Defined in: ui/src/symbol-search.ts:44

In a shell: where the symbol-search shortcut (Mod+K, /) is heard. 'shell' (default) anywhere in the shell, 'document' anywhere on the page.


source ​

source: SymbolSearchSource<T>

Defined in: ui/src/symbol-search.ts:26

Where results come from, e.g. a data source.