import { C as CommitsSlice, O as OnCommitFn, R as RowData, a as CellPatch, b as CommitRecord, F as FilterFn, S as SortingFn, T as TableOptions, c as Table, d as ColumnDef, e as Column, f as Row, g as Cell, H as HeaderGroup, h as Header, U as Updater, D as DeepKeys, i as DeepValue, j as ColumnHelper, K as KeyboardNavigationCell, k as KeyboardNavigationAction } from './types-CwNe64f5.js'; export { A as AccessorFnColumnDef, l as AccessorKeyColumnDef, m as AggregationFn, n as AggregationFnOption, o as CellClickEvent, p as CellContext, q as CellEditConfig, r as CellEditEvent, s as CellEditRenderProps, t as CellEditType, u as CellFlashEvent, v as CellRange, w as CellRangeSelectionState, x as CellStatus, y as ClipboardOptions, z as ColumnDefBase, B as ColumnDefExtensions, E as ColumnFilter, G as ColumnFiltersState, I as ColumnMeta, J as ColumnOrderState, L as ColumnPinningPosition, M as ColumnPinningState, N as ColumnSizingInfoState, P as ColumnSizingState, Q as ColumnSort, V as ColumnsRemeasureEvent, W as CommitResult, X as DisplayColumnDef, Y as EditingState, Z as EventEmitter, _ as ExpandedState, $ as ExportOptions, a0 as FillHandleState, a1 as FilterChangeEvent, a2 as FilterFnOption, a3 as FilterMeta, a4 as FormulaState, a5 as GroupColumnDef, a6 as GroupingState, a7 as HeaderClickEvent, a8 as HeaderContext, a9 as KeyboardNavigationDirection, aa as KeyboardNavigationState, ab as OnChangeFn, ac as PageChangeEvent, ad as PaginationState, ae as PivotConfig, af as PivotState, ag as RowClickEvent, ah as RowDragEndEvent, ai as RowDragEvent, aj as RowDragState, ak as RowEditCommitEvent, al as RowEditEvent, am as RowModel, an as RowPinningPosition, ao as RowPinningState, ap as RowReorderEvent, aq as RowSelectionState, ar as SelectionChangeEvent, as as SortChangeEvent, at as SortDirection, au as SortingFnOption, av as SortingState, aw as StateChangeEvent, ax as TableFeature, ay as TableOptionsResolved, az as TableState, aA as UndoAction, aB as UndoRedoState, aC as VisibilityState, aD as YableEventMap } from './types-CwNe64f5.js'; export { B as BuiltInAggregationFn, P as PivotColumn, a as PivotEngine, b as PivotFieldConfig, c as PivotRow, d as PivotValueConfig, e as aggregationFns, g as generatePivotColumnDefs, f as getInitialPivotState, h as getPivotRowModel } from './pivot-5cak4xvR.js'; interface CommitStore { getSlice: () => CommitsSlice; setSlice: (next: CommitsSlice) => void; /** Read the most-recent saved value for a cell (from rowData, NOT pending). */ getSavedValue: (rowId: string, columnId: string) => unknown; /** Read the full row snapshot. May return undefined if the row is gone. */ getRow: (rowId: string) => unknown; /** True if the row currently exists in the row model. */ rowExists: (rowId: string) => boolean; } interface CoordinatorOptions { /** Table-level commit handler. May be undefined. */ onCommit?: OnCommitFn; /** * Per-column commit override. Coordinator calls this to find a per-cell * handler; if it returns undefined, the table-level `onCommit` is used. */ resolveColumnCommit?: (columnId: string) => OnCommitFn | undefined; /** Default 'failed'. */ rowCommitRetryMode?: 'failed' | 'batch'; } declare function createCommitCoordinator(store: CommitStore, opts: CoordinatorOptions): { dispatch: (incoming: Omit[]) => Promise; retry: (rowId: string, columnId: string) => Promise; dismiss: (rowId: string, columnId: string) => void; dismissAll: () => void; runAutoClearSweep: () => void; runOrphanedGc: () => void; runConflictDetection: () => void; getRenderValue: (rowId: string, columnId: string) => unknown; getCellStatus: (rowId: string, columnId: string) => "idle" | "pending" | "error" | "conflict"; getRecord: (rowId: string, columnId: string) => CommitRecord | undefined; }; type CommitCoordinator = ReturnType; /** * T1-04: Resolve a sorting function from a column definition. * Handles: named built-in string, custom function, or 'auto'. */ declare function resolveSortingFn(sortingFnOption: string | SortingFn | undefined, tableSortingFns?: Record>): SortingFn | undefined; /** * T1-04: Resolve a filter function from a column definition. * Handles: named built-in string, custom function. */ declare function resolveFilterFn(filterFnOption: string | FilterFn | undefined, tableFilterFns?: Record>): FilterFn | undefined; declare function createTable(options: TableOptions): Table; declare function createColumn(table: Table, columnDef: ColumnDef, depth: number, parent?: Column): Column; declare function createRow(table: Table, id: string, original: TData, rowIndex: number, depth: number, subRows?: Row[], parentId?: string): Row; declare function createCell(table: Table, row: Row, column: Column, columnId: string): Cell; declare function createHeader(table: Table, column: Column, opts: { id?: string; index: number; depth: number; isPlaceholder?: boolean; placeholderId?: string; colSpan: number; rowSpan: number; headerGroup: HeaderGroup; subHeaders: Header[]; }): Header; declare function buildHeaderGroups(table: Table, allColumns: Column[]): HeaderGroup[]; declare function functionalUpdate(updater: Updater, input: T): T; /** * Lightweight memo — returns a function that caches its result. * Re-computes only when `getDeps()` returns different values (shallow compare). */ declare function memo(getDeps: () => any[], fn: (...deps: any[]) => TResult, opts?: { key?: string; debug?: () => boolean; onChange?: (result: TResult) => void; }): () => TResult; /** * Access a deeply-nested value from an object using dot-notation key. * e.g. `getDeepValue(row, 'address.city')` → `row.address.city` * * Paths deeper than `MAX_ACCESSOR_DEPTH` segments are rejected with a * console.error and `undefined` is returned, to prevent runaway walks. * * Path segments matching `__proto__`, `constructor`, or `prototype` are * blocked to prevent prototype-pollution attacks. */ declare function getDeepValue>(obj: T, key: K): DeepValue; declare function resolveColumnId(columnDef: ColumnDef): string; declare function resolveRowId(row: TData, index: number, getRowId?: (originalRow: TData, index: number, parent?: unknown) => string, parent?: unknown): string; declare function getCellValue(row: TData, columnDef: ColumnDef): unknown; declare function shallowEqual(a: T, b: T): boolean; declare function makeStateUpdater(key: K, instance: { setState: (updater: Updater) => void; getState: () => any; options: { [P in `on${Capitalize}Change`]?: (updater: Updater) => void; }; }): (updater: Updater) => void; /** No-op function */ declare const noop: () => void; /** Identity function */ declare const identity: (x: T) => T; /** Check if a value is a function */ declare function isFunction(val: unknown): val is (...args: any[]) => any; /** Create a range [start..end) */ declare function range(start: number, end: number): number[]; /** Flatten a tree of items that have children */ declare function flattenBy(items: T[], getChildren: (item: T) => T[]): T[]; /** Unique values from an array */ declare function uniqueBy(arr: T[], getKey: (item: T) => K): T[]; /** Clamp a number between min and max */ declare function clamp(value: number, min: number, max: number): number; declare function createColumnHelper(): ColumnHelper; declare const sortingFns: { readonly alphanumeric: (rowA: Row, rowB: Row, columnId: string) => number; readonly alphanumericCaseSensitive: (rowA: Row, rowB: Row, columnId: string) => number; readonly text: (rowA: Row, rowB: Row, columnId: string) => number; readonly textCaseSensitive: (rowA: Row, rowB: Row, columnId: string) => number; readonly datetime: (rowA: Row, rowB: Row, columnId: string) => number; readonly basic: (rowA: Row, rowB: Row, columnId: string) => number; }; type BuiltInSortingFn = keyof typeof sortingFns; declare const filterFns: { readonly includesString: (row: Row, columnId: string, filterValue: unknown) => boolean; readonly includesStringSensitive: (row: Row, columnId: string, filterValue: unknown) => boolean; readonly equalsString: (row: Row, columnId: string, filterValue: unknown) => boolean; readonly equalsStringSensitive: (row: Row, columnId: string, filterValue: unknown) => boolean; readonly arrIncludes: (row: Row, columnId: string, filterValue: unknown) => boolean; readonly arrIncludesAll: (row: Row, columnId: string, filterValue: unknown) => boolean; readonly arrIncludesSome: (row: Row, columnId: string, filterValue: unknown) => boolean; readonly equals: (row: Row, columnId: string, filterValue: unknown) => boolean; readonly weakEquals: (row: Row, columnId: string, filterValue: unknown) => boolean; readonly inNumberRange: (row: Row, columnId: string, filterValue: unknown) => boolean; readonly inDateRange: (row: Row, columnId: string, filterValue: unknown) => boolean; }; type BuiltInFilterFn = keyof typeof filterFns; declare class EventEmitterImpl> { private listeners; on(event: K, handler: (payload: TEventMap[K]) => void): () => void; off(event: K, handler: (payload: TEventMap[K]) => void): void; emit(event: K, payload: TEventMap[K]): void; removeAllListeners(event?: keyof TEventMap): void; } interface CellFlashInfo { columnId: string; rowId: string; direction: 'up' | 'down' | 'change'; previousValue: unknown; newValue: unknown; timestamp: number; } /** * Compares old and new data arrays to find cells that changed value. * Returns a map of "rowId:columnId" -> CellFlashInfo for cells that changed. */ declare function detectCellChanges(oldData: TData[], newData: TData[], columns: { id: string; enableCellFlash?: boolean; }[], getRowId: (row: TData, index: number) => string): Map; interface ResolvedKeyboardNavigationCell { cell: KeyboardNavigationCell; row: Row; column: Column; } declare function getFirstKeyboardCell(table: Table): KeyboardNavigationCell | null; declare function getLastKeyboardCell(table: Table): KeyboardNavigationCell | null; declare function normalizeFocusedCell(table: Table, cell: KeyboardNavigationCell | null | undefined): KeyboardNavigationCell | null; declare function getResolvedFocusedCell(table: Table, cell: KeyboardNavigationCell | null | undefined): ResolvedKeyboardNavigationCell | null; declare function getCellPositionByIds(table: Table, rowId: string, columnId: string): KeyboardNavigationCell | null; declare function canCellEnterEditMode(table: Table, row: Row, column: Column): boolean; declare function getNextFocusedCell(table: Table, current: KeyboardNavigationCell | null | undefined, action: KeyboardNavigationAction): KeyboardNavigationCell | null; interface YableLocale { paginationOf: string; paginationRows: string; paginationNoResults: string; paginationFirstPage: string; paginationLastPage: string; paginationPreviousPage: string; paginationNextPage: string; paginationPage: string; searchPlaceholder: string; searchAriaLabel: string; filterEquals: string; filterContains: string; filterStartsWith: string; filterEndsWith: string; filterEmpty: string; filterNotEmpty: string; filterBetween: string; clearFilter: string; clearAllFilters: string; sortAscending: string; sortDescending: string; sortClear: string; selectAll: string; selectRow: string; selectedCount: string; columnMenuPin: string; columnMenuPinLeft: string; columnMenuPinRight: string; columnMenuUnpin: string; columnMenuHide: string; columnMenuAutoSize: string; columnMenuResetSize: string; contextMenuCopy: string; contextMenuCut: string; contextMenuPaste: string; contextMenuExport: string; contextMenuExportCsv: string; contextMenuExportJson: string; statusBarTotal: string; statusBarFiltered: string; statusBarSelected: string; emptyNoData: string; emptyNoResults: string; emptyNoDataDetail: string; emptyNoResultsDetail: string; loadingText: string; sidebarColumns: string; sidebarFilters: string; sidebarSearchColumns: string; sidebarShowAll: string; sidebarHideAll: string; printTitle: string; close: string; apply: string; cancel: string; reset: string; } declare const en: YableLocale; /** Deep partial type for locale overrides */ type PartialLocale = Partial; /** * Merge a partial locale with the default English locale. * Only provided keys are overridden; everything else stays English. */ declare function createLocale(overrides: PartialLocale): YableLocale; /** * Set the global default locale. Affects all tables that don't specify * their own locale. */ declare function setDefaultLocale(overrides: PartialLocale): void; /** * Get the current default locale. */ declare function getDefaultLocale(): YableLocale; /** * Reset the locale to default English. */ declare function resetLocale(): void; declare class FormulaEngine { private table; private formulas; private computedValues; private errors; constructor(table: Table); /** * Sets a formula on a cell. If the value starts with '=', it's treated as * a formula; otherwise, it's stored as a regular value. */ setFormula(rowId: string, columnId: string, formula: string): void; /** * Gets the raw formula string for a cell. */ getFormula(rowId: string, columnId: string): string | undefined; /** * Gets the computed value for a cell. */ getComputedValue(rowId: string, columnId: string): unknown; /** * Gets the error message for a cell, if any. */ getError(rowId: string, columnId: string): string | undefined; /** * Evaluates all formulas in dependency order. */ evaluateAll(): void; /** * Checks if a cell has a formula. */ hasFormula(rowId: string, columnId: string): boolean; /** * Extracts cell IDs that a formula depends on. * Converts A1-style references to table cell IDs using the table's rows/columns. */ private extractDependencies; /** * Detects if adding/updating a formula for `cellId` creates a circular * dependency. Uses DFS cycle detection. */ private detectCircular; /** * Returns cell IDs in topological order (dependencies before dependents). * Uses Kahn's algorithm. */ private topologicalSort; /** * Evaluates a single formula cell and stores the result. */ private evaluateCell; /** * Resolves an A1-style cell reference to the cell's value. */ private resolveCellRef; /** * Resolves a range reference (e.g., 'A1:A10') to an array of values. */ private resolveRangeRef; } type FormulaFunction = (args: unknown[]) => unknown; declare const builtInFunctions: Record; declare class FormulaError extends Error { constructor(message: string); } interface UndoAction { type: 'cell-edit'; rowId: string; columnId: string; oldValue: unknown; newValue: unknown; timestamp: number; } interface UndoRedoState { undoStack: UndoAction[]; redoStack: UndoAction[]; maxSize: number; } interface UndoRedoOptions { /** Maximum number of undo actions to keep. Default: 50 */ undoStackSize?: number; /** Enable undo/redo. Default: true when options are provided */ enableUndoRedo?: boolean; } declare class UndoStack { private undoStack; private redoStack; private maxSize; constructor(maxSize?: number); push(action: UndoAction): void; undo(): UndoAction | undefined; redo(): UndoAction | undefined; canUndo(): boolean; canRedo(): boolean; clear(): void; getState(): UndoRedoState; } /** * Creates an UndoStack instance and wires it into the table's setPendingValue * so that every cell edit is automatically tracked. */ declare function createUndoRedoIntegration(table: Table, options?: UndoRedoOptions): { undoStack: UndoStack; undo: () => void; redo: () => void; canUndo: () => boolean; canRedo: () => boolean; clearUndoHistory: () => void; }; interface SerializeOptions { /** Column delimiter. Default: '\t' */ delimiter: string; /** Row delimiter. Default: '\n' */ rowDelimiter: string; /** Include column headers as first row. Default: false */ includeHeaders: boolean; } interface ParseOptions { /** Column delimiter. Default: '\t' */ delimiter: string; /** Row delimiter. Default: '\n' */ rowDelimiter: string; } /** * Converts rows and columns into a delimited string suitable for clipboard. * By default uses tab-separated values for Excel compatibility. */ declare function serializeCells(rows: Row[], columns: Column[], options: SerializeOptions): string; /** * Parses a delimited text string (typically from clipboard) into a 2D array * of string values. */ declare function parseClipboardText(text: string, options: ParseOptions): string[][]; /** * Applies a 2D array of values to the table starting from the target cell. * Returns the list of affected cells. */ declare function applyCellPaste(table: Table, data: string[][], targetRowId: string, targetColumnId: string, rows: Row[], columns: Column[]): { rowId: string; columnId: string; value: unknown; }[]; interface ExportOptions { /** Which columns to include (default: all visible) */ columns?: string[]; /** Whether to include column headers (default: true) */ includeHeaders?: boolean; /** Custom value formatter per column */ formatters?: Record string>; /** File name without extension */ fileName?: string; } interface CsvExportOptions extends ExportOptions { /** Delimiter character (default: ',') */ delimiter?: string; /** Add BOM for Excel compatibility (default: true) */ bom?: boolean; /** Quote character (default: '"') */ quoteChar?: string; } /** * Export table data as a CSV string. * Handles quoting (values containing delimiter, newline, or quote char), * and optionally prepends a UTF-8 BOM for Excel. */ declare function exportToCsv(table: Table, options?: CsvExportOptions): string; /** * Export table data as a JSON string. * Returns an array of objects keyed by column header text. */ declare function exportToJson(table: Table, options?: ExportOptions): string; /** rowId → colId → human-readable message */ type CommitErrorCells = Record>; declare class CommitError extends Error { cells: CommitErrorCells; constructor(cells: CommitErrorCells, message?: string); } export { type BuiltInFilterFn, type BuiltInSortingFn, Cell, type CellFlashInfo, CellPatch, Column, ColumnDef, ColumnHelper, type CommitCoordinator, CommitError, type CommitErrorCells, CommitRecord, type CommitStore, CommitsSlice, type CoordinatorOptions, type CsvExportOptions, type ExportOptions as CsvJsonExportOptions, DeepKeys, DeepValue, EventEmitterImpl, FilterFn, FormulaEngine, FormulaError, type FormulaFunction, Header, HeaderGroup, KeyboardNavigationAction, KeyboardNavigationCell, OnCommitFn, type ParseOptions, type PartialLocale, type ResolvedKeyboardNavigationCell, Row, RowData, type SerializeOptions, SortingFn, Table, TableOptions, type UndoRedoOptions, UndoStack, Updater, type YableLocale, applyCellPaste, buildHeaderGroups, canCellEnterEditMode, clamp, createCell, createColumn, createColumnHelper, createCommitCoordinator, createHeader, createLocale, createRow, createTable, createUndoRedoIntegration, detectCellChanges, en, exportToCsv, exportToJson, filterFns, flattenBy, builtInFunctions as formulaFunctions, functionalUpdate, getCellPositionByIds, getCellValue, getDeepValue, getDefaultLocale, getFirstKeyboardCell, getLastKeyboardCell, getNextFocusedCell, getResolvedFocusedCell, identity, isFunction, makeStateUpdater, memo, noop, normalizeFocusedCell, parseClipboardText, range, resetLocale, resolveColumnId, resolveFilterFn, resolveRowId, resolveSortingFn, serializeCells, setDefaultLocale, shallowEqual, sortingFns, uniqueBy };