import { Component } from 'vue'; import { ColDef, CellClassParams, CellStyle, ValueFormatterParams, ValueGetterFunc, CellDoubleClickedEvent, ITooltipParams, RowDragCallback, IRowNode } from 'ag-grid-community'; /** * Key used to store custom quick filter configuration in ColDef context. * @internal */ export declare const COAR_QUICK_FILTER_KEY = "__coarQuickFilter"; /** * Key used to pass the i18n header key via AG Grid's header component params. * @internal */ export declare const COAR_HEADER_I18N_KEY = "__coarHeaderI18nKey"; /** Quick filter configuration for a column */ export type QuickFilterConfig = false | true | ((value: TValue, data: TData) => string); /** * Fluent builder for AG Grid column definitions. * * @example * ```ts * const column = new CoarGridColumnBuilder('name') * .header('Full Name') * .sortable() * .flex(1) * .build(); * ``` */ export declare class CoarGridColumnBuilder { #private; constructor(field?: keyof TData | string); /** Set the field name (data property) */ field(value: keyof TData | string): this; /** * Set the column header text. * * @param value - Display text (used as-is, or as fallback when i18nKey is set) * @param i18nKey - Optional translation key. Requires `@cocoar/vue-localization`. * If the package is not installed or the key has no translation, * `value` is shown as fallback. * * @example * ```ts * col.header('Name') // static text * col.header('Name', 'todo.grid.header.title') // i18n with fallback * ``` */ header(value: string, i18nKey?: string): this; /** Set header tooltip */ headerTooltip(value: string): this; /** Set fixed width in pixels */ width(value: number, minWidth?: number, maxWidth?: number): this; /** Set fixed width (min, max, and width all the same) */ fixedWidth(value: number): this; /** Set minimum width */ minWidth(value: number): this; /** Set maximum width */ maxWidth(value: number): this; /** Set flex grow factor for fluid width */ flex(value?: number): this; /** Enable/disable sorting */ sortable(value?: boolean): this; /** Enable/disable resizing */ resizable(value?: boolean): this; /** Hide/show column */ hidden(value?: boolean): this; /** Pin column to left or right */ pinned(value: 'left' | 'right' | null): this; /** Lock column position */ lockPosition(value?: boolean | 'left' | 'right'): this; /** Set custom cell renderer component */ cellRenderer(component: Component, params?: Record): this; /** Set cell renderer parameters */ cellRendererParams(params: Record): this; /** Set value formatter for display */ valueFormatter(fn: (params: ValueFormatterParams) => string): this; /** Set value getter to transform data before display */ valueGetter(fn: ValueGetterFunc): this; /** Set CSS class for cells */ cellClass(value: string | string[] | ((params: CellClassParams) => string | string[])): this; /** Set CSS style for cells */ cellStyle(value: CellStyle | ((params: CellClassParams) => CellStyle | null | undefined)): this; /** Add a conditional CSS class rule */ classRule(className: string, condition: string | ((params: CellClassParams) => boolean)): this; /** Show tooltip with field value or custom function */ tooltip(value?: string | ((params: ITooltipParams) => string)): this; /** Handle cell double-click */ onCellDoubleClicked(handler: (event: CellDoubleClickedEvent) => void): this; /** Enable/disable filtering */ filter(value?: boolean | string): this; /** Set filter parameters */ filterParams(params: Record): this; /** * Configure how this column participates in quick filtering. * * - `true` — include column, use `String(value)` for matching (default behavior) * - `false` — exclude column from quick filter * - `(value, data) => string` — custom text extractor for matching * * @example * ```ts * // Exclude from search * col.field('id').quickFilter(false) * * // Custom text for tags * col.field('tags').quickFilter((tags, row) => tags.map(t => t.label).join(' ')) * ``` */ quickFilter(fn: boolean | ((value: TValue, data: TData) => string)): this; /** Set custom sort comparator */ comparator(fn: (valueA: TValue, valueB: TValue, nodeA: IRowNode, nodeB: IRowNode, isDescending: boolean) => number): this; /** Enable row drag on this column */ rowDrag(value?: boolean | RowDragCallback): this; /** Set cell renderer with config object (params wrapped in `config` key) */ cellRendererConfig(component: Component, config: Record | object): this; /** * Make this column editable. Accepts a static boolean or a row predicate. * * Without `cellEditorConfig()`, AG Grid uses its default text editor. * Use together with `gridBuilder.onCellValueChanged()` to react to commits. * * @example * ```ts * column.field('name').editable(true) * column.field('price').editable(row => !row.locked) * ``` */ editable(value: boolean | ((row: TData) => boolean)): this; /** * Set a custom cell editor with a config object (params wrapped in `config` key). * Mirrors `cellRendererConfig`. The component must expose `getValue()` per AG Grid contract. * * Note: orthogonal to `editable()` — set both, otherwise the editor never opens. */ cellEditorConfig(component: Component, config: Record | object): this; /** Set any AG Grid ColDef option directly */ option>(key: K, value: ColDef[K]): this; /** Apply custom modifications to the column definition */ customize(fn: (colDef: ColDef) => void): this; /** Build and return the AG Grid ColDef */ build(): ColDef; } //# sourceMappingURL=coar-grid-column-builder.d.ts.map