import { ColumnConfig } from './react-column-config'; /** * Type for column shorthand notation. * * Supports: * - Simple string: `'name'` → `{ field: 'name', header: 'Name' }` * - With type: `'salary:number'` → `{ field: 'salary', header: 'Salary', type: 'number' }` * - Full config object: `{ field: 'id', header: 'ID', width: 80 }` (passed through) * * @example * ```tsx * // All equivalent: * columns={['id', 'name', 'email']} * columns={['id:number', 'name:string', 'email']} * columns={[{ field: 'id' }, { field: 'name' }, { field: 'email' }]} * ``` * @since 0.7.0 */ export type ColumnShorthand = string | ColumnConfig; /** * Parse a column shorthand string into a React `ColumnConfig`. * * Delegates parsing to `@toolbox-web/grid` core (issue #276). The result only * ever carries `field`/`header`/`type`, so it satisfies React's widened column * type without a cast. * * @param shorthand - The shorthand string (e.g., 'name', 'salary:number') * @returns A ColumnConfig object * * @example * parseColumnShorthand('name') → { field: 'name', header: 'Name' } * parseColumnShorthand('salary:number') → { field: 'salary', header: 'Salary', type: 'number' } * @since 0.7.0 */ export declare function parseColumnShorthand(shorthand: string): ColumnConfig; /** * Normalize an array of column shorthands to ColumnConfig objects. * * @param columns - Array of column shorthands (strings or ColumnConfig objects) * @returns Array of ColumnConfig objects * * @example * ```tsx * normalizeColumns(['id:number', 'name', { field: 'email', width: 200 }]) * // Returns: * // [ * // { field: 'id', header: 'ID', type: 'number' }, * // { field: 'name', header: 'Name' }, * // { field: 'email', width: 200 } * // ] * ``` * @since 0.7.0 */ export declare function normalizeColumns(columns: ColumnShorthand[]): ColumnConfig[]; /** * Apply column defaults to a list of columns. Individual column properties * override defaults — the per-column value always wins over the default. * * @param columns - Normalized columns to merge defaults into * @param defaults - Partial column config applied as a baseline; pass `undefined` to no-op * @returns A new array with the defaults merged in (input is not mutated) * * @example * ```tsx * applyColumnDefaults( * [{ field: 'id' }, { field: 'name', sortable: false }], * { sortable: true, resizable: true }, * ); * // [ * // { field: 'id', sortable: true, resizable: true }, * // { field: 'name', sortable: false, resizable: true }, * // ] * ``` * @since 1.5.0 */ export declare function applyColumnDefaults(columns: ColumnConfig[], defaults: Partial> | undefined): ColumnConfig[]; /** * Check if an array of columns contains any shorthand strings. * * @param columns - Array to check * @returns True if any element is a string shorthand * @since 0.7.0 */ export declare function hasColumnShorthands(columns: ColumnShorthand[]): boolean; //# sourceMappingURL=column-shorthand.d.ts.map