Skip to content

@jsvision/datagrid / VariantStore

Interface: VariantStore

Defined in: datagrid/src/variant-store.ts:15

The app-provided store the personalization dialog reads and writes variants through. A synchronous snapshot contract: list()/getDefault() return the current in-memory state, and save/delete/setDefault mutate it (the dialog re-reads list() after each). An app backing the store with a file or database hydrates it before opening the dialog.

Methods

delete()

delete(name): void

Defined in: datagrid/src/variant-store.ts:21

Remove the variant with this name (a no-op if absent). If it was the default, the default is cleared.

Parameters

name

string

Returns

void


getDefault()

getDefault(): string | undefined

Defined in: datagrid/src/variant-store.ts:25

The default variant's name, or undefined when none is set.

Returns

string | undefined


list()

list(): readonly GridVariant[]

Defined in: datagrid/src/variant-store.ts:17

All saved variants, in app/insertion order. A snapshot the dialog renders; not aliased to any internal array.

Returns

readonly GridVariant[]


save()

save(variant): void

Defined in: datagrid/src/variant-store.ts:19

Insert a variant, or overwrite the existing one with the same name (in place, order preserved).

Parameters

variant

GridVariant

Returns

void


setDefault()

setDefault(name): void

Defined in: datagrid/src/variant-store.ts:23

Mark the named variant the default (the store persists the name; it need not already exist).

Parameters

name

string

Returns

void