Trevixal API
    Preparing search index...

    Interface TableCommands

    Table commands the UI drives, supplied by the host so @trevixal/ui does not depend on @trevixal/extension-table. Pass tableUICommands() from that package, or your own equivalents.

    interface TableCommands {
        activeTableTool?: () => "paint" | "draw" | "erase" | null;
        addColumnAfter?: Command;
        addColumnBefore?: Command;
        addRowAfter?: Command;
        addRowBefore?: Command;
        autoFitContents?: Command;
        autoFitWindow?: Command;
        clearSizing?: Command;
        columnTypeAt?: (state: EditorState) => TableColumnType | null;
        convertTableToText?: Command;
        convertTextToTable?: Command;
        csvAtSelection?: (state: EditorState) => string | null;
        deleteColumn?: Command;
        deleteRow?: Command;
        deleteTable?: Command;
        distributeColumns?: Command;
        distributeRows?: Command;
        filterRows?: (filter: TableRowFilter) => Command;
        fixColumnWidths?: Command;
        formulaAt?: (
            state: EditorState,
        ) => { expression: string; format: string | null };
        hideColumn?: Command;
        insertChart?: (kind: "line" | "bar" | "pie") => Command;
        insertFormula?: (expression: string, format: string | null) => Command;
        insertTable: (rows: number, cols: number) => Command;
        insertTableFromCSV?: (csv: string) => Command;
        mergeCells?: Command;
        setCellAlign?: (align: "right" | "center" | "left" | null) => Command;
        setCellBackground?: (color: string | null) => Command;
        setCellPadding?: (padding: string | null) => Command;
        setCellVerticalAlign?: (
            align: "top" | "bottom" | "middle" | null,
        ) => Command;
        setColumnType?: (type: TableColumnType) => Command;
        setTableBorderColor?: (color: string | null) => Command;
        setTableBorders?: (
            borders: "none" | "all" | "outer" | "horizontal" | null,
        ) => Command;
        setTableBorderStyle?: (style: TableLineStyle | null) => Command;
        setTableBorderWidth?: (width: TableLineWeight | null) => Command;
        setTableStyle?: (
            style: string | null,
            accentColor: string | null,
        ) => Command;
        showAllColumns?: Command;
        showAllRows?: Command;
        sortAscending?: Command;
        sortDescending?: Command;
        splitCell?: Command;
        splitCellInto?: (columns: number, rows?: number) => Command;
        tableColumnLabels?: (state: EditorState) => readonly string[];
        tableDesignAt?: (state: EditorState) => TableDesignState | null;
        tableLayoutAt?: (state: EditorState) => TableLayoutState | null;
        tableStyles?: readonly TableStyleTile[];
        toggleFreezeFirstColumn?: Command;
        toggleFreezeHeaderRow?: Command;
        toggleHeaderRow?: Command;
        toggleStyleOption?: (option: TableStyleOptionName) => Command;
        toggleTableTool?: (tool: "paint" | "draw" | "erase") => void;
    }
    Index
    activeTableTool?: () => "paint" | "draw" | "erase" | null

    The tool held now, so its menu entry shows a tick.

    addColumnAfter?: Command
    addColumnBefore?: Command
    addRowAfter?: Command
    addRowBefore?: Command
    autoFitContents?: Command

    Word's AutoFit: columns to their content, the table to the window, or the columns held as they are.

    autoFitWindow?: Command
    clearSizing?: Command
    columnTypeAt?: (state: EditorState) => TableColumnType | null

    The caret's column's type, for the ticks; a reader.

    convertTableToText?: Command
    convertTextToTable?: Command
    csvAtSelection?: (state: EditorState) => string | null

    Reads the table at the selection as CSV; not a command, a reader.

    deleteColumn?: Command
    deleteRow?: Command
    deleteTable?: Command
    distributeColumns?: Command
    distributeRows?: Command
    filterRows?: (filter: TableRowFilter) => Command
    fixColumnWidths?: Command
    formulaAt?: (
        state: EditorState,
    ) => { expression: string; format: string | null }

    The formula the dialog starts from: the one at the caret, or the one Word suggests; a reader.

    hideColumn?: Command
    insertChart?: (kind: "line" | "bar" | "pie") => Command
    insertFormula?: (expression: string, format: string | null) => Command

    Word's table formula, SUM(ABOVE) and the like, in an optional number format.

    insertTable: (rows: number, cols: number) => Command
    insertTableFromCSV?: (csv: string) => Command
    mergeCells?: Command
    setCellAlign?: (align: "right" | "center" | "left" | null) => Command
    setCellBackground?: (color: string | null) => Command
    setCellPadding?: (padding: string | null) => Command

    Word's cell margins for the whole table; Table ▸ Cell padding offers four.

    setCellVerticalAlign?: (align: "top" | "bottom" | "middle" | null) => Command
    setColumnType?: (type: TableColumnType) => Command
    setTableBorderColor?: (color: string | null) => Command
    setTableBorders?: (
        borders: "none" | "all" | "outer" | "horizontal" | null,
    ) => Command
    setTableBorderStyle?: (style: TableLineStyle | null) => Command

    The pen every line is drawn with; its colour is setTableBorderColor.

    setTableBorderWidth?: (width: TableLineWeight | null) => Command
    setTableStyle?: (style: string | null, accentColor: string | null) => Command
    showAllColumns?: Command
    showAllRows?: Command
    sortAscending?: Command
    sortDescending?: Command
    splitCell?: Command
    splitCellInto?: (columns: number, rows?: number) => Command

    Word's Split Cells; when present, Table ▸ Split asks how many columns.

    tableColumnLabels?: (state: EditorState) => readonly string[]

    The table's columns by header, for the filter dialog to offer; a reader.

    tableDesignAt?: (state: EditorState) => TableDesignState | null

    The design of the table at the selection, for the toolbar and the ticks; a reader.

    tableLayoutAt?: (state: EditorState) => TableLayoutState | null

    How the table at the selection is laid out, for the ticks; a reader.

    tableStyles?: readonly TableStyleTile[]

    The styles gallery, in order.

    toggleFreezeFirstColumn?: Command
    toggleFreezeHeaderRow?: Command

    The header row held at the top of the window while a long table scrolls by.

    toggleHeaderRow?: Command
    toggleStyleOption?: (option: TableStyleOptionName) => Command

    Word's Table Style Options, the header row included.

    toggleTableTool?: (tool: "paint" | "draw" | "erase") => void

    Word's Draw Table, Eraser and Border Painter, which the pointer holds rather than runs: picking one from the Table menu takes it up, picking it again puts it down. createTableTools from the table package supplies all three.