1 | import { EditorState, Plugin, Transaction } from '@remirror/pm/state';
|
2 | import { DecorationSet } from '@remirror/pm/view';
|
3 | import { PlaceholderPluginAction } from './file-placeholder-actions';
|
4 | interface UploadPlaceholderPluginData {
|
5 | set: DecorationSet;
|
6 | payloads: Map<string, any>;
|
7 | }
|
8 | export declare function createUploadPlaceholderPlugin(): Plugin<UploadPlaceholderPluginData>;
|
9 | /**
|
10 | * Try to find the position of the placeholder in the document based on the
|
11 | * upload placeholder id
|
12 | *
|
13 | * @remarks
|
14 | *
|
15 | * This function will first try to find the position based on the decoration set.
|
16 | * However, in some cases (e.g. `ReplaceStep`) the decoration will not be
|
17 | * available. In that case, it will then try to find every node in the document
|
18 | * recursively, which is much slower than the decoration set way in a large
|
19 | * document.
|
20 | */
|
21 | export declare function findUploadPlaceholderPos(state: EditorState, id: string): number | undefined;
|
22 | export declare function findUploadPlaceholderPayload(state: EditorState, id: string): any | undefined;
|
23 | /**
|
24 | * Determine if there are active file uploads in the given state
|
25 | *
|
26 | * @remarks
|
27 | * This utility is useful to warn users there are still active uploads before
|
28 | * exiting or saving a document.
|
29 | *
|
30 | * @see https://remirror.vercel.app/?path=/story/extensions-file--with-upload-incomplete-warning
|
31 | *
|
32 | * @param state - the editor state
|
33 | */
|
34 | export declare function hasUploadingFile(state: EditorState): boolean;
|
35 | export declare function setUploadPlaceholderAction(tr: Transaction, action: PlaceholderPluginAction): Transaction;
|
36 | export {};
|