@prosekit/extensions 0.7.19 → 0.7.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/dist/_tsup-dts-rollup.d.ts +2463 -2463
  2. package/dist/prosekit-extensions-autocomplete.d.ts +3 -3
  3. package/dist/prosekit-extensions-blockquote.d.ts +8 -8
  4. package/dist/prosekit-extensions-bold.d.ts +8 -8
  5. package/dist/prosekit-extensions-code-block.d.ts +20 -20
  6. package/dist/prosekit-extensions-code.d.ts +8 -8
  7. package/dist/prosekit-extensions-commit.d.ts +4 -4
  8. package/dist/prosekit-extensions-drop-cursor.d.ts +3 -3
  9. package/dist/prosekit-extensions-enter-rule.d.ts +5 -5
  10. package/dist/prosekit-extensions-file.d.ts +8 -8
  11. package/dist/prosekit-extensions-gap-cursor.d.ts +2 -2
  12. package/dist/prosekit-extensions-heading.d.ts +9 -9
  13. package/dist/prosekit-extensions-horizontal-rule.d.ts +8 -8
  14. package/dist/prosekit-extensions-image.d.ts +7 -7
  15. package/dist/prosekit-extensions-input-rule.d.ts +6 -6
  16. package/dist/prosekit-extensions-italic.d.ts +8 -8
  17. package/dist/prosekit-extensions-link.d.ts +10 -10
  18. package/dist/prosekit-extensions-list.d.ts +16 -16
  19. package/dist/prosekit-extensions-loro.d.ts +11 -11
  20. package/dist/prosekit-extensions-mark-rule.d.ts +2 -2
  21. package/dist/prosekit-extensions-mention.d.ts +4 -4
  22. package/dist/prosekit-extensions-mod-click-prevention.d.ts +2 -2
  23. package/dist/prosekit-extensions-placeholder.d.ts +2 -2
  24. package/dist/prosekit-extensions-readonly.d.ts +1 -1
  25. package/dist/prosekit-extensions-search.d.ts +3 -3
  26. package/dist/prosekit-extensions-strike.d.ts +8 -8
  27. package/dist/prosekit-extensions-table.d.ts +25 -25
  28. package/dist/prosekit-extensions-text-align.d.ts +8 -8
  29. package/dist/prosekit-extensions-underline.d.ts +7 -7
  30. package/dist/prosekit-extensions-virtual-selection.d.ts +2 -2
  31. package/dist/prosekit-extensions-yjs.d.ts +14 -14
  32. package/package.json +5 -5
@@ -1,2463 +1,2463 @@
1
- import { Attrs } from '@prosekit/pm/model';
2
- import { Attrs as Attrs_2 } from 'prosemirror-model';
3
- import type { Awareness } from 'y-protocols/awareness';
4
- import { BaseCommandsExtension } from '@prosekit/core';
5
- import type { BundledHighlighterOptions } from 'shiki';
6
- import { BundledLanguage } from 'shiki';
7
- import { BundledLanguageInfo } from 'shiki';
8
- import { bundledLanguagesInfo } from 'shiki';
9
- import { BundledTheme } from 'shiki';
10
- import { BundledThemeInfo } from 'shiki';
11
- import { bundledThemesInfo } from 'shiki';
12
- import { CellSelection } from 'prosemirror-tables';
13
- import { Command } from '@prosekit/pm/state';
14
- import { CursorAwareness } from 'loro-prosemirror';
15
- import type { DecorationAttrs } from '@prosekit/pm/view';
16
- import { DedentListOptions } from 'prosemirror-flat-list';
17
- import { config as default_alias_1 } from '@prosekit/dev/config-vitest';
18
- import { DocExtension } from '@prosekit/core';
19
- import { EditorState } from '@prosekit/pm/state';
20
- import type { EditorView } from '@prosekit/pm/view';
21
- import { Extension } from '@prosekit/core';
22
- import { ExtensionTyping } from '@prosekit/core';
23
- import { ExtractMarkActions } from '@prosekit/core';
24
- import { ExtractNodeActions } from '@prosekit/core';
25
- import { FindParentNodeResult } from '@prosekit/core';
26
- import { GapCursor } from 'prosemirror-gapcursor';
27
- import type { Highlighter } from 'shiki';
28
- import { HistoryExtension } from '@prosekit/core';
29
- import { IndentListOptions } from 'prosemirror-flat-list';
30
- import { InputRule } from '@prosekit/pm/inputrules';
31
- import type { IsEqual } from 'type-fest';
32
- import { ListAttributes } from 'prosemirror-flat-list';
33
- import { ListDOMSerializer } from 'prosemirror-flat-list';
34
- import type { LoroDocType } from 'loro-prosemirror';
35
- import { LoroSyncPluginProps } from 'loro-prosemirror';
36
- import { LoroUndoPluginProps } from 'loro-prosemirror';
37
- import { MarkType } from '@prosekit/pm/model';
38
- import { Node as Node_2 } from 'prosemirror-model';
39
- import { NodeAction } from '@prosekit/core';
40
- import { NodeChild } from '@prosekit/core';
41
- import { NodeJSON } from '@prosekit/core';
42
- import type { NodeType } from '@prosekit/pm/model';
43
- import { Options } from 'tsup';
44
- import { Parser } from 'prosemirror-highlight';
45
- import type { PeerID } from 'loro-crdt';
46
- import { PlainExtension } from '@prosekit/core';
47
- import { Plugin as Plugin_2 } from '@prosekit/pm/state';
48
- import { PluginKey } from '@prosekit/pm/state';
49
- import { ProseMirrorNode } from '@prosekit/pm/model';
50
- import type { ResolvedPos } from '@prosekit/pm/model';
51
- import type { Selection as Selection_2 } from '@prosekit/pm/state';
52
- import { SimplifyDeeper } from '@prosekit/core';
53
- import type { SpecialLanguage } from 'shiki';
54
- import { StepJSON } from '@prosekit/core';
55
- import { TestEditor } from '@prosekit/core/test';
56
- import { TextExtension } from '@prosekit/core';
57
- import { ToggleCollapsedOptions } from 'prosemirror-flat-list';
58
- import { ToMarkAction } from '@prosekit/core';
59
- import { Transaction } from '@prosekit/pm/state';
60
- import { Union } from '@prosekit/core';
61
- import { UnwrapListOptions } from 'prosemirror-flat-list';
62
- import { WrapInListGetAttrs } from 'prosemirror-flat-list';
63
- import type * as Y from 'yjs';
64
- import { yCursorPlugin } from 'y-prosemirror';
65
- import { ySyncPlugin } from 'y-prosemirror';
66
- import { yUndoPlugin } from 'y-prosemirror';
67
-
68
- export declare function applyMarkRules(rules: MarkRuleOptions[], transactions: readonly Transaction[], oldState: EditorState, newState: EditorState): Transaction | null;
69
-
70
- /**
71
- * Utility function assert that two types are equal in tests.
72
- */
73
- export declare function assertTypeEqual<T, U>(_val: IsEqual<T, U>): void;
74
-
75
- declare class AutocompleteRule {
76
- readonly regex: RegExp;
77
- readonly onMatch: MatchHandler;
78
- readonly onLeave?: VoidFunction;
79
- readonly canMatch: (options: {
80
- state: EditorState;
81
- }) => boolean;
82
- constructor(options: {
83
- regex: RegExp;
84
- onEnter: MatchHandler;
85
- onLeave?: VoidFunction;
86
- canMatch?: (options: {
87
- state: EditorState;
88
- }) => boolean;
89
- });
90
- }
91
- export { AutocompleteRule }
92
- export { AutocompleteRule as AutocompleteRule_alias_1 }
93
-
94
- declare type BlockquoteCommandsExtension = Extension<{
95
- Commands: {
96
- setBlockquote: [];
97
- insertBlockquote: [];
98
- toggleBlockquote: [];
99
- };
100
- }>;
101
- export { BlockquoteCommandsExtension }
102
- export { BlockquoteCommandsExtension as BlockquoteCommandsExtension_alias_1 }
103
-
104
- /**
105
- * @internal
106
- */
107
- declare type BlockquoteExtension = Union<[
108
- BlockquoteSpecExtension,
109
- BlockquoteCommandsExtension
110
- ]>;
111
- export { BlockquoteExtension }
112
- export { BlockquoteExtension as BlockquoteExtension_alias_1 }
113
-
114
- declare type BlockquoteSpecExtension = Extension<{
115
- Nodes: {
116
- blockquote: Attrs;
117
- };
118
- }>;
119
- export { BlockquoteSpecExtension }
120
- export { BlockquoteSpecExtension as BlockquoteSpecExtension_alias_1 }
121
-
122
- /**
123
- * @internal
124
- */
125
- declare type BoldCommandsExtension = Extension<{
126
- Commands: {
127
- toggleBold: [];
128
- };
129
- }>;
130
- export { BoldCommandsExtension }
131
- export { BoldCommandsExtension as BoldCommandsExtension_alias_1 }
132
-
133
- /**
134
- * @internal
135
- */
136
- declare type BoldExtension = Union<[BoldSpecExtension, BoldCommandsExtension]>;
137
- export { BoldExtension }
138
- export { BoldExtension as BoldExtension_alias_1 }
139
-
140
- /**
141
- * @internal
142
- */
143
- declare type BoldSpecExtension = Extension<{
144
- Marks: {
145
- bold: Attrs;
146
- };
147
- }>;
148
- export { BoldSpecExtension }
149
- export { BoldSpecExtension as BoldSpecExtension_alias_1 }
150
-
151
- export { BundledLanguage as ShikiBundledLanguage }
152
- export { BundledLanguage as ShikiBundledLanguage_alias_1 }
153
-
154
- export { BundledLanguageInfo as ShikiBundledLanguageInfo }
155
- export { BundledLanguageInfo as ShikiBundledLanguageInfo_alias_1 }
156
-
157
- export { bundledLanguagesInfo as shikiBundledLanguagesInfo }
158
- export { bundledLanguagesInfo as shikiBundledLanguagesInfo_alias_1 }
159
-
160
- export { BundledTheme as ShikiBundledTheme }
161
- export { BundledTheme as ShikiBundledTheme_alias_1 }
162
-
163
- export { BundledThemeInfo as ShikiBundledThemeInfo }
164
- export { BundledThemeInfo as ShikiBundledThemeInfo_alias_1 }
165
-
166
- export { bundledThemesInfo as shikiBundledThemesInfo }
167
- export { bundledThemesInfo as shikiBundledThemesInfo_alias_1 }
168
-
169
- /**
170
- * @public
171
- */
172
- export declare interface CellAttrs {
173
- colspan: number;
174
- rowspan: number;
175
- colwidth: number[] | null;
176
- }
177
-
178
- /**
179
- * The attributes for the `codeBlock` node.
180
- *
181
- * @public
182
- */
183
- declare interface CodeBlockAttrs {
184
- language: string;
185
- }
186
- export { CodeBlockAttrs }
187
- export { CodeBlockAttrs as CodeBlockAttrs_alias_1 }
188
-
189
- /**
190
- * @internal
191
- */
192
- declare type CodeBlockCommandsExtension = Extension<{
193
- Commands: {
194
- setCodeBlock: [attrs?: CodeBlockAttrs];
195
- insertCodeBlock: [attrs?: CodeBlockAttrs];
196
- toggleCodeBlock: [attrs?: CodeBlockAttrs];
197
- setCodeBlockAttrs: [attrs: CodeBlockAttrs];
198
- };
199
- }>;
200
- export { CodeBlockCommandsExtension }
201
- export { CodeBlockCommandsExtension as CodeBlockCommandsExtension_alias_1 }
202
-
203
- /**
204
- * @internal
205
- */
206
- declare type CodeBlockExtension = Union<[
207
- CodeBlockSpecExtension,
208
- CodeBlockCommandsExtension
209
- ]>;
210
- export { CodeBlockExtension }
211
- export { CodeBlockExtension as CodeBlockExtension_alias_1 }
212
-
213
- /**
214
- * @public
215
- */
216
- declare type CodeBlockHighlightOptions = {
217
- parser: HighlightParser;
218
- };
219
- export { CodeBlockHighlightOptions }
220
- export { CodeBlockHighlightOptions as CodeBlockHighlightOptions_alias_1 }
221
-
222
- /**
223
- * The options to configure the Shiki highlighter.
224
- *
225
- * @public
226
- */
227
- export declare interface CodeBlockShikiOptions extends Omit<ShikiHighlighterOptions, 'themes' | 'langs' | 'engine'> {
228
- /**
229
- * A list of Shiki themes to pre-load. The first theme in the list will be
230
- * used to render the code block.
231
- *
232
- * @default ['one-dark-pro']
233
- */
234
- themes?: BundledTheme[];
235
- /**
236
- * A list of Shiki languages to pre-load.
237
- *
238
- * @default ['text']
239
- */
240
- langs?: (BundledLanguage | SpecialLanguage)[];
241
- /**
242
- * The RegExp engine to use. By default, the JavaScript engine is used.
243
- */
244
- engine?: ShikiHighlighterOptions['engine'];
245
- }
246
-
247
- /**
248
- * @internal
249
- */
250
- declare type CodeBlockSpecExtension = Extension<{
251
- Nodes: {
252
- codeBlock: CodeBlockAttrs;
253
- };
254
- }>;
255
- export { CodeBlockSpecExtension }
256
- export { CodeBlockSpecExtension as CodeBlockSpecExtension_alias_1 }
257
-
258
- /**
259
- * @internal
260
- */
261
- declare type CodeCommandsExtension = Extension<{
262
- Commands: {
263
- toggleCode: [];
264
- };
265
- }>;
266
- export { CodeCommandsExtension }
267
- export { CodeCommandsExtension as CodeCommandsExtension_alias_1 }
268
-
269
- /**
270
- * @internal
271
- */
272
- declare type CodeExtension = Union<[CodeSpecExtension, CodeCommandsExtension]>;
273
- export { CodeExtension }
274
- export { CodeExtension as CodeExtension_alias_1 }
275
-
276
- /**
277
- * @internal
278
- */
279
- declare type CodeSpecExtension = Extension<{
280
- Marks: {
281
- code: Attrs;
282
- };
283
- }>;
284
- export { CodeSpecExtension }
285
- export { CodeSpecExtension as CodeSpecExtension_alias_1 }
286
-
287
- /**
288
- * A JSON representation of a commit.
289
- */
290
- export declare interface Commit {
291
- /**
292
- * The current doc node in the JSON format
293
- */
294
- doc: NodeJSON;
295
- /**
296
- * The parent node in the JSON format
297
- */
298
- parent: NodeJSON;
299
- /**
300
- * An array of steps in the JSON format that transform the parent node to the
301
- * current doc node.
302
- */
303
- steps: StepJSON[];
304
- }
305
-
306
- export declare class CommitRecorder {
307
- private parent;
308
- private doc;
309
- private steps;
310
- /**
311
- * Return a commit object including all changes since the last commit. `null`
312
- * will be returned if there is no change.
313
- */
314
- commit(): Commit | null;
315
- /**
316
- * @internal
317
- */
318
- init(doc: ProseMirrorNode): void;
319
- /**
320
- * @internal
321
- */
322
- apply(tr: Transaction): void;
323
- }
324
-
325
- export declare function createAutocompletePlugin({ getRules, }: {
326
- getRules: () => AutocompleteRule[];
327
- }): Plugin_2;
328
-
329
- /**
330
- * @internal
331
- */
332
- export declare function createLazyParser(highlighterOptions: HighlighterOptions): Parser;
333
-
334
- /**
335
- * @internal
336
- */
337
- export declare function createMarkInputRule({ regex, type, attrs, }: MarkInputRuleOptions): InputRule;
338
-
339
- export declare function createOrGetHighlighter(options: HighlighterOptions): HighlighterResult;
340
-
341
- export declare function createOrGetHighlighter_alias_1(options: HighlighterOptions): HighlighterResult;
342
-
343
- export { DedentListOptions }
344
- export { DedentListOptions as DedentListOptions_alias_1 }
345
-
346
- export declare const default_alias: Options | Options[] | ((overrideOptions: Options) => Options | Options[] | Promise<Options | Options[]>);
347
-
348
- export { default_alias_1 }
349
-
350
- export declare function defaultCanMatch({ state }: {
351
- state: EditorState;
352
- }): boolean;
353
-
354
- declare function defineAutocomplete(rule: AutocompleteRule): Extension;
355
- export { defineAutocomplete }
356
- export { defineAutocomplete as defineAutocomplete_alias_1 }
357
-
358
- /**
359
- * @public
360
- */
361
- declare function defineBlockquote(): BlockquoteExtension;
362
- export { defineBlockquote }
363
- export { defineBlockquote as defineBlockquote_alias_1 }
364
-
365
- /**
366
- * @internal
367
- */
368
- declare function defineBlockquoteCommands(): BlockquoteCommandsExtension;
369
- export { defineBlockquoteCommands }
370
- export { defineBlockquoteCommands as defineBlockquoteCommands_alias_1 }
371
-
372
- /**
373
- * Wraps the text block in a blockquote when `>` is typed at the start of a new
374
- * line followed by a space.
375
- */
376
- declare function defineBlockquoteInputRule(): PlainExtension;
377
- export { defineBlockquoteInputRule }
378
- export { defineBlockquoteInputRule as defineBlockquoteInputRule_alias_1 }
379
-
380
- /**
381
- * @internal
382
- */
383
- declare function defineBlockquoteKeymap(): PlainExtension;
384
- export { defineBlockquoteKeymap }
385
- export { defineBlockquoteKeymap as defineBlockquoteKeymap_alias_1 }
386
-
387
- declare function defineBlockquoteSpec(): BlockquoteSpecExtension;
388
- export { defineBlockquoteSpec }
389
- export { defineBlockquoteSpec as defineBlockquoteSpec_alias_1 }
390
-
391
- /**
392
- * @public
393
- */
394
- declare function defineBold(): BoldExtension;
395
- export { defineBold }
396
- export { defineBold as defineBold_alias_1 }
397
-
398
- /**
399
- * @internal
400
- */
401
- declare function defineBoldCommands(): BoldCommandsExtension;
402
- export { defineBoldCommands }
403
- export { defineBoldCommands as defineBoldCommands_alias_1 }
404
-
405
- /**
406
- * @internal
407
- */
408
- declare function defineBoldInputRule(): PlainExtension;
409
- export { defineBoldInputRule }
410
- export { defineBoldInputRule as defineBoldInputRule_alias_1 }
411
-
412
- /**
413
- * @internal
414
- */
415
- declare function defineBoldKeymap(): PlainExtension;
416
- export { defineBoldKeymap }
417
- export { defineBoldKeymap as defineBoldKeymap_alias_1 }
418
-
419
- /**
420
- * @internal
421
- */
422
- declare function defineBoldSpec(): BoldSpecExtension;
423
- export { defineBoldSpec }
424
- export { defineBoldSpec as defineBoldSpec_alias_1 }
425
-
426
- /**
427
- * @public
428
- */
429
- declare function defineCode(): CodeExtension;
430
- export { defineCode }
431
- export { defineCode as defineCode_alias_1 }
432
-
433
- /**
434
- * Adds `codeBlock` nodes to the editor. This includes the following extensions:
435
- *
436
- * - {@link defineCodeBlockSpec}
437
- * - {@link defineCodeBlockInputRule}
438
- * - {@link defineCodeBlockEnterRule}
439
- * - {@link defineCodeBlockKeymap}
440
- * - {@link defineCodeBlockCommands}.
441
- *
442
- * @public
443
- */
444
- declare function defineCodeBlock(): CodeBlockExtension;
445
- export { defineCodeBlock }
446
- export { defineCodeBlock as defineCodeBlock_alias_1 }
447
-
448
- /**
449
- * Adds commands for working with `codeBlock` nodes.
450
- *
451
- * @public
452
- */
453
- declare function defineCodeBlockCommands(): CodeBlockCommandsExtension;
454
- export { defineCodeBlockCommands }
455
- export { defineCodeBlockCommands as defineCodeBlockCommands_alias_1 }
456
-
457
- /**
458
- * Adds enter rules for `codeBlock` nodes.
459
- *
460
- * @public
461
- */
462
- declare function defineCodeBlockEnterRule(): PlainExtension;
463
- export { defineCodeBlockEnterRule }
464
- export { defineCodeBlockEnterRule as defineCodeBlockEnterRule_alias_1 }
465
-
466
- /**
467
- * Adds syntax highlighting to code blocks. This function requires a `Parser`
468
- * instance from the `prosemirror-highlight` package. See the
469
- * [documentation](https://github.com/ocavue/prosemirror-highlight) for more
470
- * information.
471
- *
472
- * @param options
473
- *
474
- * @public
475
- */
476
- declare function defineCodeBlockHighlight({ parser, }: CodeBlockHighlightOptions): Extension;
477
- export { defineCodeBlockHighlight }
478
- export { defineCodeBlockHighlight as defineCodeBlockHighlight_alias_1 }
479
-
480
- /**
481
- * Adds input rules for `codeBlock` nodes.
482
- *
483
- * @public
484
- */
485
- declare function defineCodeBlockInputRule(): PlainExtension;
486
- export { defineCodeBlockInputRule }
487
- export { defineCodeBlockInputRule as defineCodeBlockInputRule_alias_1 }
488
-
489
- /**
490
- * Defines the keymap for code blocks.
491
- */
492
- declare function defineCodeBlockKeymap(): PlainExtension;
493
- export { defineCodeBlockKeymap }
494
- export { defineCodeBlockKeymap as defineCodeBlockKeymap_alias_1 }
495
-
496
- /**
497
- * Adds syntax highlighting to code blocks using the [Shiki](https://github.com/shikijs/shiki) package.
498
- *
499
- * @param options - The options to configure the Shiki highlighter.
500
- *
501
- * @public
502
- */
503
- declare function defineCodeBlockShiki({ themes, langs, ...rest }?: CodeBlockShikiOptions): Extension;
504
- export { defineCodeBlockShiki }
505
- export { defineCodeBlockShiki as defineCodeBlockShiki_alias_1 }
506
-
507
- /**
508
- * Defines the `codeBlock` node spec.
509
- *
510
- * @public
511
- */
512
- declare function defineCodeBlockSpec(): CodeBlockSpecExtension;
513
- export { defineCodeBlockSpec }
514
- export { defineCodeBlockSpec as defineCodeBlockSpec_alias_1 }
515
-
516
- /**
517
- * @internal
518
- */
519
- declare function defineCodeCommands(): CodeCommandsExtension;
520
- export { defineCodeCommands }
521
- export { defineCodeCommands as defineCodeCommands_alias_1 }
522
-
523
- /**
524
- * @internal
525
- */
526
- declare function defineCodeInputRule(): PlainExtension;
527
- export { defineCodeInputRule }
528
- export { defineCodeInputRule as defineCodeInputRule_alias_1 }
529
-
530
- /**
531
- * @internal
532
- */
533
- declare function defineCodeKeymap(): PlainExtension;
534
- export { defineCodeKeymap }
535
- export { defineCodeKeymap as defineCodeKeymap_alias_1 }
536
-
537
- /**
538
- * @internal
539
- */
540
- declare function defineCodeSpec(): CodeSpecExtension;
541
- export { defineCodeSpec }
542
- export { defineCodeSpec as defineCodeSpec_alias_1 }
543
-
544
- /**
545
- * Define an extension that can record the changes in the editor.
546
- */
547
- export declare function defineCommitRecorder(commitRecorder: CommitRecorder): PlainExtension;
548
-
549
- /**
550
- * Define an extension to display the changes from the given commit in the editor.
551
- */
552
- export declare function defineCommitViewer(commit: Commit): PlainExtension;
553
-
554
- /**
555
- * Show up a decoration at the drop position when something is dragged over the editor.
556
- *
557
- * See [prosemirror-dropcursor](https://github.com/ProseMirror/prosemirror-dropcursor) for more information.
558
- *
559
- * @public
560
- */
561
- declare function defineDropCursor(options?: DropCursorOptions): DropCursorExtension;
562
- export { defineDropCursor }
563
- export { defineDropCursor as defineDropCursor_alias_1 }
564
-
565
- /**
566
- * Defines an enter rule. An enter rule applies when the text directly in front of
567
- * the cursor matches `regex` and user presses Enter. The `regex` should end
568
- * with `$`.
569
- *
570
- * @param options
571
- *
572
- * @public
573
- */
574
- export declare function defineEnterRule({ regex, handler, stop, }: EnterRuleOptions): PlainExtension;
575
-
576
- declare function defineFileDropHandler(handler: FileDropHandler): PlainExtension;
577
- export { defineFileDropHandler }
578
- export { defineFileDropHandler as defineFileDropHandler_alias_1 }
579
-
580
- declare function defineFilePasteHandler(handler: FilePasteHandler): PlainExtension;
581
- export { defineFilePasteHandler }
582
- export { defineFilePasteHandler as defineFilePasteHandler_alias_1 }
583
-
584
- /**
585
- * Capture clicks near and arrow-key-motion past places that don't have a
586
- * normally selectable position nearby, and create a gap cursor selection for
587
- * them. The cursor is drawn as an element with class `ProseMirror-gapcursor`.
588
- *
589
- * You can either include `prosekit/extensions/gap-cursor.css` or add your own
590
- * styles to make it visible.
591
- *
592
- * See
593
- * [prosemirror-gapcursor](https://github.com/ProseMirror/prosemirror-gapcursor)
594
- * for more information.
595
- *
596
- * @public
597
- */
598
- declare function defineGapCursor(): GapCursorExtension;
599
- export { defineGapCursor }
600
- export { defineGapCursor as defineGapCursor_alias_1 }
601
-
602
- /**
603
- * @public
604
- */
605
- declare function defineHeading(): HeadingExtension;
606
- export { defineHeading }
607
- export { defineHeading as defineHeading_alias_1 }
608
-
609
- /**
610
- * @internal
611
- */
612
- declare function defineHeadingCommands(): HeadingCommandsExtension;
613
- export { defineHeadingCommands }
614
- export { defineHeadingCommands as defineHeadingCommands_alias_1 }
615
-
616
- /**
617
- * Converts the text block to a heading when `#` is typed at the start of a new
618
- * line followed by a space.
619
- *
620
- * @internal
621
- */
622
- declare function defineHeadingInputRule(): PlainExtension;
623
- export { defineHeadingInputRule }
624
- export { defineHeadingInputRule as defineHeadingInputRule_alias_1 }
625
-
626
- /**
627
- * @internal
628
- */
629
- declare function defineHeadingKeymap(): PlainExtension;
630
- export { defineHeadingKeymap }
631
- export { defineHeadingKeymap as defineHeadingKeymap_alias_1 }
632
-
633
- /**
634
- * @internal
635
- */
636
- declare function defineHeadingSpec(): HeadingSpecExtension;
637
- export { defineHeadingSpec }
638
- export { defineHeadingSpec as defineHeadingSpec_alias_1 }
639
-
640
- /**
641
- * @public
642
- */
643
- declare function defineHorizontalRule(): HorizontalRuleExtension;
644
- export { defineHorizontalRule }
645
- export { defineHorizontalRule as defineHorizontalRule_alias_1 }
646
-
647
- declare function defineHorizontalRuleCommands(): HorizontalRuleCommandsExtension;
648
- export { defineHorizontalRuleCommands }
649
- export { defineHorizontalRuleCommands as defineHorizontalRuleCommands_alias_1 }
650
-
651
- /**
652
- * @public
653
- */
654
- declare function defineHorizontalRuleInputRule(): PlainExtension;
655
- export { defineHorizontalRuleInputRule }
656
- export { defineHorizontalRuleInputRule as defineHorizontalRuleInputRule_alias_1 }
657
-
658
- declare function defineHorizontalRuleSpec(): HorizontalRuleSpecExtension;
659
- export { defineHorizontalRuleSpec }
660
- export { defineHorizontalRuleSpec as defineHorizontalRuleSpec_alias_1 }
661
-
662
- /**
663
- * @public
664
- */
665
- declare function defineImage(): ImageExtension;
666
- export { defineImage }
667
- export { defineImage as defineImage_alias_1 }
668
-
669
- /**
670
- * @internal
671
- */
672
- declare function defineImageCommands(): ImageCommandsExtension;
673
- export { defineImageCommands }
674
- export { defineImageCommands as defineImageCommands_alias_1 }
675
-
676
- /**
677
- * @internal
678
- */
679
- declare function defineImageSpec(): ImageSpecExtension;
680
- export { defineImageSpec }
681
- export { defineImageSpec as defineImageSpec_alias_1 }
682
-
683
- /**
684
- * Defines an input rule extension.
685
- *
686
- * @param rule - The ProseMirror input rule to add.
687
- *
688
- * @public
689
- */
690
- export declare function defineInputRule(rule: InputRule): PlainExtension;
691
-
692
- /**
693
- * @public
694
- */
695
- declare function defineItalic(): ItalicExtension;
696
- export { defineItalic }
697
- export { defineItalic as defineItalic_alias_1 }
698
-
699
- /**
700
- * @internal
701
- */
702
- declare function defineItalicCommands(): ItalicCommandsExtension;
703
- export { defineItalicCommands }
704
- export { defineItalicCommands as defineItalicCommands_alias_1 }
705
-
706
- /**
707
- * @internal
708
- */
709
- declare function defineItalicInputRule(): PlainExtension;
710
- export { defineItalicInputRule }
711
- export { defineItalicInputRule as defineItalicInputRule_alias_1 }
712
-
713
- /**
714
- * @internal
715
- */
716
- declare function defineItalicKeymap(): PlainExtension;
717
- export { defineItalicKeymap }
718
- export { defineItalicKeymap as defineItalicKeymap_alias_1 }
719
-
720
- /**
721
- * @internal
722
- */
723
- declare function defineItalicSpec(): ItalicSpecExtension;
724
- export { defineItalicSpec }
725
- export { defineItalicSpec as defineItalicSpec_alias_1 }
726
-
727
- /**
728
- * @public
729
- */
730
- export declare function defineLink(): LinkExtension;
731
-
732
- export declare function defineLinkCommands(): LinkCommandsExtension;
733
-
734
- /**
735
- * Apply link marks after typing Enter.
736
- *
737
- * @internal
738
- */
739
- export declare function defineLinkEnterRule(): PlainExtension;
740
-
741
- /**
742
- * Apply link marks after pressing Space.
743
- *
744
- * @internal
745
- */
746
- export declare function defineLinkInputRule(): PlainExtension;
747
-
748
- /**
749
- * Apply and remove link marks to the text during typing.
750
- *
751
- * @internal
752
- */
753
- export declare function defineLinkMarkRule(): Extension<ExtensionTyping<any, any, any>>;
754
-
755
- /**
756
- * @internal
757
- */
758
- export declare function defineLinkSpec(): LinkSpecExtension;
759
-
760
- /**
761
- * @public
762
- */
763
- declare function defineList(): ListExtension;
764
- export { defineList }
765
- export { defineList as defineList_alias_1 }
766
-
767
- /**
768
- * Defines list commands.
769
- *
770
- * @internal
771
- */
772
- declare function defineListCommands(): ListCommandsExtension;
773
- export { defineListCommands }
774
- export { defineListCommands as defineListCommands_alias_1 }
775
- export { defineListCommands as defineListCommands_alias_2 }
776
-
777
- /**
778
- * @internal
779
- */
780
- declare function defineListInputRules(): Extension;
781
- export { defineListInputRules }
782
- export { defineListInputRules as defineListInputRules_alias_1 }
783
- export { defineListInputRules as defineListInputRules_alias_2 }
784
-
785
- /**
786
- * Returns a extension that adds key bindings for list.
787
- *
788
- * @internal
789
- */
790
- declare function defineListKeymap(): PlainExtension;
791
- export { defineListKeymap }
792
- export { defineListKeymap as defineListKeymap_alias_1 }
793
- export { defineListKeymap as defineListKeymap_alias_2 }
794
-
795
- /**
796
- * @internal
797
- */
798
- declare function defineListPlugins(): PlainExtension;
799
- export { defineListPlugins }
800
- export { defineListPlugins as defineListPlugins_alias_1 }
801
- export { defineListPlugins as defineListPlugins_alias_2 }
802
-
803
- /**
804
- * @internal
805
- */
806
- declare function defineListSpec(): ListSpecExtension;
807
- export { defineListSpec }
808
- export { defineListSpec as defineListSpec_alias_1 }
809
- export { defineListSpec as defineListSpec_alias_2 }
810
-
811
- /**
812
- * @public
813
- */
814
- declare function defineLoro(options: LoroOptions): LoroExtension;
815
- export { defineLoro }
816
- export { defineLoro as defineLoro_alias_1 }
817
-
818
- declare function defineLoroCommands(): LoroCommandsExtension;
819
- export { defineLoroCommands }
820
- export { defineLoroCommands as defineLoroCommands_alias_1 }
821
- export { defineLoroCommands as defineLoroCommands_alias_2 }
822
-
823
- declare function defineLoroCursorPlugin(options: LoroCursorOptions): PlainExtension;
824
- export { defineLoroCursorPlugin }
825
- export { defineLoroCursorPlugin as defineLoroCursorPlugin_alias_1 }
826
- export { defineLoroCursorPlugin as defineLoroCursorPlugin_alias_2 }
827
-
828
- declare function defineLoroKeymap(): PlainExtension;
829
- export { defineLoroKeymap }
830
- export { defineLoroKeymap as defineLoroKeymap_alias_1 }
831
- export { defineLoroKeymap as defineLoroKeymap_alias_2 }
832
-
833
- declare function defineLoroSyncPlugin(options: LoroSyncPluginProps): PlainExtension;
834
- export { defineLoroSyncPlugin }
835
- export { defineLoroSyncPlugin as defineLoroSyncPlugin_alias_1 }
836
- export { defineLoroSyncPlugin as defineLoroSyncPlugin_alias_2 }
837
-
838
- declare function defineLoroUndoPlugin(options: LoroUndoPluginProps): PlainExtension;
839
- export { defineLoroUndoPlugin }
840
- export { defineLoroUndoPlugin as defineLoroUndoPlugin_alias_1 }
841
- export { defineLoroUndoPlugin as defineLoroUndoPlugin_alias_2 }
842
-
843
- /**
844
- * Defines an input rule for automatically adding inline marks when a given
845
- * pattern is typed.
846
- *
847
- * @public
848
- */
849
- export declare function defineMarkInputRule(options: MarkInputRuleOptions): PlainExtension;
850
-
851
- /**
852
- * A mark rule is something that can automatically apply marks to text if it
853
- * matches a certain pattern, and remove them if it doesn't match anymore.
854
- */
855
- declare function defineMarkRule(options: MarkRuleOptions): Extension<ExtensionTyping<any, any, any>>;
856
- export { defineMarkRule }
857
- export { defineMarkRule as defineMarkRule_alias_1 }
858
-
859
- /**
860
- * @public
861
- */
862
- export declare function defineMention(): Union<readonly [Extension< {
863
- Nodes: {
864
- mention: MentionAttrs;
865
- };
866
- }>, Extension< {
867
- Commands: {
868
- insertMention: [attrs: MentionAttrs];
869
- };
870
- }>]>;
871
-
872
- export declare function defineMentionCommands(): Extension< {
873
- Commands: {
874
- insertMention: [attrs: MentionAttrs];
875
- };
876
- }>;
877
-
878
- /**
879
- * @public
880
- */
881
- export declare function defineMentionSpec(): Extension< {
882
- Nodes: {
883
- mention: MentionAttrs;
884
- };
885
- }>;
886
-
887
- /**
888
- * By default, clicking a node while holding the mod key will select the node. This
889
- * extension disables that behavior.
890
- *
891
- * @public
892
- */
893
- export declare function defineModClickPrevention(): ModClickPreventionExtension;
894
-
895
- /**
896
- * Add a placeholder text to the editor when the current block or document is
897
- * empty.
898
- */
899
- export declare function definePlaceholder(options: PlaceholderOptions): PlainExtension;
900
-
901
- /**
902
- * Make the editor read-only.
903
- */
904
- export declare function defineReadonly(): PlainExtension;
905
-
906
- /**
907
- * Defines commands for search and replace.
908
- *
909
- * @public
910
- */
911
- export declare function defineSearchCommands(): Extension< {
912
- Commands: {
913
- findNext: [];
914
- findPrev: [];
915
- findNextNoWrap: [];
916
- findPrevNoWrap: [];
917
- replaceNext: [];
918
- replaceNextNoWrap: [];
919
- replaceCurrent: [];
920
- replaceAll: [];
921
- };
922
- }>;
923
-
924
- /**
925
- * Defines an extension that stores a current search query and replace string.
926
- *
927
- * @public
928
- */
929
- export declare function defineSearchQuery(options: SearchQueryOptions): PlainExtension;
930
-
931
- /**
932
- * @public
933
- */
934
- export declare function defineStrike(): StrikeExtension;
935
-
936
- /**
937
- * @internal
938
- */
939
- export declare function defineStrikeCommands(): StrikeCommandsExtension;
940
-
941
- /**
942
- * @internal
943
- */
944
- export declare function defineStrikeInputRule(): PlainExtension;
945
-
946
- /**
947
- * @internal
948
- */
949
- export declare function defineStrikeKeymap(): PlainExtension;
950
-
951
- /**
952
- * @internal
953
- */
954
- export declare function defineStrikeSpec(): StrikeSpecExtension;
955
-
956
- /**
957
- * @public
958
- */
959
- declare function defineTable(): TableExtension;
960
- export { defineTable }
961
- export { defineTable as defineTable_alias_1 }
962
-
963
- /**
964
- * @internal
965
- */
966
- declare function defineTableCellSpec(): TableCellSpecExtension;
967
- export { defineTableCellSpec }
968
- export { defineTableCellSpec as defineTableCellSpec_alias_1 }
969
-
970
- /**
971
- * Adds commands for working with `table` nodes.
972
- *
973
- * @public
974
- */
975
- declare function defineTableCommands(): TableCommandsExtension;
976
- export { defineTableCommands }
977
- export { defineTableCommands as defineTableCommands_alias_1 }
978
-
979
- declare function defineTableHeaderCellSpec(): TableHeaderCellSpecExtension;
980
- export { defineTableHeaderCellSpec }
981
- export { defineTableHeaderCellSpec as defineTableHeaderCellSpec_alias_1 }
982
-
983
- /**
984
- * @public
985
- */
986
- declare function defineTablePlugins(): PlainExtension;
987
- export { defineTablePlugins }
988
- export { defineTablePlugins as defineTablePlugins_alias_1 }
989
-
990
- /**
991
- * @internal
992
- */
993
- declare function defineTableRowSpec(): TableRowSpecExtension;
994
- export { defineTableRowSpec }
995
- export { defineTableRowSpec as defineTableRowSpec_alias_1 }
996
-
997
- /**
998
- * @internal
999
- */
1000
- declare function defineTableSpec(): TableSpecExtension;
1001
- export { defineTableSpec }
1002
- export { defineTableSpec as defineTableSpec_alias_1 }
1003
-
1004
- /**
1005
- * @internal
1006
- */
1007
- export declare function defineTestExtension(): Union<readonly [DocExtension, TextExtension, HeadingExtension, HistoryExtension, ListExtension, BlockquoteExtension, PlainExtension, BaseCommandsExtension, ItalicExtension, BoldExtension, UnderlineExtension, StrikeExtension, CodeExtension, LinkExtension, ImageExtension, Extension<{
1008
- Nodes: {
1009
- paragraph: Attrs_2;
1010
- };
1011
- }>, TableExtension, HorizontalRuleExtension]>;
1012
-
1013
- /**
1014
- * Adds a `textAlign` attribute to the specified nodes. This will be rendered as
1015
- * a CSS `text-align` style.
1016
- *
1017
- * @public
1018
- */
1019
- export declare function defineTextAlign<NodeName extends string = string>(options: TextAlignOptions<NodeName>): TextAlignExtension<NodeName>;
1020
-
1021
- /**
1022
- * @internal
1023
- */
1024
- export declare function defineTextAlignCommands(types: string[]): TextAlignCommandsExtension;
1025
-
1026
- /**
1027
- * @internal
1028
- */
1029
- export declare function defineTextAlignKeymap(types: string[]): PlainExtension;
1030
-
1031
- /**
1032
- * Defines an enter rule that replaces the matched text with a block node.
1033
- *
1034
- * See also {@link defineEnterRule}.
1035
- *
1036
- * @param options
1037
- *
1038
- * @public
1039
- */
1040
- export declare function defineTextBlockEnterRule({ regex, type, attrs, stop, }: TextBlockEnterRuleOptions): PlainExtension;
1041
-
1042
- /**
1043
- * Defines an input rule that changes the type of a textblock when the matched
1044
- * text is typed into it.
1045
- *
1046
- * See also [textblockTypeInputRule](https://prosemirror.net/docs/ref/#inputrules.textblockTypeInputRule)
1047
- *
1048
- * @param options
1049
- *
1050
- * @public
1051
- */
1052
- export declare function defineTextBlockInputRule({ regex, type, attrs, }: {
1053
- /**
1054
- * The regular expression to match against, which should end with `$`. It
1055
- * usually also starts with `^` to that it is only matched at the start of a
1056
- * textblock.
1057
- */
1058
- regex: RegExp;
1059
- /**
1060
- * The node type to replace the matched text with.
1061
- */
1062
- type: string | NodeType;
1063
- /**
1064
- * Attributes to set on the node.
1065
- */
1066
- attrs?: Attrs | null | ((match: RegExpMatchArray) => Attrs | null);
1067
- }): PlainExtension;
1068
-
1069
- /**
1070
- * @public
1071
- */
1072
- export declare function defineUnderline(): UnderlineExtension;
1073
-
1074
- /**
1075
- * @internal
1076
- */
1077
- export declare function defineUnderlineCommands(): UnderlineCommandsExtension;
1078
-
1079
- /**
1080
- * @internal
1081
- */
1082
- export declare function defineUnderlineKeymap(): PlainExtension;
1083
-
1084
- /**
1085
- * @internal
1086
- */
1087
- export declare function defineUnderlineSpec(): UnderlineSpecExtension;
1088
-
1089
- /**
1090
- * Shows a virtual selection when the editor is not focused. When the editor is
1091
- * not focused, the selected inline content will be wrapped in a `<span>`
1092
- * element with the class `prosekit-virtual-selection`.
1093
- *
1094
- * This is useful when you want to move the focus to an element outside the
1095
- * editor, but still want to show the selection.
1096
- *
1097
- * @public
1098
- */
1099
- export declare function defineVirtualSelection(): VirtualSelectionExtension;
1100
-
1101
- /**
1102
- * Defines an input rule for automatically wrapping a textblock when a given
1103
- * string is typed.
1104
- *
1105
- * See also [wrappingInputRule](https://prosemirror.net/docs/ref/#inputrules.wrappingInputRule)
1106
- *
1107
- * @param options
1108
- *
1109
- * @public
1110
- */
1111
- export declare function defineWrappingInputRule({ regex, type, attrs, join, }: {
1112
- /**
1113
- * The regular expression to match against, which should end with `$`. It
1114
- * usually also starts with `^` to that it is only matched at the start of a
1115
- * textblock.
1116
- */
1117
- regex: RegExp;
1118
- /**
1119
- * The type of node to wrap in.
1120
- */
1121
- type: string | NodeType;
1122
- /**
1123
- * Attributes to set on the node.
1124
- */
1125
- attrs?: Attrs | null | ((match: RegExpMatchArray) => Attrs | null);
1126
- /**
1127
- * By default, if there's a node with the same type above the newly wrapped
1128
- * node, the rule will try to
1129
- * [join](https://prosemirror.net/docs/ref/#transform.Transform.join) those
1130
- * two nodes. You can pass a join predicate, which takes a regular expression
1131
- * match and the node before the wrapped node, and can return a boolean to
1132
- * indicate whether a join should happen.
1133
- */
1134
- join?: (match: RegExpMatchArray, node: ProseMirrorNode) => boolean;
1135
- }): PlainExtension;
1136
-
1137
- /**
1138
- * @public
1139
- */
1140
- declare function defineYjs(options: YjsOptions): YjsExtension;
1141
- export { defineYjs }
1142
- export { defineYjs as defineYjs_alias_1 }
1143
-
1144
- declare function defineYjsCommands(): YjsCommandsExtension;
1145
- export { defineYjsCommands }
1146
- export { defineYjsCommands as defineYjsCommands_alias_1 }
1147
-
1148
- declare function defineYjsCursorPlugin(options: YjsCursorOptions): PlainExtension;
1149
- export { defineYjsCursorPlugin }
1150
- export { defineYjsCursorPlugin as defineYjsCursorPlugin_alias_1 }
1151
-
1152
- declare function defineYjsKeymap(): PlainExtension;
1153
- export { defineYjsKeymap }
1154
- export { defineYjsKeymap as defineYjsKeymap_alias_1 }
1155
-
1156
- declare function defineYjsSyncPlugin(options: YjsSyncOptions): PlainExtension;
1157
- export { defineYjsSyncPlugin }
1158
- export { defineYjsSyncPlugin as defineYjsSyncPlugin_alias_1 }
1159
-
1160
- declare function defineYjsUndoPlugin(options: YjsUndoOptions): PlainExtension;
1161
- export { defineYjsUndoPlugin }
1162
- export { defineYjsUndoPlugin as defineYjsUndoPlugin_alias_1 }
1163
-
1164
- /**
1165
- * @internal
1166
- */
1167
- declare type DropCursorExtension = PlainExtension;
1168
- export { DropCursorExtension }
1169
- export { DropCursorExtension as DropCursorExtension_alias_1 }
1170
-
1171
- declare interface DropCursorOptions {
1172
- /**
1173
- * The color of the cursor. Use `false` to apply no color and rely only on class.
1174
- *
1175
- * @default 'black'
1176
- */
1177
- color?: string | false;
1178
- /**
1179
- * The precise width of the cursor in pixels.
1180
- *
1181
- * @default 1
1182
- */
1183
- width?: number;
1184
- /**
1185
- * A CSS class name to add to the cursor element.
1186
- */
1187
- class?: string;
1188
- }
1189
- export { DropCursorOptions }
1190
- export { DropCursorOptions as DropCursorOptions_alias_1 }
1191
-
1192
- /**
1193
- * @public
1194
- */
1195
- export declare type EnterRuleHandler = (options: {
1196
- /**
1197
- * The current editor state.
1198
- */
1199
- state: EditorState;
1200
- /**
1201
- * The start position of the matched text.
1202
- */
1203
- from: number;
1204
- /**
1205
- * The end position of the matched text.
1206
- */
1207
- to: number;
1208
- /**
1209
- * The matched result from the regular expression.
1210
- */
1211
- match: RegExpExecArray;
1212
- }) => Transaction | null;
1213
-
1214
- /**
1215
- * Options for {@link defineEnterRule}.
1216
- *
1217
- * @public
1218
- */
1219
- export declare type EnterRuleOptions = {
1220
- /**
1221
- * The regular expression to match against. It should end with `$`.
1222
- */
1223
- regex: RegExp;
1224
- /**
1225
- * A function to be called when an enter rule is triggered.
1226
- */
1227
- handler: EnterRuleHandler;
1228
- /**
1229
- * Whether to stop further handlers from being called if this rule is triggered.
1230
- *
1231
- * @default false
1232
- */
1233
- stop?: boolean;
1234
- };
1235
-
1236
- /**
1237
- * When the selection is in a table node, create a default block after the table
1238
- * table, and move the cursor there.
1239
- *
1240
- * @public
1241
- */
1242
- declare const exitTable: Command;
1243
- export { exitTable }
1244
- export { exitTable as exitTable_alias_1 }
1245
-
1246
- /**
1247
- * A function that handles one of the files in a drop event.
1248
- *
1249
- * Returns `true` if the file was handled and thus should not be handled by
1250
- * other handlers.
1251
- */
1252
- export declare type FileDropHandler = (options: FileDropHandlerOptions) => boolean | void;
1253
-
1254
- declare interface FileDropHandlerOptions {
1255
- /**
1256
- * The editor view.
1257
- */
1258
- view: EditorView;
1259
- /**
1260
- * The event that triggered the drop.
1261
- */
1262
- event: DragEvent;
1263
- /**
1264
- * The file that was dropped.
1265
- */
1266
- file: File;
1267
- /**
1268
- * The position of the document where the file was dropped.
1269
- */
1270
- pos: number;
1271
- }
1272
- export { FileDropHandlerOptions }
1273
- export { FileDropHandlerOptions as FileDropHandlerOptions_alias_1 }
1274
-
1275
- declare type FileHandler<E extends Event> = (options: {
1276
- view: EditorView;
1277
- event: E;
1278
- file: File;
1279
- }) => boolean | void;
1280
-
1281
- /**
1282
- * A function that handles one of the files in a paste event.
1283
- *
1284
- * Returns `true` if the file was handled and thus should not be handled by
1285
- * other handlers.
1286
- */
1287
- export declare type FilePasteHandler = (options: FilePasteHandlerOptions) => boolean | void;
1288
-
1289
- declare interface FilePasteHandlerOptions {
1290
- /**
1291
- * The editor view.
1292
- */
1293
- view: EditorView;
1294
- /**
1295
- * The event that triggered the paste.
1296
- */
1297
- event: ClipboardEvent;
1298
- /**
1299
- * The file that was pasted.
1300
- */
1301
- file: File;
1302
- }
1303
- export { FilePasteHandlerOptions }
1304
- export { FilePasteHandlerOptions as FilePasteHandlerOptions_alias_1 }
1305
-
1306
- /**
1307
- * Try to find a resolved pos of a cell by using the given pos as a hit point.
1308
- *
1309
- * @internal
1310
- */
1311
- export declare function findCellPos(doc: ProseMirrorNode, pos: number): ResolvedPos | undefined;
1312
-
1313
- /**
1314
- * Try to find the anchor and head cell in the same table by using the given
1315
- * anchor and head as hit points, or fallback to the selection's anchor and
1316
- * head.
1317
- *
1318
- * @internal
1319
- */
1320
- export declare function findCellRange(selection: Selection_2, anchorHit?: number, headHit?: number): [ResolvedPos, ResolvedPos] | undefined;
1321
-
1322
- export declare function findTable($pos: ResolvedPos): FindParentNodeResult | undefined;
1323
-
1324
- export { GapCursor }
1325
-
1326
- /**
1327
- * @internal
1328
- */
1329
- declare type GapCursorExtension = PlainExtension;
1330
- export { GapCursorExtension }
1331
- export { GapCursorExtension as GapCursorExtension_alias_1 }
1332
-
1333
- export declare function getCheckRanges(transactions: readonly Transaction[], oldState: EditorState, newState: EditorState): Array<[number, number]>;
1334
-
1335
- export declare function getPluginState(state: EditorState): PredictionPluginState | undefined;
1336
-
1337
- export declare function getTrMeta(tr: Transaction): PredictionPluginState;
1338
-
1339
- export declare function handleEvent<E extends Event>(view: EditorView, event: E, handlers: FileHandler<E>[], getFiles: (event: E) => File[]): boolean;
1340
-
1341
- declare interface HeadingAttrs {
1342
- level: number;
1343
- }
1344
- export { HeadingAttrs }
1345
- export { HeadingAttrs as HeadingAttrs_alias_1 }
1346
-
1347
- /**
1348
- * @internal
1349
- */
1350
- declare type HeadingCommandsExtension = Extension<{
1351
- Commands: {
1352
- setHeading: [attrs?: HeadingAttrs | undefined];
1353
- insertHeading: [attrs?: HeadingAttrs | undefined];
1354
- toggleHeading: [attrs?: HeadingAttrs | undefined];
1355
- };
1356
- }>;
1357
- export { HeadingCommandsExtension }
1358
- export { HeadingCommandsExtension as HeadingCommandsExtension_alias_1 }
1359
-
1360
- /**
1361
- * @internal
1362
- */
1363
- declare type HeadingExtension = Union<[
1364
- HeadingSpecExtension,
1365
- HeadingCommandsExtension
1366
- ]>;
1367
- export { HeadingExtension }
1368
- export { HeadingExtension as HeadingExtension_alias_1 }
1369
-
1370
- /**
1371
- * @internal
1372
- */
1373
- declare type HeadingSpecExtension = Extension<{
1374
- Nodes: {
1375
- heading: HeadingAttrs;
1376
- };
1377
- }>;
1378
- export { HeadingSpecExtension }
1379
- export { HeadingSpecExtension as HeadingSpecExtension_alias_1 }
1380
-
1381
- declare interface HighlighterOptions extends Omit<ShikiHighlighterOptions, 'langs' | 'themes'> {
1382
- themes: BundledTheme[];
1383
- langs: (BundledLanguage | SpecialLanguage)[];
1384
- }
1385
- export { HighlighterOptions }
1386
- export { HighlighterOptions as HighlighterOptions_alias_1 }
1387
-
1388
- export declare type HighlighterResult = {
1389
- highlighter: Highlighter;
1390
- promise?: undefined;
1391
- } | {
1392
- highlighter?: undefined;
1393
- promise: Promise<void>;
1394
- };
1395
-
1396
- /**
1397
- * @public
1398
- *
1399
- * An alias for the `Parser` type from the `prosemirror-highlight` package.
1400
- */
1401
- declare type HighlightParser = Parser;
1402
- export { HighlightParser }
1403
- export { HighlightParser as HighlightParser_alias_1 }
1404
-
1405
- declare type HorizontalRuleCommandsExtension = Extension<{
1406
- Commands: {
1407
- insertHorizontalRule: [];
1408
- };
1409
- }>;
1410
- export { HorizontalRuleCommandsExtension }
1411
- export { HorizontalRuleCommandsExtension as HorizontalRuleCommandsExtension_alias_1 }
1412
-
1413
- declare type HorizontalRuleExtension = Union<[
1414
- HorizontalRuleSpecExtension,
1415
- HorizontalRuleCommandsExtension
1416
- ]>;
1417
- export { HorizontalRuleExtension }
1418
- export { HorizontalRuleExtension as HorizontalRuleExtension_alias_1 }
1419
-
1420
- declare type HorizontalRuleSpecExtension = Extension<{
1421
- Nodes: {
1422
- horizontalRule: Attrs;
1423
- };
1424
- }>;
1425
- export { HorizontalRuleSpecExtension }
1426
- export { HorizontalRuleSpecExtension as HorizontalRuleSpecExtension_alias_1 }
1427
-
1428
- /**
1429
- * @public
1430
- */
1431
- declare interface ImageAttrs {
1432
- src?: string | null;
1433
- width?: number | null;
1434
- height?: number | null;
1435
- }
1436
- export { ImageAttrs }
1437
- export { ImageAttrs as ImageAttrs_alias_1 }
1438
-
1439
- /**
1440
- * @internal
1441
- */
1442
- declare type ImageCommandsExtension = Extension<{
1443
- Commands: {
1444
- insertImage: [attrs?: ImageAttrs];
1445
- };
1446
- }>;
1447
- export { ImageCommandsExtension }
1448
- export { ImageCommandsExtension as ImageCommandsExtension_alias_1 }
1449
-
1450
- /**
1451
- * @internal
1452
- */
1453
- declare type ImageExtension = Union<[ImageSpecExtension, ImageCommandsExtension]>;
1454
- export { ImageExtension }
1455
- export { ImageExtension as ImageExtension_alias_1 }
1456
-
1457
- /**
1458
- * @internal
1459
- */
1460
- declare type ImageSpecExtension = Extension<{
1461
- Nodes: {
1462
- image: ImageAttrs;
1463
- };
1464
- }>;
1465
- export { ImageSpecExtension }
1466
- export { ImageSpecExtension as ImageSpecExtension_alias_1 }
1467
-
1468
- export { IndentListOptions }
1469
- export { IndentListOptions as IndentListOptions_alias_1 }
1470
-
1471
- export declare function inputText(input: string): Promise<void>;
1472
-
1473
- /**
1474
- * Returns a command that inserts a horizontal rule at the current selection.
1475
- */
1476
- declare function insertHorizontalRule(): Command;
1477
- export { insertHorizontalRule }
1478
- export { insertHorizontalRule as insertHorizontalRule_alias_1 }
1479
-
1480
- /**
1481
- * Insert a table node with the given number of rows and columns, and optionally
1482
- * a header row.
1483
- *
1484
- * @param options
1485
- *
1486
- * @public
1487
- */
1488
- declare function insertTable(options: InsertTableOptions): Command;
1489
- export { insertTable }
1490
- export { insertTable as insertTable_alias_1 }
1491
-
1492
- /**
1493
- * @public
1494
- */
1495
- declare interface InsertTableOptions {
1496
- row: number;
1497
- col: number;
1498
- header: boolean;
1499
- }
1500
- export { InsertTableOptions }
1501
- export { InsertTableOptions as InsertTableOptions_alias_1 }
1502
-
1503
- /**
1504
- * Checks if the given object is a `CellSelection` instance.
1505
- *
1506
- * @public
1507
- */
1508
- declare function isCellSelection(value: unknown): value is CellSelection;
1509
- export { isCellSelection }
1510
- export { isCellSelection as isCellSelection_alias_1 }
1511
-
1512
- /**
1513
- * @internal
1514
- */
1515
- declare type ItalicCommandsExtension = Extension<{
1516
- Commands: {
1517
- toggleItalic: [];
1518
- };
1519
- }>;
1520
- export { ItalicCommandsExtension }
1521
- export { ItalicCommandsExtension as ItalicCommandsExtension_alias_1 }
1522
-
1523
- /**
1524
- * @internal
1525
- */
1526
- declare type ItalicExtension = Union<[
1527
- ItalicSpecExtension,
1528
- ItalicCommandsExtension
1529
- ]>;
1530
- export { ItalicExtension }
1531
- export { ItalicExtension as ItalicExtension_alias_1 }
1532
-
1533
- /**
1534
- * @internal
1535
- */
1536
- declare type ItalicSpecExtension = Extension<{
1537
- Marks: {
1538
- italic: Attrs;
1539
- };
1540
- }>;
1541
- export { ItalicSpecExtension }
1542
- export { ItalicSpecExtension as ItalicSpecExtension_alias_1 }
1543
-
1544
- export declare const LINK_ENTER_RE: RegExp;
1545
-
1546
- export declare const LINK_INPUT_RE: RegExp;
1547
-
1548
- export declare const LINK_MARK_RE: RegExp;
1549
-
1550
- /**
1551
- * @public
1552
- */
1553
- export declare interface LinkAttrs {
1554
- href: string;
1555
- }
1556
-
1557
- /**
1558
- * @internal
1559
- */
1560
- export declare type LinkCommandsExtension = Extension<{
1561
- Commands: {
1562
- addLink: [LinkAttrs];
1563
- removeLink: [];
1564
- toggleLink: [LinkAttrs];
1565
- expandLink: [];
1566
- };
1567
- }>;
1568
-
1569
- /**
1570
- * @internal
1571
- */
1572
- export declare type LinkExtension = Union<[LinkSpecExtension, LinkCommandsExtension]>;
1573
-
1574
- /**
1575
- * @internal
1576
- */
1577
- export declare type LinkSpecExtension = Extension<{
1578
- Marks: {
1579
- link: LinkAttrs;
1580
- };
1581
- }>;
1582
-
1583
- /**
1584
- * The attributes of a list node.
1585
- *
1586
- * @public
1587
- */
1588
- declare interface ListAttrs {
1589
- /**
1590
- * The kind of list node.
1591
- */
1592
- kind?: 'bullet' | 'ordered' | 'task' | 'toggle';
1593
- /**
1594
- * The optional order of the list node.
1595
- */
1596
- order?: number | null;
1597
- /**
1598
- * Whether the list node is checked if its `kind` is `"task"`.
1599
- */
1600
- checked?: boolean;
1601
- /**
1602
- * Whether the list node is collapsed if its `kind` is `"toggle"`.
1603
- */
1604
- collapsed?: boolean;
1605
- }
1606
- export { ListAttrs }
1607
- export { ListAttrs as ListAttrs_alias_1 }
1608
- export { ListAttrs as ListAttrs_alias_2 }
1609
-
1610
- /**
1611
- * @internal
1612
- */
1613
- declare type ListCommandsExtension = Extension<{
1614
- Commands: {
1615
- dedentList: [options?: DedentListOptions];
1616
- indentList: [options?: IndentListOptions];
1617
- moveList: [direction: 'up' | 'down'];
1618
- splitList: [];
1619
- toggleCollapsed: [options?: ToggleCollapsedOptions];
1620
- unwrapList: [options?: UnwrapListOptions];
1621
- toggleList: [attrs?: ListAttributes];
1622
- wrapInList: [attrs?: ListAttributes];
1623
- insertList: [attrs?: ListAttributes];
1624
- };
1625
- }>;
1626
- export { ListCommandsExtension }
1627
- export { ListCommandsExtension as ListCommandsExtension_alias_1 }
1628
- export { ListCommandsExtension as ListCommandsExtension_alias_2 }
1629
-
1630
- export { ListDOMSerializer }
1631
- export { ListDOMSerializer as ListDOMSerializer_alias_1 }
1632
-
1633
- /**
1634
- * @internal
1635
- */
1636
- declare type ListExtension = Union<[ListSpecExtension, ListCommandsExtension]>;
1637
- export { ListExtension }
1638
- export { ListExtension as ListExtension_alias_1 }
1639
-
1640
- /**
1641
- * @internal
1642
- */
1643
- declare type ListSpecExtension = Extension<{
1644
- Nodes: {
1645
- list: ListAttrs;
1646
- };
1647
- }>;
1648
- export { ListSpecExtension }
1649
- export { ListSpecExtension as ListSpecExtension_alias_1 }
1650
- export { ListSpecExtension as ListSpecExtension_alias_2 }
1651
-
1652
- /**
1653
- * @internal
1654
- */
1655
- export declare type LoroCommandsExtension = Extension<{
1656
- Commands: {
1657
- undo: [];
1658
- redo: [];
1659
- };
1660
- }>;
1661
-
1662
- declare interface LoroCursorOptions {
1663
- awareness: CursorAwareness;
1664
- getSelection?: (state: EditorState) => Selection_2;
1665
- createCursor?: (user: PeerID) => Element;
1666
- createSelection?: (user: PeerID) => DecorationAttrs;
1667
- }
1668
- export { LoroCursorOptions }
1669
- export { LoroCursorOptions as LoroCursorOptions_alias_1 }
1670
- export { LoroCursorOptions as LoroCursorOptions_alias_2 }
1671
-
1672
- /**
1673
- * @internal
1674
- */
1675
- declare type LoroExtension = Union<[LoroCommandsExtension, PlainExtension]>;
1676
- export { LoroExtension }
1677
- export { LoroExtension as LoroExtension_alias_1 }
1678
-
1679
- declare interface LoroOptions {
1680
- /**
1681
- * The Loro instance handles the state of shared data.
1682
- */
1683
- doc: LoroDocType;
1684
- /**
1685
- * The Awareness instance.
1686
- */
1687
- awareness: CursorAwareness;
1688
- /**
1689
- * Extra options for `LoroSyncPlugin`.
1690
- */
1691
- sync?: Omit<LoroSyncPluginProps, 'doc'>;
1692
- /**
1693
- * Extra options for the `LoroUndoPlugin`.
1694
- */
1695
- undo?: Omit<LoroUndoPluginProps, 'doc'>;
1696
- /**
1697
- * Extra options for `LoroCursorPlugin`.
1698
- */
1699
- cursor?: Omit<LoroCursorOptions, 'awareness'>;
1700
- }
1701
- export { LoroOptions }
1702
- export { LoroOptions as LoroOptions_alias_1 }
1703
-
1704
- export { LoroSyncPluginProps }
1705
- export { LoroSyncPluginProps as LoroSyncPluginProps_alias_1 }
1706
-
1707
- export { LoroUndoPluginProps }
1708
- export { LoroUndoPluginProps as LoroUndoPluginProps_alias_1 }
1709
-
1710
- /**
1711
- * Options for {@link defineMarkInputRule}.
1712
- *
1713
- * @public
1714
- */
1715
- export declare interface MarkInputRuleOptions {
1716
- /**
1717
- * The regular expression to match against, which should end with `$` and has
1718
- * exactly one capture group. All other matched text outside the capture group
1719
- * will be deleted.
1720
- */
1721
- regex: RegExp;
1722
- /**
1723
- * The type of mark to set.
1724
- */
1725
- type: string | MarkType;
1726
- /**
1727
- * Attributes to set on the mark.
1728
- */
1729
- attrs?: Attrs | null | ((match: RegExpMatchArray) => Attrs | null);
1730
- }
1731
-
1732
- /**
1733
- * The options for {@link defineMarkRule}.
1734
- *
1735
- * @public
1736
- */
1737
- declare interface MarkRuleOptions {
1738
- /**
1739
- * The regular expression to match against. It must has a `g` flag to match
1740
- * all instances of the mark.
1741
- */
1742
- regex: RegExp;
1743
- /**
1744
- * The mark type to apply to the matched text.
1745
- */
1746
- type: string | MarkType;
1747
- /**
1748
- * Attributes to set on the mark. If a function is provided, it will be called
1749
- * with the matched result from the regular expression.
1750
- *
1751
- * @default null
1752
- */
1753
- attrs?: Attrs | null | ((match: RegExpMatchArray) => Attrs | null);
1754
- }
1755
- export { MarkRuleOptions }
1756
- export { MarkRuleOptions as MarkRuleOptions_alias_1 }
1757
-
1758
- declare type MatchHandler = (options: {
1759
- state: EditorState;
1760
- match: RegExpExecArray;
1761
- from: number;
1762
- to: number;
1763
- ignoreMatch: () => void;
1764
- deleteMatch: () => void;
1765
- }) => void;
1766
- export { MatchHandler }
1767
- export { MatchHandler as MatchHandler_alias_1 }
1768
-
1769
- export declare interface MentionAttrs {
1770
- id: string;
1771
- value: string;
1772
- kind: string;
1773
- }
1774
-
1775
- /**
1776
- * @internal
1777
- */
1778
- export declare type ModClickPreventionExtension = PlainExtension;
1779
-
1780
- export declare interface PlaceholderOptions {
1781
- /**
1782
- * The placeholder to use. It can be a static string or a function that
1783
- * receives the current editor state and returns a string.
1784
- */
1785
- placeholder: string | ((state: EditorState) => string);
1786
- /**
1787
- * By default, the placeholder text will be shown whenever the current text
1788
- * cursor is in an empty text node. If you only want to show the placeholder
1789
- * when the whole doc is empty, you can set this option to 'doc'.
1790
- *
1791
- * @default 'block'
1792
- */
1793
- strategy?: 'doc' | 'block';
1794
- }
1795
-
1796
- export declare const pluginKey: PluginKey<PredictionPluginState>;
1797
-
1798
- export declare interface PredictionPluginState {
1799
- active: boolean;
1800
- ignore: number | null;
1801
- matching: {
1802
- rule: AutocompleteRule;
1803
- from: number;
1804
- to: number;
1805
- match: RegExpExecArray;
1806
- } | null;
1807
- }
1808
-
1809
- /**
1810
- * @example
1811
- *
1812
- * ```ts
1813
- * await pressKey('mod-1')
1814
- * await pressKey('Backspace')
1815
- * ```
1816
- *
1817
- * @internal
1818
- */
1819
- export declare function pressKey(input: string): Promise<void>;
1820
-
1821
- /**
1822
- * @internal
1823
- */
1824
- export declare const redo: Command;
1825
-
1826
- /**
1827
- * Options for {@link defineSearchQuery}
1828
- *
1829
- * @public
1830
- */
1831
- export declare interface SearchQueryOptions {
1832
- /**
1833
- * The search string (or regular expression).
1834
- */
1835
- search: string;
1836
- /**
1837
- * The replace text.
1838
- */
1839
- replace?: string;
1840
- /**
1841
- * Indicates whether the search is case-sensitive
1842
- *
1843
- * @default false
1844
- */
1845
- caseSensitive?: boolean;
1846
- /**
1847
- * By default, string search will replace `\n`, `\r`, and `\t` in the query
1848
- * with newline, return, and tab characters. When this is set to true, that
1849
- * behavior is disabled.
1850
- *
1851
- * @default false
1852
- */
1853
- literal?: boolean;
1854
- /**
1855
- * When true, the search string is interpreted as a regular expression.
1856
- *
1857
- * @default false
1858
- */
1859
- regexp?: boolean;
1860
- /**
1861
- * Enable whole-word matching.
1862
- *
1863
- * @default false
1864
- */
1865
- wholeWord?: boolean;
1866
- }
1867
-
1868
- /**
1869
- * @public
1870
- */
1871
- declare function selectTable(options?: SelectTableOptions): Command;
1872
- export { selectTable }
1873
- export { selectTable as selectTable_alias_1 }
1874
-
1875
- /**
1876
- * @public
1877
- */
1878
- declare function selectTableCell(options?: SelectTableCellOptions): Command;
1879
- export { selectTableCell }
1880
- export { selectTableCell as selectTableCell_alias_1 }
1881
-
1882
- /**
1883
- * @public
1884
- */
1885
- declare interface SelectTableCellOptions {
1886
- /**
1887
- * A hit position of the table cell to select from. By default, the selection
1888
- * anchor will be used.
1889
- */
1890
- pos?: number;
1891
- }
1892
- export { SelectTableCellOptions }
1893
- export { SelectTableCellOptions as SelectTableCellOptions_alias_1 }
1894
-
1895
- /**
1896
- * @public
1897
- */
1898
- declare function selectTableColumn(options?: SelectTableColumnOptions): Command;
1899
- export { selectTableColumn }
1900
- export { selectTableColumn as selectTableColumn_alias_1 }
1901
-
1902
- /**
1903
- * @public
1904
- */
1905
- declare interface SelectTableColumnOptions {
1906
- /**
1907
- * A hit position of the table cell to select from. By default, the selection
1908
- * anchor will be used.
1909
- */
1910
- anchor?: number;
1911
- /**
1912
- * A hit position of the table cell to select to. By default, the selection
1913
- * head will be used.
1914
- */
1915
- head?: number;
1916
- }
1917
- export { SelectTableColumnOptions }
1918
- export { SelectTableColumnOptions as SelectTableColumnOptions_alias_1 }
1919
-
1920
- /**
1921
- * @public
1922
- */
1923
- declare interface SelectTableOptions {
1924
- /**
1925
- * A hit position of the table to select from. By default, the selection
1926
- * anchor will be used.
1927
- */
1928
- pos?: number;
1929
- }
1930
- export { SelectTableOptions }
1931
- export { SelectTableOptions as SelectTableOptions_alias_1 }
1932
-
1933
- /**
1934
- * @public
1935
- */
1936
- declare function selectTableRow(options?: SelectTableRowOptions): Command;
1937
- export { selectTableRow }
1938
- export { selectTableRow as selectTableRow_alias_1 }
1939
-
1940
- /**
1941
- * @public
1942
- */
1943
- declare interface SelectTableRowOptions {
1944
- /**
1945
- * A hit position of the table cell to select from. By default, the selection
1946
- * anchor will be used.
1947
- */
1948
- anchor?: number;
1949
- /**
1950
- * A hit position of the table cell to select to. By default, the selection
1951
- * head will be used.
1952
- */
1953
- head?: number;
1954
- }
1955
- export { SelectTableRowOptions }
1956
- export { SelectTableRowOptions as SelectTableRowOptions_alias_1 }
1957
-
1958
- /**
1959
- * @internal
1960
- */
1961
- export declare function setTextAlign({ types, value, }: {
1962
- types: string[];
1963
- value: string | null;
1964
- }): Command;
1965
-
1966
- export declare function setTrMeta(tr: Transaction, meta: PredictionPluginState): Transaction;
1967
-
1968
- /**
1969
- * @internal
1970
- */
1971
- export declare function setupTest(): {
1972
- editor: TestEditor<Union<readonly [DocExtension, TextExtension, HeadingExtension, HistoryExtension, ListExtension, BlockquoteExtension, PlainExtension, BaseCommandsExtension, ItalicExtension, BoldExtension, UnderlineExtension, StrikeExtension, CodeExtension, LinkExtension, ImageExtension, Extension<{
1973
- Nodes: {
1974
- paragraph: Attrs_2;
1975
- };
1976
- }>, TableExtension, HorizontalRuleExtension]>>;
1977
- m: ToMarkAction<SimplifyDeeper< {
1978
- bold: {
1979
- readonly [x: string]: any;
1980
- };
1981
- code: {
1982
- readonly [x: string]: any;
1983
- };
1984
- italic: {
1985
- readonly [x: string]: any;
1986
- };
1987
- link: {
1988
- href: string;
1989
- };
1990
- strike: {
1991
- readonly [x: string]: any;
1992
- };
1993
- underline: {
1994
- readonly [x: string]: any;
1995
- };
1996
- }>>;
1997
- n: {
1998
- p: NodeAction< {
1999
- readonly [x: string]: any;
2000
- }>;
2001
- h1: (...children: NodeChild[]) => Node_2;
2002
- h2: (...children: NodeChild[]) => Node_2;
2003
- h3: (...children: NodeChild[]) => Node_2;
2004
- h4: (...children: NodeChild[]) => Node_2;
2005
- h5: (...children: NodeChild[]) => Node_2;
2006
- h6: (...children: NodeChild[]) => Node_2;
2007
- bullet: (...children: NodeChild[]) => Node_2;
2008
- ordered: (...children: NodeChild[]) => Node_2;
2009
- checked: (...children: NodeChild[]) => Node_2;
2010
- unchecked: (...children: NodeChild[]) => Node_2;
2011
- collapsed: (...children: NodeChild[]) => Node_2;
2012
- expanded: (...children: NodeChild[]) => Node_2;
2013
- doc: NodeAction< {
2014
- readonly [x: string]: any;
2015
- }>;
2016
- paragraph: NodeAction< {
2017
- readonly [x: string]: any;
2018
- }>;
2019
- text: NodeAction< {
2020
- readonly [x: string]: any;
2021
- }>;
2022
- blockquote: NodeAction< {
2023
- readonly [x: string]: any;
2024
- }>;
2025
- heading: NodeAction< {
2026
- level: number;
2027
- }>;
2028
- horizontalRule: NodeAction< {
2029
- readonly [x: string]: any;
2030
- }>;
2031
- image: NodeAction< {
2032
- src?: (string | null) | undefined;
2033
- width?: (number | null) | undefined;
2034
- height?: (number | null) | undefined;
2035
- }>;
2036
- list: NodeAction< {
2037
- kind?: ("bullet" | "ordered" | "task" | "toggle") | undefined;
2038
- order?: (number | null) | undefined;
2039
- checked?: boolean | undefined;
2040
- collapsed?: boolean | undefined;
2041
- }>;
2042
- table: NodeAction< {
2043
- readonly [x: string]: any;
2044
- }>;
2045
- tableRow: NodeAction< {
2046
- readonly [x: string]: any;
2047
- }>;
2048
- tableCell: NodeAction< {
2049
- colspan: number;
2050
- rowspan: number;
2051
- colwidth: number[] | null;
2052
- }>;
2053
- tableHeaderCell: NodeAction< {
2054
- colspan: number;
2055
- rowspan: number;
2056
- colwidth: number[] | null;
2057
- }>;
2058
- };
2059
- };
2060
-
2061
- /**
2062
- * @internal
2063
- */
2064
- export declare function setupTestFromExtension<E extends Extension>(extension: E): {
2065
- editor: TestEditor<E>;
2066
- n: ExtractNodeActions<E>;
2067
- m: ExtractMarkActions<E>;
2068
- };
2069
-
2070
- export declare interface ShikiHighlighterOptions extends BundledHighlighterOptions<BundledLanguage, BundledTheme> {
2071
- }
2072
-
2073
- /**
2074
- * @internal
2075
- */
2076
- export declare type StrikeCommandsExtension = Extension<{
2077
- Commands: {
2078
- toggleStrike: [];
2079
- };
2080
- }>;
2081
-
2082
- /**
2083
- * @internal
2084
- */
2085
- export declare type StrikeExtension = Union<[
2086
- StrikeSpecExtension,
2087
- StrikeCommandsExtension
2088
- ]>;
2089
-
2090
- /**
2091
- * @internal
2092
- */
2093
- export declare type StrikeSpecExtension = Extension<{
2094
- Marks: {
2095
- strike: Attrs;
2096
- };
2097
- }>;
2098
-
2099
- /**
2100
- * @internal
2101
- */
2102
- declare type TableCellSpecExtension = Extension<{
2103
- Nodes: {
2104
- tableCell: CellAttrs;
2105
- };
2106
- }>;
2107
- export { TableCellSpecExtension }
2108
- export { TableCellSpecExtension as TableCellSpecExtension_alias_1 }
2109
-
2110
- /**
2111
- * @internal
2112
- */
2113
- declare type TableCommandsExtension = Extension<{
2114
- Commands: {
2115
- insertTable: [InsertTableOptions];
2116
- exitTable: [];
2117
- selectTable: [options?: SelectTableOptions];
2118
- selectTableCell: [options?: SelectTableCellOptions];
2119
- selectTableColumn: [options?: SelectTableColumnOptions];
2120
- selectTableRow: [options?: SelectTableRowOptions];
2121
- addTableColumnBefore: [];
2122
- addTableColumnAfter: [];
2123
- addTableRowAbove: [];
2124
- addTableRowBelow: [];
2125
- deleteTable: [];
2126
- deleteTableColumn: [];
2127
- deleteTableRow: [];
2128
- deleteCellSelection: [];
2129
- mergeTableCells: [];
2130
- splitTableCell: [];
2131
- };
2132
- }>;
2133
- export { TableCommandsExtension }
2134
- export { TableCommandsExtension as TableCommandsExtension_alias_1 }
2135
-
2136
- /**
2137
- * @internal
2138
- */
2139
- declare type TableExtension = Union<[
2140
- TableSpecExtension,
2141
- TableRowSpecExtension,
2142
- TableCellSpecExtension,
2143
- TableHeaderCellSpecExtension,
2144
- TableCommandsExtension
2145
- ]>;
2146
- export { TableExtension }
2147
- export { TableExtension as TableExtension_alias_1 }
2148
-
2149
- /**
2150
- * @internal
2151
- */
2152
- declare type TableHeaderCellSpecExtension = Extension<{
2153
- Nodes: {
2154
- tableHeaderCell: CellAttrs;
2155
- };
2156
- }>;
2157
- export { TableHeaderCellSpecExtension }
2158
- export { TableHeaderCellSpecExtension as TableHeaderCellSpecExtension_alias_1 }
2159
-
2160
- /**
2161
- * @internal
2162
- */
2163
- declare type TableRowSpecExtension = Extension<{
2164
- Nodes: {
2165
- tableRow: Attrs;
2166
- };
2167
- }>;
2168
- export { TableRowSpecExtension }
2169
- export { TableRowSpecExtension as TableRowSpecExtension_alias_1 }
2170
-
2171
- /**
2172
- * @internal
2173
- */
2174
- declare type TableSpecExtension = Extension<{
2175
- Nodes: {
2176
- table: Attrs;
2177
- };
2178
- }>;
2179
- export { TableSpecExtension }
2180
- export { TableSpecExtension as TableSpecExtension_alias_1 }
2181
-
2182
- /**
2183
- * @internal
2184
- */
2185
- export declare type TextAlignAttrsExtension<NodeName extends string> = Extension<{
2186
- Nodes: {
2187
- [K in NodeName]: {
2188
- textAlign: string | null;
2189
- };
2190
- };
2191
- }>;
2192
-
2193
- /**
2194
- * @internal
2195
- */
2196
- export declare type TextAlignCommandsExtension = Extension<{
2197
- Commands: {
2198
- setTextAlign: [value: string | null];
2199
- };
2200
- }>;
2201
-
2202
- /**
2203
- * @internal
2204
- */
2205
- export declare type TextAlignExtension<NodeName extends string> = Union<[
2206
- TextAlignAttrsExtension<NodeName>,
2207
- TextAlignCommandsExtension
2208
- ]>;
2209
-
2210
- /**
2211
- * @public
2212
- */
2213
- export declare interface TextAlignOptions<NodeName extends string = string> {
2214
- /**
2215
- * The names of node to add the attribute to.
2216
- *
2217
- * @example
2218
- *
2219
- * ["paragraph", "heading"]
2220
- */
2221
- types: NodeName[];
2222
- /**
2223
- * The default value for the attribute.
2224
- *
2225
- * @default "left"
2226
- */
2227
- default?: string;
2228
- }
2229
-
2230
- /**
2231
- * Options for {@link defineTextBlockEnterRule}.
2232
- *
2233
- * @public
2234
- */
2235
- export declare type TextBlockEnterRuleOptions = {
2236
- /**
2237
- * The regular expression to match against. It should end with `$`.
2238
- */
2239
- regex: RegExp;
2240
- /**
2241
- * The node type to replace the matched text with.
2242
- */
2243
- type: string | NodeType;
2244
- /**
2245
- * Attributes to set on the node. If a function is provided, it will be called
2246
- * with the matched result from the regular expression.
2247
- */
2248
- attrs?: Attrs | null | ((match: RegExpMatchArray) => Attrs | null);
2249
- /**
2250
- * Whether to stop further handlers from being called if this rule is triggered.
2251
- *
2252
- * @default true
2253
- */
2254
- stop?: boolean;
2255
- };
2256
-
2257
- export { ToggleCollapsedOptions }
2258
- export { ToggleCollapsedOptions as ToggleCollapsedOptions_alias_1 }
2259
-
2260
- /**
2261
- * @internal
2262
- */
2263
- export declare type UnderlineCommandsExtension = Extension<{
2264
- Commands: {
2265
- toggleUnderline: [];
2266
- };
2267
- }>;
2268
-
2269
- /**
2270
- * @internal
2271
- */
2272
- export declare type UnderlineExtension = Union<[
2273
- UnderlineSpecExtension,
2274
- UnderlineCommandsExtension
2275
- ]>;
2276
-
2277
- /**
2278
- * @internal
2279
- */
2280
- export declare type UnderlineSpecExtension = Extension<{
2281
- Marks: {
2282
- underline: Attrs;
2283
- };
2284
- }>;
2285
-
2286
- /**
2287
- * @internal
2288
- */
2289
- export declare const undo: Command;
2290
-
2291
- export { UnwrapListOptions }
2292
- export { UnwrapListOptions as UnwrapListOptions_alias_1 }
2293
-
2294
- /**
2295
- * The implementation of the actual upload function. You need to implement this
2296
- * function to upload files to your desired destination.
2297
- */
2298
- declare type Uploader<Result> = (options: UploaderOptions) => Promise<Result>;
2299
- export { Uploader }
2300
- export { Uploader as Uploader_alias_1 }
2301
-
2302
- declare interface UploaderOptions {
2303
- /**
2304
- * The file to be uploaded.
2305
- */
2306
- file: File;
2307
- /**
2308
- * A callback function that should be called with the upload progress updates.
2309
- */
2310
- onProgress: (progress: UploadProgress) => void;
2311
- }
2312
- export { UploaderOptions }
2313
- export { UploaderOptions as UploaderOptions_alias_1 }
2314
-
2315
- /**
2316
- * An interface representing the upload progress.
2317
- */
2318
- declare interface UploadProgress {
2319
- loaded: number;
2320
- total: number;
2321
- }
2322
- export { UploadProgress }
2323
- export { UploadProgress as UploadProgress_alias_1 }
2324
-
2325
- /**
2326
- * A class that represents a upload task.
2327
- */
2328
- declare class UploadTask<Result> {
2329
- /**
2330
- * An [object URL](https://developer.mozilla.org/en-US/docs/Web/API/URL/createObjectURL)
2331
- * representing the file to be uploaded. This URL will be revoked once the
2332
- * upload is complete successfully.
2333
- */
2334
- readonly objectURL: string;
2335
- /**
2336
- * A boolean indicating whether the upload is complete (either successfully or with an error).
2337
- */
2338
- protected done: boolean;
2339
- /**
2340
- * A promise that fulfills once the upload is complete, or rejects if an error occurs.
2341
- */
2342
- readonly finished: Promise<Result>;
2343
- private subscribers;
2344
- /**
2345
- * Creates a new upload task. You can find the upload task by its object URL
2346
- * later using `UploadTask.get()`.
2347
- *
2348
- * @param options - The options for the upload task.
2349
- */
2350
- constructor({ file, uploader }: {
2351
- file: File;
2352
- uploader: Uploader<Result>;
2353
- });
2354
- /**
2355
- * Subscribes to progress updates. Returns a function to unsubscribe.
2356
- */
2357
- subscribeProgress(callback: (progress: UploadProgress) => void): VoidFunction;
2358
- /**
2359
- * Finds an upload task by its object URL.
2360
- */
2361
- static get<Result = unknown>(objectURL: string): UploadTask<Result> | undefined;
2362
- /**
2363
- * Deletes an upload task by its object URL.
2364
- */
2365
- static delete(objectURL: string): void;
2366
- }
2367
- export { UploadTask }
2368
- export { UploadTask as UploadTask_alias_1 }
2369
-
2370
- /**
2371
- * @internal
2372
- */
2373
- export declare type VirtualSelectionExtension = PlainExtension;
2374
-
2375
- export { WrapInListGetAttrs }
2376
- export { WrapInListGetAttrs as WrapInListGetAttrs_alias_1 }
2377
-
2378
- /**
2379
- * @internal
2380
- */
2381
- export declare type YjsCommandsExtension = Extension<{
2382
- Commands: {
2383
- undo: [];
2384
- redo: [];
2385
- };
2386
- }>;
2387
-
2388
- declare interface YjsCursorOptions extends YjsCursorPluginOptions {
2389
- awareness: Awareness;
2390
- }
2391
- export { YjsCursorOptions }
2392
- export { YjsCursorOptions as YjsCursorOptions_alias_1 }
2393
-
2394
- /**
2395
- * Options for `y-prosemirror`'s `yCursorPlugin`.
2396
- */
2397
- declare type YjsCursorPluginOptions = NonNullable<Parameters<typeof yCursorPlugin>[1]>;
2398
- export { YjsCursorPluginOptions }
2399
- export { YjsCursorPluginOptions as YjsCursorPluginOptions_alias_1 }
2400
-
2401
- /**
2402
- * @internal
2403
- */
2404
- declare type YjsExtension = Union<[YjsCommandsExtension, PlainExtension]>;
2405
- export { YjsExtension }
2406
- export { YjsExtension as YjsExtension_alias_1 }
2407
-
2408
- declare interface YjsOptions {
2409
- /**
2410
- * The Yjs instance handles the state of shared data.
2411
- */
2412
- doc: Y.Doc;
2413
- /**
2414
- * The Awareness instance.
2415
- */
2416
- awareness: Awareness;
2417
- /**
2418
- * The Yjs XmlFragment to use. If not provided,
2419
- * `doc.getXmlFragment('prosemirror')` will be used.
2420
- */
2421
- fragment?: Y.XmlFragment;
2422
- /**
2423
- * Options for `y-prosemirror`'s `ySyncPlugin`.
2424
- */
2425
- sync?: YjsSyncPluginOptions;
2426
- /**
2427
- * Options for the `y-prosemirror`'s `yUndoPlugin`.
2428
- */
2429
- undo?: YjsUndoPluginOptions;
2430
- /**
2431
- * Options for `y-prosemirror`'s `yCursorPlugin`.
2432
- */
2433
- cursor?: YjsCursorPluginOptions;
2434
- }
2435
- export { YjsOptions }
2436
- export { YjsOptions as YjsOptions_alias_1 }
2437
-
2438
- declare interface YjsSyncOptions extends YjsSyncPluginOptions {
2439
- fragment: Y.XmlFragment;
2440
- }
2441
- export { YjsSyncOptions }
2442
- export { YjsSyncOptions as YjsSyncOptions_alias_1 }
2443
-
2444
- /**
2445
- * Options for `y-prosemirror`'s `ySyncPlugin`.
2446
- */
2447
- declare type YjsSyncPluginOptions = NonNullable<Parameters<typeof ySyncPlugin>[1]>;
2448
- export { YjsSyncPluginOptions }
2449
- export { YjsSyncPluginOptions as YjsSyncPluginOptions_alias_1 }
2450
-
2451
- declare interface YjsUndoOptions extends YjsUndoPluginOptions {
2452
- }
2453
- export { YjsUndoOptions }
2454
- export { YjsUndoOptions as YjsUndoOptions_alias_1 }
2455
-
2456
- /**
2457
- * Options for the `y-prosemirror`'s `yUndoPlugin`.
2458
- */
2459
- declare type YjsUndoPluginOptions = NonNullable<Parameters<typeof yUndoPlugin>[0]>;
2460
- export { YjsUndoPluginOptions }
2461
- export { YjsUndoPluginOptions as YjsUndoPluginOptions_alias_1 }
2462
-
2463
- export { }
1
+ import { Attrs } from '@prosekit/pm/model';
2
+ import { Attrs as Attrs_2 } from 'prosemirror-model';
3
+ import type { Awareness } from 'y-protocols/awareness';
4
+ import { BaseCommandsExtension } from '@prosekit/core';
5
+ import type { BundledHighlighterOptions } from 'shiki';
6
+ import { BundledLanguage } from 'shiki';
7
+ import { BundledLanguageInfo } from 'shiki';
8
+ import { bundledLanguagesInfo } from 'shiki';
9
+ import { BundledTheme } from 'shiki';
10
+ import { BundledThemeInfo } from 'shiki';
11
+ import { bundledThemesInfo } from 'shiki';
12
+ import { CellSelection } from 'prosemirror-tables';
13
+ import { Command } from '@prosekit/pm/state';
14
+ import { CursorAwareness } from 'loro-prosemirror';
15
+ import type { DecorationAttrs } from '@prosekit/pm/view';
16
+ import { DedentListOptions } from 'prosemirror-flat-list';
17
+ import { config as default_alias_1 } from '@prosekit/dev/config-vitest';
18
+ import { DocExtension } from '@prosekit/core';
19
+ import { EditorState } from '@prosekit/pm/state';
20
+ import type { EditorView } from '@prosekit/pm/view';
21
+ import { Extension } from '@prosekit/core';
22
+ import { ExtensionTyping } from '@prosekit/core';
23
+ import { ExtractMarkActions } from '@prosekit/core';
24
+ import { ExtractNodeActions } from '@prosekit/core';
25
+ import { FindParentNodeResult } from '@prosekit/core';
26
+ import { GapCursor } from 'prosemirror-gapcursor';
27
+ import type { Highlighter } from 'shiki';
28
+ import { HistoryExtension } from '@prosekit/core';
29
+ import { IndentListOptions } from 'prosemirror-flat-list';
30
+ import { InputRule } from '@prosekit/pm/inputrules';
31
+ import type { IsEqual } from 'type-fest';
32
+ import { ListAttributes } from 'prosemirror-flat-list';
33
+ import { ListDOMSerializer } from 'prosemirror-flat-list';
34
+ import type { LoroDocType } from 'loro-prosemirror';
35
+ import { LoroSyncPluginProps } from 'loro-prosemirror';
36
+ import { LoroUndoPluginProps } from 'loro-prosemirror';
37
+ import { MarkType } from '@prosekit/pm/model';
38
+ import { Node as Node_2 } from 'prosemirror-model';
39
+ import { NodeAction } from '@prosekit/core';
40
+ import { NodeChild } from '@prosekit/core';
41
+ import { NodeJSON } from '@prosekit/core';
42
+ import type { NodeType } from '@prosekit/pm/model';
43
+ import { Options } from 'tsup';
44
+ import { Parser } from 'prosemirror-highlight';
45
+ import type { PeerID } from 'loro-crdt';
46
+ import { PlainExtension } from '@prosekit/core';
47
+ import { Plugin as Plugin_2 } from '@prosekit/pm/state';
48
+ import { PluginKey } from '@prosekit/pm/state';
49
+ import { ProseMirrorNode } from '@prosekit/pm/model';
50
+ import type { ResolvedPos } from '@prosekit/pm/model';
51
+ import type { Selection as Selection_2 } from '@prosekit/pm/state';
52
+ import { SimplifyDeeper } from '@prosekit/core';
53
+ import type { SpecialLanguage } from 'shiki';
54
+ import { StepJSON } from '@prosekit/core';
55
+ import { TestEditor } from '@prosekit/core/test';
56
+ import { TextExtension } from '@prosekit/core';
57
+ import { ToggleCollapsedOptions } from 'prosemirror-flat-list';
58
+ import { ToMarkAction } from '@prosekit/core';
59
+ import { Transaction } from '@prosekit/pm/state';
60
+ import { Union } from '@prosekit/core';
61
+ import { UnwrapListOptions } from 'prosemirror-flat-list';
62
+ import { WrapInListGetAttrs } from 'prosemirror-flat-list';
63
+ import type * as Y from 'yjs';
64
+ import { yCursorPlugin } from 'y-prosemirror';
65
+ import { ySyncPlugin } from 'y-prosemirror';
66
+ import { yUndoPlugin } from 'y-prosemirror';
67
+
68
+ export declare function applyMarkRules(rules: MarkRuleOptions[], transactions: readonly Transaction[], oldState: EditorState, newState: EditorState): Transaction | null;
69
+
70
+ /**
71
+ * Utility function assert that two types are equal in tests.
72
+ */
73
+ export declare function assertTypeEqual<T, U>(_val: IsEqual<T, U>): void;
74
+
75
+ declare class AutocompleteRule {
76
+ readonly regex: RegExp;
77
+ readonly onMatch: MatchHandler;
78
+ readonly onLeave?: VoidFunction;
79
+ readonly canMatch: (options: {
80
+ state: EditorState;
81
+ }) => boolean;
82
+ constructor(options: {
83
+ regex: RegExp;
84
+ onEnter: MatchHandler;
85
+ onLeave?: VoidFunction;
86
+ canMatch?: (options: {
87
+ state: EditorState;
88
+ }) => boolean;
89
+ });
90
+ }
91
+ export { AutocompleteRule }
92
+ export { AutocompleteRule as AutocompleteRule_alias_1 }
93
+
94
+ declare type BlockquoteCommandsExtension = Extension<{
95
+ Commands: {
96
+ setBlockquote: [];
97
+ insertBlockquote: [];
98
+ toggleBlockquote: [];
99
+ };
100
+ }>;
101
+ export { BlockquoteCommandsExtension }
102
+ export { BlockquoteCommandsExtension as BlockquoteCommandsExtension_alias_1 }
103
+
104
+ /**
105
+ * @internal
106
+ */
107
+ declare type BlockquoteExtension = Union<[
108
+ BlockquoteSpecExtension,
109
+ BlockquoteCommandsExtension
110
+ ]>;
111
+ export { BlockquoteExtension }
112
+ export { BlockquoteExtension as BlockquoteExtension_alias_1 }
113
+
114
+ declare type BlockquoteSpecExtension = Extension<{
115
+ Nodes: {
116
+ blockquote: Attrs;
117
+ };
118
+ }>;
119
+ export { BlockquoteSpecExtension }
120
+ export { BlockquoteSpecExtension as BlockquoteSpecExtension_alias_1 }
121
+
122
+ /**
123
+ * @internal
124
+ */
125
+ declare type BoldCommandsExtension = Extension<{
126
+ Commands: {
127
+ toggleBold: [];
128
+ };
129
+ }>;
130
+ export { BoldCommandsExtension }
131
+ export { BoldCommandsExtension as BoldCommandsExtension_alias_1 }
132
+
133
+ /**
134
+ * @internal
135
+ */
136
+ declare type BoldExtension = Union<[BoldSpecExtension, BoldCommandsExtension]>;
137
+ export { BoldExtension }
138
+ export { BoldExtension as BoldExtension_alias_1 }
139
+
140
+ /**
141
+ * @internal
142
+ */
143
+ declare type BoldSpecExtension = Extension<{
144
+ Marks: {
145
+ bold: Attrs;
146
+ };
147
+ }>;
148
+ export { BoldSpecExtension }
149
+ export { BoldSpecExtension as BoldSpecExtension_alias_1 }
150
+
151
+ export { BundledLanguage as ShikiBundledLanguage }
152
+ export { BundledLanguage as ShikiBundledLanguage_alias_1 }
153
+
154
+ export { BundledLanguageInfo as ShikiBundledLanguageInfo }
155
+ export { BundledLanguageInfo as ShikiBundledLanguageInfo_alias_1 }
156
+
157
+ export { bundledLanguagesInfo as shikiBundledLanguagesInfo }
158
+ export { bundledLanguagesInfo as shikiBundledLanguagesInfo_alias_1 }
159
+
160
+ export { BundledTheme as ShikiBundledTheme }
161
+ export { BundledTheme as ShikiBundledTheme_alias_1 }
162
+
163
+ export { BundledThemeInfo as ShikiBundledThemeInfo }
164
+ export { BundledThemeInfo as ShikiBundledThemeInfo_alias_1 }
165
+
166
+ export { bundledThemesInfo as shikiBundledThemesInfo }
167
+ export { bundledThemesInfo as shikiBundledThemesInfo_alias_1 }
168
+
169
+ /**
170
+ * @public
171
+ */
172
+ export declare interface CellAttrs {
173
+ colspan: number;
174
+ rowspan: number;
175
+ colwidth: number[] | null;
176
+ }
177
+
178
+ /**
179
+ * The attributes for the `codeBlock` node.
180
+ *
181
+ * @public
182
+ */
183
+ declare interface CodeBlockAttrs {
184
+ language: string;
185
+ }
186
+ export { CodeBlockAttrs }
187
+ export { CodeBlockAttrs as CodeBlockAttrs_alias_1 }
188
+
189
+ /**
190
+ * @internal
191
+ */
192
+ declare type CodeBlockCommandsExtension = Extension<{
193
+ Commands: {
194
+ setCodeBlock: [attrs?: CodeBlockAttrs];
195
+ insertCodeBlock: [attrs?: CodeBlockAttrs];
196
+ toggleCodeBlock: [attrs?: CodeBlockAttrs];
197
+ setCodeBlockAttrs: [attrs: CodeBlockAttrs];
198
+ };
199
+ }>;
200
+ export { CodeBlockCommandsExtension }
201
+ export { CodeBlockCommandsExtension as CodeBlockCommandsExtension_alias_1 }
202
+
203
+ /**
204
+ * @internal
205
+ */
206
+ declare type CodeBlockExtension = Union<[
207
+ CodeBlockSpecExtension,
208
+ CodeBlockCommandsExtension
209
+ ]>;
210
+ export { CodeBlockExtension }
211
+ export { CodeBlockExtension as CodeBlockExtension_alias_1 }
212
+
213
+ /**
214
+ * @public
215
+ */
216
+ declare type CodeBlockHighlightOptions = {
217
+ parser: HighlightParser;
218
+ };
219
+ export { CodeBlockHighlightOptions }
220
+ export { CodeBlockHighlightOptions as CodeBlockHighlightOptions_alias_1 }
221
+
222
+ /**
223
+ * The options to configure the Shiki highlighter.
224
+ *
225
+ * @public
226
+ */
227
+ export declare interface CodeBlockShikiOptions extends Omit<ShikiHighlighterOptions, 'themes' | 'langs' | 'engine'> {
228
+ /**
229
+ * A list of Shiki themes to pre-load. The first theme in the list will be
230
+ * used to render the code block.
231
+ *
232
+ * @default ['one-dark-pro']
233
+ */
234
+ themes?: BundledTheme[];
235
+ /**
236
+ * A list of Shiki languages to pre-load.
237
+ *
238
+ * @default ['text']
239
+ */
240
+ langs?: (BundledLanguage | SpecialLanguage)[];
241
+ /**
242
+ * The RegExp engine to use. By default, the JavaScript engine is used.
243
+ */
244
+ engine?: ShikiHighlighterOptions['engine'];
245
+ }
246
+
247
+ /**
248
+ * @internal
249
+ */
250
+ declare type CodeBlockSpecExtension = Extension<{
251
+ Nodes: {
252
+ codeBlock: CodeBlockAttrs;
253
+ };
254
+ }>;
255
+ export { CodeBlockSpecExtension }
256
+ export { CodeBlockSpecExtension as CodeBlockSpecExtension_alias_1 }
257
+
258
+ /**
259
+ * @internal
260
+ */
261
+ declare type CodeCommandsExtension = Extension<{
262
+ Commands: {
263
+ toggleCode: [];
264
+ };
265
+ }>;
266
+ export { CodeCommandsExtension }
267
+ export { CodeCommandsExtension as CodeCommandsExtension_alias_1 }
268
+
269
+ /**
270
+ * @internal
271
+ */
272
+ declare type CodeExtension = Union<[CodeSpecExtension, CodeCommandsExtension]>;
273
+ export { CodeExtension }
274
+ export { CodeExtension as CodeExtension_alias_1 }
275
+
276
+ /**
277
+ * @internal
278
+ */
279
+ declare type CodeSpecExtension = Extension<{
280
+ Marks: {
281
+ code: Attrs;
282
+ };
283
+ }>;
284
+ export { CodeSpecExtension }
285
+ export { CodeSpecExtension as CodeSpecExtension_alias_1 }
286
+
287
+ /**
288
+ * A JSON representation of a commit.
289
+ */
290
+ export declare interface Commit {
291
+ /**
292
+ * The current doc node in the JSON format
293
+ */
294
+ doc: NodeJSON;
295
+ /**
296
+ * The parent node in the JSON format
297
+ */
298
+ parent: NodeJSON;
299
+ /**
300
+ * An array of steps in the JSON format that transform the parent node to the
301
+ * current doc node.
302
+ */
303
+ steps: StepJSON[];
304
+ }
305
+
306
+ export declare class CommitRecorder {
307
+ private parent;
308
+ private doc;
309
+ private steps;
310
+ /**
311
+ * Return a commit object including all changes since the last commit. `null`
312
+ * will be returned if there is no change.
313
+ */
314
+ commit(): Commit | null;
315
+ /**
316
+ * @internal
317
+ */
318
+ init(doc: ProseMirrorNode): void;
319
+ /**
320
+ * @internal
321
+ */
322
+ apply(tr: Transaction): void;
323
+ }
324
+
325
+ export declare function createAutocompletePlugin({ getRules, }: {
326
+ getRules: () => AutocompleteRule[];
327
+ }): Plugin_2;
328
+
329
+ /**
330
+ * @internal
331
+ */
332
+ export declare function createLazyParser(highlighterOptions: HighlighterOptions): Parser;
333
+
334
+ /**
335
+ * @internal
336
+ */
337
+ export declare function createMarkInputRule({ regex, type, attrs, }: MarkInputRuleOptions): InputRule;
338
+
339
+ export declare function createOrGetHighlighter(options: HighlighterOptions): HighlighterResult;
340
+
341
+ export declare function createOrGetHighlighter_alias_1(options: HighlighterOptions): HighlighterResult;
342
+
343
+ export { DedentListOptions }
344
+ export { DedentListOptions as DedentListOptions_alias_1 }
345
+
346
+ export declare const default_alias: Options | Options[] | ((overrideOptions: Options) => Options | Options[] | Promise<Options | Options[]>);
347
+
348
+ export { default_alias_1 }
349
+
350
+ export declare function defaultCanMatch({ state }: {
351
+ state: EditorState;
352
+ }): boolean;
353
+
354
+ declare function defineAutocomplete(rule: AutocompleteRule): Extension;
355
+ export { defineAutocomplete }
356
+ export { defineAutocomplete as defineAutocomplete_alias_1 }
357
+
358
+ /**
359
+ * @public
360
+ */
361
+ declare function defineBlockquote(): BlockquoteExtension;
362
+ export { defineBlockquote }
363
+ export { defineBlockquote as defineBlockquote_alias_1 }
364
+
365
+ /**
366
+ * @internal
367
+ */
368
+ declare function defineBlockquoteCommands(): BlockquoteCommandsExtension;
369
+ export { defineBlockquoteCommands }
370
+ export { defineBlockquoteCommands as defineBlockquoteCommands_alias_1 }
371
+
372
+ /**
373
+ * Wraps the text block in a blockquote when `>` is typed at the start of a new
374
+ * line followed by a space.
375
+ */
376
+ declare function defineBlockquoteInputRule(): PlainExtension;
377
+ export { defineBlockquoteInputRule }
378
+ export { defineBlockquoteInputRule as defineBlockquoteInputRule_alias_1 }
379
+
380
+ /**
381
+ * @internal
382
+ */
383
+ declare function defineBlockquoteKeymap(): PlainExtension;
384
+ export { defineBlockquoteKeymap }
385
+ export { defineBlockquoteKeymap as defineBlockquoteKeymap_alias_1 }
386
+
387
+ declare function defineBlockquoteSpec(): BlockquoteSpecExtension;
388
+ export { defineBlockquoteSpec }
389
+ export { defineBlockquoteSpec as defineBlockquoteSpec_alias_1 }
390
+
391
+ /**
392
+ * @public
393
+ */
394
+ declare function defineBold(): BoldExtension;
395
+ export { defineBold }
396
+ export { defineBold as defineBold_alias_1 }
397
+
398
+ /**
399
+ * @internal
400
+ */
401
+ declare function defineBoldCommands(): BoldCommandsExtension;
402
+ export { defineBoldCommands }
403
+ export { defineBoldCommands as defineBoldCommands_alias_1 }
404
+
405
+ /**
406
+ * @internal
407
+ */
408
+ declare function defineBoldInputRule(): PlainExtension;
409
+ export { defineBoldInputRule }
410
+ export { defineBoldInputRule as defineBoldInputRule_alias_1 }
411
+
412
+ /**
413
+ * @internal
414
+ */
415
+ declare function defineBoldKeymap(): PlainExtension;
416
+ export { defineBoldKeymap }
417
+ export { defineBoldKeymap as defineBoldKeymap_alias_1 }
418
+
419
+ /**
420
+ * @internal
421
+ */
422
+ declare function defineBoldSpec(): BoldSpecExtension;
423
+ export { defineBoldSpec }
424
+ export { defineBoldSpec as defineBoldSpec_alias_1 }
425
+
426
+ /**
427
+ * @public
428
+ */
429
+ declare function defineCode(): CodeExtension;
430
+ export { defineCode }
431
+ export { defineCode as defineCode_alias_1 }
432
+
433
+ /**
434
+ * Adds `codeBlock` nodes to the editor. This includes the following extensions:
435
+ *
436
+ * - {@link defineCodeBlockSpec}
437
+ * - {@link defineCodeBlockInputRule}
438
+ * - {@link defineCodeBlockEnterRule}
439
+ * - {@link defineCodeBlockKeymap}
440
+ * - {@link defineCodeBlockCommands}.
441
+ *
442
+ * @public
443
+ */
444
+ declare function defineCodeBlock(): CodeBlockExtension;
445
+ export { defineCodeBlock }
446
+ export { defineCodeBlock as defineCodeBlock_alias_1 }
447
+
448
+ /**
449
+ * Adds commands for working with `codeBlock` nodes.
450
+ *
451
+ * @public
452
+ */
453
+ declare function defineCodeBlockCommands(): CodeBlockCommandsExtension;
454
+ export { defineCodeBlockCommands }
455
+ export { defineCodeBlockCommands as defineCodeBlockCommands_alias_1 }
456
+
457
+ /**
458
+ * Adds enter rules for `codeBlock` nodes.
459
+ *
460
+ * @public
461
+ */
462
+ declare function defineCodeBlockEnterRule(): PlainExtension;
463
+ export { defineCodeBlockEnterRule }
464
+ export { defineCodeBlockEnterRule as defineCodeBlockEnterRule_alias_1 }
465
+
466
+ /**
467
+ * Adds syntax highlighting to code blocks. This function requires a `Parser`
468
+ * instance from the `prosemirror-highlight` package. See the
469
+ * [documentation](https://github.com/ocavue/prosemirror-highlight) for more
470
+ * information.
471
+ *
472
+ * @param options
473
+ *
474
+ * @public
475
+ */
476
+ declare function defineCodeBlockHighlight({ parser, }: CodeBlockHighlightOptions): Extension;
477
+ export { defineCodeBlockHighlight }
478
+ export { defineCodeBlockHighlight as defineCodeBlockHighlight_alias_1 }
479
+
480
+ /**
481
+ * Adds input rules for `codeBlock` nodes.
482
+ *
483
+ * @public
484
+ */
485
+ declare function defineCodeBlockInputRule(): PlainExtension;
486
+ export { defineCodeBlockInputRule }
487
+ export { defineCodeBlockInputRule as defineCodeBlockInputRule_alias_1 }
488
+
489
+ /**
490
+ * Defines the keymap for code blocks.
491
+ */
492
+ declare function defineCodeBlockKeymap(): PlainExtension;
493
+ export { defineCodeBlockKeymap }
494
+ export { defineCodeBlockKeymap as defineCodeBlockKeymap_alias_1 }
495
+
496
+ /**
497
+ * Adds syntax highlighting to code blocks using the [Shiki](https://github.com/shikijs/shiki) package.
498
+ *
499
+ * @param options - The options to configure the Shiki highlighter.
500
+ *
501
+ * @public
502
+ */
503
+ declare function defineCodeBlockShiki({ themes, langs, ...rest }?: CodeBlockShikiOptions): Extension;
504
+ export { defineCodeBlockShiki }
505
+ export { defineCodeBlockShiki as defineCodeBlockShiki_alias_1 }
506
+
507
+ /**
508
+ * Defines the `codeBlock` node spec.
509
+ *
510
+ * @public
511
+ */
512
+ declare function defineCodeBlockSpec(): CodeBlockSpecExtension;
513
+ export { defineCodeBlockSpec }
514
+ export { defineCodeBlockSpec as defineCodeBlockSpec_alias_1 }
515
+
516
+ /**
517
+ * @internal
518
+ */
519
+ declare function defineCodeCommands(): CodeCommandsExtension;
520
+ export { defineCodeCommands }
521
+ export { defineCodeCommands as defineCodeCommands_alias_1 }
522
+
523
+ /**
524
+ * @internal
525
+ */
526
+ declare function defineCodeInputRule(): PlainExtension;
527
+ export { defineCodeInputRule }
528
+ export { defineCodeInputRule as defineCodeInputRule_alias_1 }
529
+
530
+ /**
531
+ * @internal
532
+ */
533
+ declare function defineCodeKeymap(): PlainExtension;
534
+ export { defineCodeKeymap }
535
+ export { defineCodeKeymap as defineCodeKeymap_alias_1 }
536
+
537
+ /**
538
+ * @internal
539
+ */
540
+ declare function defineCodeSpec(): CodeSpecExtension;
541
+ export { defineCodeSpec }
542
+ export { defineCodeSpec as defineCodeSpec_alias_1 }
543
+
544
+ /**
545
+ * Define an extension that can record the changes in the editor.
546
+ */
547
+ export declare function defineCommitRecorder(commitRecorder: CommitRecorder): PlainExtension;
548
+
549
+ /**
550
+ * Define an extension to display the changes from the given commit in the editor.
551
+ */
552
+ export declare function defineCommitViewer(commit: Commit): PlainExtension;
553
+
554
+ /**
555
+ * Show up a decoration at the drop position when something is dragged over the editor.
556
+ *
557
+ * See [prosemirror-dropcursor](https://github.com/ProseMirror/prosemirror-dropcursor) for more information.
558
+ *
559
+ * @public
560
+ */
561
+ declare function defineDropCursor(options?: DropCursorOptions): DropCursorExtension;
562
+ export { defineDropCursor }
563
+ export { defineDropCursor as defineDropCursor_alias_1 }
564
+
565
+ /**
566
+ * Defines an enter rule. An enter rule applies when the text directly in front of
567
+ * the cursor matches `regex` and user presses Enter. The `regex` should end
568
+ * with `$`.
569
+ *
570
+ * @param options
571
+ *
572
+ * @public
573
+ */
574
+ export declare function defineEnterRule({ regex, handler, stop, }: EnterRuleOptions): PlainExtension;
575
+
576
+ declare function defineFileDropHandler(handler: FileDropHandler): PlainExtension;
577
+ export { defineFileDropHandler }
578
+ export { defineFileDropHandler as defineFileDropHandler_alias_1 }
579
+
580
+ declare function defineFilePasteHandler(handler: FilePasteHandler): PlainExtension;
581
+ export { defineFilePasteHandler }
582
+ export { defineFilePasteHandler as defineFilePasteHandler_alias_1 }
583
+
584
+ /**
585
+ * Capture clicks near and arrow-key-motion past places that don't have a
586
+ * normally selectable position nearby, and create a gap cursor selection for
587
+ * them. The cursor is drawn as an element with class `ProseMirror-gapcursor`.
588
+ *
589
+ * You can either include `prosekit/extensions/gap-cursor.css` or add your own
590
+ * styles to make it visible.
591
+ *
592
+ * See
593
+ * [prosemirror-gapcursor](https://github.com/ProseMirror/prosemirror-gapcursor)
594
+ * for more information.
595
+ *
596
+ * @public
597
+ */
598
+ declare function defineGapCursor(): GapCursorExtension;
599
+ export { defineGapCursor }
600
+ export { defineGapCursor as defineGapCursor_alias_1 }
601
+
602
+ /**
603
+ * @public
604
+ */
605
+ declare function defineHeading(): HeadingExtension;
606
+ export { defineHeading }
607
+ export { defineHeading as defineHeading_alias_1 }
608
+
609
+ /**
610
+ * @internal
611
+ */
612
+ declare function defineHeadingCommands(): HeadingCommandsExtension;
613
+ export { defineHeadingCommands }
614
+ export { defineHeadingCommands as defineHeadingCommands_alias_1 }
615
+
616
+ /**
617
+ * Converts the text block to a heading when `#` is typed at the start of a new
618
+ * line followed by a space.
619
+ *
620
+ * @internal
621
+ */
622
+ declare function defineHeadingInputRule(): PlainExtension;
623
+ export { defineHeadingInputRule }
624
+ export { defineHeadingInputRule as defineHeadingInputRule_alias_1 }
625
+
626
+ /**
627
+ * @internal
628
+ */
629
+ declare function defineHeadingKeymap(): PlainExtension;
630
+ export { defineHeadingKeymap }
631
+ export { defineHeadingKeymap as defineHeadingKeymap_alias_1 }
632
+
633
+ /**
634
+ * @internal
635
+ */
636
+ declare function defineHeadingSpec(): HeadingSpecExtension;
637
+ export { defineHeadingSpec }
638
+ export { defineHeadingSpec as defineHeadingSpec_alias_1 }
639
+
640
+ /**
641
+ * @public
642
+ */
643
+ declare function defineHorizontalRule(): HorizontalRuleExtension;
644
+ export { defineHorizontalRule }
645
+ export { defineHorizontalRule as defineHorizontalRule_alias_1 }
646
+
647
+ declare function defineHorizontalRuleCommands(): HorizontalRuleCommandsExtension;
648
+ export { defineHorizontalRuleCommands }
649
+ export { defineHorizontalRuleCommands as defineHorizontalRuleCommands_alias_1 }
650
+
651
+ /**
652
+ * @public
653
+ */
654
+ declare function defineHorizontalRuleInputRule(): PlainExtension;
655
+ export { defineHorizontalRuleInputRule }
656
+ export { defineHorizontalRuleInputRule as defineHorizontalRuleInputRule_alias_1 }
657
+
658
+ declare function defineHorizontalRuleSpec(): HorizontalRuleSpecExtension;
659
+ export { defineHorizontalRuleSpec }
660
+ export { defineHorizontalRuleSpec as defineHorizontalRuleSpec_alias_1 }
661
+
662
+ /**
663
+ * @public
664
+ */
665
+ declare function defineImage(): ImageExtension;
666
+ export { defineImage }
667
+ export { defineImage as defineImage_alias_1 }
668
+
669
+ /**
670
+ * @internal
671
+ */
672
+ declare function defineImageCommands(): ImageCommandsExtension;
673
+ export { defineImageCommands }
674
+ export { defineImageCommands as defineImageCommands_alias_1 }
675
+
676
+ /**
677
+ * @internal
678
+ */
679
+ declare function defineImageSpec(): ImageSpecExtension;
680
+ export { defineImageSpec }
681
+ export { defineImageSpec as defineImageSpec_alias_1 }
682
+
683
+ /**
684
+ * Defines an input rule extension.
685
+ *
686
+ * @param rule - The ProseMirror input rule to add.
687
+ *
688
+ * @public
689
+ */
690
+ export declare function defineInputRule(rule: InputRule): PlainExtension;
691
+
692
+ /**
693
+ * @public
694
+ */
695
+ declare function defineItalic(): ItalicExtension;
696
+ export { defineItalic }
697
+ export { defineItalic as defineItalic_alias_1 }
698
+
699
+ /**
700
+ * @internal
701
+ */
702
+ declare function defineItalicCommands(): ItalicCommandsExtension;
703
+ export { defineItalicCommands }
704
+ export { defineItalicCommands as defineItalicCommands_alias_1 }
705
+
706
+ /**
707
+ * @internal
708
+ */
709
+ declare function defineItalicInputRule(): PlainExtension;
710
+ export { defineItalicInputRule }
711
+ export { defineItalicInputRule as defineItalicInputRule_alias_1 }
712
+
713
+ /**
714
+ * @internal
715
+ */
716
+ declare function defineItalicKeymap(): PlainExtension;
717
+ export { defineItalicKeymap }
718
+ export { defineItalicKeymap as defineItalicKeymap_alias_1 }
719
+
720
+ /**
721
+ * @internal
722
+ */
723
+ declare function defineItalicSpec(): ItalicSpecExtension;
724
+ export { defineItalicSpec }
725
+ export { defineItalicSpec as defineItalicSpec_alias_1 }
726
+
727
+ /**
728
+ * @public
729
+ */
730
+ export declare function defineLink(): LinkExtension;
731
+
732
+ export declare function defineLinkCommands(): LinkCommandsExtension;
733
+
734
+ /**
735
+ * Apply link marks after typing Enter.
736
+ *
737
+ * @internal
738
+ */
739
+ export declare function defineLinkEnterRule(): PlainExtension;
740
+
741
+ /**
742
+ * Apply link marks after pressing Space.
743
+ *
744
+ * @internal
745
+ */
746
+ export declare function defineLinkInputRule(): PlainExtension;
747
+
748
+ /**
749
+ * Apply and remove link marks to the text during typing.
750
+ *
751
+ * @internal
752
+ */
753
+ export declare function defineLinkMarkRule(): Extension<ExtensionTyping<any, any, any>>;
754
+
755
+ /**
756
+ * @internal
757
+ */
758
+ export declare function defineLinkSpec(): LinkSpecExtension;
759
+
760
+ /**
761
+ * @public
762
+ */
763
+ declare function defineList(): ListExtension;
764
+ export { defineList }
765
+ export { defineList as defineList_alias_1 }
766
+
767
+ /**
768
+ * Defines list commands.
769
+ *
770
+ * @internal
771
+ */
772
+ declare function defineListCommands(): ListCommandsExtension;
773
+ export { defineListCommands }
774
+ export { defineListCommands as defineListCommands_alias_1 }
775
+ export { defineListCommands as defineListCommands_alias_2 }
776
+
777
+ /**
778
+ * @internal
779
+ */
780
+ declare function defineListInputRules(): Extension;
781
+ export { defineListInputRules }
782
+ export { defineListInputRules as defineListInputRules_alias_1 }
783
+ export { defineListInputRules as defineListInputRules_alias_2 }
784
+
785
+ /**
786
+ * Returns a extension that adds key bindings for list.
787
+ *
788
+ * @internal
789
+ */
790
+ declare function defineListKeymap(): PlainExtension;
791
+ export { defineListKeymap }
792
+ export { defineListKeymap as defineListKeymap_alias_1 }
793
+ export { defineListKeymap as defineListKeymap_alias_2 }
794
+
795
+ /**
796
+ * @internal
797
+ */
798
+ declare function defineListPlugins(): PlainExtension;
799
+ export { defineListPlugins }
800
+ export { defineListPlugins as defineListPlugins_alias_1 }
801
+ export { defineListPlugins as defineListPlugins_alias_2 }
802
+
803
+ /**
804
+ * @internal
805
+ */
806
+ declare function defineListSpec(): ListSpecExtension;
807
+ export { defineListSpec }
808
+ export { defineListSpec as defineListSpec_alias_1 }
809
+ export { defineListSpec as defineListSpec_alias_2 }
810
+
811
+ /**
812
+ * @public
813
+ */
814
+ declare function defineLoro(options: LoroOptions): LoroExtension;
815
+ export { defineLoro }
816
+ export { defineLoro as defineLoro_alias_1 }
817
+
818
+ declare function defineLoroCommands(): LoroCommandsExtension;
819
+ export { defineLoroCommands }
820
+ export { defineLoroCommands as defineLoroCommands_alias_1 }
821
+ export { defineLoroCommands as defineLoroCommands_alias_2 }
822
+
823
+ declare function defineLoroCursorPlugin(options: LoroCursorOptions): PlainExtension;
824
+ export { defineLoroCursorPlugin }
825
+ export { defineLoroCursorPlugin as defineLoroCursorPlugin_alias_1 }
826
+ export { defineLoroCursorPlugin as defineLoroCursorPlugin_alias_2 }
827
+
828
+ declare function defineLoroKeymap(): PlainExtension;
829
+ export { defineLoroKeymap }
830
+ export { defineLoroKeymap as defineLoroKeymap_alias_1 }
831
+ export { defineLoroKeymap as defineLoroKeymap_alias_2 }
832
+
833
+ declare function defineLoroSyncPlugin(options: LoroSyncPluginProps): PlainExtension;
834
+ export { defineLoroSyncPlugin }
835
+ export { defineLoroSyncPlugin as defineLoroSyncPlugin_alias_1 }
836
+ export { defineLoroSyncPlugin as defineLoroSyncPlugin_alias_2 }
837
+
838
+ declare function defineLoroUndoPlugin(options: LoroUndoPluginProps): PlainExtension;
839
+ export { defineLoroUndoPlugin }
840
+ export { defineLoroUndoPlugin as defineLoroUndoPlugin_alias_1 }
841
+ export { defineLoroUndoPlugin as defineLoroUndoPlugin_alias_2 }
842
+
843
+ /**
844
+ * Defines an input rule for automatically adding inline marks when a given
845
+ * pattern is typed.
846
+ *
847
+ * @public
848
+ */
849
+ export declare function defineMarkInputRule(options: MarkInputRuleOptions): PlainExtension;
850
+
851
+ /**
852
+ * A mark rule is something that can automatically apply marks to text if it
853
+ * matches a certain pattern, and remove them if it doesn't match anymore.
854
+ */
855
+ declare function defineMarkRule(options: MarkRuleOptions): Extension<ExtensionTyping<any, any, any>>;
856
+ export { defineMarkRule }
857
+ export { defineMarkRule as defineMarkRule_alias_1 }
858
+
859
+ /**
860
+ * @public
861
+ */
862
+ export declare function defineMention(): Union<readonly [Extension< {
863
+ Nodes: {
864
+ mention: MentionAttrs;
865
+ };
866
+ }>, Extension< {
867
+ Commands: {
868
+ insertMention: [attrs: MentionAttrs];
869
+ };
870
+ }>]>;
871
+
872
+ export declare function defineMentionCommands(): Extension< {
873
+ Commands: {
874
+ insertMention: [attrs: MentionAttrs];
875
+ };
876
+ }>;
877
+
878
+ /**
879
+ * @public
880
+ */
881
+ export declare function defineMentionSpec(): Extension< {
882
+ Nodes: {
883
+ mention: MentionAttrs;
884
+ };
885
+ }>;
886
+
887
+ /**
888
+ * By default, clicking a node while holding the mod key will select the node. This
889
+ * extension disables that behavior.
890
+ *
891
+ * @public
892
+ */
893
+ export declare function defineModClickPrevention(): ModClickPreventionExtension;
894
+
895
+ /**
896
+ * Add a placeholder text to the editor when the current block or document is
897
+ * empty.
898
+ */
899
+ export declare function definePlaceholder(options: PlaceholderOptions): PlainExtension;
900
+
901
+ /**
902
+ * Make the editor read-only.
903
+ */
904
+ export declare function defineReadonly(): PlainExtension;
905
+
906
+ /**
907
+ * Defines commands for search and replace.
908
+ *
909
+ * @public
910
+ */
911
+ export declare function defineSearchCommands(): Extension< {
912
+ Commands: {
913
+ findNext: [];
914
+ findPrev: [];
915
+ findNextNoWrap: [];
916
+ findPrevNoWrap: [];
917
+ replaceNext: [];
918
+ replaceNextNoWrap: [];
919
+ replaceCurrent: [];
920
+ replaceAll: [];
921
+ };
922
+ }>;
923
+
924
+ /**
925
+ * Defines an extension that stores a current search query and replace string.
926
+ *
927
+ * @public
928
+ */
929
+ export declare function defineSearchQuery(options: SearchQueryOptions): PlainExtension;
930
+
931
+ /**
932
+ * @public
933
+ */
934
+ export declare function defineStrike(): StrikeExtension;
935
+
936
+ /**
937
+ * @internal
938
+ */
939
+ export declare function defineStrikeCommands(): StrikeCommandsExtension;
940
+
941
+ /**
942
+ * @internal
943
+ */
944
+ export declare function defineStrikeInputRule(): PlainExtension;
945
+
946
+ /**
947
+ * @internal
948
+ */
949
+ export declare function defineStrikeKeymap(): PlainExtension;
950
+
951
+ /**
952
+ * @internal
953
+ */
954
+ export declare function defineStrikeSpec(): StrikeSpecExtension;
955
+
956
+ /**
957
+ * @public
958
+ */
959
+ declare function defineTable(): TableExtension;
960
+ export { defineTable }
961
+ export { defineTable as defineTable_alias_1 }
962
+
963
+ /**
964
+ * @internal
965
+ */
966
+ declare function defineTableCellSpec(): TableCellSpecExtension;
967
+ export { defineTableCellSpec }
968
+ export { defineTableCellSpec as defineTableCellSpec_alias_1 }
969
+
970
+ /**
971
+ * Adds commands for working with `table` nodes.
972
+ *
973
+ * @public
974
+ */
975
+ declare function defineTableCommands(): TableCommandsExtension;
976
+ export { defineTableCommands }
977
+ export { defineTableCommands as defineTableCommands_alias_1 }
978
+
979
+ declare function defineTableHeaderCellSpec(): TableHeaderCellSpecExtension;
980
+ export { defineTableHeaderCellSpec }
981
+ export { defineTableHeaderCellSpec as defineTableHeaderCellSpec_alias_1 }
982
+
983
+ /**
984
+ * @public
985
+ */
986
+ declare function defineTablePlugins(): PlainExtension;
987
+ export { defineTablePlugins }
988
+ export { defineTablePlugins as defineTablePlugins_alias_1 }
989
+
990
+ /**
991
+ * @internal
992
+ */
993
+ declare function defineTableRowSpec(): TableRowSpecExtension;
994
+ export { defineTableRowSpec }
995
+ export { defineTableRowSpec as defineTableRowSpec_alias_1 }
996
+
997
+ /**
998
+ * @internal
999
+ */
1000
+ declare function defineTableSpec(): TableSpecExtension;
1001
+ export { defineTableSpec }
1002
+ export { defineTableSpec as defineTableSpec_alias_1 }
1003
+
1004
+ /**
1005
+ * @internal
1006
+ */
1007
+ export declare function defineTestExtension(): Union<readonly [DocExtension, TextExtension, HeadingExtension, HistoryExtension, ListExtension, BlockquoteExtension, PlainExtension, BaseCommandsExtension, ItalicExtension, BoldExtension, UnderlineExtension, StrikeExtension, CodeExtension, LinkExtension, ImageExtension, Extension<{
1008
+ Nodes: {
1009
+ paragraph: Attrs_2;
1010
+ };
1011
+ }>, TableExtension, HorizontalRuleExtension]>;
1012
+
1013
+ /**
1014
+ * Adds a `textAlign` attribute to the specified nodes. This will be rendered as
1015
+ * a CSS `text-align` style.
1016
+ *
1017
+ * @public
1018
+ */
1019
+ export declare function defineTextAlign<NodeName extends string = string>(options: TextAlignOptions<NodeName>): TextAlignExtension<NodeName>;
1020
+
1021
+ /**
1022
+ * @internal
1023
+ */
1024
+ export declare function defineTextAlignCommands(types: string[]): TextAlignCommandsExtension;
1025
+
1026
+ /**
1027
+ * @internal
1028
+ */
1029
+ export declare function defineTextAlignKeymap(types: string[]): PlainExtension;
1030
+
1031
+ /**
1032
+ * Defines an enter rule that replaces the matched text with a block node.
1033
+ *
1034
+ * See also {@link defineEnterRule}.
1035
+ *
1036
+ * @param options
1037
+ *
1038
+ * @public
1039
+ */
1040
+ export declare function defineTextBlockEnterRule({ regex, type, attrs, stop, }: TextBlockEnterRuleOptions): PlainExtension;
1041
+
1042
+ /**
1043
+ * Defines an input rule that changes the type of a textblock when the matched
1044
+ * text is typed into it.
1045
+ *
1046
+ * See also [textblockTypeInputRule](https://prosemirror.net/docs/ref/#inputrules.textblockTypeInputRule)
1047
+ *
1048
+ * @param options
1049
+ *
1050
+ * @public
1051
+ */
1052
+ export declare function defineTextBlockInputRule({ regex, type, attrs, }: {
1053
+ /**
1054
+ * The regular expression to match against, which should end with `$`. It
1055
+ * usually also starts with `^` to that it is only matched at the start of a
1056
+ * textblock.
1057
+ */
1058
+ regex: RegExp;
1059
+ /**
1060
+ * The node type to replace the matched text with.
1061
+ */
1062
+ type: string | NodeType;
1063
+ /**
1064
+ * Attributes to set on the node.
1065
+ */
1066
+ attrs?: Attrs | null | ((match: RegExpMatchArray) => Attrs | null);
1067
+ }): PlainExtension;
1068
+
1069
+ /**
1070
+ * @public
1071
+ */
1072
+ export declare function defineUnderline(): UnderlineExtension;
1073
+
1074
+ /**
1075
+ * @internal
1076
+ */
1077
+ export declare function defineUnderlineCommands(): UnderlineCommandsExtension;
1078
+
1079
+ /**
1080
+ * @internal
1081
+ */
1082
+ export declare function defineUnderlineKeymap(): PlainExtension;
1083
+
1084
+ /**
1085
+ * @internal
1086
+ */
1087
+ export declare function defineUnderlineSpec(): UnderlineSpecExtension;
1088
+
1089
+ /**
1090
+ * Shows a virtual selection when the editor is not focused. When the editor is
1091
+ * not focused, the selected inline content will be wrapped in a `<span>`
1092
+ * element with the class `prosekit-virtual-selection`.
1093
+ *
1094
+ * This is useful when you want to move the focus to an element outside the
1095
+ * editor, but still want to show the selection.
1096
+ *
1097
+ * @public
1098
+ */
1099
+ export declare function defineVirtualSelection(): VirtualSelectionExtension;
1100
+
1101
+ /**
1102
+ * Defines an input rule for automatically wrapping a textblock when a given
1103
+ * string is typed.
1104
+ *
1105
+ * See also [wrappingInputRule](https://prosemirror.net/docs/ref/#inputrules.wrappingInputRule)
1106
+ *
1107
+ * @param options
1108
+ *
1109
+ * @public
1110
+ */
1111
+ export declare function defineWrappingInputRule({ regex, type, attrs, join, }: {
1112
+ /**
1113
+ * The regular expression to match against, which should end with `$`. It
1114
+ * usually also starts with `^` to that it is only matched at the start of a
1115
+ * textblock.
1116
+ */
1117
+ regex: RegExp;
1118
+ /**
1119
+ * The type of node to wrap in.
1120
+ */
1121
+ type: string | NodeType;
1122
+ /**
1123
+ * Attributes to set on the node.
1124
+ */
1125
+ attrs?: Attrs | null | ((match: RegExpMatchArray) => Attrs | null);
1126
+ /**
1127
+ * By default, if there's a node with the same type above the newly wrapped
1128
+ * node, the rule will try to
1129
+ * [join](https://prosemirror.net/docs/ref/#transform.Transform.join) those
1130
+ * two nodes. You can pass a join predicate, which takes a regular expression
1131
+ * match and the node before the wrapped node, and can return a boolean to
1132
+ * indicate whether a join should happen.
1133
+ */
1134
+ join?: (match: RegExpMatchArray, node: ProseMirrorNode) => boolean;
1135
+ }): PlainExtension;
1136
+
1137
+ /**
1138
+ * @public
1139
+ */
1140
+ declare function defineYjs(options: YjsOptions): YjsExtension;
1141
+ export { defineYjs }
1142
+ export { defineYjs as defineYjs_alias_1 }
1143
+
1144
+ declare function defineYjsCommands(): YjsCommandsExtension;
1145
+ export { defineYjsCommands }
1146
+ export { defineYjsCommands as defineYjsCommands_alias_1 }
1147
+
1148
+ declare function defineYjsCursorPlugin(options: YjsCursorOptions): PlainExtension;
1149
+ export { defineYjsCursorPlugin }
1150
+ export { defineYjsCursorPlugin as defineYjsCursorPlugin_alias_1 }
1151
+
1152
+ declare function defineYjsKeymap(): PlainExtension;
1153
+ export { defineYjsKeymap }
1154
+ export { defineYjsKeymap as defineYjsKeymap_alias_1 }
1155
+
1156
+ declare function defineYjsSyncPlugin(options: YjsSyncOptions): PlainExtension;
1157
+ export { defineYjsSyncPlugin }
1158
+ export { defineYjsSyncPlugin as defineYjsSyncPlugin_alias_1 }
1159
+
1160
+ declare function defineYjsUndoPlugin(options: YjsUndoOptions): PlainExtension;
1161
+ export { defineYjsUndoPlugin }
1162
+ export { defineYjsUndoPlugin as defineYjsUndoPlugin_alias_1 }
1163
+
1164
+ /**
1165
+ * @internal
1166
+ */
1167
+ declare type DropCursorExtension = PlainExtension;
1168
+ export { DropCursorExtension }
1169
+ export { DropCursorExtension as DropCursorExtension_alias_1 }
1170
+
1171
+ declare interface DropCursorOptions {
1172
+ /**
1173
+ * The color of the cursor. Use `false` to apply no color and rely only on class.
1174
+ *
1175
+ * @default 'black'
1176
+ */
1177
+ color?: string | false;
1178
+ /**
1179
+ * The precise width of the cursor in pixels.
1180
+ *
1181
+ * @default 1
1182
+ */
1183
+ width?: number;
1184
+ /**
1185
+ * A CSS class name to add to the cursor element.
1186
+ */
1187
+ class?: string;
1188
+ }
1189
+ export { DropCursorOptions }
1190
+ export { DropCursorOptions as DropCursorOptions_alias_1 }
1191
+
1192
+ /**
1193
+ * @public
1194
+ */
1195
+ export declare type EnterRuleHandler = (options: {
1196
+ /**
1197
+ * The current editor state.
1198
+ */
1199
+ state: EditorState;
1200
+ /**
1201
+ * The start position of the matched text.
1202
+ */
1203
+ from: number;
1204
+ /**
1205
+ * The end position of the matched text.
1206
+ */
1207
+ to: number;
1208
+ /**
1209
+ * The matched result from the regular expression.
1210
+ */
1211
+ match: RegExpExecArray;
1212
+ }) => Transaction | null;
1213
+
1214
+ /**
1215
+ * Options for {@link defineEnterRule}.
1216
+ *
1217
+ * @public
1218
+ */
1219
+ export declare type EnterRuleOptions = {
1220
+ /**
1221
+ * The regular expression to match against. It should end with `$`.
1222
+ */
1223
+ regex: RegExp;
1224
+ /**
1225
+ * A function to be called when an enter rule is triggered.
1226
+ */
1227
+ handler: EnterRuleHandler;
1228
+ /**
1229
+ * Whether to stop further handlers from being called if this rule is triggered.
1230
+ *
1231
+ * @default false
1232
+ */
1233
+ stop?: boolean;
1234
+ };
1235
+
1236
+ /**
1237
+ * When the selection is in a table node, create a default block after the table
1238
+ * table, and move the cursor there.
1239
+ *
1240
+ * @public
1241
+ */
1242
+ declare const exitTable: Command;
1243
+ export { exitTable }
1244
+ export { exitTable as exitTable_alias_1 }
1245
+
1246
+ /**
1247
+ * A function that handles one of the files in a drop event.
1248
+ *
1249
+ * Returns `true` if the file was handled and thus should not be handled by
1250
+ * other handlers.
1251
+ */
1252
+ export declare type FileDropHandler = (options: FileDropHandlerOptions) => boolean | void;
1253
+
1254
+ declare interface FileDropHandlerOptions {
1255
+ /**
1256
+ * The editor view.
1257
+ */
1258
+ view: EditorView;
1259
+ /**
1260
+ * The event that triggered the drop.
1261
+ */
1262
+ event: DragEvent;
1263
+ /**
1264
+ * The file that was dropped.
1265
+ */
1266
+ file: File;
1267
+ /**
1268
+ * The position of the document where the file was dropped.
1269
+ */
1270
+ pos: number;
1271
+ }
1272
+ export { FileDropHandlerOptions }
1273
+ export { FileDropHandlerOptions as FileDropHandlerOptions_alias_1 }
1274
+
1275
+ declare type FileHandler<E extends Event> = (options: {
1276
+ view: EditorView;
1277
+ event: E;
1278
+ file: File;
1279
+ }) => boolean | void;
1280
+
1281
+ /**
1282
+ * A function that handles one of the files in a paste event.
1283
+ *
1284
+ * Returns `true` if the file was handled and thus should not be handled by
1285
+ * other handlers.
1286
+ */
1287
+ export declare type FilePasteHandler = (options: FilePasteHandlerOptions) => boolean | void;
1288
+
1289
+ declare interface FilePasteHandlerOptions {
1290
+ /**
1291
+ * The editor view.
1292
+ */
1293
+ view: EditorView;
1294
+ /**
1295
+ * The event that triggered the paste.
1296
+ */
1297
+ event: ClipboardEvent;
1298
+ /**
1299
+ * The file that was pasted.
1300
+ */
1301
+ file: File;
1302
+ }
1303
+ export { FilePasteHandlerOptions }
1304
+ export { FilePasteHandlerOptions as FilePasteHandlerOptions_alias_1 }
1305
+
1306
+ /**
1307
+ * Try to find a resolved pos of a cell by using the given pos as a hit point.
1308
+ *
1309
+ * @internal
1310
+ */
1311
+ export declare function findCellPos(doc: ProseMirrorNode, pos: number): ResolvedPos | undefined;
1312
+
1313
+ /**
1314
+ * Try to find the anchor and head cell in the same table by using the given
1315
+ * anchor and head as hit points, or fallback to the selection's anchor and
1316
+ * head.
1317
+ *
1318
+ * @internal
1319
+ */
1320
+ export declare function findCellRange(selection: Selection_2, anchorHit?: number, headHit?: number): [ResolvedPos, ResolvedPos] | undefined;
1321
+
1322
+ export declare function findTable($pos: ResolvedPos): FindParentNodeResult | undefined;
1323
+
1324
+ export { GapCursor }
1325
+
1326
+ /**
1327
+ * @internal
1328
+ */
1329
+ declare type GapCursorExtension = PlainExtension;
1330
+ export { GapCursorExtension }
1331
+ export { GapCursorExtension as GapCursorExtension_alias_1 }
1332
+
1333
+ export declare function getCheckRanges(transactions: readonly Transaction[], oldState: EditorState, newState: EditorState): Array<[number, number]>;
1334
+
1335
+ export declare function getPluginState(state: EditorState): PredictionPluginState | undefined;
1336
+
1337
+ export declare function getTrMeta(tr: Transaction): PredictionPluginState;
1338
+
1339
+ export declare function handleEvent<E extends Event>(view: EditorView, event: E, handlers: FileHandler<E>[], getFiles: (event: E) => File[]): boolean;
1340
+
1341
+ declare interface HeadingAttrs {
1342
+ level: number;
1343
+ }
1344
+ export { HeadingAttrs }
1345
+ export { HeadingAttrs as HeadingAttrs_alias_1 }
1346
+
1347
+ /**
1348
+ * @internal
1349
+ */
1350
+ declare type HeadingCommandsExtension = Extension<{
1351
+ Commands: {
1352
+ setHeading: [attrs?: HeadingAttrs | undefined];
1353
+ insertHeading: [attrs?: HeadingAttrs | undefined];
1354
+ toggleHeading: [attrs?: HeadingAttrs | undefined];
1355
+ };
1356
+ }>;
1357
+ export { HeadingCommandsExtension }
1358
+ export { HeadingCommandsExtension as HeadingCommandsExtension_alias_1 }
1359
+
1360
+ /**
1361
+ * @internal
1362
+ */
1363
+ declare type HeadingExtension = Union<[
1364
+ HeadingSpecExtension,
1365
+ HeadingCommandsExtension
1366
+ ]>;
1367
+ export { HeadingExtension }
1368
+ export { HeadingExtension as HeadingExtension_alias_1 }
1369
+
1370
+ /**
1371
+ * @internal
1372
+ */
1373
+ declare type HeadingSpecExtension = Extension<{
1374
+ Nodes: {
1375
+ heading: HeadingAttrs;
1376
+ };
1377
+ }>;
1378
+ export { HeadingSpecExtension }
1379
+ export { HeadingSpecExtension as HeadingSpecExtension_alias_1 }
1380
+
1381
+ declare interface HighlighterOptions extends Omit<ShikiHighlighterOptions, 'langs' | 'themes'> {
1382
+ themes: BundledTheme[];
1383
+ langs: (BundledLanguage | SpecialLanguage)[];
1384
+ }
1385
+ export { HighlighterOptions }
1386
+ export { HighlighterOptions as HighlighterOptions_alias_1 }
1387
+
1388
+ export declare type HighlighterResult = {
1389
+ highlighter: Highlighter;
1390
+ promise?: undefined;
1391
+ } | {
1392
+ highlighter?: undefined;
1393
+ promise: Promise<void>;
1394
+ };
1395
+
1396
+ /**
1397
+ * @public
1398
+ *
1399
+ * An alias for the `Parser` type from the `prosemirror-highlight` package.
1400
+ */
1401
+ declare type HighlightParser = Parser;
1402
+ export { HighlightParser }
1403
+ export { HighlightParser as HighlightParser_alias_1 }
1404
+
1405
+ declare type HorizontalRuleCommandsExtension = Extension<{
1406
+ Commands: {
1407
+ insertHorizontalRule: [];
1408
+ };
1409
+ }>;
1410
+ export { HorizontalRuleCommandsExtension }
1411
+ export { HorizontalRuleCommandsExtension as HorizontalRuleCommandsExtension_alias_1 }
1412
+
1413
+ declare type HorizontalRuleExtension = Union<[
1414
+ HorizontalRuleSpecExtension,
1415
+ HorizontalRuleCommandsExtension
1416
+ ]>;
1417
+ export { HorizontalRuleExtension }
1418
+ export { HorizontalRuleExtension as HorizontalRuleExtension_alias_1 }
1419
+
1420
+ declare type HorizontalRuleSpecExtension = Extension<{
1421
+ Nodes: {
1422
+ horizontalRule: Attrs;
1423
+ };
1424
+ }>;
1425
+ export { HorizontalRuleSpecExtension }
1426
+ export { HorizontalRuleSpecExtension as HorizontalRuleSpecExtension_alias_1 }
1427
+
1428
+ /**
1429
+ * @public
1430
+ */
1431
+ declare interface ImageAttrs {
1432
+ src?: string | null;
1433
+ width?: number | null;
1434
+ height?: number | null;
1435
+ }
1436
+ export { ImageAttrs }
1437
+ export { ImageAttrs as ImageAttrs_alias_1 }
1438
+
1439
+ /**
1440
+ * @internal
1441
+ */
1442
+ declare type ImageCommandsExtension = Extension<{
1443
+ Commands: {
1444
+ insertImage: [attrs?: ImageAttrs];
1445
+ };
1446
+ }>;
1447
+ export { ImageCommandsExtension }
1448
+ export { ImageCommandsExtension as ImageCommandsExtension_alias_1 }
1449
+
1450
+ /**
1451
+ * @internal
1452
+ */
1453
+ declare type ImageExtension = Union<[ImageSpecExtension, ImageCommandsExtension]>;
1454
+ export { ImageExtension }
1455
+ export { ImageExtension as ImageExtension_alias_1 }
1456
+
1457
+ /**
1458
+ * @internal
1459
+ */
1460
+ declare type ImageSpecExtension = Extension<{
1461
+ Nodes: {
1462
+ image: ImageAttrs;
1463
+ };
1464
+ }>;
1465
+ export { ImageSpecExtension }
1466
+ export { ImageSpecExtension as ImageSpecExtension_alias_1 }
1467
+
1468
+ export { IndentListOptions }
1469
+ export { IndentListOptions as IndentListOptions_alias_1 }
1470
+
1471
+ export declare function inputText(input: string): Promise<void>;
1472
+
1473
+ /**
1474
+ * Returns a command that inserts a horizontal rule at the current selection.
1475
+ */
1476
+ declare function insertHorizontalRule(): Command;
1477
+ export { insertHorizontalRule }
1478
+ export { insertHorizontalRule as insertHorizontalRule_alias_1 }
1479
+
1480
+ /**
1481
+ * Insert a table node with the given number of rows and columns, and optionally
1482
+ * a header row.
1483
+ *
1484
+ * @param options
1485
+ *
1486
+ * @public
1487
+ */
1488
+ declare function insertTable(options: InsertTableOptions): Command;
1489
+ export { insertTable }
1490
+ export { insertTable as insertTable_alias_1 }
1491
+
1492
+ /**
1493
+ * @public
1494
+ */
1495
+ declare interface InsertTableOptions {
1496
+ row: number;
1497
+ col: number;
1498
+ header: boolean;
1499
+ }
1500
+ export { InsertTableOptions }
1501
+ export { InsertTableOptions as InsertTableOptions_alias_1 }
1502
+
1503
+ /**
1504
+ * Checks if the given object is a `CellSelection` instance.
1505
+ *
1506
+ * @public
1507
+ */
1508
+ declare function isCellSelection(value: unknown): value is CellSelection;
1509
+ export { isCellSelection }
1510
+ export { isCellSelection as isCellSelection_alias_1 }
1511
+
1512
+ /**
1513
+ * @internal
1514
+ */
1515
+ declare type ItalicCommandsExtension = Extension<{
1516
+ Commands: {
1517
+ toggleItalic: [];
1518
+ };
1519
+ }>;
1520
+ export { ItalicCommandsExtension }
1521
+ export { ItalicCommandsExtension as ItalicCommandsExtension_alias_1 }
1522
+
1523
+ /**
1524
+ * @internal
1525
+ */
1526
+ declare type ItalicExtension = Union<[
1527
+ ItalicSpecExtension,
1528
+ ItalicCommandsExtension
1529
+ ]>;
1530
+ export { ItalicExtension }
1531
+ export { ItalicExtension as ItalicExtension_alias_1 }
1532
+
1533
+ /**
1534
+ * @internal
1535
+ */
1536
+ declare type ItalicSpecExtension = Extension<{
1537
+ Marks: {
1538
+ italic: Attrs;
1539
+ };
1540
+ }>;
1541
+ export { ItalicSpecExtension }
1542
+ export { ItalicSpecExtension as ItalicSpecExtension_alias_1 }
1543
+
1544
+ export declare const LINK_ENTER_RE: RegExp;
1545
+
1546
+ export declare const LINK_INPUT_RE: RegExp;
1547
+
1548
+ export declare const LINK_MARK_RE: RegExp;
1549
+
1550
+ /**
1551
+ * @public
1552
+ */
1553
+ export declare interface LinkAttrs {
1554
+ href: string;
1555
+ }
1556
+
1557
+ /**
1558
+ * @internal
1559
+ */
1560
+ export declare type LinkCommandsExtension = Extension<{
1561
+ Commands: {
1562
+ addLink: [LinkAttrs];
1563
+ removeLink: [];
1564
+ toggleLink: [LinkAttrs];
1565
+ expandLink: [];
1566
+ };
1567
+ }>;
1568
+
1569
+ /**
1570
+ * @internal
1571
+ */
1572
+ export declare type LinkExtension = Union<[LinkSpecExtension, LinkCommandsExtension]>;
1573
+
1574
+ /**
1575
+ * @internal
1576
+ */
1577
+ export declare type LinkSpecExtension = Extension<{
1578
+ Marks: {
1579
+ link: LinkAttrs;
1580
+ };
1581
+ }>;
1582
+
1583
+ /**
1584
+ * The attributes of a list node.
1585
+ *
1586
+ * @public
1587
+ */
1588
+ declare interface ListAttrs {
1589
+ /**
1590
+ * The kind of list node.
1591
+ */
1592
+ kind?: 'bullet' | 'ordered' | 'task' | 'toggle';
1593
+ /**
1594
+ * The optional order of the list node.
1595
+ */
1596
+ order?: number | null;
1597
+ /**
1598
+ * Whether the list node is checked if its `kind` is `"task"`.
1599
+ */
1600
+ checked?: boolean;
1601
+ /**
1602
+ * Whether the list node is collapsed if its `kind` is `"toggle"`.
1603
+ */
1604
+ collapsed?: boolean;
1605
+ }
1606
+ export { ListAttrs }
1607
+ export { ListAttrs as ListAttrs_alias_1 }
1608
+ export { ListAttrs as ListAttrs_alias_2 }
1609
+
1610
+ /**
1611
+ * @internal
1612
+ */
1613
+ declare type ListCommandsExtension = Extension<{
1614
+ Commands: {
1615
+ dedentList: [options?: DedentListOptions];
1616
+ indentList: [options?: IndentListOptions];
1617
+ moveList: [direction: 'up' | 'down'];
1618
+ splitList: [];
1619
+ toggleCollapsed: [options?: ToggleCollapsedOptions];
1620
+ unwrapList: [options?: UnwrapListOptions];
1621
+ toggleList: [attrs?: ListAttributes];
1622
+ wrapInList: [attrs?: ListAttributes];
1623
+ insertList: [attrs?: ListAttributes];
1624
+ };
1625
+ }>;
1626
+ export { ListCommandsExtension }
1627
+ export { ListCommandsExtension as ListCommandsExtension_alias_1 }
1628
+ export { ListCommandsExtension as ListCommandsExtension_alias_2 }
1629
+
1630
+ export { ListDOMSerializer }
1631
+ export { ListDOMSerializer as ListDOMSerializer_alias_1 }
1632
+
1633
+ /**
1634
+ * @internal
1635
+ */
1636
+ declare type ListExtension = Union<[ListSpecExtension, ListCommandsExtension]>;
1637
+ export { ListExtension }
1638
+ export { ListExtension as ListExtension_alias_1 }
1639
+
1640
+ /**
1641
+ * @internal
1642
+ */
1643
+ declare type ListSpecExtension = Extension<{
1644
+ Nodes: {
1645
+ list: ListAttrs;
1646
+ };
1647
+ }>;
1648
+ export { ListSpecExtension }
1649
+ export { ListSpecExtension as ListSpecExtension_alias_1 }
1650
+ export { ListSpecExtension as ListSpecExtension_alias_2 }
1651
+
1652
+ /**
1653
+ * @internal
1654
+ */
1655
+ export declare type LoroCommandsExtension = Extension<{
1656
+ Commands: {
1657
+ undo: [];
1658
+ redo: [];
1659
+ };
1660
+ }>;
1661
+
1662
+ declare interface LoroCursorOptions {
1663
+ awareness: CursorAwareness;
1664
+ getSelection?: (state: EditorState) => Selection_2;
1665
+ createCursor?: (user: PeerID) => Element;
1666
+ createSelection?: (user: PeerID) => DecorationAttrs;
1667
+ }
1668
+ export { LoroCursorOptions }
1669
+ export { LoroCursorOptions as LoroCursorOptions_alias_1 }
1670
+ export { LoroCursorOptions as LoroCursorOptions_alias_2 }
1671
+
1672
+ /**
1673
+ * @internal
1674
+ */
1675
+ declare type LoroExtension = Union<[LoroCommandsExtension, PlainExtension]>;
1676
+ export { LoroExtension }
1677
+ export { LoroExtension as LoroExtension_alias_1 }
1678
+
1679
+ declare interface LoroOptions {
1680
+ /**
1681
+ * The Loro instance handles the state of shared data.
1682
+ */
1683
+ doc: LoroDocType;
1684
+ /**
1685
+ * The Awareness instance.
1686
+ */
1687
+ awareness: CursorAwareness;
1688
+ /**
1689
+ * Extra options for `LoroSyncPlugin`.
1690
+ */
1691
+ sync?: Omit<LoroSyncPluginProps, 'doc'>;
1692
+ /**
1693
+ * Extra options for the `LoroUndoPlugin`.
1694
+ */
1695
+ undo?: Omit<LoroUndoPluginProps, 'doc'>;
1696
+ /**
1697
+ * Extra options for `LoroCursorPlugin`.
1698
+ */
1699
+ cursor?: Omit<LoroCursorOptions, 'awareness'>;
1700
+ }
1701
+ export { LoroOptions }
1702
+ export { LoroOptions as LoroOptions_alias_1 }
1703
+
1704
+ export { LoroSyncPluginProps }
1705
+ export { LoroSyncPluginProps as LoroSyncPluginProps_alias_1 }
1706
+
1707
+ export { LoroUndoPluginProps }
1708
+ export { LoroUndoPluginProps as LoroUndoPluginProps_alias_1 }
1709
+
1710
+ /**
1711
+ * Options for {@link defineMarkInputRule}.
1712
+ *
1713
+ * @public
1714
+ */
1715
+ export declare interface MarkInputRuleOptions {
1716
+ /**
1717
+ * The regular expression to match against, which should end with `$` and has
1718
+ * exactly one capture group. All other matched text outside the capture group
1719
+ * will be deleted.
1720
+ */
1721
+ regex: RegExp;
1722
+ /**
1723
+ * The type of mark to set.
1724
+ */
1725
+ type: string | MarkType;
1726
+ /**
1727
+ * Attributes to set on the mark.
1728
+ */
1729
+ attrs?: Attrs | null | ((match: RegExpMatchArray) => Attrs | null);
1730
+ }
1731
+
1732
+ /**
1733
+ * The options for {@link defineMarkRule}.
1734
+ *
1735
+ * @public
1736
+ */
1737
+ declare interface MarkRuleOptions {
1738
+ /**
1739
+ * The regular expression to match against. It must has a `g` flag to match
1740
+ * all instances of the mark.
1741
+ */
1742
+ regex: RegExp;
1743
+ /**
1744
+ * The mark type to apply to the matched text.
1745
+ */
1746
+ type: string | MarkType;
1747
+ /**
1748
+ * Attributes to set on the mark. If a function is provided, it will be called
1749
+ * with the matched result from the regular expression.
1750
+ *
1751
+ * @default null
1752
+ */
1753
+ attrs?: Attrs | null | ((match: RegExpMatchArray) => Attrs | null);
1754
+ }
1755
+ export { MarkRuleOptions }
1756
+ export { MarkRuleOptions as MarkRuleOptions_alias_1 }
1757
+
1758
+ declare type MatchHandler = (options: {
1759
+ state: EditorState;
1760
+ match: RegExpExecArray;
1761
+ from: number;
1762
+ to: number;
1763
+ ignoreMatch: () => void;
1764
+ deleteMatch: () => void;
1765
+ }) => void;
1766
+ export { MatchHandler }
1767
+ export { MatchHandler as MatchHandler_alias_1 }
1768
+
1769
+ export declare interface MentionAttrs {
1770
+ id: string;
1771
+ value: string;
1772
+ kind: string;
1773
+ }
1774
+
1775
+ /**
1776
+ * @internal
1777
+ */
1778
+ export declare type ModClickPreventionExtension = PlainExtension;
1779
+
1780
+ export declare interface PlaceholderOptions {
1781
+ /**
1782
+ * The placeholder to use. It can be a static string or a function that
1783
+ * receives the current editor state and returns a string.
1784
+ */
1785
+ placeholder: string | ((state: EditorState) => string);
1786
+ /**
1787
+ * By default, the placeholder text will be shown whenever the current text
1788
+ * cursor is in an empty text node. If you only want to show the placeholder
1789
+ * when the whole doc is empty, you can set this option to 'doc'.
1790
+ *
1791
+ * @default 'block'
1792
+ */
1793
+ strategy?: 'doc' | 'block';
1794
+ }
1795
+
1796
+ export declare const pluginKey: PluginKey<PredictionPluginState>;
1797
+
1798
+ export declare interface PredictionPluginState {
1799
+ active: boolean;
1800
+ ignore: number | null;
1801
+ matching: {
1802
+ rule: AutocompleteRule;
1803
+ from: number;
1804
+ to: number;
1805
+ match: RegExpExecArray;
1806
+ } | null;
1807
+ }
1808
+
1809
+ /**
1810
+ * @example
1811
+ *
1812
+ * ```ts
1813
+ * await pressKey('mod-1')
1814
+ * await pressKey('Backspace')
1815
+ * ```
1816
+ *
1817
+ * @internal
1818
+ */
1819
+ export declare function pressKey(input: string): Promise<void>;
1820
+
1821
+ /**
1822
+ * @internal
1823
+ */
1824
+ export declare const redo: Command;
1825
+
1826
+ /**
1827
+ * Options for {@link defineSearchQuery}
1828
+ *
1829
+ * @public
1830
+ */
1831
+ export declare interface SearchQueryOptions {
1832
+ /**
1833
+ * The search string (or regular expression).
1834
+ */
1835
+ search: string;
1836
+ /**
1837
+ * The replace text.
1838
+ */
1839
+ replace?: string;
1840
+ /**
1841
+ * Indicates whether the search is case-sensitive
1842
+ *
1843
+ * @default false
1844
+ */
1845
+ caseSensitive?: boolean;
1846
+ /**
1847
+ * By default, string search will replace `\n`, `\r`, and `\t` in the query
1848
+ * with newline, return, and tab characters. When this is set to true, that
1849
+ * behavior is disabled.
1850
+ *
1851
+ * @default false
1852
+ */
1853
+ literal?: boolean;
1854
+ /**
1855
+ * When true, the search string is interpreted as a regular expression.
1856
+ *
1857
+ * @default false
1858
+ */
1859
+ regexp?: boolean;
1860
+ /**
1861
+ * Enable whole-word matching.
1862
+ *
1863
+ * @default false
1864
+ */
1865
+ wholeWord?: boolean;
1866
+ }
1867
+
1868
+ /**
1869
+ * @public
1870
+ */
1871
+ declare function selectTable(options?: SelectTableOptions): Command;
1872
+ export { selectTable }
1873
+ export { selectTable as selectTable_alias_1 }
1874
+
1875
+ /**
1876
+ * @public
1877
+ */
1878
+ declare function selectTableCell(options?: SelectTableCellOptions): Command;
1879
+ export { selectTableCell }
1880
+ export { selectTableCell as selectTableCell_alias_1 }
1881
+
1882
+ /**
1883
+ * @public
1884
+ */
1885
+ declare interface SelectTableCellOptions {
1886
+ /**
1887
+ * A hit position of the table cell to select from. By default, the selection
1888
+ * anchor will be used.
1889
+ */
1890
+ pos?: number;
1891
+ }
1892
+ export { SelectTableCellOptions }
1893
+ export { SelectTableCellOptions as SelectTableCellOptions_alias_1 }
1894
+
1895
+ /**
1896
+ * @public
1897
+ */
1898
+ declare function selectTableColumn(options?: SelectTableColumnOptions): Command;
1899
+ export { selectTableColumn }
1900
+ export { selectTableColumn as selectTableColumn_alias_1 }
1901
+
1902
+ /**
1903
+ * @public
1904
+ */
1905
+ declare interface SelectTableColumnOptions {
1906
+ /**
1907
+ * A hit position of the table cell to select from. By default, the selection
1908
+ * anchor will be used.
1909
+ */
1910
+ anchor?: number;
1911
+ /**
1912
+ * A hit position of the table cell to select to. By default, the selection
1913
+ * head will be used.
1914
+ */
1915
+ head?: number;
1916
+ }
1917
+ export { SelectTableColumnOptions }
1918
+ export { SelectTableColumnOptions as SelectTableColumnOptions_alias_1 }
1919
+
1920
+ /**
1921
+ * @public
1922
+ */
1923
+ declare interface SelectTableOptions {
1924
+ /**
1925
+ * A hit position of the table to select from. By default, the selection
1926
+ * anchor will be used.
1927
+ */
1928
+ pos?: number;
1929
+ }
1930
+ export { SelectTableOptions }
1931
+ export { SelectTableOptions as SelectTableOptions_alias_1 }
1932
+
1933
+ /**
1934
+ * @public
1935
+ */
1936
+ declare function selectTableRow(options?: SelectTableRowOptions): Command;
1937
+ export { selectTableRow }
1938
+ export { selectTableRow as selectTableRow_alias_1 }
1939
+
1940
+ /**
1941
+ * @public
1942
+ */
1943
+ declare interface SelectTableRowOptions {
1944
+ /**
1945
+ * A hit position of the table cell to select from. By default, the selection
1946
+ * anchor will be used.
1947
+ */
1948
+ anchor?: number;
1949
+ /**
1950
+ * A hit position of the table cell to select to. By default, the selection
1951
+ * head will be used.
1952
+ */
1953
+ head?: number;
1954
+ }
1955
+ export { SelectTableRowOptions }
1956
+ export { SelectTableRowOptions as SelectTableRowOptions_alias_1 }
1957
+
1958
+ /**
1959
+ * @internal
1960
+ */
1961
+ export declare function setTextAlign({ types, value, }: {
1962
+ types: string[];
1963
+ value: string | null;
1964
+ }): Command;
1965
+
1966
+ export declare function setTrMeta(tr: Transaction, meta: PredictionPluginState): Transaction;
1967
+
1968
+ /**
1969
+ * @internal
1970
+ */
1971
+ export declare function setupTest(): {
1972
+ editor: TestEditor<Union<readonly [DocExtension, TextExtension, HeadingExtension, HistoryExtension, ListExtension, BlockquoteExtension, PlainExtension, BaseCommandsExtension, ItalicExtension, BoldExtension, UnderlineExtension, StrikeExtension, CodeExtension, LinkExtension, ImageExtension, Extension<{
1973
+ Nodes: {
1974
+ paragraph: Attrs_2;
1975
+ };
1976
+ }>, TableExtension, HorizontalRuleExtension]>>;
1977
+ m: ToMarkAction<SimplifyDeeper< {
1978
+ bold: {
1979
+ readonly [x: string]: any;
1980
+ };
1981
+ code: {
1982
+ readonly [x: string]: any;
1983
+ };
1984
+ italic: {
1985
+ readonly [x: string]: any;
1986
+ };
1987
+ link: {
1988
+ href: string;
1989
+ };
1990
+ strike: {
1991
+ readonly [x: string]: any;
1992
+ };
1993
+ underline: {
1994
+ readonly [x: string]: any;
1995
+ };
1996
+ }>>;
1997
+ n: {
1998
+ p: NodeAction< {
1999
+ readonly [x: string]: any;
2000
+ }>;
2001
+ h1: (...children: NodeChild[]) => Node_2;
2002
+ h2: (...children: NodeChild[]) => Node_2;
2003
+ h3: (...children: NodeChild[]) => Node_2;
2004
+ h4: (...children: NodeChild[]) => Node_2;
2005
+ h5: (...children: NodeChild[]) => Node_2;
2006
+ h6: (...children: NodeChild[]) => Node_2;
2007
+ bullet: (...children: NodeChild[]) => Node_2;
2008
+ ordered: (...children: NodeChild[]) => Node_2;
2009
+ checked: (...children: NodeChild[]) => Node_2;
2010
+ unchecked: (...children: NodeChild[]) => Node_2;
2011
+ collapsed: (...children: NodeChild[]) => Node_2;
2012
+ expanded: (...children: NodeChild[]) => Node_2;
2013
+ doc: NodeAction< {
2014
+ readonly [x: string]: any;
2015
+ }>;
2016
+ paragraph: NodeAction< {
2017
+ readonly [x: string]: any;
2018
+ }>;
2019
+ text: NodeAction< {
2020
+ readonly [x: string]: any;
2021
+ }>;
2022
+ blockquote: NodeAction< {
2023
+ readonly [x: string]: any;
2024
+ }>;
2025
+ heading: NodeAction< {
2026
+ level: number;
2027
+ }>;
2028
+ horizontalRule: NodeAction< {
2029
+ readonly [x: string]: any;
2030
+ }>;
2031
+ image: NodeAction< {
2032
+ src?: (string | null) | undefined;
2033
+ width?: (number | null) | undefined;
2034
+ height?: (number | null) | undefined;
2035
+ }>;
2036
+ list: NodeAction< {
2037
+ kind?: ("bullet" | "ordered" | "task" | "toggle") | undefined;
2038
+ order?: (number | null) | undefined;
2039
+ checked?: boolean | undefined;
2040
+ collapsed?: boolean | undefined;
2041
+ }>;
2042
+ table: NodeAction< {
2043
+ readonly [x: string]: any;
2044
+ }>;
2045
+ tableRow: NodeAction< {
2046
+ readonly [x: string]: any;
2047
+ }>;
2048
+ tableCell: NodeAction< {
2049
+ colspan: number;
2050
+ rowspan: number;
2051
+ colwidth: number[] | null;
2052
+ }>;
2053
+ tableHeaderCell: NodeAction< {
2054
+ colspan: number;
2055
+ rowspan: number;
2056
+ colwidth: number[] | null;
2057
+ }>;
2058
+ };
2059
+ };
2060
+
2061
+ /**
2062
+ * @internal
2063
+ */
2064
+ export declare function setupTestFromExtension<E extends Extension>(extension: E): {
2065
+ editor: TestEditor<E>;
2066
+ n: ExtractNodeActions<E>;
2067
+ m: ExtractMarkActions<E>;
2068
+ };
2069
+
2070
+ export declare interface ShikiHighlighterOptions extends BundledHighlighterOptions<BundledLanguage, BundledTheme> {
2071
+ }
2072
+
2073
+ /**
2074
+ * @internal
2075
+ */
2076
+ export declare type StrikeCommandsExtension = Extension<{
2077
+ Commands: {
2078
+ toggleStrike: [];
2079
+ };
2080
+ }>;
2081
+
2082
+ /**
2083
+ * @internal
2084
+ */
2085
+ export declare type StrikeExtension = Union<[
2086
+ StrikeSpecExtension,
2087
+ StrikeCommandsExtension
2088
+ ]>;
2089
+
2090
+ /**
2091
+ * @internal
2092
+ */
2093
+ export declare type StrikeSpecExtension = Extension<{
2094
+ Marks: {
2095
+ strike: Attrs;
2096
+ };
2097
+ }>;
2098
+
2099
+ /**
2100
+ * @internal
2101
+ */
2102
+ declare type TableCellSpecExtension = Extension<{
2103
+ Nodes: {
2104
+ tableCell: CellAttrs;
2105
+ };
2106
+ }>;
2107
+ export { TableCellSpecExtension }
2108
+ export { TableCellSpecExtension as TableCellSpecExtension_alias_1 }
2109
+
2110
+ /**
2111
+ * @internal
2112
+ */
2113
+ declare type TableCommandsExtension = Extension<{
2114
+ Commands: {
2115
+ insertTable: [InsertTableOptions];
2116
+ exitTable: [];
2117
+ selectTable: [options?: SelectTableOptions];
2118
+ selectTableCell: [options?: SelectTableCellOptions];
2119
+ selectTableColumn: [options?: SelectTableColumnOptions];
2120
+ selectTableRow: [options?: SelectTableRowOptions];
2121
+ addTableColumnBefore: [];
2122
+ addTableColumnAfter: [];
2123
+ addTableRowAbove: [];
2124
+ addTableRowBelow: [];
2125
+ deleteTable: [];
2126
+ deleteTableColumn: [];
2127
+ deleteTableRow: [];
2128
+ deleteCellSelection: [];
2129
+ mergeTableCells: [];
2130
+ splitTableCell: [];
2131
+ };
2132
+ }>;
2133
+ export { TableCommandsExtension }
2134
+ export { TableCommandsExtension as TableCommandsExtension_alias_1 }
2135
+
2136
+ /**
2137
+ * @internal
2138
+ */
2139
+ declare type TableExtension = Union<[
2140
+ TableSpecExtension,
2141
+ TableRowSpecExtension,
2142
+ TableCellSpecExtension,
2143
+ TableHeaderCellSpecExtension,
2144
+ TableCommandsExtension
2145
+ ]>;
2146
+ export { TableExtension }
2147
+ export { TableExtension as TableExtension_alias_1 }
2148
+
2149
+ /**
2150
+ * @internal
2151
+ */
2152
+ declare type TableHeaderCellSpecExtension = Extension<{
2153
+ Nodes: {
2154
+ tableHeaderCell: CellAttrs;
2155
+ };
2156
+ }>;
2157
+ export { TableHeaderCellSpecExtension }
2158
+ export { TableHeaderCellSpecExtension as TableHeaderCellSpecExtension_alias_1 }
2159
+
2160
+ /**
2161
+ * @internal
2162
+ */
2163
+ declare type TableRowSpecExtension = Extension<{
2164
+ Nodes: {
2165
+ tableRow: Attrs;
2166
+ };
2167
+ }>;
2168
+ export { TableRowSpecExtension }
2169
+ export { TableRowSpecExtension as TableRowSpecExtension_alias_1 }
2170
+
2171
+ /**
2172
+ * @internal
2173
+ */
2174
+ declare type TableSpecExtension = Extension<{
2175
+ Nodes: {
2176
+ table: Attrs;
2177
+ };
2178
+ }>;
2179
+ export { TableSpecExtension }
2180
+ export { TableSpecExtension as TableSpecExtension_alias_1 }
2181
+
2182
+ /**
2183
+ * @internal
2184
+ */
2185
+ export declare type TextAlignAttrsExtension<NodeName extends string> = Extension<{
2186
+ Nodes: {
2187
+ [K in NodeName]: {
2188
+ textAlign: string | null;
2189
+ };
2190
+ };
2191
+ }>;
2192
+
2193
+ /**
2194
+ * @internal
2195
+ */
2196
+ export declare type TextAlignCommandsExtension = Extension<{
2197
+ Commands: {
2198
+ setTextAlign: [value: string | null];
2199
+ };
2200
+ }>;
2201
+
2202
+ /**
2203
+ * @internal
2204
+ */
2205
+ export declare type TextAlignExtension<NodeName extends string> = Union<[
2206
+ TextAlignAttrsExtension<NodeName>,
2207
+ TextAlignCommandsExtension
2208
+ ]>;
2209
+
2210
+ /**
2211
+ * @public
2212
+ */
2213
+ export declare interface TextAlignOptions<NodeName extends string = string> {
2214
+ /**
2215
+ * The names of node to add the attribute to.
2216
+ *
2217
+ * @example
2218
+ *
2219
+ * ["paragraph", "heading"]
2220
+ */
2221
+ types: NodeName[];
2222
+ /**
2223
+ * The default value for the attribute.
2224
+ *
2225
+ * @default "left"
2226
+ */
2227
+ default?: string;
2228
+ }
2229
+
2230
+ /**
2231
+ * Options for {@link defineTextBlockEnterRule}.
2232
+ *
2233
+ * @public
2234
+ */
2235
+ export declare type TextBlockEnterRuleOptions = {
2236
+ /**
2237
+ * The regular expression to match against. It should end with `$`.
2238
+ */
2239
+ regex: RegExp;
2240
+ /**
2241
+ * The node type to replace the matched text with.
2242
+ */
2243
+ type: string | NodeType;
2244
+ /**
2245
+ * Attributes to set on the node. If a function is provided, it will be called
2246
+ * with the matched result from the regular expression.
2247
+ */
2248
+ attrs?: Attrs | null | ((match: RegExpMatchArray) => Attrs | null);
2249
+ /**
2250
+ * Whether to stop further handlers from being called if this rule is triggered.
2251
+ *
2252
+ * @default true
2253
+ */
2254
+ stop?: boolean;
2255
+ };
2256
+
2257
+ export { ToggleCollapsedOptions }
2258
+ export { ToggleCollapsedOptions as ToggleCollapsedOptions_alias_1 }
2259
+
2260
+ /**
2261
+ * @internal
2262
+ */
2263
+ export declare type UnderlineCommandsExtension = Extension<{
2264
+ Commands: {
2265
+ toggleUnderline: [];
2266
+ };
2267
+ }>;
2268
+
2269
+ /**
2270
+ * @internal
2271
+ */
2272
+ export declare type UnderlineExtension = Union<[
2273
+ UnderlineSpecExtension,
2274
+ UnderlineCommandsExtension
2275
+ ]>;
2276
+
2277
+ /**
2278
+ * @internal
2279
+ */
2280
+ export declare type UnderlineSpecExtension = Extension<{
2281
+ Marks: {
2282
+ underline: Attrs;
2283
+ };
2284
+ }>;
2285
+
2286
+ /**
2287
+ * @internal
2288
+ */
2289
+ export declare const undo: Command;
2290
+
2291
+ export { UnwrapListOptions }
2292
+ export { UnwrapListOptions as UnwrapListOptions_alias_1 }
2293
+
2294
+ /**
2295
+ * The implementation of the actual upload function. You need to implement this
2296
+ * function to upload files to your desired destination.
2297
+ */
2298
+ declare type Uploader<Result> = (options: UploaderOptions) => Promise<Result>;
2299
+ export { Uploader }
2300
+ export { Uploader as Uploader_alias_1 }
2301
+
2302
+ declare interface UploaderOptions {
2303
+ /**
2304
+ * The file to be uploaded.
2305
+ */
2306
+ file: File;
2307
+ /**
2308
+ * A callback function that should be called with the upload progress updates.
2309
+ */
2310
+ onProgress: (progress: UploadProgress) => void;
2311
+ }
2312
+ export { UploaderOptions }
2313
+ export { UploaderOptions as UploaderOptions_alias_1 }
2314
+
2315
+ /**
2316
+ * An interface representing the upload progress.
2317
+ */
2318
+ declare interface UploadProgress {
2319
+ loaded: number;
2320
+ total: number;
2321
+ }
2322
+ export { UploadProgress }
2323
+ export { UploadProgress as UploadProgress_alias_1 }
2324
+
2325
+ /**
2326
+ * A class that represents a upload task.
2327
+ */
2328
+ declare class UploadTask<Result> {
2329
+ /**
2330
+ * An [object URL](https://developer.mozilla.org/en-US/docs/Web/API/URL/createObjectURL)
2331
+ * representing the file to be uploaded. This URL will be revoked once the
2332
+ * upload is complete successfully.
2333
+ */
2334
+ readonly objectURL: string;
2335
+ /**
2336
+ * A boolean indicating whether the upload is complete (either successfully or with an error).
2337
+ */
2338
+ protected done: boolean;
2339
+ /**
2340
+ * A promise that fulfills once the upload is complete, or rejects if an error occurs.
2341
+ */
2342
+ readonly finished: Promise<Result>;
2343
+ private subscribers;
2344
+ /**
2345
+ * Creates a new upload task. You can find the upload task by its object URL
2346
+ * later using `UploadTask.get()`.
2347
+ *
2348
+ * @param options - The options for the upload task.
2349
+ */
2350
+ constructor({ file, uploader }: {
2351
+ file: File;
2352
+ uploader: Uploader<Result>;
2353
+ });
2354
+ /**
2355
+ * Subscribes to progress updates. Returns a function to unsubscribe.
2356
+ */
2357
+ subscribeProgress(callback: (progress: UploadProgress) => void): VoidFunction;
2358
+ /**
2359
+ * Finds an upload task by its object URL.
2360
+ */
2361
+ static get<Result = unknown>(objectURL: string): UploadTask<Result> | undefined;
2362
+ /**
2363
+ * Deletes an upload task by its object URL.
2364
+ */
2365
+ static delete(objectURL: string): void;
2366
+ }
2367
+ export { UploadTask }
2368
+ export { UploadTask as UploadTask_alias_1 }
2369
+
2370
+ /**
2371
+ * @internal
2372
+ */
2373
+ export declare type VirtualSelectionExtension = PlainExtension;
2374
+
2375
+ export { WrapInListGetAttrs }
2376
+ export { WrapInListGetAttrs as WrapInListGetAttrs_alias_1 }
2377
+
2378
+ /**
2379
+ * @internal
2380
+ */
2381
+ export declare type YjsCommandsExtension = Extension<{
2382
+ Commands: {
2383
+ undo: [];
2384
+ redo: [];
2385
+ };
2386
+ }>;
2387
+
2388
+ declare interface YjsCursorOptions extends YjsCursorPluginOptions {
2389
+ awareness: Awareness;
2390
+ }
2391
+ export { YjsCursorOptions }
2392
+ export { YjsCursorOptions as YjsCursorOptions_alias_1 }
2393
+
2394
+ /**
2395
+ * Options for `y-prosemirror`'s `yCursorPlugin`.
2396
+ */
2397
+ declare type YjsCursorPluginOptions = NonNullable<Parameters<typeof yCursorPlugin>[1]>;
2398
+ export { YjsCursorPluginOptions }
2399
+ export { YjsCursorPluginOptions as YjsCursorPluginOptions_alias_1 }
2400
+
2401
+ /**
2402
+ * @internal
2403
+ */
2404
+ declare type YjsExtension = Union<[YjsCommandsExtension, PlainExtension]>;
2405
+ export { YjsExtension }
2406
+ export { YjsExtension as YjsExtension_alias_1 }
2407
+
2408
+ declare interface YjsOptions {
2409
+ /**
2410
+ * The Yjs instance handles the state of shared data.
2411
+ */
2412
+ doc: Y.Doc;
2413
+ /**
2414
+ * The Awareness instance.
2415
+ */
2416
+ awareness: Awareness;
2417
+ /**
2418
+ * The Yjs XmlFragment to use. If not provided,
2419
+ * `doc.getXmlFragment('prosemirror')` will be used.
2420
+ */
2421
+ fragment?: Y.XmlFragment;
2422
+ /**
2423
+ * Options for `y-prosemirror`'s `ySyncPlugin`.
2424
+ */
2425
+ sync?: YjsSyncPluginOptions;
2426
+ /**
2427
+ * Options for the `y-prosemirror`'s `yUndoPlugin`.
2428
+ */
2429
+ undo?: YjsUndoPluginOptions;
2430
+ /**
2431
+ * Options for `y-prosemirror`'s `yCursorPlugin`.
2432
+ */
2433
+ cursor?: YjsCursorPluginOptions;
2434
+ }
2435
+ export { YjsOptions }
2436
+ export { YjsOptions as YjsOptions_alias_1 }
2437
+
2438
+ declare interface YjsSyncOptions extends YjsSyncPluginOptions {
2439
+ fragment: Y.XmlFragment;
2440
+ }
2441
+ export { YjsSyncOptions }
2442
+ export { YjsSyncOptions as YjsSyncOptions_alias_1 }
2443
+
2444
+ /**
2445
+ * Options for `y-prosemirror`'s `ySyncPlugin`.
2446
+ */
2447
+ declare type YjsSyncPluginOptions = NonNullable<Parameters<typeof ySyncPlugin>[1]>;
2448
+ export { YjsSyncPluginOptions }
2449
+ export { YjsSyncPluginOptions as YjsSyncPluginOptions_alias_1 }
2450
+
2451
+ declare interface YjsUndoOptions extends YjsUndoPluginOptions {
2452
+ }
2453
+ export { YjsUndoOptions }
2454
+ export { YjsUndoOptions as YjsUndoOptions_alias_1 }
2455
+
2456
+ /**
2457
+ * Options for the `y-prosemirror`'s `yUndoPlugin`.
2458
+ */
2459
+ declare type YjsUndoPluginOptions = NonNullable<Parameters<typeof yUndoPlugin>[0]>;
2460
+ export { YjsUndoPluginOptions }
2461
+ export { YjsUndoPluginOptions as YjsUndoPluginOptions_alias_1 }
2462
+
2463
+ export { }