import { VersionUpgrade } from './VersionUpgrade';
import { columnWidthsToColumnSizing } from '../Api/Implementation/LayoutHelpers';
export class VersionUpgrade21 extends VersionUpgrade {
    migrateState(state) {
        this.migrateLayoutState(state);
        return state;
    }
    migrateLayoutState(state) {
        const layoutState = state.Layout;
        if (layoutState && layoutState.Layouts) {
            layoutState.Layouts = layoutState.Layouts.map((layout) => {
                //@ts-ignore
                if (layout.ColumnWidths && !layout.ColumnSizing) {
                    //@ts-ignore
                    layout.ColumnSizing = columnWidthsToColumnSizing(layout.ColumnWidths);
                    //@ts-ignore
                    delete layout.ColumnWidths;
                }
                return layout;
            });
        }
        return state;
    }
}
