UNPKG

prism-react-editor

Version:

Lightweight, extensible code editor component for React apps

23 lines (22 loc) 841 B
import { PrismEditor } from '../../types'; export interface SearchWidget { /** * Hides the search widget and removes most event listeners. * @param focusTextarea Whether the editor's `textarea` should gain focus. Defaults to true. */ close(focusTextarea?: boolean): void; /** * Opens the search widget. * @param focusInput Whether the widgets's search input should gain focus. Defaults to true. */ open(focusInput?: boolean): void; } /** * Hook that adds a widget for search and replace functionality. * This requires styling from `prism-react-editor/search.css`. * * The widget can be opened/closed programmatically with the * `editor.extensions.searchWidget` object once effects have been run. */ declare const useSearchWidget: (editor: PrismEditor) => void; export { useSearchWidget };