/** * 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. * * @param {Object} options * @param {() => import('../core/surface-manager.js').SurfaceManager | null} options.getSurfaceManager * @param {() => import('@superdoc/super-editor').Editor | null} options.getActiveEditor * @param {import('vue').Ref} [options.activeEditorRef] - Reactive ref to the active editor (for watching switches) * @param {() => boolean | FindReplaceConfig | undefined} [options.getFindReplaceConfig] - Config getter */ export function useFindReplace({ getSurfaceManager, getActiveEditor, activeEditorRef, getFindReplaceConfig }: { getSurfaceManager: () => import('../core/surface-manager.js').SurfaceManager | null; getActiveEditor: () => import('../../../super-editor/src/index.js').Editor | null; activeEditorRef?: import('vue').Ref | undefined; getFindReplaceConfig?: (() => boolean | FindReplaceConfig | undefined) | undefined; }): { open: () => Promise; close: () => void; isOpen: import('vue').Ref; wouldOpen: () => boolean; destroy: () => void; }; /** * The shape of `setSearchSession`, * `nextSearchMatch`, `previousSearchMatch`, `replaceSearchMatch` returns. * The Search extension lives in super-editor; this composable only consumes * the two fields below. */ export type SearchResult = { matches: { length: number; }[]; activeMatchIndex: number; }; /** * The Search extension's storage shape. * The Search extension is internal to super-editor; this composable only * needs the fields it reads to detect a live search session and resync * from external mutations. */ export type SearchStorage = { searchIndex?: unknown; searchResults?: unknown; activeMatchIndex?: number | undefined; matches?: { length: number; }[] | undefined; }; export type FindReplaceConfig = import('../core/types/index.js').FindReplaceConfig; export type ResolvedFindReplaceTexts = import('../core/types/index.js').ResolvedFindReplaceTexts; export type FindReplaceHandle = import('../core/types/index.js').FindReplaceHandle; export type FindReplaceContext = import('../core/types/index.js').FindReplaceContext; export type FindReplaceResolution = import('../core/types/index.js').FindReplaceResolution; //# sourceMappingURL=use-find-replace.d.ts.map