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 } 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 { store: Store; props: TreeProps; list: MutableRefObject; listEl: MutableRefObject; static editPromise: null | ((args: EditResult) => void); root: NodeApi; visibleNodes: NodeApi[]; visibleStartIndex: number; visibleStopIndex: number; idToIndex: { [id: string]: number; }; constructor(store: Store, props: TreeProps, list: MutableRefObject, listEl: MutableRefObject); update(props: TreeProps): 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; anchor: string | null; mostRecent: string | null; }) => { ids: Set; 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; get rowHeight(): number; get overscanCount(): number; get searchTerm(): string; get matchFn(): (node: NodeApi) => boolean; accessChildren(data: T): readonly T[] | null; accessId(data: T): string; get firstNode(): NodeApi; get lastNode(): NodeApi; get focusedNode(): NodeApi | null; get mostRecentNode(): NodeApi | null; get nextNode(): NodeApi | null; get prevNode(): NodeApi | null; get(id: string | null): NodeApi | null; at(index: number): NodeApi | null; nodesBetween(startId: string | null, endId: string | null): NodeApi[]; indexOf(id: string | null | IdObj): number | null; get editingId(): string | null; createInternal(): Promise; createLeaf(): Promise; create(opts?: { type?: "internal" | "leaf"; parentId?: null | string; index?: null | number; }): Promise; delete(node: string | IdObj | null | string[] | IdObj[]): Promise; edit(node: string | IdObj): Promise; submit(identity: Identity, value: string): Promise; reset(): void; activate(id: string | IdObj | null): void; private resolveEdit; get selectedIds(): Set; get selectedNodes(): NodeApi[]; focus(node: Identity, opts?: { scroll?: boolean; }): void; pageUp(): void; pageDown(): void; select(node: Identity, opts?: { align?: Align; focus?: boolean; }): void; deselect(node: Identity): void; selectMulti(identity: Identity): void; selectContiguous(identity: Identity): void; deselectAll(): void; selectAll(): void; setSelection(args: { ids: (IdObj | string)[] | null; anchor: IdObj | string | null; mostRecent: IdObj | string | null; }): void; get cursorParentId(): string | null; get cursorOverFolder(): boolean; get dragNodes(): NodeApi[]; get dragNode(): NodeApi | null; get dragDestinationParent(): NodeApi | null; get dragDestinationIndex(): number | null; canDrop(): boolean; hideCursor(): void; showCursor(cursor: Cursor): void; open(identity: Identity): void; close(identity: Identity): void; toggle(identity: Identity): void; openParents(identity: Identity): void; openSiblings(node: NodeApi): void; openAll(): void; closeAll(): void; scrollTo(identity: Identity, align?: Align): Promise | 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; isDragging(node: string | IdObj | null): boolean; isFocused(id: string): boolean; isMatch(node: NodeApi): boolean; willReceiveDrop(node: string | IdObj | null): boolean; onFocus(): void; onBlur(): void; onItemsRendered(args: ListOnItemsRenderedProps): void; get renderContainer(): import("react").ElementType<{}> | typeof DefaultContainer; get renderRow(): import("react").ElementType> | typeof DefaultRow; get renderNode(): import("react").ElementType> | typeof DefaultNode; get renderDragPreview(): import("react").ElementType | typeof DefaultDragPreview; get renderCursor(): import("react").ElementType | import("react").NamedExoticComponent; }