UNPKG

@atlaskit/editor-plugin-find-replace

Version:

find replace plugin for @atlaskit/editor-core

36 lines (35 loc) • 2.32 kB
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics/api'; import type { TRIGGER_METHOD } from '@atlaskit/editor-common/analytics/types/enums'; import type { Command } from '@atlaskit/editor-common/types/command'; import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types/next-editor-plugin'; import type { EditorView } from '@atlaskit/editor-prosemirror/view'; import type { FindReplacePlugin } from '../findReplacePluginType'; /** * Hosts that do not install `editorViewMode` are always editing, so the attribute * falls back to `edit` when the api is absent. */ export type EditorViewModeAPI = ExtractInjectionAPI<FindReplacePlugin>['editorViewMode']; export declare const activateWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined, editorViewModeAPI?: EditorViewModeAPI) => ({ triggerMethod, }: { triggerMethod: TRIGGER_METHOD.SHORTCUT | TRIGGER_METHOD.TOOLBAR | TRIGGER_METHOD.EXTERNAL; }) => Command; export declare const findWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => ({ editorView, containerElement, keyword, }: { containerElement: HTMLElement | null; editorView: EditorView; keyword?: string; }) => Command; export declare const findNextWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined, editorView: EditorView) => ({ triggerMethod, }: { triggerMethod: TRIGGER_METHOD.KEYBOARD | TRIGGER_METHOD.BUTTON; }) => Command; export declare const findPrevWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined, editorView: EditorView) => ({ triggerMethod, }: { triggerMethod: TRIGGER_METHOD.KEYBOARD | TRIGGER_METHOD.BUTTON; }) => Command; export declare const replaceWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => ({ triggerMethod, replaceText, }: { replaceText: string; triggerMethod: TRIGGER_METHOD.KEYBOARD | TRIGGER_METHOD.BUTTON; }) => Command; export declare const replaceAllWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => ({ replaceText }: { replaceText: string; }) => Command; export declare const cancelSearchWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => ({ triggerMethod, }: { triggerMethod: TRIGGER_METHOD.KEYBOARD | TRIGGER_METHOD.TOOLBAR | TRIGGER_METHOD.BUTTON; }) => Command;