UNPKG

@atlaskit/editor-plugin-date

Version:

Date plugin for @atlaskit/editor-core

22 lines (21 loc) • 1.31 kB
import type { Command, CommandDispatch } from '@atlaskit/editor-common/types/command'; import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types/next-editor-plugin'; import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state'; import type { DatePlugin, DateType } from '../types'; /** * Creates a date using a new transaction from the editor state. * * @private * @deprecated Used by the legacy Quick Insert flow. Use `createDateAtTransaction` when an existing transaction is available. */ export declare const createDate: (isQuickInsertAction?: boolean) => (state: EditorState) => Transaction; export declare const createDateAtTransaction: (isQuickInsertAction?: boolean) => (tr: Transaction) => Transaction; /** Focus input */ export declare const focusDateInput: () => (state: EditorState, dispatch: CommandDispatch | undefined) => boolean; export declare const setDatePickerAt: (showDatePickerAt: number | null) => (state: EditorState, dispatch: (tr: Transaction) => void) => boolean; export declare const closeDatePicker: () => Command; export declare const closeDatePickerWithAnalytics: ({ date, pluginInjectionApi, }: { date?: DateType; pluginInjectionApi?: ExtractInjectionAPI<DatePlugin>; }) => Command; export declare const openDatePicker: () => Command;