UNPKG

prism-code-editor

Version:

Lightweight, extensible code editor component for the web using Prism

24 lines (23 loc) 934 B
import { BasicExtension } from '../../index.js'; export interface SearchWidget extends BasicExtension { /** The search widget's outer element. */ readonly element: HTMLDivElement; /** * 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; } /** * Extension that adds a widget for search and replace functionality. * This extension needs styles from `prism-code-editor/search.css`. * * Once added to an editor the widget can be opened/closed programmatically with the * `editor.extensions.searchWidget` object. */ export declare const searchWidget: () => SearchWidget;