import type { LogicalCellTarget } from './commit-row-update.js'; import type { EditTargetCapture, RemoveTargetCapture } from './row-target-resolution.js'; import type { FieldConfig } from '../fields/field-config.js'; import type { EditorHost, HostApplyContext, HostBatchUpdate, HostBatchUpdateCapability, HostPresentationCapability, HostRecordEntry, HostRefreshCapability, HostRowCollectionCapability, HostSelectionCapability } from '../host/editor-host.js'; import type { InlineHostRuntime, InlineHostRuntimeArguments, InlineHostRuntimeFactory } from '../host/inline-host-runtime.js'; import type { InlineColumnMapping } from '../inline/inline-column-mapping.js'; import type { InlineTargetSummary } from '../inline/inline-edit-state.js'; import type { InlineNavigationIntent } from '../inline/inline-navigation.js'; import type { InlineTargetCapture } from '../inline/inline-target-capture.js'; import type { Api, ColumnSelector, RowSelector } from 'datatables.net'; declare const dataTablesRecordTargetBrand: unique symbol; /** Opaque record identity resolved by a DataTables host. */ export interface DataTablesRecordTarget { readonly [dataTablesRecordTargetBrand]: true; } declare const dataTablesInlineTargetBrand: unique symbol; /** Opaque cell identity accepted by the neutral inline editor method. */ export interface DataTablesInlineTarget { readonly [dataTablesInlineTargetBrand]: true; } /** DataTables-backed implementation of the neutral record host contract. */ export declare class DataTablesHost implements EditorHost, HostBatchUpdateCapability, HostPresentationCapability, HostRefreshCapability, HostRowCollectionCapability, HostSelectionCapability, InlineHostRuntimeFactory { #private; private readonly table; private readonly refreshTimeout; readonly eventTarget: HTMLTableElement; readonly ownershipKey: object; constructor(table: Api, refreshTimeout?: number); /** Returns the DataTables API for explicitly integration-specific work. */ unwrap(): Api; /** Reads one DataTables record by its resolved internal index. */ read(target: DataTablesRecordTarget): Readonly; /** Adds a record and waits for the editor-owned draw to complete. */ applyCreate(row: TRow, context: Readonly): Promise; /** Replaces a record and waits for the editor-owned draw to complete. */ applyUpdate(target: DataTablesRecordTarget, row: TRow, context: Readonly): Promise; /** Replaces multiple records and performs one editor-owned draw. */ applyUpdates(updates: readonly Readonly>[], context: Readonly): Promise; /** Removes records and waits for the editor-owned draw to complete. */ applyRemove(targets: readonly DataTablesRecordTarget[], context: Readonly): Promise; /** Replaces a row selected by a DataTables internal index for inline editing. */ applyInlineUpdate(rowIndex: number, row: TRow, context: Readonly): Promise; /** Refreshes DataTables while marking any resulting redraw as editor-owned. */ refresh(signal: AbortSignal, action?: () => Promise): Promise; /** Enumerates the records currently loaded by DataTables. */ entries(): Iterable>>; /** Finds the loaded record target for one live DataTables row object. */ findRecordTarget(row: TRow): DataTablesRecordTarget | undefined; /** Reports whether the optional Select integration is available. */ selectionAvailable(): boolean; /** Returns the current DataTables Select targets. */ getSelectedTargets(unavailableMessage?: string): readonly DataTablesRecordTarget[]; /** Notifies registered DataTables UI integrations about editor state changes. */ notifyEditorStateChange(): void; /** Completes optional extension synchronization after presentation cleanup. */ completeEditorPresentation(): void; /** Synchronizes optional extensions after a DataTables inline session. */ synchronizeExtensions(): void; /** Resolves an explicit row selector or the current Select selection. */ resolveRequestedRowIndexes(rowSelector: RowSelector | undefined, unavailableMessage: string): readonly number[]; /** Resolves one DataTables selector to an opaque record target. */ resolveRecordTarget(rowSelector: RowSelector): DataTablesRecordTarget; /** Resolves a DataTables selector to opaque record targets. */ resolveRecordTargets(rowSelector: RowSelector): readonly DataTablesRecordTarget[]; /** Reports whether an opaque record target belongs to this Host wrapper. */ ownsRecordTarget(target: unknown): target is DataTablesRecordTarget; /** Creates an opaque inline target from DataTables selectors. */ createInlineTarget(rowSelector: RowSelector, columnSelector: ColumnSelector): DataTablesInlineTarget; /** Creates the DataTables-owned inline editing runtime. */ createInlineRuntime(runtime: InlineHostRuntimeArguments): InlineHostRuntime; /** Captures one validated DataTables row identity. */ captureEditTarget(rowIndex: number, unavailableMessage: string): EditTargetCapture; /** Captures validated DataTables row identities for removal. */ captureRemoveTargets(rowIndexes: readonly number[], unavailableMessage: string): RemoveTargetCapture; /** Revalidates one previously captured row identity. */ resolveEditTarget(capture: EditTargetCapture, unavailableMessage: string): number; /** Revalidates a previously captured row set atomically. */ resolveRemoveTargets(capture: RemoveTargetCapture, unavailableMessage: string): readonly number[]; /** Captures one eligible DataTables cell for inline editing. */ captureInlineTarget(rowSelector: RowSelector, columnSelector: ColumnSelector, fieldsByName: ReadonlyMap>>, mappings: ReadonlyMap>>, unavailableMessage: string): InlineTargetCapture; /** Revalidates an inline row, field mapping, and rendered cell identity. */ resolveInlineTarget(capture: InlineTargetCapture, mappings: ReadonlyMap>>, unavailableMessage: string): number; /** Resolves the next eligible inline cell on the current page. */ createInlineNavigationIntent(mappings: ReadonlyMap>>, fieldsByName: ReadonlyMap>>, currentTarget: Readonly, direction: 'forward' | 'backward'): Readonly | undefined; /** Resolves a navigation row after a presentation update. */ resolveInlineNavigationRow(intent: Readonly, unavailableMessage: string): number; /** Resolves the cell associated with a completed inline commit. */ resolveInlineCommitCell(target: Readonly>, unavailableMessage: string): HTMLTableCellElement; /** Resolves a stable cell after a consumer-owned refresh. */ resolveInlineRefreshCell(summary: Readonly, mappings: ReadonlyMap>>, unavailableMessage: string): HTMLTableCellElement; /** Restores focus to a logical cell with the owned table as a fallback. */ focusInlineCell(cellNode: HTMLTableCellElement | undefined): void; /** Reports whether the editor currently owns a DataTables presentation update. */ ownsPresentationChange(): boolean; /** Releases owned DataTables listeners without destroying the table. */ destroy(): void; } export {};