import { BaseEditor } from './baseEditor/baseEditor'; import type { CellProperties, CellValue } from '../settings'; import type { Context } from '../shortcuts/context'; type Shortcut = Parameters[0]; export type ExtendedEditor = BaseEditor & { render: (editor: ExtendedEditor) => void; value?: T extends { value: CellValue; } ? T['value'] : CellValue; config?: T extends { config: CellValue; } ? T['config'] : CellValue; container: HTMLDivElement; } & T; export interface EditorFactoryOptions { init: (editor: InstanceType) => void; afterOpen?: (editor: InstanceType, event?: Event) => void; afterInit?: (editor: InstanceType) => void; afterClose?: (editor: InstanceType) => void; beforeOpen?: (editor: InstanceType, context: Record) => void; getValue?: (editor: InstanceType) => unknown; setValue?: (editor: InstanceType, value: unknown) => void; onFocus?: (editor: InstanceType) => void; shortcuts?: Array>; value?: unknown; render?: (editor: InstanceType) => void; config?: unknown; shortcutsGroup?: string; position?: 'container' | 'portal'; [key: string]: unknown; } /** * Factory function to create a custom Handsontable editor. */ export declare const editorFactory: >({ init, afterOpen, afterInit, afterClose, beforeOpen, getValue, setValue, onFocus, shortcuts, value, render, config, shortcutsGroup, position, ...args }: { value?: TProperties extends { value: CellValue; } ? TProperties["value"] : CellValue; config?: TProperties extends { config: CellValue; } ? TProperties["config"] : CellValue; render?: (editor: ExtendedEditor) => void; init: (editor: ExtendedEditor) => void; afterOpen?: (editor: ExtendedEditor, event?: Event) => void; afterClose?: (editor: ExtendedEditor) => void; afterInit?: (editor: ExtendedEditor) => void; beforeOpen?: (editor: ExtendedEditor, { row, col, prop, td, originalValue, cellProperties, }: { row: number; col: number; prop: string | number; td: HTMLTableCellElement; originalValue: CellValue; cellProperties: CellProperties; }) => void; getValue?: (editor: ExtendedEditor) => unknown; setValue?: (editor: ExtendedEditor, value: CellValue) => void; onFocus?: (editor: ExtendedEditor) => void; shortcutsGroup?: string; shortcuts?: (Omit & { callback: (editor: ExtendedEditor, event: Event) => boolean | void; group?: string; })[]; position?: "container" | "portal"; } & TMethods & Record) => ExtendedEditor; export {};