Skip to content

charton API


charton API / @chart-on/core / index / migrateLayout

Function: migrateLayout() ​

migrateLayout(data, current?, steps?, hook?): Record<string, unknown>

Defined in: packages/core/src/layout.ts:304

Upgrade a saved layout to current, step by step through steps. A version the steps don't cover goes through hook once, which may return the current version or an older one the steps continue from. Throws when the payload is not a layout object or no step or hook upgrades it.

Parameters ​

data ​

unknown

current? ​

number = LAYOUT_VERSION

steps? ​

Readonly<Record<number, LayoutMigration>> = MIGRATIONS

hook? ​

LayoutMigration | null

Returns ​

Record<string, unknown>