kapom-report - v0.1.2
    Preparing search index...

    Interface ColumnHelpers<T>

    Column-constructor namespace bound to the row type T (Zod-style col.data()/col.group()) — a lighter way to write columns than object literals, especially for a group tree (col.group(...) composes with .map(), no chain/callback nesting). T must be fixed up front because key is keyof T and computed/runningTotal callbacks receive a T — hence a col<Row>() factory rather than a bare namespace. Each method takes the kind's required fields positionally; everything else (align/width/aggregate/formatter/numberFormat/cellStyle/visible/…) goes in extra.

    interface ColumnHelpers<T> {
        computed(
            header: string,
            compute: (row: T) => Decimalish,
            extra?: Partial<Omit<ComputedColumn<T>, "type" | "header" | "compute">>,
        ): ComputedColumn<T>;
        data(
            key: keyof T,
            header: string,
            extra?: Partial<Omit<DataColumn<T>, "type" | "key" | "header">>,
        ): DataColumn<T>;
        group(
            header: string,
            columns: readonly TableColumn<T>[],
            extra?: Partial<Omit<ColumnGroup<T>, "type" | "header" | "columns">>,
        ): ColumnGroup<T>;
        rowNumber(extra?: Partial<Omit<RowNumberColumn, "type">>): RowNumberColumn;
        runningTotal(
            header: string,
            valueOf: (row: T) => Decimalish,
            extra?: Partial<
                Omit<RunningTotalColumn<T>, "valueOf" | "type" | "header">,
            >,
        ): RunningTotalColumn<T>;
    }

    Type Parameters

    • T
    Index