UNPKG

@atlaskit/editor-plugin-find-replace

Version:

find replace plugin for @atlaskit/editor-core

46 lines (45 loc) • 1.83 kB
import React from 'react'; import type { WithIntlProps, WrappedComponentProps } from 'react-intl'; import type { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics/types/dispatch-analytics-event'; import { TRIGGER_METHOD } from '@atlaskit/editor-common/analytics/types/enums'; export type ReplaceProps = { /** * When `false`, the replace label, field, replacement count message and both * replace buttons are not rendered. Both chevrons and the Close button stay. * Defaults to `true`. */ allowReplace?: boolean; canReplace: boolean; count: { index: number; total: number; totalReplaceable?: number; }; dispatchAnalyticsEvent?: DispatchAnalyticsEvent; findTyped: boolean; focusToolbarButton: () => void; onArrowUp: () => void; onCancel: ({ triggerMethod, }: { triggerMethod: TRIGGER_METHOD.KEYBOARD | TRIGGER_METHOD.TOOLBAR | TRIGGER_METHOD.BUTTON; }) => void; onFindNext: ({ triggerMethod, }: { triggerMethod: TRIGGER_METHOD.KEYBOARD | TRIGGER_METHOD.BUTTON; }) => void; onFindPrev: ({ triggerMethod, }: { triggerMethod: TRIGGER_METHOD.KEYBOARD | TRIGGER_METHOD.BUTTON; }) => void; onReplace: ({ triggerMethod, replaceText, }: { replaceText: string; triggerMethod: TRIGGER_METHOD.KEYBOARD | TRIGGER_METHOD.BUTTON; }) => void; onReplaceAll: ({ replaceText }: { replaceText: string; }) => void; onReplaceTextfieldRefSet: (ref: React.RefObject<HTMLInputElement>) => void; replaceText?: string; setFindTyped: (value: boolean) => void; }; declare const _default_1: React.FC<WithIntlProps<ReplaceProps & WrappedComponentProps>> & { WrappedComponent: React.ComponentType<ReplaceProps & WrappedComponentProps>; }; export default _default_1;