@atlaskit/editor-plugin-date
Version:
Date plugin for @atlaskit/editor-core
21 lines (20 loc) • 1.24 kB
TypeScript
import type { Command, CommandDispatch, ExtractInjectionAPI } from '@atlaskit/editor-common/types';
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;