import "d3-transition";
import { Field, Grid } from "./Database.ts";
import { PropertyExt } from "./PropertyExt.ts";
import { TextRect, TextSize } from "./Utility.ts";
import "../src/Widget.css";
export { Field };
export type IPrimative = boolean | number | string | object;
export type IFieldType = "boolean" | "number" | "string" | "dataset" | "object" | "any";
export interface InputField {
    id: string;
    type: IFieldType;
    multi?: boolean;
    default?: IPrimative | InputField[];
    children?: InputField[];
}
export interface IPos {
    x: number;
    y: number;
}
export interface ISize {
    width: number;
    height: number;
}
export interface BBox {
    x: number;
    y: number;
    width: number;
    height: number;
}
export interface DataMetaT {
    min?: number;
    max?: number;
    mean?: number;
    stdDev?: number;
    sum?: number;
}
export declare abstract class Widget extends PropertyExt {
    static _idSeed: string;
    protected _tag: string;
    protected _isRootNode: boolean;
    protected _db: Grid;
    protected _pos: any;
    protected _prevPos: any;
    protected _size: any;
    protected _widgetScale: any;
    protected _visible: any;
    protected _display: any;
    protected _dataMeta: DataMetaT;
    protected _target: null | HTMLElement | SVGElement;
    protected _placeholderElement: any;
    protected _parentWidget: any;
    protected _element: any;
    protected _renderCount: any;
    protected _overlayElement: any;
    constructor();
    columnChecksum(): string;
    dataChecksum(): string;
    importJSON(_: string | object): this;
    importCSV(_: string): this;
    importTSV(_: string): this;
    export(_?: "JSON" | "CSV" | "TSV"): string;
    leakCheck(newNode: any): void;
    renderCount(): number;
    columns(): string[];
    columns(_: string[], asDefault?: boolean): this;
    protected columnIdx(column: string): number;
    protected cellIdxFunc<T>(colIdx: number, defValue?: T): (row: any) => T;
    protected cellFunc<T>(column: string, defValue?: T): (row: any) => T;
    parsedData(): any[];
    formattedData(): any[][];
    data(): any;
    data(_: any): this;
    cloneData(): any;
    flattenData(columns?: string[], data?: any): any[];
    rowToObj(row: any[]): object;
    pos(): IPos;
    pos(_: IPos): this;
    x(): number;
    x(_: any): this;
    y(): number;
    y(_: any): this;
    size(): ISize;
    size(_: any): this;
    width(): number;
    width(_: any): this;
    height(): number;
    height(_: any): this;
    resize(size?: ISize, delta?: ISize): this;
    scale(): number;
    scale(_: any): this;
    visible(): boolean;
    visible(_: any): this;
    display(): boolean;
    display(_: any): this;
    dataMeta(): DataMetaT;
    dataMeta(_: any): this;
    private _appData;
    appData(key: string): any;
    appData(key: string, value: any): this;
    calcSnap(snapSize: any): ({
        x: number;
        y: number;
        width?: undefined;
        height?: undefined;
    } | {
        width: number;
        height: number;
        x?: undefined;
        y?: undefined;
    })[];
    toWidget(domNode: any): Widget | null;
    parentOverlay(): any;
    locateParentWidget(domNode?: any): Widget | null;
    locateSVGNode(domNode: any): SVGSVGElement | null;
    locateOverlayNode(): any;
    locateAncestor(classID: any): Widget | null;
    locateClosestAncestor(classIDArr: any): Widget | null;
    getAbsolutePos(domNode: any, w: any, h: any): any;
    hasOverlay(): any;
    syncOverlay(): void;
    getBBox(refresh?: boolean, round?: boolean): BBox;
    textSize(_text: string | string[], fontName?: string, fontSize?: number, bold?: boolean): Readonly<TextSize>;
    textRect(_text: string, fontName?: string, fontSize?: number, bold?: boolean): Readonly<TextRect>;
    element(): any;
    node(): any;
    target(): null | HTMLElement | SVGElement;
    target(_: null | string | HTMLElement | SVGElement): this;
    isDOMHidden(): boolean;
    hasSize(): boolean;
    protected publishedWidgets(): Widget[];
    private _prevNow;
    render(callback?: (w: Widget) => void): this;
    renderPromise(): Promise<Widget>;
    private _lazyRender;
    lazyRender(callback?: (w: Widget) => void): this;
    animationFrameRender(): this;
    enter(_domNode: HTMLElement, _element: any): void;
    preUpdate(_domNode: HTMLElement, _element: any): void;
    update(_domNode: HTMLElement, _element: any): void;
    postUpdate(_domNode: HTMLElement, _element: any): void;
    exit(_domNode?: HTMLElement, _element?: any): void;
}
export interface Widget {
    fields(): Field[];
    fields(_: Field[]): this;
    classed(classID: string): boolean;
    classed(classID: string, _: boolean): this;
    classed(): {
        [classID: string]: boolean;
    };
    classed(_: {
        [classID: string]: boolean;
    }): this;
}
