import { Singleton } from '@ephox/katamari';
import { nuState } from '../common/BehaviourState';
const flatgrid = () => {
    const dimensions = Singleton.value();
    const setGridSize = (numRows, numColumns) => {
        dimensions.set({ numRows, numColumns });
    };
    const getNumRows = () => dimensions.get().map((d) => d.numRows);
    const getNumColumns = () => dimensions.get().map((d) => d.numColumns);
    return nuState({
        readState: () => dimensions.get().map((d) => ({
            numRows: String(d.numRows),
            numColumns: String(d.numColumns)
        })).getOr({
            numRows: '?',
            numColumns: '?'
        }),
        setGridSize,
        getNumRows,
        getNumColumns
    });
};
const init = (spec) => spec.state(spec);
export { flatgrid, init };
//# sourceMappingURL=KeyingState.js.map