@prosekit/extensions 0.0.0-next-20240715071354 → 0.0.0-next-20240724172520

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.
@@ -1,5 +1,7 @@
1
- import { AddMarkOptions } from '@prosekit/core';
2
1
  import { Attrs } from '@prosekit/pm/model';
2
+ import { Attrs as Attrs_2 } from 'prosemirror-model';
3
+ import { BaseCommandsExtension } from '@prosekit/core';
4
+ import { BaseKeymapExtension } from '@prosekit/core';
3
5
  import { BundledLanguage } from 'shiki';
4
6
  import { BundledLanguageInfo } from 'shiki';
5
7
  import { bundledLanguagesInfo } from 'shiki';
@@ -9,45 +11,52 @@ import { bundledThemesInfo } from 'shiki';
9
11
  import { Command } from '@prosekit/pm/state';
10
12
  import { DedentListOptions } from 'prosemirror-flat-list';
11
13
  import { config as default_alias_1 } from '@prosekit/dev/config-vitest';
14
+ import { DocExtension } from '@prosekit/core';
12
15
  import { EditorState } from '@prosekit/pm/state';
13
16
  import { Extension } from '@prosekit/core';
14
17
  import { ExtensionTyping } from '@prosekit/core';
15
- import { ExtractMarks } from '@prosekit/core';
16
- import { ExtractNodes } from '@prosekit/core';
18
+ import { ExtractMarkActions } from '@prosekit/core';
19
+ import { ExtractNodeActions } from '@prosekit/core';
20
+ import { GapCursor } from 'prosemirror-gapcursor';
17
21
  import { getSingletonHighlighter } from 'shiki/bundle/full';
18
22
  import type { Highlighter } from 'shiki';
23
+ import { HistoryExtension } from '@prosekit/core';
19
24
  import { IndentListOptions } from 'prosemirror-flat-list';
20
25
  import { InputRule } from '@prosekit/pm/inputrules';
21
- import { InsertNodeOptions } from '@prosekit/core';
22
- import { ListAttributes } from 'prosemirror-flat-list';
26
+ import type { IsEqual } from 'type-fest';
27
+ import type { ListAttributes } from 'prosemirror-flat-list';
23
28
  import { ListDOMSerializer } from 'prosemirror-flat-list';
24
- import { MarkBuilder } from '@prosekit/core';
25
29
  import { MarkType } from '@prosekit/pm/model';
26
- import { NodeBuilder } from '@prosekit/core';
30
+ import { Node as Node_2 } from 'prosemirror-model';
31
+ import { NodeAction } from '@prosekit/core';
32
+ import { NodeChild } from '@prosekit/core';
27
33
  import { NodeJSON } from '@prosekit/core';
28
34
  import { NodeType } from '@prosekit/pm/model';
29
35
  import { Options } from 'tsup';
30
36
  import { Parser } from 'prosemirror-highlight';
31
37
  import { Plugin as Plugin_2 } from '@prosekit/pm/state';
38
+ import { PluginExtension } from '@prosekit/core';
32
39
  import { PluginKey } from '@prosekit/pm/state';
33
40
  import { ProseMirrorNode } from '@prosekit/pm/model';
34
- import { RemoveMarkOptions } from '@prosekit/core';
35
- import { RemoveNodeOptions } from '@prosekit/core';
36
- import { SetBlockTypeOptions } from '@prosekit/core';
37
- import { SetNodeAttrsOptions } from '@prosekit/core';
41
+ import { SimplifyDeeper } from '@prosekit/core';
38
42
  import type { SpecialLanguage } from 'shiki';
39
43
  import { StepJSON } from '@prosekit/core';
40
44
  import { TestEditor } from '@prosekit/core/test';
45
+ import { TextExtension } from '@prosekit/core';
41
46
  import { ToggleCollapsedOptions } from 'prosemirror-flat-list';
47
+ import { ToMarkAction } from '@prosekit/core';
42
48
  import { Transaction } from '@prosekit/pm/state';
43
- import { UnsetBlockTypeOptions } from '@prosekit/core';
44
- import { UnsetMarkOptions } from '@prosekit/core';
49
+ import { Union } from '@prosekit/core';
45
50
  import { UnwrapListOptions } from 'prosemirror-flat-list';
46
51
  import { WrapInListGetAttrs } from 'prosemirror-flat-list';
47
- import { WrapOptions } from '@prosekit/core';
48
52
 
49
53
  export declare function applyMarkRules(rules: MarkRuleOptions[], transactions: readonly Transaction[], oldState: EditorState, newState: EditorState): Transaction | null;
50
54
 
55
+ /**
56
+ * Utility function assert that two types are equal in tests.
57
+ */
58
+ export declare function assertTypeEqual<T, U>(_val: IsEqual<T, U>): void;
59
+
51
60
  declare class AutocompleteRule {
52
61
  readonly regex: RegExp;
53
62
  readonly onMatch: MatchHandler;
@@ -67,6 +76,43 @@ declare class AutocompleteRule {
67
76
  export { AutocompleteRule }
68
77
  export { AutocompleteRule as AutocompleteRule_alias_1 }
69
78
 
79
+ /**
80
+ * @internal
81
+ */
82
+ export declare type BlockquoteExtension = Union<[BlockquoteSpecExtension]>;
83
+
84
+ /**
85
+ * @internal
86
+ */
87
+ export declare type BlockquoteSpecExtension = Extension<{
88
+ Nodes: {
89
+ blockquote: Attrs;
90
+ };
91
+ }>;
92
+
93
+ /**
94
+ * @internal
95
+ */
96
+ export declare type BoldCommandsExtension = Extension<{
97
+ Commands: {
98
+ toggleBold: [];
99
+ };
100
+ }>;
101
+
102
+ /**
103
+ * @internal
104
+ */
105
+ export declare type BoldExtension = Union<[BoldSpecExtension, BoldCommandsExtension]>;
106
+
107
+ /**
108
+ * @internal
109
+ */
110
+ export declare type BoldSpecExtension = Extension<{
111
+ Marks: {
112
+ bold: Attrs;
113
+ };
114
+ }>;
115
+
70
116
  export { BundledLanguage as ShikiBundledLanguage }
71
117
  export { BundledLanguage as ShikiBundledLanguage_alias_1 }
72
118
 
@@ -85,6 +131,9 @@ export { BundledThemeInfo as ShikiBundledThemeInfo_alias_1 }
85
131
  export { bundledThemesInfo as shikiBundledThemesInfo }
86
132
  export { bundledThemesInfo as shikiBundledThemesInfo_alias_1 }
87
133
 
134
+ /**
135
+ * @public
136
+ */
88
137
  export declare interface CellAttrs {
89
138
  colspan: number;
90
139
  rowspan: number;
@@ -127,6 +176,29 @@ export declare interface CodeBlockShikiOptions {
127
176
  langAlias?: Record<string, BundledLanguage>;
128
177
  }
129
178
 
179
+ /**
180
+ * @internal
181
+ */
182
+ export declare type CodeCommandsExtension = Extension<{
183
+ Commands: {
184
+ toggleCode: [];
185
+ };
186
+ }>;
187
+
188
+ /**
189
+ * @internal
190
+ */
191
+ export declare type CodeExtension = Union<[CodeSpecExtension, CodeCommandsExtension]>;
192
+
193
+ /**
194
+ * @internal
195
+ */
196
+ export declare type CodeSpecExtension = Extension<{
197
+ Marks: {
198
+ code: Attrs;
199
+ };
200
+ }>;
201
+
130
202
  /**
131
203
  * A JSON representation of a commit.
132
204
  */
@@ -194,11 +266,7 @@ export declare function defineAutocomplete(rule: AutocompleteRule): Extension;
194
266
  /**
195
267
  * @public
196
268
  */
197
- export declare function defineBlockquote(): Extension< {
198
- Nodes: "blockquote";
199
- Marks: never;
200
- Commands: never;
201
- }>;
269
+ export declare function defineBlockquote(): BlockquoteExtension;
202
270
 
203
271
  /**
204
272
  * Wraps the text block in a blockquote when `>` is typed at the start of a new
@@ -206,51 +274,41 @@ Commands: never;
206
274
  */
207
275
  export declare function defineBlockquoteInputRule(): Extension<ExtensionTyping<any, any, any>>;
208
276
 
209
- export declare function defineBlockquoteSpec(): Extension< {
210
- Nodes: "blockquote";
211
- Marks: never;
212
- Commands: never;
277
+ export declare function defineBlockquoteSpec(): Extension<{
278
+ Nodes: {
279
+ blockquote: Attrs;
280
+ };
213
281
  }>;
214
282
 
215
283
  /**
216
284
  * @public
217
285
  */
218
- export declare function defineBold(): Extension< {
219
- Nodes: never;
220
- Marks: "bold";
221
- Commands: {
222
- toggleBold: [];
223
- };
224
- }>;
286
+ export declare function defineBold(): BoldExtension;
225
287
 
226
- export declare function defineBoldCommands(): Extension< {
227
- Commands: {
228
- toggleBold: [];
229
- };
230
- Nodes: never;
231
- Marks: never;
232
- }>;
288
+ /**
289
+ * @internal
290
+ */
291
+ export declare function defineBoldCommands(): BoldCommandsExtension;
233
292
 
293
+ /**
294
+ * @internal
295
+ */
234
296
  export declare function defineBoldInputRule(): Extension<ExtensionTyping<any, any, any>>;
235
297
 
298
+ /**
299
+ * @internal
300
+ */
236
301
  export declare function defineBoldKeymap(): Extension<ExtensionTyping<any, any, any>>;
237
302
 
238
- export declare function defineBoldSpec(): Extension< {
239
- Marks: "bold";
240
- Nodes: never;
241
- Commands: never;
242
- }>;
303
+ /**
304
+ * @internal
305
+ */
306
+ export declare function defineBoldSpec(): BoldSpecExtension;
243
307
 
244
308
  /**
245
309
  * @public
246
310
  */
247
- export declare function defineCode(): Extension< {
248
- Nodes: never;
249
- Marks: "code";
250
- Commands: {
251
- toggleCode: [];
252
- };
253
- }>;
311
+ export declare function defineCode(): CodeExtension;
254
312
 
255
313
  /**
256
314
  * Adds `codeBlock` nodes to the editor. This includes the following extensions:
@@ -263,16 +321,20 @@ toggleCode: [];
263
321
  *
264
322
  * @public
265
323
  */
266
- declare function defineCodeBlock(): Extension< {
267
- Nodes: "codeBlock";
268
- Marks: never;
324
+ declare function defineCodeBlock(): Union<readonly [Extension< {
325
+ Nodes: {
326
+ codeBlock: {
327
+ language: string;
328
+ };
329
+ };
330
+ }>, Extension<ExtensionTyping<any, any, any>>, Extension<ExtensionTyping<any, any, any>>, Extension<ExtensionTyping<any, any, any>>, Extension< {
269
331
  Commands: {
270
332
  setCodeBlock: [attrs?: CodeBlockAttrs | undefined];
271
333
  insertCodeBlock: [attrs?: CodeBlockAttrs | undefined];
272
334
  toggleCodeBlock: [attrs?: CodeBlockAttrs | undefined];
273
335
  setCodeBlockAttrs: [attrs: CodeBlockAttrs];
274
336
  };
275
- }>;
337
+ }>]>;
276
338
  export { defineCodeBlock }
277
339
  export { defineCodeBlock as defineCodeBlock_alias_1 }
278
340
 
@@ -288,8 +350,6 @@ insertCodeBlock: [attrs?: CodeBlockAttrs | undefined];
288
350
  toggleCodeBlock: [attrs?: CodeBlockAttrs | undefined];
289
351
  setCodeBlockAttrs: [attrs: CodeBlockAttrs];
290
352
  };
291
- Nodes: never;
292
- Marks: never;
293
353
  }>;
294
354
  export { defineCodeBlockCommands }
295
355
  export { defineCodeBlockCommands as defineCodeBlockCommands_alias_1 }
@@ -346,47 +406,44 @@ export { defineCodeBlockShiki as defineCodeBlockShiki_alias_1 }
346
406
  * @public
347
407
  */
348
408
  declare function defineCodeBlockSpec(): Extension< {
349
- Nodes: "codeBlock";
350
- Marks: never;
351
- Commands: never;
409
+ Nodes: {
410
+ codeBlock: {
411
+ language: string;
412
+ };
413
+ };
352
414
  }>;
353
415
  export { defineCodeBlockSpec }
354
416
  export { defineCodeBlockSpec as defineCodeBlockSpec_alias_1 }
355
417
 
356
- export declare function defineCodeCommands(): Extension< {
357
- Commands: {
358
- toggleCode: [];
359
- };
360
- Nodes: never;
361
- Marks: never;
362
- }>;
418
+ /**
419
+ * @internal
420
+ */
421
+ export declare function defineCodeCommands(): CodeCommandsExtension;
363
422
 
423
+ /**
424
+ * @internal
425
+ */
364
426
  export declare function defineCodeInputRule(): Extension<ExtensionTyping<any, any, any>>;
365
427
 
428
+ /**
429
+ * @internal
430
+ */
366
431
  export declare function defineCodeKeymap(): Extension<ExtensionTyping<any, any, any>>;
367
432
 
368
433
  /**
369
- * @public
434
+ * @internal
370
435
  */
371
- export declare function defineCodeSpec(): Extension< {
372
- Marks: "code";
373
- Nodes: never;
374
- Commands: never;
375
- }>;
436
+ export declare function defineCodeSpec(): CodeSpecExtension;
376
437
 
377
438
  /**
378
439
  * Define an extension that can record the changes in the editor.
379
440
  */
380
- export declare function defineCommitRecorder(commitRecorder: CommitRecorder): Extension<ExtensionTyping<any, any, any>>;
441
+ export declare function defineCommitRecorder(commitRecorder: CommitRecorder): PluginExtension;
381
442
 
382
443
  /**
383
444
  * Define an extension to display the changes from the given commit in the editor.
384
445
  */
385
- export declare function defineCommitViewer(commit: Commit): Extension< {
386
- Nodes: never;
387
- Marks: never;
388
- Commands: never;
389
- }>;
446
+ export declare function defineCommitViewer(commit: Commit): Union<readonly [Extension<ExtensionTyping<any, any, any>>, PluginExtension]>;
390
447
 
391
448
  /**
392
449
  * Show up a decoration at the drop position when something is dragged over the editor.
@@ -395,7 +452,7 @@ Commands: never;
395
452
  *
396
453
  * @public
397
454
  */
398
- export declare function defineDropCursor(options?: DropCursorOptions): Extension<ExtensionTyping<any, any, any>>;
455
+ export declare function defineDropCursor(options?: DropCursorOptions): DropCursorExtension;
399
456
 
400
457
  /**
401
458
  * Defines an enter rule. An enter rule applies when the text directly in front of
@@ -407,74 +464,71 @@ export declare function defineDropCursor(options?: DropCursorOptions): Extension
407
464
  export declare function defineEnterRule({ regex, handler, stop, }: EnterRuleOptions): Extension;
408
465
 
409
466
  /**
467
+ * Capture clicks near and arrow-key-motion past places that don't have a
468
+ * normally selectable position nearby, and create a gap cursor selection for
469
+ * them. The cursor is drawn as an element with class `ProseMirror-gapcursor`.
470
+ *
471
+ * You can either include `prosekit/extensions/gap-cursor.css` or add your own
472
+ * styles to make it visible.
473
+ *
474
+ * See
475
+ * [prosemirror-gapcursor](https://github.com/ProseMirror/prosemirror-gapcursor)
476
+ * for more information.
477
+ *
410
478
  * @public
411
479
  */
412
- export declare function defineHeading(): Extension< {
413
- Nodes: "heading";
414
- Marks: never;
415
- Commands: {
416
- setHeading: [attrs?: HeadingAttrs | undefined];
417
- insertHeading: [attrs?: HeadingAttrs | undefined];
418
- toggleHeading: [attrs?: HeadingAttrs | undefined];
419
- };
420
- }>;
480
+ export declare function defineGapCursor(): PluginExtension;
421
481
 
422
- declare function defineHeadingCommands(): Extension< {
423
- Commands: {
424
- setHeading: [attrs?: HeadingAttrs | undefined];
425
- insertHeading: [attrs?: HeadingAttrs | undefined];
426
- toggleHeading: [attrs?: HeadingAttrs | undefined];
427
- };
428
- Nodes: never;
429
- Marks: never;
430
- }>;
482
+ /**
483
+ * @public
484
+ */
485
+ export declare function defineHeading(): HeadingExtension;
486
+
487
+ /**
488
+ * @internal
489
+ */
490
+ declare function defineHeadingCommands(): HeadingCommandsExtension;
431
491
  export { defineHeadingCommands }
432
492
  export { defineHeadingCommands as defineHeadingCommands_alias_1 }
433
493
 
434
494
  /**
435
495
  * Converts the text block to a heading when `#` is typed at the start of a new
436
496
  * line followed by a space.
497
+ *
498
+ * @internal
437
499
  */
438
500
  declare function defineHeadingInputRule(): Extension<ExtensionTyping<any, any, any>>;
439
501
  export { defineHeadingInputRule }
440
502
  export { defineHeadingInputRule as defineHeadingInputRule_alias_1 }
441
503
 
504
+ /**
505
+ * @internal
506
+ */
442
507
  declare function defineHeadingKeymap(): Extension<ExtensionTyping<any, any, any>>;
443
508
  export { defineHeadingKeymap }
444
509
  export { defineHeadingKeymap as defineHeadingKeymap_alias_1 }
445
510
 
446
- declare function defineHeadingSpec(): Extension< {
447
- Nodes: "heading";
448
- Marks: never;
449
- Commands: never;
450
- }>;
511
+ /**
512
+ * @internal
513
+ */
514
+ declare function defineHeadingSpec(): HeadingSpecExtension;
451
515
  export { defineHeadingSpec }
452
516
  export { defineHeadingSpec as defineHeadingSpec_alias_1 }
453
517
 
454
518
  /**
455
519
  * @public
456
520
  */
457
- export declare function defineImage(): Extension< {
458
- Nodes: "image";
459
- Marks: never;
460
- Commands: {
461
- insertImage: [attrs?: ImageAttrs | undefined];
462
- };
463
- }>;
521
+ export declare function defineImage(): ImageExtension;
464
522
 
465
- export declare function defineImageCommands(): Extension< {
466
- Commands: {
467
- insertImage: [attrs?: ImageAttrs | undefined];
468
- };
469
- Nodes: never;
470
- Marks: never;
471
- }>;
523
+ /**
524
+ * @internal
525
+ */
526
+ export declare function defineImageCommands(): ImageCommandsExtension;
472
527
 
473
- export declare function defineImageSpec(): Extension< {
474
- Nodes: "image";
475
- Marks: never;
476
- Commands: never;
477
- }>;
528
+ /**
529
+ * @internal
530
+ */
531
+ export declare function defineImageSpec(): ImageSpecExtension;
478
532
 
479
533
  /**
480
534
  * Defines an input rule extension.
@@ -488,136 +542,104 @@ export declare function defineInputRule(rule: InputRule): Extension;
488
542
  /**
489
543
  * @public
490
544
  */
491
- export declare function defineItalic(): Extension< {
492
- Nodes: never;
493
- Marks: "italic";
494
- Commands: {
495
- toggleItalic: [];
496
- };
497
- }>;
545
+ export declare function defineItalic(): ItalicExtension;
498
546
 
499
- export declare function defineItalicCommands(): Extension< {
500
- Commands: {
501
- toggleItalic: [];
502
- };
503
- Nodes: never;
504
- Marks: never;
505
- }>;
547
+ /**
548
+ * @internal
549
+ */
550
+ export declare function defineItalicCommands(): ItalicCommandsExtension;
506
551
 
552
+ /**
553
+ * @internal
554
+ */
507
555
  export declare function defineItalicInputRule(): Extension<ExtensionTyping<any, any, any>>;
508
556
 
557
+ /**
558
+ * @internal
559
+ */
509
560
  export declare function defineItalicKeymap(): Extension<ExtensionTyping<any, any, any>>;
510
561
 
511
- export declare function defineItalicSpec(): Extension< {
512
- Marks: "italic";
513
- Nodes: never;
514
- Commands: never;
515
- }>;
562
+ /**
563
+ * @internal
564
+ */
565
+ export declare function defineItalicSpec(): ItalicSpecExtension;
516
566
 
517
567
  /**
518
568
  * @public
519
569
  */
520
- export declare function defineLink(): Extension< {
521
- Nodes: never;
522
- Marks: "link";
523
- Commands: {
524
- addLink: [attrs: LinkAttrs];
525
- removeLink: [];
526
- toggleLink: [attrs: LinkAttrs];
527
- expandLink: [];
528
- };
529
- }>;
570
+ export declare function defineLink(): LinkExtension;
530
571
 
531
- export declare function defineLinkCommands(): Extension< {
532
- Commands: {
533
- addLink: [attrs: LinkAttrs];
534
- removeLink: [];
535
- toggleLink: [attrs: LinkAttrs];
536
- expandLink: [];
537
- };
538
- Nodes: never;
539
- Marks: never;
540
- }>;
572
+ export declare function defineLinkCommands(): LinkCommandsExtension;
541
573
 
542
574
  /**
543
575
  * Apply link marks after typing Enter.
576
+ *
577
+ * @internal
544
578
  */
545
579
  export declare function defineLinkEnterRule(): Extension<ExtensionTyping<any, any, any>>;
546
580
 
547
581
  /**
548
582
  * Apply link marks after pressing Space.
583
+ *
584
+ * @internal
549
585
  */
550
586
  export declare function defineLinkInputRule(): Extension<ExtensionTyping<any, any, any>>;
551
587
 
552
588
  /**
553
589
  * Apply and remove link marks to the text during typing.
590
+ *
591
+ * @internal
554
592
  */
555
593
  export declare function defineLinkMarkRule(): Extension<ExtensionTyping<any, any, any>>;
556
594
 
557
- export declare function defineLinkSpec(): Extension< {
558
- Marks: "link";
559
- Nodes: never;
560
- Commands: never;
561
- }>;
595
+ /**
596
+ * @internal
597
+ */
598
+ export declare function defineLinkSpec(): LinkSpecExtension;
562
599
 
563
600
  /**
564
601
  * @public
565
602
  */
566
- export declare function defineList(): Extension<{
567
- Nodes: "list";
568
- Marks: never;
569
- Commands: {
570
- dedentList: [options?: DedentListOptions | undefined];
571
- indentList: [options?: IndentListOptions | undefined];
572
- moveList: [direction: "up" | "down"];
573
- splitList: [];
574
- toggleCollapsed: [(ToggleCollapsedOptions | undefined)?];
575
- toggleList: [attrs: ListAttributes];
576
- unwrapList: [options?: UnwrapListOptions | undefined];
577
- wrapInList: [getAttrs: WrapInListGetAttrs<ListAttributes>];
578
- insertList: [attrs?: ListAttributes | undefined];
579
- };
580
- }>;
603
+ export declare function defineList(): ListExtension;
581
604
 
582
605
  /**
583
- * Defines list commands
606
+ * Defines list commands.
607
+ *
608
+ * @internal
584
609
  */
585
- declare function defineListCommands(): Extension< {
586
- Commands: {
587
- dedentList: [options?: DedentListOptions | undefined];
588
- indentList: [options?: IndentListOptions | undefined];
589
- moveList: [direction: "up" | "down"];
590
- splitList: [];
591
- toggleCollapsed: [(ToggleCollapsedOptions | undefined)?];
592
- toggleList: [attrs: ListAttributes];
593
- unwrapList: [options?: UnwrapListOptions | undefined];
594
- wrapInList: [getAttrs: WrapInListGetAttrs<ListAttributes>];
595
- insertList: [attrs?: ListAttributes | undefined];
596
- };
597
- Nodes: never;
598
- Marks: never;
599
- }>;
610
+ declare function defineListCommands(): ListCommandsExtension;
600
611
  export { defineListCommands }
601
612
  export { defineListCommands as defineListCommands_alias_1 }
602
613
 
603
- export declare function defineListInputRules(): Extension;
614
+ /**
615
+ * @internal
616
+ */
617
+ declare function defineListInputRules(): Extension;
618
+ export { defineListInputRules }
619
+ export { defineListInputRules as defineListInputRules_alias_1 }
604
620
 
605
621
  /**
606
622
  * Returns a extension that adds key bindings for list.
607
623
  *
608
- * @public
624
+ * @internal
609
625
  */
610
626
  declare function defineListKeymap(): Extension<ExtensionTyping<any, any, any>>;
611
627
  export { defineListKeymap }
612
628
  export { defineListKeymap as defineListKeymap_alias_1 }
613
629
 
614
- export declare function defineListPlugins(): Extension<ExtensionTyping<any, any, any>>;
630
+ /**
631
+ * @internal
632
+ */
633
+ declare function defineListPlugins(): PluginExtension;
634
+ export { defineListPlugins }
635
+ export { defineListPlugins as defineListPlugins_alias_1 }
615
636
 
616
- export declare function defineListSpec(): Extension<{
617
- Nodes: "list";
618
- Marks: never;
619
- Commands: never;
620
- }>;
637
+ /**
638
+ * @internal
639
+ */
640
+ declare function defineListSpec(): ListSpecExtension;
641
+ export { defineListSpec }
642
+ export { defineListSpec as defineListSpec_alias_1 }
621
643
 
622
644
  /**
623
645
  * Defines an input rule for automatically adding inline marks when a given
@@ -638,29 +660,29 @@ export { defineMarkRule as defineMarkRule_alias_1 }
638
660
  /**
639
661
  * @public
640
662
  */
641
- export declare function defineMention(): Extension< {
642
- Nodes: "mention";
643
- Marks: never;
663
+ export declare function defineMention(): Union<readonly [Extension< {
664
+ Nodes: {
665
+ mention: MentionAttrs;
666
+ };
667
+ }>, Extension< {
644
668
  Commands: {
645
669
  insertMention: [attrs: MentionAttrs];
646
670
  };
647
- }>;
671
+ }>]>;
648
672
 
649
673
  export declare function defineMentionCommands(): Extension< {
650
674
  Commands: {
651
675
  insertMention: [attrs: MentionAttrs];
652
676
  };
653
- Nodes: never;
654
- Marks: never;
655
677
  }>;
656
678
 
657
679
  /**
658
680
  * @public
659
681
  */
660
682
  export declare function defineMentionSpec(): Extension< {
661
- Nodes: "mention";
662
- Marks: never;
663
- Commands: never;
683
+ Nodes: {
684
+ mention: MentionAttrs;
685
+ };
664
686
  }>;
665
687
 
666
688
  /**
@@ -669,18 +691,18 @@ Commands: never;
669
691
  *
670
692
  * @public
671
693
  */
672
- export declare function defineModClickPrevention(): Extension;
694
+ export declare function defineModClickPrevention(): ModClickPreventionExtension;
673
695
 
674
696
  /**
675
697
  * Add a placeholder text to the editor when the current block or document is
676
698
  * empty.
677
699
  */
678
- export declare function definePlaceholder(options: PlaceholderOptions): Extension<ExtensionTyping<any, any, any>>;
700
+ export declare function definePlaceholder(options: PlaceholderOptions): PluginExtension;
679
701
 
680
702
  /**
681
703
  * Make the editor read-only.
682
704
  */
683
- export declare function defineReadonly(): Extension<ExtensionTyping<any, any, any>>;
705
+ export declare function defineReadonly(): PluginExtension;
684
706
 
685
707
  /**
686
708
  * Defines commands for search and replace.
@@ -698,8 +720,6 @@ replaceNextNoWrap: [];
698
720
  replaceCurrent: [];
699
721
  replaceAll: [];
700
722
  };
701
- Nodes: never;
702
- Marks: never;
703
723
  }>;
704
724
 
705
725
  /**
@@ -707,58 +727,46 @@ Marks: never;
707
727
  *
708
728
  * @public
709
729
  */
710
- export declare function defineSearchQuery(options: SearchQueryOptions): Extension<ExtensionTyping<any, any, any>>;
730
+ export declare function defineSearchQuery(options: SearchQueryOptions): PluginExtension;
711
731
 
712
732
  /**
713
733
  * @public
714
734
  */
715
- export declare function defineStrike(): Extension< {
716
- Nodes: never;
717
- Marks: "strike";
718
- Commands: {
719
- toggleStrike: [];
720
- };
721
- }>;
735
+ export declare function defineStrike(): StrikeExtension;
722
736
 
723
- export declare function defineStrikeCommands(): Extension< {
724
- Commands: {
725
- toggleStrike: [];
726
- };
727
- Nodes: never;
728
- Marks: never;
729
- }>;
737
+ /**
738
+ * @internal
739
+ */
740
+ export declare function defineStrikeCommands(): StrikeCommandsExtension;
730
741
 
742
+ /**
743
+ * @internal
744
+ */
731
745
  export declare function defineStrikeInputRule(): Extension<ExtensionTyping<any, any, any>>;
732
746
 
747
+ /**
748
+ * @internal
749
+ */
733
750
  export declare function defineStrikeKeymap(): Extension<ExtensionTyping<any, any, any>>;
734
751
 
735
- export declare function defineStrikeSpec(): Extension< {
736
- Marks: "strike";
737
- Nodes: never;
738
- Commands: never;
752
+ /**
753
+ * @internal
754
+ */
755
+ export declare function defineStrikeSpec(): Extension<{
756
+ Marks: {
757
+ strike: Attrs;
758
+ };
739
759
  }>;
740
760
 
741
761
  /**
742
762
  * @public
743
763
  */
744
- export declare function defineTable(): Extension< {
745
- Nodes: "table" | "tableRow" | "tableCell" | "tableHeaderCell";
746
- Marks: never;
747
- Commands: {
748
- insertTable: [{
749
- row: number;
750
- col: number;
751
- header: boolean;
752
- }];
753
- exitTable: [];
754
- };
755
- }>;
764
+ export declare function defineTable(): TableExtension;
756
765
 
757
- declare function defineTableCellSpec(): Extension< {
758
- Nodes: "tableCell";
759
- Marks: never;
760
- Commands: never;
761
- }>;
766
+ /**
767
+ * @internal
768
+ */
769
+ declare function defineTableCellSpec(): TableCellSpecExtension;
762
770
  export { defineTableCellSpec }
763
771
  export { defineTableCellSpec as defineTableCellSpec_alias_1 }
764
772
 
@@ -767,106 +775,43 @@ export { defineTableCellSpec as defineTableCellSpec_alias_1 }
767
775
  *
768
776
  * @public
769
777
  */
770
- declare function defineTableCommands(): Extension< {
771
- Commands: {
772
- insertTable: [{
773
- row: number;
774
- col: number;
775
- header: boolean;
776
- }];
777
- exitTable: [];
778
- };
779
- Nodes: never;
780
- Marks: never;
781
- }>;
778
+ declare function defineTableCommands(): TableCommandsExtension;
782
779
  export { defineTableCommands }
783
780
  export { defineTableCommands as defineTableCommands_alias_1 }
784
781
 
785
- declare function defineTableHeaderCellSpec(): Extension< {
786
- Nodes: "tableHeaderCell";
787
- Marks: never;
788
- Commands: never;
789
- }>;
782
+ declare function defineTableHeaderCellSpec(): TableHeaderCellSpecExtension;
790
783
  export { defineTableHeaderCellSpec }
791
784
  export { defineTableHeaderCellSpec as defineTableHeaderCellSpec_alias_1 }
792
785
 
793
786
  /**
794
787
  * @public
795
788
  */
796
- declare function defineTablePlugins(): Extension<ExtensionTyping<any, any, any>>;
789
+ declare function defineTablePlugins(): PluginExtension;
797
790
  export { defineTablePlugins }
798
791
  export { defineTablePlugins as defineTablePlugins_alias_1 }
799
792
 
800
- declare function defineTableRowSpec(): Extension< {
801
- Nodes: "tableRow";
802
- Marks: never;
803
- Commands: never;
804
- }>;
793
+ /**
794
+ * @internal
795
+ */
796
+ declare function defineTableRowSpec(): TableRowSpecExtension;
805
797
  export { defineTableRowSpec }
806
798
  export { defineTableRowSpec as defineTableRowSpec_alias_1 }
807
799
 
808
- declare function defineTableSpec(): Extension< {
809
- Nodes: "table";
810
- Marks: never;
811
- Commands: never;
812
- }>;
800
+ /**
801
+ * @internal
802
+ */
803
+ declare function defineTableSpec(): TableSpecExtension;
813
804
  export { defineTableSpec }
814
805
  export { defineTableSpec as defineTableSpec_alias_1 }
815
806
 
816
807
  /**
817
808
  * @internal
818
809
  */
819
- export declare function defineTestExtension(): Extension<{
820
- Nodes: "blockquote" | "table" | "text" | "doc" | "paragraph" | "heading" | "image" | "list" | "tableRow" | "tableCell" | "tableHeaderCell";
821
- Marks: "code" | "link" | "bold" | "strike" | "italic" | "underline";
822
- Commands: {
823
- insertText: [{
824
- text: string;
825
- from?: number;
826
- to?: number;
827
- }];
828
- insertNode: [options: InsertNodeOptions];
829
- removeNode: [options: RemoveNodeOptions];
830
- wrap: [WrapOptions];
831
- setBlockType: [options: SetBlockTypeOptions];
832
- setNodeAttrs: [options: SetNodeAttrsOptions];
833
- selectAll: [];
834
- addMark: [options: AddMarkOptions];
835
- removeMark: [options: RemoveMarkOptions];
836
- unsetBlockType: [options?: UnsetBlockTypeOptions | undefined];
837
- unsetMark: [options?: UnsetMarkOptions | undefined];
838
- readonly undo: [];
839
- readonly redo: [];
840
- toggleBold: [];
841
- toggleCode: [];
842
- setHeading: [attrs?: HeadingAttrs | undefined];
843
- insertHeading: [attrs?: HeadingAttrs | undefined];
844
- toggleHeading: [attrs?: HeadingAttrs | undefined];
845
- insertImage: [attrs?: ImageAttrs | undefined];
846
- toggleItalic: [];
847
- addLink: [attrs: LinkAttrs];
848
- removeLink: [];
849
- toggleLink: [attrs: LinkAttrs];
850
- expandLink: [];
851
- dedentList: [options?: DedentListOptions | undefined];
852
- indentList: [options?: IndentListOptions | undefined];
853
- moveList: [direction: "up" | "down"];
854
- splitList: [];
855
- toggleCollapsed: [(ToggleCollapsedOptions | undefined)?];
856
- toggleList: [attrs: ListAttributes];
857
- unwrapList: [options?: UnwrapListOptions | undefined];
858
- wrapInList: [getAttrs: WrapInListGetAttrs<ListAttributes>];
859
- insertList: [attrs?: ListAttributes | undefined];
860
- toggleStrike: [];
861
- insertTable: [{
862
- row: number;
863
- col: number;
864
- header: boolean;
865
- }];
866
- exitTable: [];
867
- toggleUnderline: [];
868
- };
869
- }>;
810
+ export declare function defineTestExtension(): Union<readonly [DocExtension, TextExtension, HeadingExtension, HistoryExtension, ListExtension, BlockquoteExtension, BaseKeymapExtension, BaseCommandsExtension, ItalicExtension, BoldExtension, UnderlineExtension, StrikeExtension, CodeExtension, LinkExtension, ImageExtension, Extension<{
811
+ Nodes: {
812
+ paragraph: Attrs_2;
813
+ };
814
+ }>, TableExtension]>;
870
815
 
871
816
  /**
872
817
  * Adds a `textAlign` attribute to the specified nodes. This will be rendered as
@@ -874,23 +819,20 @@ export declare function defineTestExtension(): Extension<{
874
819
  *
875
820
  * @public
876
821
  */
877
- export declare function defineTextAlign(options: TextAlignOptions): Extension<{
878
- Nodes: never;
879
- Marks: never;
880
- Commands: {
881
- setTextAlign: [value: string | null];
822
+ export declare function defineTextAlign<NodeName extends string = string>(options: TextAlignOptions<NodeName>): Extension<{
823
+ Nodes: {
824
+ [K in NodeName]: {
825
+ textAlign: string | null;
826
+ };
882
827
  };
828
+ Commands: TextAlignCommandTyping;
883
829
  }>;
884
830
 
885
831
  /**
886
832
  * @internal
887
833
  */
888
834
  export declare function defineTextAlignCommands(types: string[]): Extension<{
889
- Commands: {
890
- setTextAlign: [value: string | null];
891
- };
892
- Nodes: never;
893
- Marks: never;
835
+ Commands: TextAlignCommandTyping;
894
836
  }>;
895
837
 
896
838
  /**
@@ -935,29 +877,22 @@ export declare function defineTextBlockInputRule({ regex, type, attrs, }: {
935
877
  /**
936
878
  * @public
937
879
  */
938
- export declare function defineUnderline(): Extension< {
939
- Nodes: never;
940
- Marks: "underline";
941
- Commands: {
942
- toggleUnderline: [];
943
- };
944
- }>;
880
+ export declare function defineUnderline(): UnderlineExtension;
945
881
 
946
- export declare function defineUnderlineCommands(): Extension< {
947
- Commands: {
948
- toggleUnderline: [];
949
- };
950
- Nodes: never;
951
- Marks: never;
952
- }>;
882
+ /**
883
+ * @internal
884
+ */
885
+ export declare function defineUnderlineCommands(): UnderlineCommandsExtension;
953
886
 
887
+ /**
888
+ * @internal
889
+ */
954
890
  export declare function defineUnderlineKeymap(): Extension<ExtensionTyping<any, any, any>>;
955
891
 
956
- export declare function defineUnderlineSpec(): Extension< {
957
- Marks: "underline";
958
- Nodes: never;
959
- Commands: never;
960
- }>;
892
+ /**
893
+ * @internal
894
+ */
895
+ export declare function defineUnderlineSpec(): UnderlineSpecExtension;
961
896
 
962
897
  /**
963
898
  * Shows a virtual selection when the editor is not focused. When the editor is
@@ -969,7 +904,7 @@ Commands: never;
969
904
  *
970
905
  * @public
971
906
  */
972
- export declare function defineVirtualSelection(): Extension;
907
+ export declare function defineVirtualSelection(): VirtualSelectionExtension;
973
908
 
974
909
  /**
975
910
  * Defines an input rule for automatically wrapping a textblock when a given
@@ -1005,6 +940,11 @@ export declare function defineWrappingInputRule({ regex, type, attrs, join, }: {
1005
940
  join?: (match: RegExpMatchArray, node: ProseMirrorNode) => boolean;
1006
941
  }): Extension;
1007
942
 
943
+ /**
944
+ * @internal
945
+ */
946
+ export declare type DropCursorExtension = PluginExtension;
947
+
1008
948
  export declare interface DropCursorOptions {
1009
949
  /**
1010
950
  * The color of the cursor. Use `false` to apply no color and rely only on class.
@@ -1076,6 +1016,8 @@ export declare type EnterRuleOptions = {
1076
1016
  */
1077
1017
  export declare const exitTable: Command;
1078
1018
 
1019
+ export { GapCursor }
1020
+
1079
1021
  export declare function getCheckRanges(transactions: readonly Transaction[], oldState: EditorState, newState: EditorState): Array<[number, number]>;
1080
1022
 
1081
1023
  export declare function getPluginState(state: EditorState): PredictionPluginState | undefined;
@@ -1090,6 +1032,38 @@ declare interface HeadingAttrs {
1090
1032
  export { HeadingAttrs }
1091
1033
  export { HeadingAttrs as HeadingAttrs_alias_1 }
1092
1034
 
1035
+ /**
1036
+ * @internal
1037
+ */
1038
+ declare type HeadingCommandsExtension = Extension<{
1039
+ Commands: {
1040
+ setHeading: [attrs?: HeadingAttrs | undefined];
1041
+ insertHeading: [attrs?: HeadingAttrs | undefined];
1042
+ toggleHeading: [attrs?: HeadingAttrs | undefined];
1043
+ };
1044
+ }>;
1045
+ export { HeadingCommandsExtension }
1046
+ export { HeadingCommandsExtension as HeadingCommandsExtension_alias_1 }
1047
+
1048
+ /**
1049
+ * @internal
1050
+ */
1051
+ export declare type HeadingExtension = Union<[
1052
+ HeadingSpecExtension,
1053
+ HeadingCommandsExtension
1054
+ ]>;
1055
+
1056
+ /**
1057
+ * @internal
1058
+ */
1059
+ declare type HeadingSpecExtension = Extension<{
1060
+ Nodes: {
1061
+ heading: HeadingAttrs;
1062
+ };
1063
+ }>;
1064
+ export { HeadingSpecExtension }
1065
+ export { HeadingSpecExtension as HeadingSpecExtension_alias_1 }
1066
+
1093
1067
  export declare type HighlighterOptions = {
1094
1068
  themes: BundledTheme[];
1095
1069
  langs: (BundledLanguage | SpecialLanguage)[];
@@ -1113,10 +1087,36 @@ declare type HighlightParser = Parser;
1113
1087
  export { HighlightParser }
1114
1088
  export { HighlightParser as HighlightParser_alias_1 }
1115
1089
 
1090
+ /**
1091
+ * @public
1092
+ */
1116
1093
  export declare interface ImageAttrs {
1117
1094
  src?: string | null;
1118
1095
  }
1119
1096
 
1097
+ /**
1098
+ * @internal
1099
+ */
1100
+ export declare type ImageCommandsExtension = Extension<{
1101
+ Commands: {
1102
+ insertImage: [attrs?: ImageAttrs];
1103
+ };
1104
+ }>;
1105
+
1106
+ /**
1107
+ * @internal
1108
+ */
1109
+ export declare type ImageExtension = Union<[ImageSpecExtension, ImageCommandsExtension]>;
1110
+
1111
+ /**
1112
+ * @internal
1113
+ */
1114
+ export declare type ImageSpecExtension = Extension<{
1115
+ Nodes: {
1116
+ image: ImageAttrs;
1117
+ };
1118
+ }>;
1119
+
1120
1120
  export { IndentListOptions }
1121
1121
 
1122
1122
  /**
@@ -1125,11 +1125,42 @@ export { IndentListOptions }
1125
1125
  *
1126
1126
  * @public
1127
1127
  */
1128
- export declare function insertTable({ row, col, header, }: {
1128
+ export declare function insertTable({ row, col, header }: InsertTableOptions): Command;
1129
+
1130
+ /**
1131
+ * @public
1132
+ */
1133
+ export declare interface InsertTableOptions {
1129
1134
  row: number;
1130
1135
  col: number;
1131
1136
  header: boolean;
1132
- }): Command;
1137
+ }
1138
+
1139
+ /**
1140
+ * @internal
1141
+ */
1142
+ export declare type ItalicCommandsExtension = Extension<{
1143
+ Commands: {
1144
+ toggleItalic: [];
1145
+ };
1146
+ }>;
1147
+
1148
+ /**
1149
+ * @internal
1150
+ */
1151
+ export declare type ItalicExtension = Union<[
1152
+ ItalicSpecExtension,
1153
+ ItalicCommandsExtension
1154
+ ]>;
1155
+
1156
+ /**
1157
+ * @internal
1158
+ */
1159
+ export declare type ItalicSpecExtension = Extension<{
1160
+ Marks: {
1161
+ italic: Attrs;
1162
+ };
1163
+ }>;
1133
1164
 
1134
1165
  export declare const LINK_ENTER_RE: RegExp;
1135
1166
 
@@ -1144,10 +1175,95 @@ export declare interface LinkAttrs {
1144
1175
  href: string;
1145
1176
  }
1146
1177
 
1147
- export { ListAttributes }
1178
+ /**
1179
+ * @internal
1180
+ */
1181
+ export declare type LinkCommandsExtension = Extension<{
1182
+ Commands: {
1183
+ addLink: [LinkAttrs];
1184
+ removeLink: [];
1185
+ toggleLink: [LinkAttrs];
1186
+ expandLink: [];
1187
+ };
1188
+ }>;
1189
+
1190
+ /**
1191
+ * @internal
1192
+ */
1193
+ export declare type LinkExtension = Union<[LinkSpecExtension, LinkCommandsExtension]>;
1194
+
1195
+ /**
1196
+ * @internal
1197
+ */
1198
+ export declare type LinkSpecExtension = Extension<{
1199
+ Marks: {
1200
+ link: LinkAttrs;
1201
+ };
1202
+ }>;
1203
+
1204
+ /**
1205
+ * The attributes of a list node.
1206
+ *
1207
+ * @public
1208
+ */
1209
+ declare interface ListAttrs {
1210
+ /**
1211
+ * The kind of list node.
1212
+ */
1213
+ kind?: 'bullet' | 'ordered' | 'task' | 'toggle';
1214
+ /**
1215
+ * The optional order of the list node.
1216
+ */
1217
+ order?: number | null;
1218
+ /**
1219
+ * Whether the list node is checked if its `kind` is `"task"`.
1220
+ */
1221
+ checked?: boolean;
1222
+ /**
1223
+ * Whether the list node is collapsed if its `kind` is `"toggle"`.
1224
+ */
1225
+ collapsed?: boolean;
1226
+ }
1227
+ export { ListAttrs }
1228
+ export { ListAttrs as ListAttrs_alias_1 }
1229
+
1230
+ /**
1231
+ * @internal
1232
+ */
1233
+ declare type ListCommandsExtension = Extension<{
1234
+ Commands: {
1235
+ dedentList: [options?: DedentListOptions];
1236
+ indentList: [options?: IndentListOptions];
1237
+ moveList: [direction: 'up' | 'down'];
1238
+ splitList: [];
1239
+ toggleCollapsed: [options?: ToggleCollapsedOptions];
1240
+ unwrapList: [options?: UnwrapListOptions];
1241
+ toggleList: [attrs?: ListAttributes];
1242
+ wrapInList: [attrs?: ListAttributes];
1243
+ insertList: [attrs?: ListAttributes];
1244
+ };
1245
+ }>;
1246
+ export { ListCommandsExtension }
1247
+ export { ListCommandsExtension as ListCommandsExtension_alias_1 }
1148
1248
 
1149
1249
  export { ListDOMSerializer }
1150
1250
 
1251
+ /**
1252
+ * @internal
1253
+ */
1254
+ export declare type ListExtension = Union<[ListSpecExtension, ListCommandsExtension]>;
1255
+
1256
+ /**
1257
+ * @internal
1258
+ */
1259
+ declare type ListSpecExtension = Extension<{
1260
+ Nodes: {
1261
+ list: ListAttrs;
1262
+ };
1263
+ }>;
1264
+ export { ListSpecExtension }
1265
+ export { ListSpecExtension as ListSpecExtension_alias_1 }
1266
+
1151
1267
  /**
1152
1268
  * Options for {@link defineMarkInputRule}.
1153
1269
  *
@@ -1209,10 +1325,15 @@ export { MatchHandler as MatchHandler_alias_1 }
1209
1325
 
1210
1326
  export declare interface MentionAttrs {
1211
1327
  id: string;
1212
- kind: string;
1213
1328
  value: string;
1329
+ kind: string;
1214
1330
  }
1215
1331
 
1332
+ /**
1333
+ * @internal
1334
+ */
1335
+ export declare type ModClickPreventionExtension = PluginExtension;
1336
+
1216
1337
  export declare interface PlaceholderOptions {
1217
1338
  /**
1218
1339
  * The placeholder text to use.
@@ -1311,59 +1432,88 @@ export declare function setTrMeta(tr: Transaction, meta: PredictionPluginState):
1311
1432
  * @internal
1312
1433
  */
1313
1434
  export declare function setupTest(): {
1314
- editor: TestEditor<Extension<{
1315
- Nodes: "blockquote" | "table" | "text" | "doc" | "paragraph" | "heading" | "image" | "list" | "tableRow" | "tableCell" | "tableHeaderCell";
1316
- Marks: "code" | "link" | "bold" | "strike" | "italic" | "underline";
1317
- Commands: {
1318
- insertText: [{
1319
- text: string;
1320
- from?: number;
1321
- to?: number;
1322
- }];
1323
- insertNode: [options: InsertNodeOptions];
1324
- removeNode: [options: RemoveNodeOptions];
1325
- wrap: [WrapOptions];
1326
- setBlockType: [options: SetBlockTypeOptions];
1327
- setNodeAttrs: [options: SetNodeAttrsOptions];
1328
- selectAll: [];
1329
- addMark: [options: AddMarkOptions];
1330
- removeMark: [options: RemoveMarkOptions];
1331
- unsetBlockType: [options?: UnsetBlockTypeOptions | undefined];
1332
- unsetMark: [options?: UnsetMarkOptions | undefined];
1333
- readonly undo: [];
1334
- readonly redo: [];
1335
- toggleBold: [];
1336
- toggleCode: [];
1337
- setHeading: [attrs?: HeadingAttrs | undefined];
1338
- insertHeading: [attrs?: HeadingAttrs | undefined];
1339
- toggleHeading: [attrs?: HeadingAttrs | undefined];
1340
- insertImage: [attrs?: ImageAttrs | undefined];
1341
- toggleItalic: [];
1342
- addLink: [attrs: LinkAttrs];
1343
- removeLink: [];
1344
- toggleLink: [attrs: LinkAttrs];
1345
- expandLink: [];
1346
- dedentList: [options?: DedentListOptions | undefined];
1347
- indentList: [options?: IndentListOptions | undefined];
1348
- moveList: [direction: "up" | "down"];
1349
- splitList: [];
1350
- toggleCollapsed: [(ToggleCollapsedOptions | undefined)?];
1351
- toggleList: [attrs: ListAttributes];
1352
- unwrapList: [options?: UnwrapListOptions | undefined];
1353
- wrapInList: [getAttrs: WrapInListGetAttrs<ListAttributes>];
1354
- insertList: [attrs?: ListAttributes | undefined];
1355
- toggleStrike: [];
1356
- insertTable: [{
1357
- row: number;
1358
- col: number;
1359
- header: boolean;
1360
- }];
1361
- exitTable: [];
1362
- toggleUnderline: [];
1363
- };
1435
+ editor: TestEditor<Union<readonly [DocExtension, TextExtension, HeadingExtension, HistoryExtension, ListExtension, BlockquoteExtension, BaseKeymapExtension, BaseCommandsExtension, ItalicExtension, BoldExtension, UnderlineExtension, StrikeExtension, CodeExtension, LinkExtension, ImageExtension, Extension<{
1436
+ Nodes: {
1437
+ paragraph: Attrs_2;
1438
+ };
1439
+ }>, TableExtension]>>;
1440
+ m: ToMarkAction<SimplifyDeeper< {
1441
+ bold: {
1442
+ readonly [x: string]: any;
1443
+ };
1444
+ code: {
1445
+ readonly [x: string]: any;
1446
+ };
1447
+ italic: {
1448
+ readonly [x: string]: any;
1449
+ };
1450
+ link: {
1451
+ href: string;
1452
+ };
1453
+ strike: {
1454
+ readonly [x: string]: any;
1455
+ };
1456
+ underline: {
1457
+ readonly [x: string]: any;
1458
+ };
1364
1459
  }>>;
1365
- n: Record<"blockquote" | "table" | "text" | "doc" | "paragraph" | "heading" | "image" | "list" | "tableRow" | "tableCell" | "tableHeaderCell", NodeBuilder>;
1366
- m: Record<"code" | "link" | "bold" | "strike" | "italic" | "underline", MarkBuilder>;
1460
+ n: {
1461
+ p: NodeAction< {
1462
+ readonly [x: string]: any;
1463
+ }>;
1464
+ h1: (...children: NodeChild[]) => Node_2;
1465
+ h2: (...children: NodeChild[]) => Node_2;
1466
+ h3: (...children: NodeChild[]) => Node_2;
1467
+ h4: (...children: NodeChild[]) => Node_2;
1468
+ h5: (...children: NodeChild[]) => Node_2;
1469
+ h6: (...children: NodeChild[]) => Node_2;
1470
+ bullet: (...children: NodeChild[]) => Node_2;
1471
+ ordered: (...children: NodeChild[]) => Node_2;
1472
+ checked: (...children: NodeChild[]) => Node_2;
1473
+ unchecked: (...children: NodeChild[]) => Node_2;
1474
+ collapsed: (...children: NodeChild[]) => Node_2;
1475
+ expanded: (...children: NodeChild[]) => Node_2;
1476
+ doc: NodeAction< {
1477
+ readonly [x: string]: any;
1478
+ }>;
1479
+ paragraph: NodeAction< {
1480
+ readonly [x: string]: any;
1481
+ }>;
1482
+ text: NodeAction< {
1483
+ readonly [x: string]: any;
1484
+ }>;
1485
+ blockquote: NodeAction< {
1486
+ readonly [x: string]: any;
1487
+ }>;
1488
+ heading: NodeAction< {
1489
+ level: number;
1490
+ }>;
1491
+ image: NodeAction< {
1492
+ src?: string | null;
1493
+ }>;
1494
+ list: NodeAction< {
1495
+ kind?: "bullet" | "ordered" | "task" | "toggle";
1496
+ order?: number | null;
1497
+ checked?: boolean;
1498
+ collapsed?: boolean;
1499
+ }>;
1500
+ table: NodeAction< {
1501
+ readonly [x: string]: any;
1502
+ }>;
1503
+ tableRow: NodeAction< {
1504
+ readonly [x: string]: any;
1505
+ }>;
1506
+ tableCell: NodeAction< {
1507
+ colspan: number;
1508
+ rowspan: number;
1509
+ colwidth: number[] | null;
1510
+ }>;
1511
+ tableHeaderCell: NodeAction< {
1512
+ colspan: number;
1513
+ rowspan: number;
1514
+ colwidth: number[] | null;
1515
+ }>;
1516
+ };
1367
1517
  };
1368
1518
 
1369
1519
  /**
@@ -1371,11 +1521,111 @@ export declare function setupTest(): {
1371
1521
  */
1372
1522
  export declare function setupTestFromExtension<E extends Extension>(extension: E): {
1373
1523
  editor: TestEditor<E>;
1374
- n: Record<ExtractNodes<E>, NodeBuilder>;
1375
- m: Record<ExtractMarks<E>, MarkBuilder>;
1524
+ n: ExtractNodeActions<E>;
1525
+ m: ExtractMarkActions<E>;
1376
1526
  };
1377
1527
 
1378
- export declare interface TextAlignOptions {
1528
+ /**
1529
+ * @internal
1530
+ */
1531
+ export declare type StrikeCommandsExtension = Extension<{
1532
+ Commands: {
1533
+ toggleStrike: [];
1534
+ };
1535
+ }>;
1536
+
1537
+ /**
1538
+ * @internal
1539
+ */
1540
+ export declare type StrikeExtension = Union<[
1541
+ StrikeSpecExtension,
1542
+ StrikeCommandsExtension
1543
+ ]>;
1544
+
1545
+ /**
1546
+ * @internal
1547
+ */
1548
+ export declare type StrikeSpecExtension = Extension<{
1549
+ Marks: {
1550
+ strike: Attrs;
1551
+ };
1552
+ }>;
1553
+
1554
+ /**
1555
+ * @internal
1556
+ */
1557
+ declare type TableCellSpecExtension = Extension<{
1558
+ Nodes: {
1559
+ tableCell: CellAttrs;
1560
+ };
1561
+ }>;
1562
+ export { TableCellSpecExtension }
1563
+ export { TableCellSpecExtension as TableCellSpecExtension_alias_1 }
1564
+
1565
+ /**
1566
+ * @internal
1567
+ */
1568
+ declare type TableCommandsExtension = Extension<{
1569
+ Commands: {
1570
+ insertTable: [InsertTableOptions];
1571
+ exitTable: [];
1572
+ };
1573
+ }>;
1574
+ export { TableCommandsExtension }
1575
+ export { TableCommandsExtension as TableCommandsExtension_alias_1 }
1576
+
1577
+ /**
1578
+ * @internal
1579
+ */
1580
+ export declare type TableExtension = Union<[
1581
+ TableSpecExtension,
1582
+ TableRowSpecExtension,
1583
+ TableCellSpecExtension,
1584
+ TableHeaderCellSpecExtension,
1585
+ TableCommandsExtension
1586
+ ]>;
1587
+
1588
+ /**
1589
+ * @internal
1590
+ */
1591
+ declare type TableHeaderCellSpecExtension = Extension<{
1592
+ Nodes: {
1593
+ tableHeaderCell: CellAttrs;
1594
+ };
1595
+ }>;
1596
+ export { TableHeaderCellSpecExtension }
1597
+ export { TableHeaderCellSpecExtension as TableHeaderCellSpecExtension_alias_1 }
1598
+
1599
+ /**
1600
+ * @internal
1601
+ */
1602
+ declare type TableRowSpecExtension = Extension<{
1603
+ Nodes: {
1604
+ tableRow: Attrs;
1605
+ };
1606
+ }>;
1607
+ export { TableRowSpecExtension }
1608
+ export { TableRowSpecExtension as TableRowSpecExtension_alias_1 }
1609
+
1610
+ /**
1611
+ * @internal
1612
+ */
1613
+ declare type TableSpecExtension = Extension<{
1614
+ Nodes: {
1615
+ table: Attrs;
1616
+ };
1617
+ }>;
1618
+ export { TableSpecExtension }
1619
+ export { TableSpecExtension as TableSpecExtension_alias_1 }
1620
+
1621
+ /**
1622
+ * @internal
1623
+ */
1624
+ export declare type TextAlignCommandTyping = {
1625
+ setTextAlign: [value: string | null];
1626
+ };
1627
+
1628
+ export declare interface TextAlignOptions<NodeName extends string = string> {
1379
1629
  /**
1380
1630
  * The names of node to add the attribute to.
1381
1631
  *
@@ -1383,7 +1633,7 @@ export declare interface TextAlignOptions {
1383
1633
  *
1384
1634
  * ["paragraph", "heading"]
1385
1635
  */
1386
- types: string[];
1636
+ types: NodeName[];
1387
1637
  /**
1388
1638
  * The default value for the attribute.
1389
1639
  *
@@ -1421,8 +1671,39 @@ export declare type TextBlockEnterRuleOptions = {
1421
1671
 
1422
1672
  export { ToggleCollapsedOptions }
1423
1673
 
1674
+ /**
1675
+ * @internal
1676
+ */
1677
+ export declare type UnderlineCommandsExtension = Extension<{
1678
+ Commands: {
1679
+ toggleUnderline: [];
1680
+ };
1681
+ }>;
1682
+
1683
+ /**
1684
+ * @internal
1685
+ */
1686
+ export declare type UnderlineExtension = Union<[
1687
+ UnderlineSpecExtension,
1688
+ UnderlineCommandsExtension
1689
+ ]>;
1690
+
1691
+ /**
1692
+ * @internal
1693
+ */
1694
+ export declare type UnderlineSpecExtension = Extension<{
1695
+ Marks: {
1696
+ underline: Attrs;
1697
+ };
1698
+ }>;
1699
+
1424
1700
  export { UnwrapListOptions }
1425
1701
 
1702
+ /**
1703
+ * @internal
1704
+ */
1705
+ export declare type VirtualSelectionExtension = PluginExtension;
1706
+
1426
1707
  export { WrapInListGetAttrs }
1427
1708
 
1428
1709
  export { }