extension-search
package @remirror/extension-search
class SearchExtension
Warning: This API is now obsolete.
- use
@remirror/extension-find
instead.
This extension add search functionality to your editor.
Signature:
export declare class SearchExtension extends PlainExtension<SearchOptions>
Extends: PlainExtension<SearchOptions>
(Some inherited members may not be shown because they are not represented in the documentation.)
property name
Signature:
get name(): "search";
method clearSearch
Clears the current search.
Signature:
clearSearch(): CommandFunction;
Returns:
CommandFunction
method createPlugin
This plugin is responsible for adding something decorations to the
Signature:
createPlugin(): CreateExtensionPlugin;
Returns:
CreateExtensionPlugin
method escapeShortcut
Signature:
escapeShortcut(_: KeyBindingProps): boolean;
Parameters:
Parameter | Type | Description |
---|---|---|
_ | KeyBindingProps |
Returns:
boolean
method replaceAllSearchResults
Replaces all search results with the replacement text.
Signature:
replaceAllSearchResults(replacement: string): CommandFunction;
Parameters:
Parameter | Type | Description |
---|---|---|
replacement | string |
Returns:
CommandFunction
method replaceSearchResult
Replace the provided
Signature:
replaceSearchResult(replacement: string, index?: number): CommandFunction;
Parameters:
Parameter | Type | Description |
---|---|---|
replacement | string | |
index | number | (Optional) |
Returns:
CommandFunction
method search
Find a search term in the editor. If no search term is provided it defaults to the currently selected text.
Signature:
search(searchTerm?: string, direction?: SearchDirection): CommandFunction;
Parameters:
Parameter | Type | Description |
---|---|---|
searchTerm | string | (Optional) |
direction | SearchDirection | (Optional) |
Returns:
CommandFunction
method searchBackwardShortcut
Signature:
searchBackwardShortcut(props: KeyBindingProps): boolean;
Parameters:
Parameter | Type | Description |
---|---|---|
props | KeyBindingProps |
Returns:
boolean
method searchForwardShortcut
Signature:
searchForwardShortcut(props: KeyBindingProps): boolean;
Parameters:
Parameter | Type | Description |
---|---|---|
props | KeyBindingProps |
Returns:
boolean
method searchNext
Find the next occurrence of the search term.
Signature:
searchNext(): CommandFunction;
Returns:
CommandFunction
method searchPrevious
Find the previous occurrence of the search term.
Signature:
searchPrevious(): CommandFunction;
Returns:
CommandFunction
variable rotateHighlightedIndex
Signature:
rotateHighlightedIndex: (props: RotateHighlightedIndexProps) => number
interface SearchOptions
Warning: This API is now obsolete.
- use
@remirror/extension-find
instead.
Signature:
export interface SearchOptions
property alwaysSearch
Signature:
alwaysSearch?: boolean;
property autoSelectNext
Signature:
autoSelectNext?: boolean;
property caseSensitive
Signature:
caseSensitive?: boolean;
property clearOnEscape
Whether to clear the search when the Escape
key is pressed.
Signature:
clearOnEscape?: boolean;
property disableRegex
Signature:
disableRegex?: boolean;
property highlightedClass
The class to apply to the currently highlighted index.
Signature:
highlightedClass?: Static<string>;
property onSearch
Search handler
Signature:
onSearch: Handler<(selectedText: string, direction: SearchDirection) => void>;
property searchClass
Signature:
searchClass?: Static<string>;
property searching
Signature:
searching?: boolean;
type SearchDirection
Signature:
export type SearchDirection = 'next' | 'previous';