import { Ref } from 'vue'; import { SurfaceManager } from '../core/surface-manager.js'; import { Editor, FindReplaceConfig } from '../core/types/index.js'; import { SearchController, SearchSnapshot } from '../public/ui/types.js'; type FindReplaceSearchQuery = (...args: Parameters) => Partial; export type FindReplaceSearch = Pick & { getSnapshot: () => Partial; } & ({ find: FindReplaceSearchQuery; search?: FindReplaceSearchQuery; } | { find?: undefined; search: FindReplaceSearchQuery; }); type UseFindReplaceOptions = { getSurfaceManager: () => Pick | null; getActiveEditor: () => Editor | null; activeEditorRef?: Ref; getFindReplaceConfig?: () => boolean | FindReplaceConfig | undefined; /** * Getter for the SuperDoc-owned UI controller (`superdoc.ui`). Its `.search` * slice is the single find/replace session authority. */ getSuperDocUI?: () => { search?: FindReplaceSearch | null; } | null | undefined; }; /** * Composable that manages a find/replace floating surface. * * Owns all search state (query, toggles, match count, active index) and the * resolution chain for custom/external/built-in rendering. The component * receives a FindReplaceHandle with reactive state and actions. */ export declare function useFindReplace({ getSurfaceManager, getActiveEditor, activeEditorRef, getFindReplaceConfig, getSuperDocUI, }: UseFindReplaceOptions): { open: () => Promise; close: () => void; isOpen: Ref; wouldOpen: () => boolean; destroy: () => void; }; export {};