@prosekit/extensions 0.7.6 → 0.7.8

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 (34) hide show
  1. package/dist/_tsup-dts-rollup.d.ts +621 -649
  2. package/dist/{chunk-OJCMRVEY.js → chunk-5H7DHO2K.js} +6 -13
  3. package/dist/{chunk-LVMTQOWG.js → chunk-J57QWYYX.js} +12 -13
  4. package/dist/prosekit-extensions-blockquote.d.ts +2 -0
  5. package/dist/prosekit-extensions-blockquote.js +5 -2
  6. package/dist/prosekit-extensions-bold.d.ts +3 -0
  7. package/dist/prosekit-extensions-bold.js +1 -1
  8. package/dist/prosekit-extensions-code-block.d.ts +3 -0
  9. package/dist/prosekit-extensions-code-block.js +2 -2
  10. package/dist/prosekit-extensions-code.d.ts +3 -0
  11. package/dist/prosekit-extensions-code.js +1 -1
  12. package/dist/prosekit-extensions-drop-cursor.d.ts +1 -0
  13. package/dist/prosekit-extensions-enter-rule.js +1 -1
  14. package/dist/prosekit-extensions-gap-cursor.d.ts +1 -0
  15. package/dist/prosekit-extensions-heading.d.ts +3 -0
  16. package/dist/prosekit-extensions-heading.js +1 -1
  17. package/dist/prosekit-extensions-image.d.ts +3 -0
  18. package/dist/prosekit-extensions-input-rule.js +1 -1
  19. package/dist/prosekit-extensions-italic.d.ts +3 -0
  20. package/dist/prosekit-extensions-italic.js +1 -1
  21. package/dist/prosekit-extensions-link.d.ts +3 -0
  22. package/dist/prosekit-extensions-link.js +2 -2
  23. package/dist/prosekit-extensions-list.d.ts +3 -0
  24. package/dist/prosekit-extensions-list.js +2 -2
  25. package/dist/prosekit-extensions-mod-click-prevention.d.ts +1 -0
  26. package/dist/prosekit-extensions-strike.d.ts +3 -0
  27. package/dist/prosekit-extensions-strike.js +1 -1
  28. package/dist/prosekit-extensions-table.d.ts +6 -0
  29. package/dist/prosekit-extensions-table.js +6 -10
  30. package/dist/prosekit-extensions-text-align.d.ts +3 -1
  31. package/dist/prosekit-extensions-underline.d.ts +3 -0
  32. package/dist/prosekit-extensions-underline.js +2 -2
  33. package/dist/prosekit-extensions-virtual-selection.d.ts +1 -0
  34. package/package.json +2 -2
@@ -1,6 +1,6 @@
1
- import { AddMarkOptions } from '@prosekit/core';
2
- import { Attrs } from 'prosemirror-model';
3
- import { Attrs as Attrs_2 } from '@prosekit/pm/model';
1
+ import { Attrs } from '@prosekit/pm/model';
2
+ import { Attrs as Attrs_2 } from 'prosemirror-model';
3
+ import { BaseCommandsExtension } from '@prosekit/core';
4
4
  import { BundledLanguage } from 'shiki';
5
5
  import { BundledLanguageInfo } from 'shiki';
6
6
  import { bundledLanguagesInfo } from 'shiki';
@@ -10,6 +10,7 @@ import { bundledThemesInfo } from 'shiki';
10
10
  import { Command } from '@prosekit/pm/state';
11
11
  import { DedentListOptions } from 'prosemirror-flat-list';
12
12
  import { config as default_alias_1 } from '@prosekit/dev/config-vitest';
13
+ import { DocExtension } from '@prosekit/core';
13
14
  import { EditorState } from '@prosekit/pm/state';
14
15
  import { Extension } from '@prosekit/core';
15
16
  import { ExtensionTyping } from '@prosekit/core';
@@ -18,11 +19,11 @@ import { ExtractNodeActions } from '@prosekit/core';
18
19
  import { GapCursor } from 'prosemirror-gapcursor';
19
20
  import { getSingletonHighlighter } from 'shiki/bundle/full';
20
21
  import type { Highlighter } from 'shiki';
22
+ import { HistoryExtension } from '@prosekit/core';
21
23
  import { IndentListOptions } from 'prosemirror-flat-list';
22
24
  import { InputRule } from '@prosekit/pm/inputrules';
23
- import { InsertNodeOptions } from '@prosekit/core';
24
25
  import type { IsEqual } from 'type-fest';
25
- import { ListAttributes } from 'prosemirror-flat-list';
26
+ import type { ListAttributes } from 'prosemirror-flat-list';
26
27
  import { ListDOMSerializer } from 'prosemirror-flat-list';
27
28
  import { MarkType } from '@prosekit/pm/model';
28
29
  import { Node as Node_2 } from 'prosemirror-model';
@@ -32,25 +33,21 @@ import { NodeJSON } from '@prosekit/core';
32
33
  import { NodeType } from '@prosekit/pm/model';
33
34
  import { Options } from 'tsup';
34
35
  import { Parser } from 'prosemirror-highlight';
36
+ import { PlainExtension } from '@prosekit/core';
35
37
  import { Plugin as Plugin_2 } from '@prosekit/pm/state';
36
38
  import { PluginKey } from '@prosekit/pm/state';
37
39
  import { ProseMirrorNode } from '@prosekit/pm/model';
38
- import { RemoveMarkOptions } from '@prosekit/core';
39
- import { RemoveNodeOptions } from '@prosekit/core';
40
- import { SetBlockTypeOptions } from '@prosekit/core';
41
- import { SetNodeAttrsOptions } from '@prosekit/core';
42
40
  import { SimplifyDeeper } from '@prosekit/core';
43
41
  import type { SpecialLanguage } from 'shiki';
44
42
  import { StepJSON } from '@prosekit/core';
45
43
  import { TestEditor } from '@prosekit/core/test';
44
+ import { TextExtension } from '@prosekit/core';
46
45
  import { ToggleCollapsedOptions } from 'prosemirror-flat-list';
47
46
  import { ToMarkAction } from '@prosekit/core';
48
47
  import { Transaction } from '@prosekit/pm/state';
49
- import { UnsetBlockTypeOptions } from '@prosekit/core';
50
- import { UnsetMarkOptions } from '@prosekit/core';
48
+ import { Union } from '@prosekit/core';
51
49
  import { UnwrapListOptions } from 'prosemirror-flat-list';
52
50
  import { WrapInListGetAttrs } from 'prosemirror-flat-list';
53
- import { WrapOptions } from '@prosekit/core';
54
51
 
55
52
  export declare function applyMarkRules(rules: MarkRuleOptions[], transactions: readonly Transaction[], oldState: EditorState, newState: EditorState): Transaction | null;
56
53
 
@@ -78,6 +75,43 @@ declare class AutocompleteRule {
78
75
  export { AutocompleteRule }
79
76
  export { AutocompleteRule as AutocompleteRule_alias_1 }
80
77
 
78
+ /**
79
+ * @internal
80
+ */
81
+ export declare type BlockquoteExtension = Union<[BlockquoteSpecExtension]>;
82
+
83
+ /**
84
+ * @internal
85
+ */
86
+ export declare type BlockquoteSpecExtension = Extension<{
87
+ Nodes: {
88
+ blockquote: Attrs;
89
+ };
90
+ }>;
91
+
92
+ /**
93
+ * @internal
94
+ */
95
+ export declare type BoldCommandsExtension = Extension<{
96
+ Commands: {
97
+ toggleBold: [];
98
+ };
99
+ }>;
100
+
101
+ /**
102
+ * @internal
103
+ */
104
+ export declare type BoldExtension = Union<[BoldSpecExtension, BoldCommandsExtension]>;
105
+
106
+ /**
107
+ * @internal
108
+ */
109
+ export declare type BoldSpecExtension = Extension<{
110
+ Marks: {
111
+ bold: Attrs;
112
+ };
113
+ }>;
114
+
81
115
  export { BundledLanguage as ShikiBundledLanguage }
82
116
  export { BundledLanguage as ShikiBundledLanguage_alias_1 }
83
117
 
@@ -96,6 +130,9 @@ export { BundledThemeInfo as ShikiBundledThemeInfo_alias_1 }
96
130
  export { bundledThemesInfo as shikiBundledThemesInfo }
97
131
  export { bundledThemesInfo as shikiBundledThemesInfo_alias_1 }
98
132
 
133
+ /**
134
+ * @public
135
+ */
99
136
  export declare interface CellAttrs {
100
137
  colspan: number;
101
138
  rowspan: number;
@@ -108,11 +145,35 @@ export declare interface CellAttrs {
108
145
  * @public
109
146
  */
110
147
  declare interface CodeBlockAttrs {
111
- language?: string;
148
+ language: string;
112
149
  }
113
150
  export { CodeBlockAttrs }
114
151
  export { CodeBlockAttrs as CodeBlockAttrs_alias_1 }
115
152
 
153
+ /**
154
+ * @internal
155
+ */
156
+ declare type CodeBlockCommandsExtension = Extension<{
157
+ Commands: {
158
+ setCodeBlock: [attrs?: CodeBlockAttrs];
159
+ insertCodeBlock: [attrs?: CodeBlockAttrs];
160
+ toggleCodeBlock: [attrs?: CodeBlockAttrs];
161
+ setCodeBlockAttrs: [attrs: CodeBlockAttrs];
162
+ };
163
+ }>;
164
+ export { CodeBlockCommandsExtension }
165
+ export { CodeBlockCommandsExtension as CodeBlockCommandsExtension_alias_1 }
166
+
167
+ /**
168
+ * @internal
169
+ */
170
+ declare type CodeBlockExtension = Union<[
171
+ CodeBlockSpecExtension,
172
+ CodeBlockCommandsExtension
173
+ ]>;
174
+ export { CodeBlockExtension }
175
+ export { CodeBlockExtension as CodeBlockExtension_alias_1 }
176
+
116
177
  /**
117
178
  * @public
118
179
  */
@@ -138,6 +199,40 @@ export declare interface CodeBlockShikiOptions {
138
199
  langAlias?: Record<string, BundledLanguage>;
139
200
  }
140
201
 
202
+ /**
203
+ * @internal
204
+ */
205
+ declare type CodeBlockSpecExtension = Extension<{
206
+ Nodes: {
207
+ codeBlock: CodeBlockAttrs;
208
+ };
209
+ }>;
210
+ export { CodeBlockSpecExtension }
211
+ export { CodeBlockSpecExtension as CodeBlockSpecExtension_alias_1 }
212
+
213
+ /**
214
+ * @internal
215
+ */
216
+ export declare type CodeCommandsExtension = Extension<{
217
+ Commands: {
218
+ toggleCode: [];
219
+ };
220
+ }>;
221
+
222
+ /**
223
+ * @internal
224
+ */
225
+ export declare type CodeExtension = Union<[CodeSpecExtension, CodeCommandsExtension]>;
226
+
227
+ /**
228
+ * @internal
229
+ */
230
+ export declare type CodeSpecExtension = Extension<{
231
+ Marks: {
232
+ code: Attrs;
233
+ };
234
+ }>;
235
+
141
236
  /**
142
237
  * A JSON representation of a commit.
143
238
  */
@@ -205,73 +300,45 @@ export declare function defineAutocomplete(rule: AutocompleteRule): Extension;
205
300
  /**
206
301
  * @public
207
302
  */
208
- export declare function defineBlockquote(): Extension< {
209
- Nodes: SimplifyDeeper< {
210
- blockquote: Attrs;
211
- }>;
212
- Marks: never;
213
- Commands: never;
214
- }>;
303
+ export declare function defineBlockquote(): BlockquoteExtension;
215
304
 
216
305
  /**
217
306
  * Wraps the text block in a blockquote when `>` is typed at the start of a new
218
307
  * line followed by a space.
219
308
  */
220
- export declare function defineBlockquoteInputRule(): Extension<ExtensionTyping<any, any, any>>;
309
+ export declare function defineBlockquoteInputRule(): PlainExtension;
221
310
 
222
- export declare function defineBlockquoteSpec(): Extension< {
223
- Nodes: {
224
- blockquote: Attrs;
225
- };
226
- Marks: never;
227
- Commands: never;
228
- }>;
311
+ export declare function defineBlockquoteSpec(): BlockquoteSpecExtension;
229
312
 
230
313
  /**
231
314
  * @public
232
315
  */
233
- export declare function defineBold(): Extension< {
234
- Nodes: never;
235
- Marks: SimplifyDeeper< {
236
- bold: Attrs;
237
- }>;
238
- Commands: {
239
- toggleBold: [];
240
- };
241
- }>;
316
+ export declare function defineBold(): BoldExtension;
242
317
 
243
- export declare function defineBoldCommands(): Extension< {
244
- Commands: {
245
- toggleBold: [];
246
- };
247
- Nodes: never;
248
- Marks: never;
249
- }>;
318
+ /**
319
+ * @internal
320
+ */
321
+ export declare function defineBoldCommands(): BoldCommandsExtension;
250
322
 
251
- export declare function defineBoldInputRule(): Extension<ExtensionTyping<any, any, any>>;
323
+ /**
324
+ * @internal
325
+ */
326
+ export declare function defineBoldInputRule(): PlainExtension;
252
327
 
253
- export declare function defineBoldKeymap(): Extension<ExtensionTyping<any, any, any>>;
328
+ /**
329
+ * @internal
330
+ */
331
+ export declare function defineBoldKeymap(): PlainExtension;
254
332
 
255
- export declare function defineBoldSpec(): Extension< {
256
- Marks: {
257
- bold: Attrs;
258
- };
259
- Nodes: never;
260
- Commands: never;
261
- }>;
333
+ /**
334
+ * @internal
335
+ */
336
+ export declare function defineBoldSpec(): BoldSpecExtension;
262
337
 
263
338
  /**
264
339
  * @public
265
340
  */
266
- export declare function defineCode(): Extension< {
267
- Nodes: never;
268
- Marks: SimplifyDeeper< {
269
- code: Attrs;
270
- }>;
271
- Commands: {
272
- toggleCode: [];
273
- };
274
- }>;
341
+ export declare function defineCode(): CodeExtension;
275
342
 
276
343
  /**
277
344
  * Adds `codeBlock` nodes to the editor. This includes the following extensions:
@@ -284,20 +351,7 @@ toggleCode: [];
284
351
  *
285
352
  * @public
286
353
  */
287
- declare function defineCodeBlock(): Extension< {
288
- Nodes: SimplifyDeeper< {
289
- codeBlock: {
290
- language: string;
291
- };
292
- }>;
293
- Marks: never;
294
- Commands: {
295
- setCodeBlock: [attrs?: CodeBlockAttrs | undefined];
296
- insertCodeBlock: [attrs?: CodeBlockAttrs | undefined];
297
- toggleCodeBlock: [attrs?: CodeBlockAttrs | undefined];
298
- setCodeBlockAttrs: [attrs: CodeBlockAttrs];
299
- };
300
- }>;
354
+ declare function defineCodeBlock(): CodeBlockExtension;
301
355
  export { defineCodeBlock }
302
356
  export { defineCodeBlock as defineCodeBlock_alias_1 }
303
357
 
@@ -306,16 +360,7 @@ export { defineCodeBlock as defineCodeBlock_alias_1 }
306
360
  *
307
361
  * @public
308
362
  */
309
- declare function defineCodeBlockCommands(): Extension< {
310
- Commands: {
311
- setCodeBlock: [attrs?: CodeBlockAttrs | undefined];
312
- insertCodeBlock: [attrs?: CodeBlockAttrs | undefined];
313
- toggleCodeBlock: [attrs?: CodeBlockAttrs | undefined];
314
- setCodeBlockAttrs: [attrs: CodeBlockAttrs];
315
- };
316
- Nodes: never;
317
- Marks: never;
318
- }>;
363
+ declare function defineCodeBlockCommands(): CodeBlockCommandsExtension;
319
364
  export { defineCodeBlockCommands }
320
365
  export { defineCodeBlockCommands as defineCodeBlockCommands_alias_1 }
321
366
 
@@ -324,7 +369,7 @@ export { defineCodeBlockCommands as defineCodeBlockCommands_alias_1 }
324
369
  *
325
370
  * @public
326
371
  */
327
- declare function defineCodeBlockEnterRule(): Extension<ExtensionTyping<any, any, any>>;
372
+ declare function defineCodeBlockEnterRule(): PlainExtension;
328
373
  export { defineCodeBlockEnterRule }
329
374
  export { defineCodeBlockEnterRule as defineCodeBlockEnterRule_alias_1 }
330
375
 
@@ -347,14 +392,14 @@ export { defineCodeBlockHighlight as defineCodeBlockHighlight_alias_1 }
347
392
  *
348
393
  * @public
349
394
  */
350
- declare function defineCodeBlockInputRule(): Extension<ExtensionTyping<any, any, any>>;
395
+ declare function defineCodeBlockInputRule(): PlainExtension;
351
396
  export { defineCodeBlockInputRule }
352
397
  export { defineCodeBlockInputRule as defineCodeBlockInputRule_alias_1 }
353
398
 
354
399
  /**
355
400
  * Defines the keymap for code blocks.
356
401
  */
357
- export declare function defineCodeBlockKeymap(): Extension<ExtensionTyping<any, any, any>>;
402
+ export declare function defineCodeBlockKeymap(): PlainExtension;
358
403
 
359
404
  /**
360
405
  * Adds syntax highlighting to code blocks using the [shiki](https://github.com/shikijs/shiki) package.
@@ -370,54 +415,39 @@ export { defineCodeBlockShiki as defineCodeBlockShiki_alias_1 }
370
415
  *
371
416
  * @public
372
417
  */
373
- declare function defineCodeBlockSpec(): Extension< {
374
- Nodes: {
375
- codeBlock: {
376
- language: string;
377
- };
378
- };
379
- Marks: never;
380
- Commands: never;
381
- }>;
418
+ declare function defineCodeBlockSpec(): CodeBlockSpecExtension;
382
419
  export { defineCodeBlockSpec }
383
420
  export { defineCodeBlockSpec as defineCodeBlockSpec_alias_1 }
384
421
 
385
- export declare function defineCodeCommands(): Extension< {
386
- Commands: {
387
- toggleCode: [];
388
- };
389
- Nodes: never;
390
- Marks: never;
391
- }>;
422
+ /**
423
+ * @internal
424
+ */
425
+ export declare function defineCodeCommands(): CodeCommandsExtension;
392
426
 
393
- export declare function defineCodeInputRule(): Extension<ExtensionTyping<any, any, any>>;
427
+ /**
428
+ * @internal
429
+ */
430
+ export declare function defineCodeInputRule(): PlainExtension;
394
431
 
395
- export declare function defineCodeKeymap(): Extension<ExtensionTyping<any, any, any>>;
432
+ /**
433
+ * @internal
434
+ */
435
+ export declare function defineCodeKeymap(): PlainExtension;
396
436
 
397
437
  /**
398
- * @public
438
+ * @internal
399
439
  */
400
- export declare function defineCodeSpec(): Extension< {
401
- Marks: {
402
- code: Attrs;
403
- };
404
- Nodes: never;
405
- Commands: never;
406
- }>;
440
+ export declare function defineCodeSpec(): CodeSpecExtension;
407
441
 
408
442
  /**
409
443
  * Define an extension that can record the changes in the editor.
410
444
  */
411
- export declare function defineCommitRecorder(commitRecorder: CommitRecorder): Extension<ExtensionTyping<any, any, any>>;
445
+ export declare function defineCommitRecorder(commitRecorder: CommitRecorder): PlainExtension;
412
446
 
413
447
  /**
414
448
  * Define an extension to display the changes from the given commit in the editor.
415
449
  */
416
- export declare function defineCommitViewer(commit: Commit): Extension< {
417
- Nodes: never;
418
- Marks: never;
419
- Commands: never;
420
- }>;
450
+ export declare function defineCommitViewer(commit: Commit): PlainExtension;
421
451
 
422
452
  /**
423
453
  * Show up a decoration at the drop position when something is dragged over the editor.
@@ -426,7 +456,7 @@ Commands: never;
426
456
  *
427
457
  * @public
428
458
  */
429
- export declare function defineDropCursor(options?: DropCursorOptions): Extension<ExtensionTyping<any, any, any>>;
459
+ export declare function defineDropCursor(options?: DropCursorOptions): DropCursorExtension;
430
460
 
431
461
  /**
432
462
  * Defines an enter rule. An enter rule applies when the text directly in front of
@@ -435,7 +465,7 @@ export declare function defineDropCursor(options?: DropCursorOptions): Extension
435
465
  *
436
466
  * @public
437
467
  */
438
- export declare function defineEnterRule({ regex, handler, stop, }: EnterRuleOptions): Extension;
468
+ export declare function defineEnterRule(options: EnterRuleOptions): PlainExtension;
439
469
 
440
470
  /**
441
471
  * Capture clicks near and arrow-key-motion past places that don't have a
@@ -451,93 +481,58 @@ export declare function defineEnterRule({ regex, handler, stop, }: EnterRuleOpti
451
481
  *
452
482
  * @public
453
483
  */
454
- export declare function defineGapCursor(): Extension<ExtensionTyping<any, any, any>>;
484
+ export declare function defineGapCursor(): GapCursorExtension;
455
485
 
456
486
  /**
457
487
  * @public
458
488
  */
459
- export declare function defineHeading(): Extension< {
460
- Nodes: SimplifyDeeper< {
461
- heading: {
462
- level: number;
463
- };
464
- }>;
465
- Marks: never;
466
- Commands: {
467
- setHeading: [attrs?: HeadingAttrs | undefined];
468
- insertHeading: [attrs?: HeadingAttrs | undefined];
469
- toggleHeading: [attrs?: HeadingAttrs | undefined];
470
- };
471
- }>;
489
+ export declare function defineHeading(): HeadingExtension;
472
490
 
473
- declare function defineHeadingCommands(): Extension< {
474
- Commands: {
475
- setHeading: [attrs?: HeadingAttrs | undefined];
476
- insertHeading: [attrs?: HeadingAttrs | undefined];
477
- toggleHeading: [attrs?: HeadingAttrs | undefined];
478
- };
479
- Nodes: never;
480
- Marks: never;
481
- }>;
491
+ /**
492
+ * @internal
493
+ */
494
+ declare function defineHeadingCommands(): HeadingCommandsExtension;
482
495
  export { defineHeadingCommands }
483
496
  export { defineHeadingCommands as defineHeadingCommands_alias_1 }
484
497
 
485
498
  /**
486
499
  * Converts the text block to a heading when `#` is typed at the start of a new
487
500
  * line followed by a space.
501
+ *
502
+ * @internal
488
503
  */
489
- declare function defineHeadingInputRule(): Extension<ExtensionTyping<any, any, any>>;
504
+ declare function defineHeadingInputRule(): PlainExtension;
490
505
  export { defineHeadingInputRule }
491
506
  export { defineHeadingInputRule as defineHeadingInputRule_alias_1 }
492
507
 
493
- declare function defineHeadingKeymap(): Extension<ExtensionTyping<any, any, any>>;
508
+ /**
509
+ * @internal
510
+ */
511
+ declare function defineHeadingKeymap(): PlainExtension;
494
512
  export { defineHeadingKeymap }
495
513
  export { defineHeadingKeymap as defineHeadingKeymap_alias_1 }
496
514
 
497
- declare function defineHeadingSpec(): Extension< {
498
- Nodes: {
499
- heading: {
500
- level: number;
501
- };
502
- };
503
- Marks: never;
504
- Commands: never;
505
- }>;
515
+ /**
516
+ * @internal
517
+ */
518
+ declare function defineHeadingSpec(): HeadingSpecExtension;
506
519
  export { defineHeadingSpec }
507
520
  export { defineHeadingSpec as defineHeadingSpec_alias_1 }
508
521
 
509
522
  /**
510
523
  * @public
511
524
  */
512
- export declare function defineImage(): Extension< {
513
- Nodes: SimplifyDeeper< {
514
- image: {
515
- src: null;
516
- };
517
- }>;
518
- Marks: never;
519
- Commands: {
520
- insertImage: [attrs?: ImageAttrs | undefined];
521
- };
522
- }>;
525
+ export declare function defineImage(): ImageExtension;
523
526
 
524
- export declare function defineImageCommands(): Extension< {
525
- Commands: {
526
- insertImage: [attrs?: ImageAttrs | undefined];
527
- };
528
- Nodes: never;
529
- Marks: never;
530
- }>;
527
+ /**
528
+ * @internal
529
+ */
530
+ export declare function defineImageCommands(): ImageCommandsExtension;
531
531
 
532
- export declare function defineImageSpec(): Extension< {
533
- Nodes: {
534
- image: {
535
- src: null;
536
- };
537
- };
538
- Marks: never;
539
- Commands: never;
540
- }>;
532
+ /**
533
+ * @internal
534
+ */
535
+ export declare function defineImageSpec(): ImageSpecExtension;
541
536
 
542
537
  /**
543
538
  * Defines an input rule extension.
@@ -546,132 +541,77 @@ Commands: never;
546
541
  *
547
542
  * @public
548
543
  */
549
- export declare function defineInputRule(rule: InputRule): Extension;
544
+ export declare function defineInputRule(rule: InputRule): PlainExtension;
550
545
 
551
546
  /**
552
547
  * @public
553
548
  */
554
- export declare function defineItalic(): Extension< {
555
- Nodes: never;
556
- Marks: SimplifyDeeper< {
557
- italic: Attrs;
558
- }>;
559
- Commands: {
560
- toggleItalic: [];
561
- };
562
- }>;
549
+ export declare function defineItalic(): ItalicExtension;
563
550
 
564
- export declare function defineItalicCommands(): Extension< {
565
- Commands: {
566
- toggleItalic: [];
567
- };
568
- Nodes: never;
569
- Marks: never;
570
- }>;
551
+ /**
552
+ * @internal
553
+ */
554
+ export declare function defineItalicCommands(): ItalicCommandsExtension;
571
555
 
572
- export declare function defineItalicInputRule(): Extension<ExtensionTyping<any, any, any>>;
556
+ /**
557
+ * @internal
558
+ */
559
+ export declare function defineItalicInputRule(): PlainExtension;
573
560
 
574
- export declare function defineItalicKeymap(): Extension<ExtensionTyping<any, any, any>>;
561
+ /**
562
+ * @internal
563
+ */
564
+ export declare function defineItalicKeymap(): PlainExtension;
575
565
 
576
- export declare function defineItalicSpec(): Extension< {
577
- Marks: {
578
- italic: Attrs;
579
- };
580
- Nodes: never;
581
- Commands: never;
582
- }>;
566
+ /**
567
+ * @internal
568
+ */
569
+ export declare function defineItalicSpec(): ItalicSpecExtension;
583
570
 
584
571
  /**
585
572
  * @public
586
573
  */
587
- export declare function defineLink(): Extension< {
588
- Nodes: never;
589
- Marks: SimplifyDeeper< {
590
- link: LinkAttrs;
591
- }>;
592
- Commands: {
593
- addLink: [attrs: LinkAttrs];
594
- removeLink: [];
595
- toggleLink: [attrs: LinkAttrs];
596
- expandLink: [];
597
- };
598
- }>;
574
+ export declare function defineLink(): LinkExtension;
599
575
 
600
- export declare function defineLinkCommands(): Extension< {
601
- Commands: {
602
- addLink: [attrs: LinkAttrs];
603
- removeLink: [];
604
- toggleLink: [attrs: LinkAttrs];
605
- expandLink: [];
606
- };
607
- Nodes: never;
608
- Marks: never;
609
- }>;
576
+ export declare function defineLinkCommands(): LinkCommandsExtension;
610
577
 
611
578
  /**
612
579
  * Apply link marks after typing Enter.
580
+ *
581
+ * @internal
613
582
  */
614
- export declare function defineLinkEnterRule(): Extension<ExtensionTyping<any, any, any>>;
583
+ export declare function defineLinkEnterRule(): PlainExtension;
615
584
 
616
585
  /**
617
586
  * Apply link marks after pressing Space.
587
+ *
588
+ * @internal
618
589
  */
619
- export declare function defineLinkInputRule(): Extension<ExtensionTyping<any, any, any>>;
590
+ export declare function defineLinkInputRule(): PlainExtension;
620
591
 
621
592
  /**
622
593
  * Apply and remove link marks to the text during typing.
594
+ *
595
+ * @internal
623
596
  */
624
597
  export declare function defineLinkMarkRule(): Extension<ExtensionTyping<any, any, any>>;
625
598
 
626
- export declare function defineLinkSpec(): Extension< {
627
- Marks: {
628
- link: LinkAttrs;
629
- };
630
- Nodes: never;
631
- Commands: never;
632
- }>;
599
+ /**
600
+ * @internal
601
+ */
602
+ export declare function defineLinkSpec(): LinkSpecExtension;
633
603
 
634
604
  /**
635
605
  * @public
636
606
  */
637
- export declare function defineList(): Extension< {
638
- Nodes: SimplifyDeeper< {
639
- list: ListAttrs;
640
- }>;
641
- Marks: never;
642
- Commands: {
643
- dedentList: [options?: DedentListOptions | undefined];
644
- indentList: [options?: IndentListOptions | undefined];
645
- moveList: [direction: "up" | "down"];
646
- splitList: [];
647
- toggleCollapsed: [(ToggleCollapsedOptions | undefined)?];
648
- toggleList: [attrs: ListAttributes];
649
- unwrapList: [options?: UnwrapListOptions | undefined];
650
- wrapInList: [getAttrs: WrapInListGetAttrs<ListAttributes>];
651
- insertList: [attrs?: ListAttributes | undefined];
652
- };
653
- }>;
607
+ export declare function defineList(): ListExtension;
654
608
 
655
609
  /**
656
610
  * Defines list commands.
657
611
  *
658
612
  * @internal
659
613
  */
660
- declare function defineListCommands(): Extension< {
661
- Commands: {
662
- dedentList: [options?: DedentListOptions | undefined];
663
- indentList: [options?: IndentListOptions | undefined];
664
- moveList: [direction: "up" | "down"];
665
- splitList: [];
666
- toggleCollapsed: [(ToggleCollapsedOptions | undefined)?];
667
- toggleList: [attrs: ListAttributes];
668
- unwrapList: [options?: UnwrapListOptions | undefined];
669
- wrapInList: [getAttrs: WrapInListGetAttrs<ListAttributes>];
670
- insertList: [attrs?: ListAttributes | undefined];
671
- };
672
- Nodes: never;
673
- Marks: never;
674
- }>;
614
+ declare function defineListCommands(): ListCommandsExtension;
675
615
  export { defineListCommands }
676
616
  export { defineListCommands as defineListCommands_alias_1 }
677
617
 
@@ -687,27 +627,21 @@ export { defineListInputRules as defineListInputRules_alias_1 }
687
627
  *
688
628
  * @internal
689
629
  */
690
- declare function defineListKeymap(): Extension<ExtensionTyping<any, any, any>>;
630
+ declare function defineListKeymap(): PlainExtension;
691
631
  export { defineListKeymap }
692
632
  export { defineListKeymap as defineListKeymap_alias_1 }
693
633
 
694
634
  /**
695
635
  * @internal
696
636
  */
697
- declare function defineListPlugins(): Extension<ExtensionTyping<any, any, any>>;
637
+ declare function defineListPlugins(): PlainExtension;
698
638
  export { defineListPlugins }
699
639
  export { defineListPlugins as defineListPlugins_alias_1 }
700
640
 
701
641
  /**
702
642
  * @internal
703
643
  */
704
- declare function defineListSpec(): Extension< {
705
- Nodes: {
706
- list: ListAttrs;
707
- };
708
- Marks: never;
709
- Commands: never;
710
- }>;
644
+ declare function defineListSpec(): ListSpecExtension;
711
645
  export { defineListSpec }
712
646
  export { defineListSpec as defineListSpec_alias_1 }
713
647
 
@@ -717,7 +651,7 @@ export { defineListSpec as defineListSpec_alias_1 }
717
651
  *
718
652
  * @public
719
653
  */
720
- export declare function defineMarkInputRule(options: MarkInputRuleOptions): Extension;
654
+ export declare function defineMarkInputRule(options: MarkInputRuleOptions): PlainExtension;
721
655
 
722
656
  /**
723
657
  * A mark rule is something that can automatically apply marks to text if it
@@ -730,22 +664,20 @@ export { defineMarkRule as defineMarkRule_alias_1 }
730
664
  /**
731
665
  * @public
732
666
  */
733
- export declare function defineMention(): Extension< {
734
- Nodes: SimplifyDeeper< {
667
+ export declare function defineMention(): Union<readonly [Extension< {
668
+ Nodes: {
735
669
  mention: MentionAttrs;
736
- }>;
737
- Marks: never;
670
+ };
671
+ }>, Extension< {
738
672
  Commands: {
739
673
  insertMention: [attrs: MentionAttrs];
740
674
  };
741
- }>;
675
+ }>]>;
742
676
 
743
677
  export declare function defineMentionCommands(): Extension< {
744
678
  Commands: {
745
679
  insertMention: [attrs: MentionAttrs];
746
680
  };
747
- Nodes: never;
748
- Marks: never;
749
681
  }>;
750
682
 
751
683
  /**
@@ -755,8 +687,6 @@ export declare function defineMentionSpec(): Extension< {
755
687
  Nodes: {
756
688
  mention: MentionAttrs;
757
689
  };
758
- Marks: never;
759
- Commands: never;
760
690
  }>;
761
691
 
762
692
  /**
@@ -765,18 +695,18 @@ Commands: never;
765
695
  *
766
696
  * @public
767
697
  */
768
- export declare function defineModClickPrevention(): Extension;
698
+ export declare function defineModClickPrevention(): ModClickPreventionExtension;
769
699
 
770
700
  /**
771
701
  * Add a placeholder text to the editor when the current block or document is
772
702
  * empty.
773
703
  */
774
- export declare function definePlaceholder(options: PlaceholderOptions): Extension<ExtensionTyping<any, any, any>>;
704
+ export declare function definePlaceholder(options: PlaceholderOptions): PlainExtension;
775
705
 
776
706
  /**
777
707
  * Make the editor read-only.
778
708
  */
779
- export declare function defineReadonly(): Extension<ExtensionTyping<any, any, any>>;
709
+ export declare function defineReadonly(): PlainExtension;
780
710
 
781
711
  /**
782
712
  * Defines commands for search and replace.
@@ -794,8 +724,6 @@ replaceNextNoWrap: [];
794
724
  replaceCurrent: [];
795
725
  replaceAll: [];
796
726
  };
797
- Nodes: never;
798
- Marks: never;
799
727
  }>;
800
728
 
801
729
  /**
@@ -803,75 +731,42 @@ Marks: never;
803
731
  *
804
732
  * @public
805
733
  */
806
- export declare function defineSearchQuery(options: SearchQueryOptions): Extension<ExtensionTyping<any, any, any>>;
734
+ export declare function defineSearchQuery(options: SearchQueryOptions): PlainExtension;
807
735
 
808
736
  /**
809
737
  * @public
810
738
  */
811
- export declare function defineStrike(): Extension< {
812
- Nodes: never;
813
- Marks: SimplifyDeeper< {
814
- strike: Attrs;
815
- }>;
816
- Commands: {
817
- toggleStrike: [];
818
- };
819
- }>;
739
+ export declare function defineStrike(): StrikeExtension;
820
740
 
821
- export declare function defineStrikeCommands(): Extension< {
822
- Commands: {
823
- toggleStrike: [];
824
- };
825
- Nodes: never;
826
- Marks: never;
827
- }>;
741
+ /**
742
+ * @internal
743
+ */
744
+ export declare function defineStrikeCommands(): StrikeCommandsExtension;
828
745
 
829
- export declare function defineStrikeInputRule(): Extension<ExtensionTyping<any, any, any>>;
746
+ /**
747
+ * @internal
748
+ */
749
+ export declare function defineStrikeInputRule(): PlainExtension;
830
750
 
831
- export declare function defineStrikeKeymap(): Extension<ExtensionTyping<any, any, any>>;
751
+ /**
752
+ * @internal
753
+ */
754
+ export declare function defineStrikeKeymap(): PlainExtension;
832
755
 
833
- export declare function defineStrikeSpec(): Extension< {
834
- Marks: {
835
- strike: Attrs;
836
- };
837
- Nodes: never;
838
- Commands: never;
839
- }>;
756
+ /**
757
+ * @internal
758
+ */
759
+ export declare function defineStrikeSpec(): StrikeSpecExtension;
840
760
 
841
761
  /**
842
762
  * @public
843
763
  */
844
- export declare function defineTable(): Extension< {
845
- Nodes: SimplifyDeeper< {
846
- table: Attrs;
847
- tableRow: Attrs;
848
- tableCell: {
849
- [x: string]: any;
850
- };
851
- tableHeaderCell: {
852
- [x: string]: any;
853
- };
854
- }>;
855
- Marks: never;
856
- Commands: {
857
- insertTable: [{
858
- row: number;
859
- col: number;
860
- header: boolean;
861
- }];
862
- exitTable: [];
863
- };
864
- }>;
764
+ export declare function defineTable(): TableExtension;
865
765
 
866
- declare function defineTableCellSpec(): Extension< {
867
- Nodes: {
868
- tableCell: {
869
- [x: string]: any;
870
- };
871
- };
872
- Marks: never;
873
- Commands: never;
874
- }>;
766
+ /**
767
+ * @internal
768
+ */
769
+ declare function defineTableCellSpec(): TableCellSpecExtension;
875
770
  export { defineTableCellSpec }
876
771
  export { defineTableCellSpec as defineTableCellSpec_alias_1 }
877
772
 
@@ -880,164 +775,43 @@ export { defineTableCellSpec as defineTableCellSpec_alias_1 }
880
775
  *
881
776
  * @public
882
777
  */
883
- declare function defineTableCommands(): Extension< {
884
- Commands: {
885
- insertTable: [{
886
- row: number;
887
- col: number;
888
- header: boolean;
889
- }];
890
- exitTable: [];
891
- };
892
- Nodes: never;
893
- Marks: never;
894
- }>;
778
+ declare function defineTableCommands(): TableCommandsExtension;
895
779
  export { defineTableCommands }
896
780
  export { defineTableCommands as defineTableCommands_alias_1 }
897
781
 
898
- declare function defineTableHeaderCellSpec(): Extension< {
899
- Nodes: {
900
- tableHeaderCell: {
901
- [x: string]: any;
902
- };
903
- };
904
- Marks: never;
905
- Commands: never;
906
- }>;
782
+ declare function defineTableHeaderCellSpec(): TableHeaderCellSpecExtension;
907
783
  export { defineTableHeaderCellSpec }
908
784
  export { defineTableHeaderCellSpec as defineTableHeaderCellSpec_alias_1 }
909
785
 
910
786
  /**
911
787
  * @public
912
788
  */
913
- declare function defineTablePlugins(): Extension<ExtensionTyping<any, any, any>>;
789
+ declare function defineTablePlugins(): PlainExtension;
914
790
  export { defineTablePlugins }
915
791
  export { defineTablePlugins as defineTablePlugins_alias_1 }
916
792
 
917
- declare function defineTableRowSpec(): Extension< {
918
- Nodes: {
919
- tableRow: Attrs_2;
920
- };
921
- Marks: never;
922
- Commands: never;
923
- }>;
793
+ /**
794
+ * @internal
795
+ */
796
+ declare function defineTableRowSpec(): TableRowSpecExtension;
924
797
  export { defineTableRowSpec }
925
798
  export { defineTableRowSpec as defineTableRowSpec_alias_1 }
926
799
 
927
- declare function defineTableSpec(): Extension< {
928
- Nodes: {
929
- table: Attrs_2;
930
- };
931
- Marks: never;
932
- Commands: never;
933
- }>;
800
+ /**
801
+ * @internal
802
+ */
803
+ declare function defineTableSpec(): TableSpecExtension;
934
804
  export { defineTableSpec }
935
805
  export { defineTableSpec as defineTableSpec_alias_1 }
936
806
 
937
807
  /**
938
808
  * @internal
939
809
  */
940
- export declare function defineTestExtension(): Extension<{
941
- Nodes: SimplifyDeeper< {
942
- paragraph: Attrs;
943
- doc: Attrs;
944
- text: Attrs;
945
- blockquote: {
946
- readonly [x: string]: any;
947
- };
948
- heading: {
949
- level: number;
950
- };
951
- image: {
952
- src: null;
953
- };
954
- list: {
955
- kind?: "bullet" | "ordered" | "task" | "toggle";
956
- order?: number | null;
957
- checked?: boolean;
958
- collapsed?: boolean;
959
- };
960
- table: {
961
- readonly [x: string]: any;
962
- };
963
- tableRow: {
964
- readonly [x: string]: any;
965
- };
966
- tableCell: {
967
- [x: string]: any;
968
- };
969
- tableHeaderCell: {
970
- [x: string]: any;
971
- };
972
- }>;
973
- Marks: SimplifyDeeper< {
974
- bold: {
975
- readonly [x: string]: any;
976
- };
977
- code: {
978
- readonly [x: string]: any;
979
- };
980
- italic: {
981
- readonly [x: string]: any;
982
- };
983
- link: {
984
- href: string;
985
- };
986
- strike: {
987
- readonly [x: string]: any;
988
- };
989
- underline: {
990
- readonly [x: string]: any;
991
- };
992
- }>;
993
- Commands: {
994
- insertText: [{
995
- text: string;
996
- from?: number;
997
- to?: number;
998
- }];
999
- insertNode: [options: InsertNodeOptions];
1000
- removeNode: [options: RemoveNodeOptions];
1001
- wrap: [WrapOptions];
1002
- setBlockType: [options: SetBlockTypeOptions];
1003
- setNodeAttrs: [options: SetNodeAttrsOptions];
1004
- selectAll: [];
1005
- addMark: [options: AddMarkOptions];
1006
- removeMark: [options: RemoveMarkOptions];
1007
- unsetBlockType: [options?: UnsetBlockTypeOptions | undefined];
1008
- unsetMark: [options?: UnsetMarkOptions | undefined];
1009
- readonly undo: [];
1010
- readonly redo: [];
1011
- toggleBold: [];
1012
- toggleCode: [];
1013
- setHeading: [attrs?: HeadingAttrs | undefined];
1014
- insertHeading: [attrs?: HeadingAttrs | undefined];
1015
- toggleHeading: [attrs?: HeadingAttrs | undefined];
1016
- insertImage: [attrs?: ImageAttrs | undefined];
1017
- toggleItalic: [];
1018
- addLink: [attrs: LinkAttrs];
1019
- removeLink: [];
1020
- toggleLink: [attrs: LinkAttrs];
1021
- expandLink: [];
1022
- dedentList: [options?: DedentListOptions | undefined];
1023
- indentList: [options?: IndentListOptions | undefined];
1024
- moveList: [direction: "up" | "down"];
1025
- splitList: [];
1026
- toggleCollapsed: [(ToggleCollapsedOptions | undefined)?];
1027
- toggleList: [attrs: ListAttributes];
1028
- unwrapList: [options?: UnwrapListOptions | undefined];
1029
- wrapInList: [getAttrs: WrapInListGetAttrs<ListAttributes>];
1030
- insertList: [attrs?: ListAttributes | undefined];
1031
- toggleStrike: [];
1032
- insertTable: [{
1033
- row: number;
1034
- col: number;
1035
- header: boolean;
1036
- }];
1037
- exitTable: [];
1038
- toggleUnderline: [];
1039
- };
1040
- }>;
810
+ export declare function defineTestExtension(): Union<readonly [DocExtension, TextExtension, HeadingExtension, HistoryExtension, ListExtension, BlockquoteExtension, PlainExtension, BaseCommandsExtension, ItalicExtension, BoldExtension, UnderlineExtension, StrikeExtension, CodeExtension, LinkExtension, ImageExtension, Extension<{
811
+ Nodes: {
812
+ paragraph: Attrs_2;
813
+ };
814
+ }>, TableExtension]>;
1041
815
 
1042
816
  /**
1043
817
  * Adds a `textAlign` attribute to the specified nodes. This will be rendered as
@@ -1045,29 +819,17 @@ export declare function defineTestExtension(): Extension<{
1045
819
  *
1046
820
  * @public
1047
821
  */
1048
- export declare function defineTextAlign<NodeName extends string = string>(options: TextAlignOptions<NodeName>): Extension<{
1049
- Nodes: {
1050
- [K in NodeName]: {
1051
- textAlign: string | null;
1052
- };
1053
- };
1054
- Marks: never;
1055
- Commands: TextAlignCommandTyping;
1056
- }>;
822
+ export declare function defineTextAlign<NodeName extends string = string>(options: TextAlignOptions<NodeName>): TextAlignExtension<NodeName>;
1057
823
 
1058
824
  /**
1059
825
  * @internal
1060
826
  */
1061
- export declare function defineTextAlignCommands(types: string[]): Extension<{
1062
- Nodes: never;
1063
- Marks: never;
1064
- Commands: TextAlignCommandTyping;
1065
- }>;
827
+ export declare function defineTextAlignCommands(types: string[]): TextAlignCommandsExtension;
1066
828
 
1067
829
  /**
1068
830
  * @internal
1069
831
  */
1070
- export declare function defineTextAlignKeymap(types: string[]): Extension<ExtensionTyping<any, any, any>>;
832
+ export declare function defineTextAlignKeymap(types: string[]): PlainExtension;
1071
833
 
1072
834
  /**
1073
835
  * Defines an enter rule that replaces the matched text with a block node.
@@ -1076,7 +838,7 @@ export declare function defineTextAlignKeymap(types: string[]): Extension<Extens
1076
838
  *
1077
839
  * @public
1078
840
  */
1079
- export declare function defineTextBlockEnterRule({ regex, type, attrs, stop, }: TextBlockEnterRuleOptions): Extension;
841
+ export declare function defineTextBlockEnterRule(options: TextBlockEnterRuleOptions): PlainExtension;
1080
842
 
1081
843
  /**
1082
844
  * Defines an input rule that changes the type of a textblock when the matched
@@ -1100,39 +862,28 @@ export declare function defineTextBlockInputRule({ regex, type, attrs, }: {
1100
862
  /**
1101
863
  * Attributes to set on the node.
1102
864
  */
1103
- attrs?: Attrs_2 | null | ((match: RegExpMatchArray) => Attrs_2 | null);
1104
- }): Extension;
865
+ attrs?: Attrs | null | ((match: RegExpMatchArray) => Attrs | null);
866
+ }): PlainExtension;
1105
867
 
1106
868
  /**
1107
869
  * @public
1108
870
  */
1109
- export declare function defineUnderline(): Extension< {
1110
- Nodes: never;
1111
- Marks: SimplifyDeeper< {
1112
- underline: Attrs;
1113
- }>;
1114
- Commands: {
1115
- toggleUnderline: [];
1116
- };
1117
- }>;
871
+ export declare function defineUnderline(): UnderlineExtension;
1118
872
 
1119
- export declare function defineUnderlineCommands(): Extension< {
1120
- Commands: {
1121
- toggleUnderline: [];
1122
- };
1123
- Nodes: never;
1124
- Marks: never;
1125
- }>;
873
+ /**
874
+ * @internal
875
+ */
876
+ export declare function defineUnderlineCommands(): UnderlineCommandsExtension;
1126
877
 
1127
- export declare function defineUnderlineKeymap(): Extension<ExtensionTyping<any, any, any>>;
878
+ /**
879
+ * @internal
880
+ */
881
+ export declare function defineUnderlineKeymap(): PlainExtension;
1128
882
 
1129
- export declare function defineUnderlineSpec(): Extension< {
1130
- Marks: {
1131
- underline: Attrs;
1132
- };
1133
- Nodes: never;
1134
- Commands: never;
1135
- }>;
883
+ /**
884
+ * @internal
885
+ */
886
+ export declare function defineUnderlineSpec(): UnderlineSpecExtension;
1136
887
 
1137
888
  /**
1138
889
  * Shows a virtual selection when the editor is not focused. When the editor is
@@ -1144,7 +895,7 @@ Commands: never;
1144
895
  *
1145
896
  * @public
1146
897
  */
1147
- export declare function defineVirtualSelection(): Extension;
898
+ export declare function defineVirtualSelection(): VirtualSelectionExtension;
1148
899
 
1149
900
  /**
1150
901
  * Defines an input rule for automatically wrapping a textblock when a given
@@ -1168,7 +919,7 @@ export declare function defineWrappingInputRule({ regex, type, attrs, join, }: {
1168
919
  /**
1169
920
  * Attributes to set on the node.
1170
921
  */
1171
- attrs?: Attrs_2 | null | ((match: RegExpMatchArray) => Attrs_2 | null);
922
+ attrs?: Attrs | null | ((match: RegExpMatchArray) => Attrs | null);
1172
923
  /**
1173
924
  * By default, if there's a node with the same type above the newly wrapped
1174
925
  * node, the rule will try to
@@ -1178,7 +929,12 @@ export declare function defineWrappingInputRule({ regex, type, attrs, join, }: {
1178
929
  * indicate whether a join should happen.
1179
930
  */
1180
931
  join?: (match: RegExpMatchArray, node: ProseMirrorNode) => boolean;
1181
- }): Extension;
932
+ }): PlainExtension;
933
+
934
+ /**
935
+ * @internal
936
+ */
937
+ export declare type DropCursorExtension = PlainExtension;
1182
938
 
1183
939
  export declare interface DropCursorOptions {
1184
940
  /**
@@ -1253,6 +1009,11 @@ export declare const exitTable: Command;
1253
1009
 
1254
1010
  export { GapCursor }
1255
1011
 
1012
+ /**
1013
+ * @internal
1014
+ */
1015
+ export declare type GapCursorExtension = PlainExtension;
1016
+
1256
1017
  export declare function getCheckRanges(transactions: readonly Transaction[], oldState: EditorState, newState: EditorState): Array<[number, number]>;
1257
1018
 
1258
1019
  export declare function getPluginState(state: EditorState): PredictionPluginState | undefined;
@@ -1267,6 +1028,38 @@ declare interface HeadingAttrs {
1267
1028
  export { HeadingAttrs }
1268
1029
  export { HeadingAttrs as HeadingAttrs_alias_1 }
1269
1030
 
1031
+ /**
1032
+ * @internal
1033
+ */
1034
+ declare type HeadingCommandsExtension = Extension<{
1035
+ Commands: {
1036
+ setHeading: [attrs?: HeadingAttrs | undefined];
1037
+ insertHeading: [attrs?: HeadingAttrs | undefined];
1038
+ toggleHeading: [attrs?: HeadingAttrs | undefined];
1039
+ };
1040
+ }>;
1041
+ export { HeadingCommandsExtension }
1042
+ export { HeadingCommandsExtension as HeadingCommandsExtension_alias_1 }
1043
+
1044
+ /**
1045
+ * @internal
1046
+ */
1047
+ export declare type HeadingExtension = Union<[
1048
+ HeadingSpecExtension,
1049
+ HeadingCommandsExtension
1050
+ ]>;
1051
+
1052
+ /**
1053
+ * @internal
1054
+ */
1055
+ declare type HeadingSpecExtension = Extension<{
1056
+ Nodes: {
1057
+ heading: HeadingAttrs;
1058
+ };
1059
+ }>;
1060
+ export { HeadingSpecExtension }
1061
+ export { HeadingSpecExtension as HeadingSpecExtension_alias_1 }
1062
+
1270
1063
  export declare type HighlighterOptions = {
1271
1064
  themes: BundledTheme[];
1272
1065
  langs: (BundledLanguage | SpecialLanguage)[];
@@ -1290,10 +1083,36 @@ declare type HighlightParser = Parser;
1290
1083
  export { HighlightParser }
1291
1084
  export { HighlightParser as HighlightParser_alias_1 }
1292
1085
 
1086
+ /**
1087
+ * @public
1088
+ */
1293
1089
  export declare interface ImageAttrs {
1294
1090
  src?: string | null;
1295
1091
  }
1296
1092
 
1093
+ /**
1094
+ * @internal
1095
+ */
1096
+ export declare type ImageCommandsExtension = Extension<{
1097
+ Commands: {
1098
+ insertImage: [attrs?: ImageAttrs];
1099
+ };
1100
+ }>;
1101
+
1102
+ /**
1103
+ * @internal
1104
+ */
1105
+ export declare type ImageExtension = Union<[ImageSpecExtension, ImageCommandsExtension]>;
1106
+
1107
+ /**
1108
+ * @internal
1109
+ */
1110
+ export declare type ImageSpecExtension = Extension<{
1111
+ Nodes: {
1112
+ image: ImageAttrs;
1113
+ };
1114
+ }>;
1115
+
1297
1116
  export { IndentListOptions }
1298
1117
 
1299
1118
  /**
@@ -1302,11 +1121,42 @@ export { IndentListOptions }
1302
1121
  *
1303
1122
  * @public
1304
1123
  */
1305
- export declare function insertTable({ row, col, header, }: {
1124
+ export declare function insertTable({ row, col, header }: InsertTableOptions): Command;
1125
+
1126
+ /**
1127
+ * @public
1128
+ */
1129
+ export declare interface InsertTableOptions {
1306
1130
  row: number;
1307
1131
  col: number;
1308
1132
  header: boolean;
1309
- }): Command;
1133
+ }
1134
+
1135
+ /**
1136
+ * @internal
1137
+ */
1138
+ export declare type ItalicCommandsExtension = Extension<{
1139
+ Commands: {
1140
+ toggleItalic: [];
1141
+ };
1142
+ }>;
1143
+
1144
+ /**
1145
+ * @internal
1146
+ */
1147
+ export declare type ItalicExtension = Union<[
1148
+ ItalicSpecExtension,
1149
+ ItalicCommandsExtension
1150
+ ]>;
1151
+
1152
+ /**
1153
+ * @internal
1154
+ */
1155
+ export declare type ItalicSpecExtension = Extension<{
1156
+ Marks: {
1157
+ italic: Attrs;
1158
+ };
1159
+ }>;
1310
1160
 
1311
1161
  export declare const LINK_ENTER_RE: RegExp;
1312
1162
 
@@ -1321,6 +1171,32 @@ export declare interface LinkAttrs {
1321
1171
  href: string;
1322
1172
  }
1323
1173
 
1174
+ /**
1175
+ * @internal
1176
+ */
1177
+ export declare type LinkCommandsExtension = Extension<{
1178
+ Commands: {
1179
+ addLink: [LinkAttrs];
1180
+ removeLink: [];
1181
+ toggleLink: [LinkAttrs];
1182
+ expandLink: [];
1183
+ };
1184
+ }>;
1185
+
1186
+ /**
1187
+ * @internal
1188
+ */
1189
+ export declare type LinkExtension = Union<[LinkSpecExtension, LinkCommandsExtension]>;
1190
+
1191
+ /**
1192
+ * @internal
1193
+ */
1194
+ export declare type LinkSpecExtension = Extension<{
1195
+ Marks: {
1196
+ link: LinkAttrs;
1197
+ };
1198
+ }>;
1199
+
1324
1200
  /**
1325
1201
  * The attributes of a list node.
1326
1202
  *
@@ -1347,8 +1223,43 @@ declare interface ListAttrs {
1347
1223
  export { ListAttrs }
1348
1224
  export { ListAttrs as ListAttrs_alias_1 }
1349
1225
 
1226
+ /**
1227
+ * @internal
1228
+ */
1229
+ declare type ListCommandsExtension = Extension<{
1230
+ Commands: {
1231
+ dedentList: [options?: DedentListOptions];
1232
+ indentList: [options?: IndentListOptions];
1233
+ moveList: [direction: 'up' | 'down'];
1234
+ splitList: [];
1235
+ toggleCollapsed: [options?: ToggleCollapsedOptions];
1236
+ unwrapList: [options?: UnwrapListOptions];
1237
+ toggleList: [attrs?: ListAttributes];
1238
+ wrapInList: [attrs?: ListAttributes];
1239
+ insertList: [attrs?: ListAttributes];
1240
+ };
1241
+ }>;
1242
+ export { ListCommandsExtension }
1243
+ export { ListCommandsExtension as ListCommandsExtension_alias_1 }
1244
+
1350
1245
  export { ListDOMSerializer }
1351
1246
 
1247
+ /**
1248
+ * @internal
1249
+ */
1250
+ export declare type ListExtension = Union<[ListSpecExtension, ListCommandsExtension]>;
1251
+
1252
+ /**
1253
+ * @internal
1254
+ */
1255
+ declare type ListSpecExtension = Extension<{
1256
+ Nodes: {
1257
+ list: ListAttrs;
1258
+ };
1259
+ }>;
1260
+ export { ListSpecExtension }
1261
+ export { ListSpecExtension as ListSpecExtension_alias_1 }
1262
+
1352
1263
  /**
1353
1264
  * Options for {@link defineMarkInputRule}.
1354
1265
  *
@@ -1368,7 +1279,7 @@ export declare interface MarkInputRuleOptions {
1368
1279
  /**
1369
1280
  * Attributes to set on the mark.
1370
1281
  */
1371
- attrs?: Attrs_2 | null | ((match: RegExpMatchArray) => Attrs_2 | null);
1282
+ attrs?: Attrs | null | ((match: RegExpMatchArray) => Attrs | null);
1372
1283
  }
1373
1284
 
1374
1285
  /**
@@ -1392,7 +1303,7 @@ declare interface MarkRuleOptions {
1392
1303
  *
1393
1304
  * @default null
1394
1305
  */
1395
- attrs?: Attrs_2 | null | ((match: RegExpMatchArray) => Attrs_2 | null);
1306
+ attrs?: Attrs | null | ((match: RegExpMatchArray) => Attrs | null);
1396
1307
  }
1397
1308
  export { MarkRuleOptions }
1398
1309
  export { MarkRuleOptions as MarkRuleOptions_alias_1 }
@@ -1414,6 +1325,11 @@ export declare interface MentionAttrs {
1414
1325
  kind: string;
1415
1326
  }
1416
1327
 
1328
+ /**
1329
+ * @internal
1330
+ */
1331
+ export declare type ModClickPreventionExtension = PlainExtension;
1332
+
1417
1333
  export declare interface PlaceholderOptions {
1418
1334
  /**
1419
1335
  * The placeholder text to use.
@@ -1512,107 +1428,11 @@ export declare function setTrMeta(tr: Transaction, meta: PredictionPluginState):
1512
1428
  * @internal
1513
1429
  */
1514
1430
  export declare function setupTest(): {
1515
- editor: TestEditor<Extension<{
1516
- Nodes: SimplifyDeeper< {
1517
- paragraph: Attrs;
1518
- doc: Attrs;
1519
- text: Attrs;
1520
- blockquote: {
1521
- readonly [x: string]: any;
1522
- };
1523
- heading: {
1524
- level: number;
1525
- };
1526
- image: {
1527
- src: null;
1528
- };
1529
- list: {
1530
- kind?: "bullet" | "ordered" | "task" | "toggle";
1531
- order?: number | null;
1532
- checked?: boolean;
1533
- collapsed?: boolean;
1534
- };
1535
- table: {
1536
- readonly [x: string]: any;
1537
- };
1538
- tableRow: {
1539
- readonly [x: string]: any;
1540
- };
1541
- tableCell: {
1542
- [x: string]: any;
1543
- };
1544
- tableHeaderCell: {
1545
- [x: string]: any;
1546
- };
1547
- }>;
1548
- Marks: SimplifyDeeper< {
1549
- bold: {
1550
- readonly [x: string]: any;
1551
- };
1552
- code: {
1553
- readonly [x: string]: any;
1554
- };
1555
- italic: {
1556
- readonly [x: string]: any;
1557
- };
1558
- link: {
1559
- href: string;
1560
- };
1561
- strike: {
1562
- readonly [x: string]: any;
1563
- };
1564
- underline: {
1565
- readonly [x: string]: any;
1566
- };
1567
- }>;
1568
- Commands: {
1569
- insertText: [{
1570
- text: string;
1571
- from?: number;
1572
- to?: number;
1573
- }];
1574
- insertNode: [options: InsertNodeOptions];
1575
- removeNode: [options: RemoveNodeOptions];
1576
- wrap: [WrapOptions];
1577
- setBlockType: [options: SetBlockTypeOptions];
1578
- setNodeAttrs: [options: SetNodeAttrsOptions];
1579
- selectAll: [];
1580
- addMark: [options: AddMarkOptions];
1581
- removeMark: [options: RemoveMarkOptions];
1582
- unsetBlockType: [options?: UnsetBlockTypeOptions | undefined];
1583
- unsetMark: [options?: UnsetMarkOptions | undefined];
1584
- readonly undo: [];
1585
- readonly redo: [];
1586
- toggleBold: [];
1587
- toggleCode: [];
1588
- setHeading: [attrs?: HeadingAttrs | undefined];
1589
- insertHeading: [attrs?: HeadingAttrs | undefined];
1590
- toggleHeading: [attrs?: HeadingAttrs | undefined];
1591
- insertImage: [attrs?: ImageAttrs | undefined];
1592
- toggleItalic: [];
1593
- addLink: [attrs: LinkAttrs];
1594
- removeLink: [];
1595
- toggleLink: [attrs: LinkAttrs];
1596
- expandLink: [];
1597
- dedentList: [options?: DedentListOptions | undefined];
1598
- indentList: [options?: IndentListOptions | undefined];
1599
- moveList: [direction: "up" | "down"];
1600
- splitList: [];
1601
- toggleCollapsed: [(ToggleCollapsedOptions | undefined)?];
1602
- toggleList: [attrs: ListAttributes];
1603
- unwrapList: [options?: UnwrapListOptions | undefined];
1604
- wrapInList: [getAttrs: WrapInListGetAttrs<ListAttributes>];
1605
- insertList: [attrs?: ListAttributes | undefined];
1606
- toggleStrike: [];
1607
- insertTable: [{
1608
- row: number;
1609
- col: number;
1610
- header: boolean;
1611
- }];
1612
- exitTable: [];
1613
- toggleUnderline: [];
1614
- };
1615
- }>>;
1431
+ editor: TestEditor<Union<readonly [DocExtension, TextExtension, HeadingExtension, HistoryExtension, ListExtension, BlockquoteExtension, PlainExtension, BaseCommandsExtension, ItalicExtension, BoldExtension, UnderlineExtension, StrikeExtension, CodeExtension, LinkExtension, ImageExtension, Extension<{
1432
+ Nodes: {
1433
+ paragraph: Attrs_2;
1434
+ };
1435
+ }>, TableExtension]>>;
1616
1436
  m: ToMarkAction<SimplifyDeeper< {
1617
1437
  bold: {
1618
1438
  readonly [x: string]: any;
@@ -1649,10 +1469,10 @@ export declare function setupTest(): {
1649
1469
  unchecked: (...children: NodeChild[]) => Node_2;
1650
1470
  collapsed: (...children: NodeChild[]) => Node_2;
1651
1471
  expanded: (...children: NodeChild[]) => Node_2;
1652
- paragraph: NodeAction< {
1472
+ doc: NodeAction< {
1653
1473
  readonly [x: string]: any;
1654
1474
  }>;
1655
- doc: NodeAction< {
1475
+ paragraph: NodeAction< {
1656
1476
  readonly [x: string]: any;
1657
1477
  }>;
1658
1478
  text: NodeAction< {
@@ -1665,7 +1485,7 @@ export declare function setupTest(): {
1665
1485
  level: number;
1666
1486
  }>;
1667
1487
  image: NodeAction< {
1668
- src: null;
1488
+ src?: string | null;
1669
1489
  }>;
1670
1490
  list: NodeAction< {
1671
1491
  kind?: "bullet" | "ordered" | "task" | "toggle";
@@ -1680,10 +1500,14 @@ export declare function setupTest(): {
1680
1500
  readonly [x: string]: any;
1681
1501
  }>;
1682
1502
  tableCell: NodeAction< {
1683
- [x: string]: any;
1503
+ colspan: number;
1504
+ rowspan: number;
1505
+ colwidth: number[] | null;
1684
1506
  }>;
1685
1507
  tableHeaderCell: NodeAction< {
1686
- [x: string]: any;
1508
+ colspan: number;
1509
+ rowspan: number;
1510
+ colwidth: number[] | null;
1687
1511
  }>;
1688
1512
  };
1689
1513
  };
@@ -1700,10 +1524,127 @@ export declare function setupTestFromExtension<E extends Extension>(extension: E
1700
1524
  /**
1701
1525
  * @internal
1702
1526
  */
1703
- export declare type TextAlignCommandTyping = {
1704
- setTextAlign: [value: string | null];
1705
- };
1527
+ export declare type StrikeCommandsExtension = Extension<{
1528
+ Commands: {
1529
+ toggleStrike: [];
1530
+ };
1531
+ }>;
1532
+
1533
+ /**
1534
+ * @internal
1535
+ */
1536
+ export declare type StrikeExtension = Union<[
1537
+ StrikeSpecExtension,
1538
+ StrikeCommandsExtension
1539
+ ]>;
1540
+
1541
+ /**
1542
+ * @internal
1543
+ */
1544
+ export declare type StrikeSpecExtension = Extension<{
1545
+ Marks: {
1546
+ strike: Attrs;
1547
+ };
1548
+ }>;
1549
+
1550
+ /**
1551
+ * @internal
1552
+ */
1553
+ declare type TableCellSpecExtension = Extension<{
1554
+ Nodes: {
1555
+ tableCell: CellAttrs;
1556
+ };
1557
+ }>;
1558
+ export { TableCellSpecExtension }
1559
+ export { TableCellSpecExtension as TableCellSpecExtension_alias_1 }
1560
+
1561
+ /**
1562
+ * @internal
1563
+ */
1564
+ declare type TableCommandsExtension = Extension<{
1565
+ Commands: {
1566
+ insertTable: [InsertTableOptions];
1567
+ exitTable: [];
1568
+ };
1569
+ }>;
1570
+ export { TableCommandsExtension }
1571
+ export { TableCommandsExtension as TableCommandsExtension_alias_1 }
1572
+
1573
+ /**
1574
+ * @internal
1575
+ */
1576
+ export declare type TableExtension = Union<[
1577
+ TableSpecExtension,
1578
+ TableRowSpecExtension,
1579
+ TableCellSpecExtension,
1580
+ TableHeaderCellSpecExtension,
1581
+ TableCommandsExtension
1582
+ ]>;
1583
+
1584
+ /**
1585
+ * @internal
1586
+ */
1587
+ declare type TableHeaderCellSpecExtension = Extension<{
1588
+ Nodes: {
1589
+ tableHeaderCell: CellAttrs;
1590
+ };
1591
+ }>;
1592
+ export { TableHeaderCellSpecExtension }
1593
+ export { TableHeaderCellSpecExtension as TableHeaderCellSpecExtension_alias_1 }
1594
+
1595
+ /**
1596
+ * @internal
1597
+ */
1598
+ declare type TableRowSpecExtension = Extension<{
1599
+ Nodes: {
1600
+ tableRow: Attrs;
1601
+ };
1602
+ }>;
1603
+ export { TableRowSpecExtension }
1604
+ export { TableRowSpecExtension as TableRowSpecExtension_alias_1 }
1605
+
1606
+ /**
1607
+ * @internal
1608
+ */
1609
+ declare type TableSpecExtension = Extension<{
1610
+ Nodes: {
1611
+ table: Attrs;
1612
+ };
1613
+ }>;
1614
+ export { TableSpecExtension }
1615
+ export { TableSpecExtension as TableSpecExtension_alias_1 }
1616
+
1617
+ /**
1618
+ * @internal
1619
+ */
1620
+ export declare type TextAlignAttrsExtension<NodeName extends string> = Extension<{
1621
+ Nodes: {
1622
+ [K in NodeName]: {
1623
+ textAlign: string | null;
1624
+ };
1625
+ };
1626
+ }>;
1627
+
1628
+ /**
1629
+ * @internal
1630
+ */
1631
+ export declare type TextAlignCommandsExtension = Extension<{
1632
+ Commands: {
1633
+ setTextAlign: [value: string | null];
1634
+ };
1635
+ }>;
1636
+
1637
+ /**
1638
+ * @internal
1639
+ */
1640
+ export declare type TextAlignExtension<NodeName extends string> = Union<[
1641
+ TextAlignAttrsExtension<NodeName>,
1642
+ TextAlignCommandsExtension
1643
+ ]>;
1706
1644
 
1645
+ /**
1646
+ * @public
1647
+ */
1707
1648
  export declare interface TextAlignOptions<NodeName extends string = string> {
1708
1649
  /**
1709
1650
  * The names of node to add the attribute to.
@@ -1739,7 +1680,7 @@ export declare type TextBlockEnterRuleOptions = {
1739
1680
  * Attributes to set on the node. If a function is provided, it will be called
1740
1681
  * with the matched result from the regular expression.
1741
1682
  */
1742
- attrs?: Attrs_2 | null | ((match: RegExpMatchArray) => Attrs_2 | null);
1683
+ attrs?: Attrs | null | ((match: RegExpMatchArray) => Attrs | null);
1743
1684
  /**
1744
1685
  * Whether to stop further handlers from being called if this rule is triggered.
1745
1686
  *
@@ -1750,8 +1691,39 @@ export declare type TextBlockEnterRuleOptions = {
1750
1691
 
1751
1692
  export { ToggleCollapsedOptions }
1752
1693
 
1694
+ /**
1695
+ * @internal
1696
+ */
1697
+ export declare type UnderlineCommandsExtension = Extension<{
1698
+ Commands: {
1699
+ toggleUnderline: [];
1700
+ };
1701
+ }>;
1702
+
1703
+ /**
1704
+ * @internal
1705
+ */
1706
+ export declare type UnderlineExtension = Union<[
1707
+ UnderlineSpecExtension,
1708
+ UnderlineCommandsExtension
1709
+ ]>;
1710
+
1711
+ /**
1712
+ * @internal
1713
+ */
1714
+ export declare type UnderlineSpecExtension = Extension<{
1715
+ Marks: {
1716
+ underline: Attrs;
1717
+ };
1718
+ }>;
1719
+
1753
1720
  export { UnwrapListOptions }
1754
1721
 
1722
+ /**
1723
+ * @internal
1724
+ */
1725
+ export declare type VirtualSelectionExtension = PlainExtension;
1726
+
1755
1727
  export { WrapInListGetAttrs }
1756
1728
 
1757
1729
  export { }