Skip to content

charton API


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

Interface: FavoritesOptions ​

Defined in: ui/src/favorites.ts:28

The shell's favorites option: the starting favourite drawing tools, bar visibility and layout, and where they are saved.

Properties ​

bar? ​

optional bar?: boolean

Defined in: ui/src/favorites.ts:32

Show the favourites bar while it has tools; when storage holds none yet. Default true.


kinds? ​

optional kinds?: FavoritesKind[]

Defined in: ui/src/favorites.ts:48

Limits and behaviour of kinds, built-in or the app's own; shell.favorites.registerKind adds more later.


orientation? ​

optional orientation?: FavoritesBarOrientation

Defined in: ui/src/favorites.ts:34

Layout of the bar when storage holds none yet. Default horizontal.


settings? ​

optional settings?: SettingsAdapter | null

Defined in: ui/src/favorites.ts:41

Preference store, under key favorites, e.g. the settings of createLocalStorageAdapter or an app's own store. Used when storage is not given.


storage? ​

optional storage?: FavoritesStorage | null

Defined in: ui/src/favorites.ts:36

Where to keep favourites and the bar's place; null keeps them for this visit only. Default localStorage.


storageKey? ​

optional storageKey?: string

Defined in: ui/src/favorites.ts:46

localStorage key of the default storage. Default 'charton:favorites'. Give each shell on a page its own key, or they share (and overwrite) one set.


tools? ​

optional tools?: string[]

Defined in: ui/src/favorites.ts:30

Starred tool types when storage holds none yet. Unknown types are skipped. Default none.