import { type OnChangeFn, type Updater } from '@tanstack/react-table'; import { type TableFeature, type TableOptions } from '../hooks/useTable/types.js'; /** * @public */ export interface DataTableV2LineWrapBaseProps { /** * Callback that is called when the lineWrap state of the table or any column is changed. */ onLineWrapChange?: (lineWrap: DataTableV2LineWrapState) => void; } /** * @public */ export interface DataTableV2LineWrapControlledProps extends DataTableV2LineWrapBaseProps { /** * Lets you control the lineWrap state of the entire table or individual columns. * `boolean` values will affect the whole table, whereas `Record` values will let you assign * lineWraps to individual columns. * @example * ```typescript * lineWrap={true} // for forcing lineWrap on all columns in the table * lineWrap={{ [column.id]: true|false }} // to control the lineWrap on individual columns. * ``` */ lineWrap?: DataTableV2LineWrapState; /** * Lets you set lineWrap state initially of the entire table or individual columns. * `boolean` values will affect the whole table, whereas `Record` values will let you assign * lineWraps to individual columns. * @example * ```typescript * defaultLineWrap={true} // for forcing lineWrap on all columns in the table * defaultLineWrap={{ [column.id]: true|false }} // to control the lineWrap on individual columns. * ``` */ defaultLineWrap?: never; } /** * @public */ export interface DataTableV2LineWrapUncontrolledProps extends DataTableV2LineWrapBaseProps { /** * Lets you control the lineWrap state of the entire table or individual columns. * `boolean` values will affect the whole table, whereas `Record` values will let you assign * lineWraps to individual columns. * @example * ```typescript * lineWrap={true} // for forcing lineWrap on all columns in the table * lineWrap={{ [column.id]: true|false }} // to control the lineWrap on individual columns. * ``` */ lineWrap?: never; /** * Lets you set lineWrap state initially of the entire table or individual columns. * `boolean` values will affect the whole table, whereas `Record` values will let you assign * lineWraps to individual columns. * @example * ```typescript * defaultLineWrap={true} // for forcing lineWrap on all columns in the table * defaultLineWrap={{ [column.id]: true|false }} // to control the lineWrap on individual columns. * ``` */ defaultLineWrap?: DataTableV2LineWrapState; } /** * Interface defining the props on the DataTableV2 that control the line wrapping feature. * @public */ export type DataTableV2LineWrapProps = DataTableV2LineWrapControlledProps | DataTableV2LineWrapUncontrolledProps; /** * Global line wrap action for the DataTableV2 to be used in the DataTableV2.Toolbar * * @public */ export declare function DataTableV2GlobalLineWrapAction(): null; /** * Defines the shape of the LineWrap state within the tanstack tables state. * @public */ export type DataTableV2LineWrapState = Record | boolean; /** * Extension interface to extend the tanstack table state with the LineWrap state. * @internal */ export interface DataTableV2LineWrapTableState { /** * Table state extension for lineWrap */ columnLineWrap: DataTableV2LineWrapState; } /** * Extension interface to extend the useTable hook options with the LineWrap options. * @internal */ export interface DataTableV2LineWrapOptions { /** * Enables line wrapping as a feature on the table. */ enableLineWrap?: boolean; /** * Exposes the onLineWrapChange function to the Table options. */ onColumnLineWrapChange?: OnChangeFn; } /** * Extension interface to extend the types of the tanstack table instance. * @internal */ export interface DataTableV2LineWrapInstance { /** * Helper function to update the global table states `columnLineWrap` portion. */ setColumnLineWrap: (updater: Updater) => void; } /** * Extension interface to extend the types exposed on the tanstack column instance. * @internal */ export interface DataTableV2LineWrapColumn { /** * Returns a boolean value that will represent if the column allows line wrapping. */ getCanLineWrap: () => boolean; /** * Return a boolean value that will represent the current line wrap state of a column. */ getIsLineWrapped: () => boolean; /** * Toggles the line wrap property of the column * @param value - If a value is provided, this function behaves like a setter instead of a toggle. */ toggleLineWrap: (value?: boolean) => void; } /** * Feature implementation for LineWrap. This contains the logic that will be given * to the tanstack table. The implementing interface is important as these are * the function that will be called by the tanstack table core during render. * @internal */ export declare const LineWrap: TableFeature; /** * Configuration hook for the DataTableV2 LineWrap feature. * @internal */ export declare function useColumnLineWrap(props: DataTableV2LineWrapProps, options: TableOptions): void; /** * Provides the toolbar button that allows toggling global line wrap. * @internal */ export declare function DataTableV2GlobalLineWrapToolbarAction(): import("react/jsx-runtime.js").JSX.Element;