import { EditResult } from "../types/handlers";
import { Identity, IdObj } from "../types/utils";
import { TreeProps } from "../types/tree-props";
import { MutableRefObject } from "react";
import { Align, FixedSizeList, ListOnItemsRenderedProps, VariableSizeList } from "react-window";
import { DefaultRow } from "../components/default-row";
import { DefaultNode } from "../components/default-node";
import { NodeApi } from "./node-api";
import { Actions, RootState } from "../state/root-reducer";
import { DefaultDragPreview } from "../components/default-drag-preview";
import { DefaultContainer } from "../components/default-container";
import { Cursor } from "../dnd/compute-drop";
import { Store } from "redux";
export declare class TreeApi<T> {
    store: Store<RootState, Actions>;
    props: TreeProps<T>;
    list: MutableRefObject<FixedSizeList | VariableSizeList | null>;
    listEl: MutableRefObject<HTMLDivElement | null>;
    static editPromise: null | ((args: EditResult) => void);
    root: NodeApi<T>;
    visibleNodes: NodeApi<T>[];
    visibleStartIndex: number;
    visibleStopIndex: number;
    idToIndex: {
        [id: string]: number;
    };
    private rowOffsets;
    constructor(store: Store<RootState, Actions>, props: TreeProps<T>, list: MutableRefObject<FixedSizeList | VariableSizeList | null>, listEl: MutableRefObject<HTMLDivElement | null>);
    update(props: TreeProps<T>): void;
    dispatch(action: Actions): {
        type: "FOCUS";
        id: string | null;
    } | {
        readonly type: "TREE_BLUR";
    } | {
        type: "EDIT";
        id: string | null;
    } | import("../types/utils").ActionTypes<{
        open(id: string, filtered: boolean): {
            type: "VISIBILITY_OPEN";
            id: string;
            filtered: boolean;
        };
        close(id: string, filtered: boolean): {
            type: "VISIBILITY_CLOSE";
            id: string;
            filtered: boolean;
        };
        toggle(id: string, filtered: boolean): {
            type: "VISIBILITY_TOGGLE";
            id: string;
            filtered: boolean;
        };
        clear(filtered: boolean): {
            type: "VISIBILITY_CLEAR";
            filtered: boolean;
        };
    }> | import("../types/utils").ActionTypes<{
        clear: () => {
            type: "SELECTION_CLEAR";
        };
        only: (id: string | IdObj) => {
            type: "SELECTION_ONLY";
            id: string;
        };
        add: (id: string | string[] | IdObj | IdObj[]) => {
            type: "SELECTION_ADD";
            ids: string[];
        };
        remove: (id: string | string[] | IdObj | IdObj[]) => {
            type: "SELECTION_REMOVE";
            ids: string[];
        };
        set: (args: {
            ids: Set<string>;
            anchor: string | null;
            mostRecent: string | null;
        }) => {
            ids: Set<string>;
            anchor: string | null;
            mostRecent: string | null;
            type: "SELECTION_SET";
        };
        mostRecent: (id: string | null | IdObj) => {
            type: "SELECTION_MOST_RECENT";
            id: string | null;
        };
        anchor: (id: string | null | IdObj) => {
            type: "SELECTION_ANCHOR";
            id: string | null;
        };
    }> | import("../types/utils").ActionTypes<{
        cursor(cursor: Cursor): {
            type: "DND_CURSOR";
            cursor: Cursor;
        };
        dragStart(id: string, dragIds: string[]): {
            type: "DND_DRAG_START";
            id: string;
            dragIds: string[];
        };
        dragEnd(): {
            type: "DND_DRAG_END";
        };
        hovering(parentId: string | null, index: number | null): {
            type: "DND_HOVERING";
            parentId: string | null;
            index: number | null;
        };
    }>;
    get state(): {
        nodes: {
            focus: import("../state/focus-slice").FocusState;
            edit: import("../state/edit-slice").EditState;
            open: import("../state/open-slice").OpenSlice;
            selection: import("../state/selection-slice").SelectionState;
            drag: import("../state/drag-slice").DragSlice;
        };
        dnd: import("../state/dnd-slice").DndState;
    };
    get openState(): import("../state/open-slice").OpenMap;
    get width(): string | number;
    get height(): number;
    get indent(): number;
    /**
     * The fixed row height. When a `rowHeight` function is supplied for variable
     * heights, this returns the default (24); use `rowHeightAt(index)` to get the
     * height of a specific row.
     */
    get rowHeight(): number;
    /**
     * The height of the row at `index`, evaluating the `rowHeight` function if
     * given. Falls back to the default height for an out-of-range index so this
     * never feeds an invalid `0` to react-window's `itemSize`.
     */
    rowHeightAt: (index: number) => number;
    /** The pixel offset of the top of the row at `index` from the top of the list. */
    rowTopPosition: (index: number) => number;
    /**
     * Tell the underlying virtualized list to recompute row heights at and after
     * `index`. Call this if a `rowHeight` function's output changes for reasons
     * the tree can't observe (e.g. external state).
     */
    redrawList: (afterIndex?: number) => void;
    /** Lazily-built prefix sum where offsets[i] is the top of row i. */
    private getRowOffsets;
    get overscanCount(): number;
    get searchTerm(): string;
    get matchFn(): (node: NodeApi<T>) => boolean;
    accessChildren(data: T): readonly T[] | null;
    accessId(data: T): string;
    /**
     * Resolve an identifier to a node id. Public methods accept an id string, a
     * NodeApi, or the raw row data; this is the one place that turns any of those
     * into the string id used internally. Raw data is run through the configured
     * `idAccessor` so a custom accessor (e.g. `uuid`) is honored everywhere, not
     * just where nodes were built. A NodeApi already carries its accessor-derived
     * `id`, so it is used directly rather than re-accessed (the accessor reads the
     * underlying data, which a NodeApi does not expose under that key). Unlike
     * `accessId`, an unresolved id comes back as `undefined` rather than throwing,
     * preserving the previous behavior of the `id`-only lookup.
     */
    identify(identity: string | IdObj | T): string;
    identifyNull(identity: Identity | T): string | null;
    get firstNode(): NodeApi<T>;
    get lastNode(): NodeApi<T>;
    get focusedNode(): NodeApi<T> | null;
    get mostRecentNode(): NodeApi<T> | null;
    get nextNode(): NodeApi<T> | null;
    get prevNode(): NodeApi<T> | null;
    get(id: string | null): NodeApi<T> | null;
    at(index: number): NodeApi<T> | null;
    nodesBetween(startId: string | null, endId: string | null): NodeApi<T>[];
    indexOf(id: Identity | T): number | null;
    get editingId(): string | null;
    createInternal(): Promise<void>;
    createLeaf(): Promise<void>;
    create(opts?: {
        type?: "internal" | "leaf";
        parentId?: null | string;
        index?: null | number;
    }): Promise<void>;
    delete(node: Identity | T | (string | IdObj | T)[]): Promise<void>;
    edit(node: string | IdObj | T): Promise<EditResult>;
    submit(identity: Identity | T, value: string): Promise<void>;
    reset(): void;
    activate(id: Identity | T): void;
    private resolveEdit;
    get selectedIds(): Set<string>;
    get selectedNodes(): NodeApi<T>[];
    focus(node: Identity | T, opts?: {
        scroll?: boolean;
    }): void;
    pageUp(): void;
    pageDown(): void;
    select(node: Identity | T, opts?: {
        align?: Align;
        focus?: boolean;
    }): void;
    deselect(node: Identity | T): void;
    selectMulti(identity: Identity | T, opts?: {
        align?: Align;
        focus?: boolean;
    }): void;
    selectContiguous(identity: Identity | T): void;
    deselectAll(): void;
    selectAll(): void;
    private filterSelectableNodes;
    setSelection(args: {
        ids: (IdObj | string | T)[] | null;
        anchor: Identity | T;
        mostRecent: Identity | T;
    }): void;
    get cursorParentId(): string | null;
    get cursorOverFolder(): boolean;
    get dragNodes(): NodeApi<T>[];
    get dragNode(): NodeApi<T> | null;
    get dragDestinationParent(): NodeApi<T> | null;
    get dragDestinationIndex(): number | null;
    canDrop(): boolean;
    drop(): void;
    hideCursor(): void;
    showCursor(cursor: Cursor): void;
    open(identity: Identity | T, redraw?: boolean): void;
    close(identity: Identity | T, redraw?: boolean): void;
    toggle(identity: Identity | T): void;
    openParents(identity: Identity | T): void;
    openSiblings(node: NodeApi<T>): void;
    openAll(): void;
    closeAll(): void;
    scrollTo(identity: Identity | T, align?: Align): Promise<void> | undefined;
    get isEditing(): boolean;
    get isFiltered(): boolean;
    get hasFocus(): boolean;
    get hasNoSelection(): boolean;
    get hasOneSelection(): boolean;
    get hasMultipleSelections(): boolean;
    isSelected(id?: string): boolean;
    isOpen(id?: string): boolean;
    isEditable(data: T): boolean;
    isDraggable(data: T): boolean;
    isSelectable(data: T): boolean;
    private isActionPossible;
    isDragging(node: Identity | T): boolean;
    isFocused(id: string): boolean;
    isMatch(node: NodeApi<T>): boolean;
    willReceiveDrop(node: Identity | T): boolean;
    onFocus(): void;
    onBlur(): void;
    onItemsRendered(args: ListOnItemsRenderedProps): void;
    get renderContainer(): import("react").ElementType<{}> | typeof DefaultContainer;
    get renderRow(): import("react").ElementType<import("..").RowRendererProps<T>> | typeof DefaultRow;
    get renderNode(): import("react").ElementType<import("..").NodeRendererProps<T>> | typeof DefaultNode;
    get renderDragPreview(): import("react").ElementType<import("..").DragPreviewProps> | typeof DefaultDragPreview;
    get renderCursor(): import("react").ElementType<import("..").CursorProps> | import("react").NamedExoticComponent<import("..").CursorProps>;
}
