import type { OpenMenu } from '../components/ContextMenu.js'; export interface Point { x: number; y: number; } export interface Box { left: number; top: number; right: number; bottom: number; } /** A small store for an editor's view state, so a change redraws only what reads it. */ export declare function createStore(initial: T): { get: () => T; set(patch: Partial): void; subscribe(listener: () => void): () => void; }; export type Store = ReturnType>; export declare function useStore(store: Store, select: (state: T) => V): V; /** * Gives `container` focus back once it has fallen to the page, as when the row, menu or dialog * holding it goes away, so the editor's shortcuts, Cmd+Z among them, keep reaching it. */ export declare function reclaimFocus(container: HTMLElement | null | undefined): void; /** Reclaims focus for the editor's container each time its dialog closes. */ export declare function useFocusAfterDialog(store: Store, container: () => HTMLElement | null): void; /** `openMenu` whose menus reclaim focus for the editor when they close. */ export declare function returningFocus(openMenu: OpenMenu, container: () => HTMLElement | null): OpenMenu; interface DragOptions { /** Each move, once the pointer has gone past the threshold. */ onMove?: (client: Point) => void; /** The release; `dragged` tells a drag from a click. */ onEnd?: (client: Point, dragged: boolean) => void; /** A canceled pointer, or Escape when `escape` is on. */ onCancel?: (dragged: boolean) => void; /** Escape cancels the press, and goes no further. */ escape?: boolean; /** Keeps the page's text from selecting: from the press, or once it is a drag. */ holdText?: 'press' | 'drag'; /** The click after the release: swallowed always, only after a drag, or never. */ swallowClick?: 'always' | 'drag' | 'never'; } /** Follows a press from `start` until it's released or canceled. */ export declare function trackDrag(start: Point, { onMove, onEnd, onCancel, escape: cancelOnEscape, holdText, swallowClick, }: DragOptions): void; export declare function place(box: Box): { left: number; top: number; width: number; height: number; }; /** The box a shift + drag draws, in its layer's coordinates. */ export declare function MarqueeBox({ box, className }: { box: Box; className?: string; }): import("react").JSX.Element; /** Calls `clear` when a press lands outside the editor and everything it has open. */ export declare function usePressOutside(container: () => HTMLElement | null, clear: () => void): void; export {};