import type { View, ViewWindow } from "@perspective-dev/client"; import type { ColumnConfigSchema, IPerspectiveViewerPlugin, PerspectiveHitTest, PluginStaticConfig } from "@perspective-dev/viewer"; import type { CommandColumn, DatagridModel, DatagridToolbarElement, EditMode, DatagridPluginConfig, ColumnsConfig, Align, ColumnRole } from "../types.ts"; import { RegularTableElement } from "regular-table"; /** * The custom element class for this plugin. The interface methods for this */ export declare class HTMLPerspectiveViewerDatagridPluginElement extends HTMLElement implements IPerspectiveViewerPlugin { private static _sheet; regular_table: RegularTableElement; model?: DatagridModel; _toolbar?: DatagridToolbarElement; _edit_button?: HTMLElement; _scroll_lock?: HTMLElement; _is_scroll_lock: boolean; _edit_mode: EditMode; _font_family?: string; _font_size?: number; _bold: boolean; _italic: boolean; _word_wrap: boolean; _column_menus: boolean; _command_column: CommandColumn; _command_cells: boolean; _align?: Align; _row_height?: number; _zebra_rows: number; _zebra_color?: string; _column_overrides: Map; _initialized?: boolean; _reset_scroll_top?: boolean; _reset_scroll_left?: boolean; _reset_select?: boolean; _reset_column_size?: boolean; _columns_config: ColumnsConfig; /** * Reconcile the last fetched window at gesture end and echo the columns * whose override changed. */ private _persist_column_sizes; private _on_column_resize; constructor(); connectedCallback(): void; disconnectedCallback(): void; activate(view: View): Promise; get_static_config(): PluginStaticConfig; plugin_config_schema(view_config?: Record, current_value?: Record | null): ColumnConfigSchema; column_config_schema(type: string, group: string | undefined, column_name: string, current_value: Record | null, viewer_config?: { group_by?: string[]; split_by?: string[]; group_rollup_mode?: string; }, plugin_config?: Record | null, role?: ColumnRole): ColumnConfigSchema; draw(view: View): Promise; update(view: View): Promise; render(view: View, viewport?: ViewWindow): Promise; resize(_view: View): Promise; /** * Host presize protocol: stage a render for the TARGET element box * `(width, height)` — the box the host's pending layout commit will * produce — via `regular-table`'s `predraw()`, which runs the data * fetch and viewport calculation now without touching the visible * DOM. Resolves to the commit closure; the host invokes it in the * same task as the layout commit, landing geometry and cells in one * paint. * * The `predraw()` box is derived by delta: `regular-table` fills this * element with constant chrome, so the element's box delta IS the * table's. When column widths for the target viewport aren't yet * measured (first paint, post-`resetAutoSize`), `predraw()` draws * inline and the closure no-ops — the pre-staging behavior, degraded * not broken. */ presize(width: number, height: number): Promise<(() => void) | void>; clear(): Promise; save(): any; restore(token: DatagridPluginConfig, columns_config?: ColumnsConfig): void; deselect(): Promise; hit_test(x: number, y: number): Promise; restyle(): void; delete(): void; }