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

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,6 @@
1
1
  import { AddMarkOptions } from '@prosekit/core';
2
- import { Attrs } from '@prosekit/pm/model';
2
+ import { Attrs } from 'prosemirror-model';
3
+ import { Attrs as Attrs_2 } from '@prosekit/pm/model';
3
4
  import { BundledLanguage } from 'shiki';
4
5
  import { BundledLanguageInfo } from 'shiki';
5
6
  import { bundledLanguagesInfo } from 'shiki';
@@ -12,18 +13,21 @@ import { config as default_alias_1 } from '@prosekit/dev/config-vitest';
12
13
  import { EditorState } from '@prosekit/pm/state';
13
14
  import { Extension } from '@prosekit/core';
14
15
  import { ExtensionTyping } from '@prosekit/core';
15
- import { ExtractMarks } from '@prosekit/core';
16
- import { ExtractNodes } from '@prosekit/core';
16
+ import { ExtractMarkActions } from '@prosekit/core';
17
+ import { ExtractNodeActions } from '@prosekit/core';
18
+ import { GapCursor } from 'prosemirror-gapcursor';
17
19
  import { getSingletonHighlighter } from 'shiki/bundle/full';
18
20
  import type { Highlighter } from 'shiki';
19
21
  import { IndentListOptions } from 'prosemirror-flat-list';
20
22
  import { InputRule } from '@prosekit/pm/inputrules';
21
23
  import { InsertNodeOptions } from '@prosekit/core';
24
+ import type { IsEqual } from 'type-fest';
22
25
  import { ListAttributes } from 'prosemirror-flat-list';
23
26
  import { ListDOMSerializer } from 'prosemirror-flat-list';
24
- import { MarkBuilder } from '@prosekit/core';
25
27
  import { MarkType } from '@prosekit/pm/model';
26
- import { NodeBuilder } from '@prosekit/core';
28
+ import { Node as Node_2 } from 'prosemirror-model';
29
+ import { NodeAction } from '@prosekit/core';
30
+ import { NodeChild } from '@prosekit/core';
27
31
  import { NodeJSON } from '@prosekit/core';
28
32
  import { NodeType } from '@prosekit/pm/model';
29
33
  import { Options } from 'tsup';
@@ -35,11 +39,14 @@ import { RemoveMarkOptions } from '@prosekit/core';
35
39
  import { RemoveNodeOptions } from '@prosekit/core';
36
40
  import { SetBlockTypeOptions } from '@prosekit/core';
37
41
  import { SetNodeAttrsOptions } from '@prosekit/core';
42
+ import { SimplifyDeeper } from '@prosekit/core';
38
43
  import type { SpecialLanguage } from 'shiki';
39
44
  import { StepJSON } from '@prosekit/core';
40
45
  import { TestEditor } from '@prosekit/core/test';
41
46
  import { ToggleCollapsedOptions } from 'prosemirror-flat-list';
47
+ import { ToMarkAction } from '@prosekit/core';
42
48
  import { Transaction } from '@prosekit/pm/state';
49
+ import { UnionExtension } from '@prosekit/core';
43
50
  import { UnsetBlockTypeOptions } from '@prosekit/core';
44
51
  import { UnsetMarkOptions } from '@prosekit/core';
45
52
  import { UnwrapListOptions } from 'prosemirror-flat-list';
@@ -48,6 +55,11 @@ import { WrapOptions } from '@prosekit/core';
48
55
 
49
56
  export declare function applyMarkRules(rules: MarkRuleOptions[], transactions: readonly Transaction[], oldState: EditorState, newState: EditorState): Transaction | null;
50
57
 
58
+ /**
59
+ * Utility function assert that two types are equal in tests.
60
+ */
61
+ export declare function assertTypeEqual<T, U>(_val: IsEqual<T, U>): void;
62
+
51
63
  declare class AutocompleteRule {
52
64
  readonly regex: RegExp;
53
65
  readonly onMatch: MatchHandler;
@@ -194,11 +206,13 @@ export declare function defineAutocomplete(rule: AutocompleteRule): Extension;
194
206
  /**
195
207
  * @public
196
208
  */
197
- export declare function defineBlockquote(): Extension< {
198
- Nodes: "blockquote";
209
+ export declare function defineBlockquote(): UnionExtension<readonly [Extension< {
210
+ Nodes: {
211
+ blockquote: Attrs;
212
+ };
199
213
  Marks: never;
200
214
  Commands: never;
201
- }>;
215
+ }>, Extension<ExtensionTyping<any, any, any>>]>;
202
216
 
203
217
  /**
204
218
  * Wraps the text block in a blockquote when `>` is typed at the start of a new
@@ -207,7 +221,9 @@ Commands: never;
207
221
  export declare function defineBlockquoteInputRule(): Extension<ExtensionTyping<any, any, any>>;
208
222
 
209
223
  export declare function defineBlockquoteSpec(): Extension< {
210
- Nodes: "blockquote";
224
+ Nodes: {
225
+ blockquote: Attrs;
226
+ };
211
227
  Marks: never;
212
228
  Commands: never;
213
229
  }>;
@@ -215,13 +231,19 @@ Commands: never;
215
231
  /**
216
232
  * @public
217
233
  */
218
- export declare function defineBold(): Extension< {
234
+ export declare function defineBold(): UnionExtension<readonly [Extension< {
235
+ Marks: {
236
+ bold: Attrs;
237
+ };
219
238
  Nodes: never;
220
- Marks: "bold";
239
+ Commands: never;
240
+ }>, Extension< {
221
241
  Commands: {
222
242
  toggleBold: [];
223
243
  };
224
- }>;
244
+ Nodes: never;
245
+ Marks: never;
246
+ }>, Extension<ExtensionTyping<any, any, any>>, Extension<ExtensionTyping<any, any, any>>]>;
225
247
 
226
248
  export declare function defineBoldCommands(): Extension< {
227
249
  Commands: {
@@ -236,7 +258,9 @@ export declare function defineBoldInputRule(): Extension<ExtensionTyping<any, an
236
258
  export declare function defineBoldKeymap(): Extension<ExtensionTyping<any, any, any>>;
237
259
 
238
260
  export declare function defineBoldSpec(): Extension< {
239
- Marks: "bold";
261
+ Marks: {
262
+ bold: Attrs;
263
+ };
240
264
  Nodes: never;
241
265
  Commands: never;
242
266
  }>;
@@ -244,13 +268,19 @@ Commands: never;
244
268
  /**
245
269
  * @public
246
270
  */
247
- export declare function defineCode(): Extension< {
271
+ export declare function defineCode(): UnionExtension<readonly [Extension< {
272
+ Marks: {
273
+ code: Attrs;
274
+ };
248
275
  Nodes: never;
249
- Marks: "code";
276
+ Commands: never;
277
+ }>, Extension< {
250
278
  Commands: {
251
279
  toggleCode: [];
252
280
  };
253
- }>;
281
+ Nodes: never;
282
+ Marks: never;
283
+ }>, Extension<ExtensionTyping<any, any, any>>, Extension<ExtensionTyping<any, any, any>>]>;
254
284
 
255
285
  /**
256
286
  * Adds `codeBlock` nodes to the editor. This includes the following extensions:
@@ -263,16 +293,24 @@ toggleCode: [];
263
293
  *
264
294
  * @public
265
295
  */
266
- declare function defineCodeBlock(): Extension< {
267
- Nodes: "codeBlock";
296
+ declare function defineCodeBlock(): UnionExtension<readonly [Extension< {
297
+ Nodes: {
298
+ codeBlock: {
299
+ language: string;
300
+ };
301
+ };
268
302
  Marks: never;
303
+ Commands: never;
304
+ }>, Extension<ExtensionTyping<any, any, any>>, Extension<ExtensionTyping<any, any, any>>, Extension<ExtensionTyping<any, any, any>>, Extension< {
269
305
  Commands: {
270
306
  setCodeBlock: [attrs?: CodeBlockAttrs | undefined];
271
307
  insertCodeBlock: [attrs?: CodeBlockAttrs | undefined];
272
308
  toggleCodeBlock: [attrs?: CodeBlockAttrs | undefined];
273
309
  setCodeBlockAttrs: [attrs: CodeBlockAttrs];
274
310
  };
275
- }>;
311
+ Nodes: never;
312
+ Marks: never;
313
+ }>]>;
276
314
  export { defineCodeBlock }
277
315
  export { defineCodeBlock as defineCodeBlock_alias_1 }
278
316
 
@@ -346,7 +384,11 @@ export { defineCodeBlockShiki as defineCodeBlockShiki_alias_1 }
346
384
  * @public
347
385
  */
348
386
  declare function defineCodeBlockSpec(): Extension< {
349
- Nodes: "codeBlock";
387
+ Nodes: {
388
+ codeBlock: {
389
+ language: string;
390
+ };
391
+ };
350
392
  Marks: never;
351
393
  Commands: never;
352
394
  }>;
@@ -369,7 +411,9 @@ export declare function defineCodeKeymap(): Extension<ExtensionTyping<any, any,
369
411
  * @public
370
412
  */
371
413
  export declare function defineCodeSpec(): Extension< {
372
- Marks: "code";
414
+ Marks: {
415
+ code: Attrs;
416
+ };
373
417
  Nodes: never;
374
418
  Commands: never;
375
419
  }>;
@@ -382,11 +426,7 @@ export declare function defineCommitRecorder(commitRecorder: CommitRecorder): Ex
382
426
  /**
383
427
  * Define an extension to display the changes from the given commit in the editor.
384
428
  */
385
- export declare function defineCommitViewer(commit: Commit): Extension< {
386
- Nodes: never;
387
- Marks: never;
388
- Commands: never;
389
- }>;
429
+ export declare function defineCommitViewer(commit: Commit): UnionExtension<readonly [Extension<ExtensionTyping<any, any, any>>, Extension<ExtensionTyping<any, any, any>>]>;
390
430
 
391
431
  /**
392
432
  * Show up a decoration at the drop position when something is dragged over the editor.
@@ -407,17 +447,41 @@ export declare function defineDropCursor(options?: DropCursorOptions): Extension
407
447
  export declare function defineEnterRule({ regex, handler, stop, }: EnterRuleOptions): Extension;
408
448
 
409
449
  /**
450
+ * Capture clicks near and arrow-key-motion past places that don't have a
451
+ * normally selectable position nearby, and create a gap cursor selection for
452
+ * them. The cursor is drawn as an element with class `ProseMirror-gapcursor`.
453
+ *
454
+ * You can either include `prosekit/extensions/gap-cursor.css` or add your own
455
+ * styles to make it visible.
456
+ *
457
+ * See
458
+ * [prosemirror-gapcursor](https://github.com/ProseMirror/prosemirror-gapcursor)
459
+ * for more information.
460
+ *
410
461
  * @public
411
462
  */
412
- export declare function defineHeading(): Extension< {
413
- Nodes: "heading";
463
+ export declare function defineGapCursor(): Extension<ExtensionTyping<any, any, any>>;
464
+
465
+ /**
466
+ * @public
467
+ */
468
+ export declare function defineHeading(): UnionExtension<readonly [Extension< {
469
+ Nodes: {
470
+ heading: {
471
+ level: number;
472
+ };
473
+ };
414
474
  Marks: never;
475
+ Commands: never;
476
+ }>, Extension<ExtensionTyping<any, any, any>>, Extension<ExtensionTyping<any, any, any>>, Extension< {
415
477
  Commands: {
416
478
  setHeading: [attrs?: HeadingAttrs | undefined];
417
479
  insertHeading: [attrs?: HeadingAttrs | undefined];
418
480
  toggleHeading: [attrs?: HeadingAttrs | undefined];
419
481
  };
420
- }>;
482
+ Nodes: never;
483
+ Marks: never;
484
+ }>]>;
421
485
 
422
486
  declare function defineHeadingCommands(): Extension< {
423
487
  Commands: {
@@ -444,7 +508,11 @@ export { defineHeadingKeymap }
444
508
  export { defineHeadingKeymap as defineHeadingKeymap_alias_1 }
445
509
 
446
510
  declare function defineHeadingSpec(): Extension< {
447
- Nodes: "heading";
511
+ Nodes: {
512
+ heading: {
513
+ level: number;
514
+ };
515
+ };
448
516
  Marks: never;
449
517
  Commands: never;
450
518
  }>;
@@ -454,13 +522,21 @@ export { defineHeadingSpec as defineHeadingSpec_alias_1 }
454
522
  /**
455
523
  * @public
456
524
  */
457
- export declare function defineImage(): Extension< {
458
- Nodes: "image";
525
+ export declare function defineImage(): UnionExtension<readonly [Extension< {
526
+ Nodes: {
527
+ image: {
528
+ src: null;
529
+ };
530
+ };
459
531
  Marks: never;
532
+ Commands: never;
533
+ }>, Extension< {
460
534
  Commands: {
461
535
  insertImage: [attrs?: ImageAttrs | undefined];
462
536
  };
463
- }>;
537
+ Nodes: never;
538
+ Marks: never;
539
+ }>]>;
464
540
 
465
541
  export declare function defineImageCommands(): Extension< {
466
542
  Commands: {
@@ -471,7 +547,11 @@ Marks: never;
471
547
  }>;
472
548
 
473
549
  export declare function defineImageSpec(): Extension< {
474
- Nodes: "image";
550
+ Nodes: {
551
+ image: {
552
+ src: null;
553
+ };
554
+ };
475
555
  Marks: never;
476
556
  Commands: never;
477
557
  }>;
@@ -488,13 +568,19 @@ export declare function defineInputRule(rule: InputRule): Extension;
488
568
  /**
489
569
  * @public
490
570
  */
491
- export declare function defineItalic(): Extension< {
571
+ export declare function defineItalic(): UnionExtension<readonly [Extension< {
572
+ Marks: {
573
+ italic: Attrs;
574
+ };
492
575
  Nodes: never;
493
- Marks: "italic";
576
+ Commands: never;
577
+ }>, Extension< {
494
578
  Commands: {
495
579
  toggleItalic: [];
496
580
  };
497
- }>;
581
+ Nodes: never;
582
+ Marks: never;
583
+ }>, Extension<ExtensionTyping<any, any, any>>, Extension<ExtensionTyping<any, any, any>>]>;
498
584
 
499
585
  export declare function defineItalicCommands(): Extension< {
500
586
  Commands: {
@@ -509,7 +595,9 @@ export declare function defineItalicInputRule(): Extension<ExtensionTyping<any,
509
595
  export declare function defineItalicKeymap(): Extension<ExtensionTyping<any, any, any>>;
510
596
 
511
597
  export declare function defineItalicSpec(): Extension< {
512
- Marks: "italic";
598
+ Marks: {
599
+ italic: Attrs;
600
+ };
513
601
  Nodes: never;
514
602
  Commands: never;
515
603
  }>;
@@ -517,16 +605,22 @@ Commands: never;
517
605
  /**
518
606
  * @public
519
607
  */
520
- export declare function defineLink(): Extension< {
608
+ export declare function defineLink(): UnionExtension<readonly [Extension< {
609
+ Marks: {
610
+ link: LinkAttrs;
611
+ };
521
612
  Nodes: never;
522
- Marks: "link";
613
+ Commands: never;
614
+ }>, Extension< {
523
615
  Commands: {
524
616
  addLink: [attrs: LinkAttrs];
525
617
  removeLink: [];
526
618
  toggleLink: [attrs: LinkAttrs];
527
619
  expandLink: [];
528
620
  };
529
- }>;
621
+ Nodes: never;
622
+ Marks: never;
623
+ }>, Extension<ExtensionTyping<any, any, any>>, Extension<ExtensionTyping<any, any, any>>]>;
530
624
 
531
625
  export declare function defineLinkCommands(): Extension< {
532
626
  Commands: {
@@ -555,7 +649,9 @@ export declare function defineLinkInputRule(): Extension<ExtensionTyping<any, an
555
649
  export declare function defineLinkMarkRule(): Extension<ExtensionTyping<any, any, any>>;
556
650
 
557
651
  export declare function defineLinkSpec(): Extension< {
558
- Marks: "link";
652
+ Marks: {
653
+ link: LinkAttrs;
654
+ };
559
655
  Nodes: never;
560
656
  Commands: never;
561
657
  }>;
@@ -563,24 +659,32 @@ Commands: never;
563
659
  /**
564
660
  * @public
565
661
  */
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
- }>;
662
+ export declare function defineList(): UnionExtension<readonly [Extension< {
663
+ Nodes: {
664
+ list: ListAttrs;
665
+ };
666
+ Marks: never;
667
+ Commands: never;
668
+ }>, Extension<ExtensionTyping<any, any, any>>, Extension<ExtensionTyping<any, any, any>>, Extension<ExtensionTyping<any, any, any>>, Extension< {
669
+ Commands: {
670
+ dedentList: [options?: DedentListOptions | undefined];
671
+ indentList: [options?: IndentListOptions | undefined];
672
+ moveList: [direction: "up" | "down"];
673
+ splitList: [];
674
+ toggleCollapsed: [(ToggleCollapsedOptions | undefined)?];
675
+ toggleList: [attrs: ListAttributes];
676
+ unwrapList: [options?: UnwrapListOptions | undefined];
677
+ wrapInList: [getAttrs: WrapInListGetAttrs<ListAttributes>];
678
+ insertList: [attrs?: ListAttributes | undefined];
679
+ };
680
+ Nodes: never;
681
+ Marks: never;
682
+ }>]>;
581
683
 
582
684
  /**
583
- * Defines list commands
685
+ * Defines list commands.
686
+ *
687
+ * @internal
584
688
  */
585
689
  declare function defineListCommands(): Extension< {
586
690
  Commands: {
@@ -600,24 +704,41 @@ Marks: never;
600
704
  export { defineListCommands }
601
705
  export { defineListCommands as defineListCommands_alias_1 }
602
706
 
603
- export declare function defineListInputRules(): Extension;
707
+ /**
708
+ * @internal
709
+ */
710
+ declare function defineListInputRules(): Extension;
711
+ export { defineListInputRules }
712
+ export { defineListInputRules as defineListInputRules_alias_1 }
604
713
 
605
714
  /**
606
715
  * Returns a extension that adds key bindings for list.
607
716
  *
608
- * @public
717
+ * @internal
609
718
  */
610
719
  declare function defineListKeymap(): Extension<ExtensionTyping<any, any, any>>;
611
720
  export { defineListKeymap }
612
721
  export { defineListKeymap as defineListKeymap_alias_1 }
613
722
 
614
- export declare function defineListPlugins(): Extension<ExtensionTyping<any, any, any>>;
723
+ /**
724
+ * @internal
725
+ */
726
+ declare function defineListPlugins(): Extension<ExtensionTyping<any, any, any>>;
727
+ export { defineListPlugins }
728
+ export { defineListPlugins as defineListPlugins_alias_1 }
615
729
 
616
- export declare function defineListSpec(): Extension<{
617
- Nodes: "list";
618
- Marks: never;
619
- Commands: never;
730
+ /**
731
+ * @internal
732
+ */
733
+ declare function defineListSpec(): Extension< {
734
+ Nodes: {
735
+ list: ListAttrs;
736
+ };
737
+ Marks: never;
738
+ Commands: never;
620
739
  }>;
740
+ export { defineListSpec }
741
+ export { defineListSpec as defineListSpec_alias_1 }
621
742
 
622
743
  /**
623
744
  * Defines an input rule for automatically adding inline marks when a given
@@ -638,13 +759,19 @@ export { defineMarkRule as defineMarkRule_alias_1 }
638
759
  /**
639
760
  * @public
640
761
  */
641
- export declare function defineMention(): Extension< {
642
- Nodes: "mention";
762
+ export declare function defineMention(): UnionExtension<readonly [Extension< {
763
+ Nodes: {
764
+ mention: MentionAttrs;
765
+ };
643
766
  Marks: never;
767
+ Commands: never;
768
+ }>, Extension< {
644
769
  Commands: {
645
770
  insertMention: [attrs: MentionAttrs];
646
771
  };
647
- }>;
772
+ Nodes: never;
773
+ Marks: never;
774
+ }>]>;
648
775
 
649
776
  export declare function defineMentionCommands(): Extension< {
650
777
  Commands: {
@@ -658,7 +785,9 @@ Marks: never;
658
785
  * @public
659
786
  */
660
787
  export declare function defineMentionSpec(): Extension< {
661
- Nodes: "mention";
788
+ Nodes: {
789
+ mention: MentionAttrs;
790
+ };
662
791
  Marks: never;
663
792
  Commands: never;
664
793
  }>;
@@ -712,13 +841,19 @@ export declare function defineSearchQuery(options: SearchQueryOptions): Extensio
712
841
  /**
713
842
  * @public
714
843
  */
715
- export declare function defineStrike(): Extension< {
844
+ export declare function defineStrike(): UnionExtension<readonly [Extension< {
845
+ Marks: {
846
+ strike: Attrs;
847
+ };
716
848
  Nodes: never;
717
- Marks: "strike";
849
+ Commands: never;
850
+ }>, Extension< {
718
851
  Commands: {
719
852
  toggleStrike: [];
720
853
  };
721
- }>;
854
+ Nodes: never;
855
+ Marks: never;
856
+ }>, Extension<ExtensionTyping<any, any, any>>, Extension<ExtensionTyping<any, any, any>>]>;
722
857
 
723
858
  export declare function defineStrikeCommands(): Extension< {
724
859
  Commands: {
@@ -733,7 +868,9 @@ export declare function defineStrikeInputRule(): Extension<ExtensionTyping<any,
733
868
  export declare function defineStrikeKeymap(): Extension<ExtensionTyping<any, any, any>>;
734
869
 
735
870
  export declare function defineStrikeSpec(): Extension< {
736
- Marks: "strike";
871
+ Marks: {
872
+ strike: Attrs;
873
+ };
737
874
  Nodes: never;
738
875
  Commands: never;
739
876
  }>;
@@ -741,9 +878,35 @@ Commands: never;
741
878
  /**
742
879
  * @public
743
880
  */
744
- export declare function defineTable(): Extension< {
745
- Nodes: "table" | "tableRow" | "tableCell" | "tableHeaderCell";
881
+ export declare function defineTable(): UnionExtension<readonly [Extension< {
882
+ Nodes: {
883
+ table: Attrs;
884
+ };
746
885
  Marks: never;
886
+ Commands: never;
887
+ }>, Extension< {
888
+ Nodes: {
889
+ tableRow: Attrs;
890
+ };
891
+ Marks: never;
892
+ Commands: never;
893
+ }>, Extension< {
894
+ Nodes: {
895
+ tableCell: {
896
+ [x: string]: any;
897
+ };
898
+ };
899
+ Marks: never;
900
+ Commands: never;
901
+ }>, Extension< {
902
+ Nodes: {
903
+ tableHeaderCell: {
904
+ [x: string]: any;
905
+ };
906
+ };
907
+ Marks: never;
908
+ Commands: never;
909
+ }>, Extension<ExtensionTyping<any, any, any>>, Extension< {
747
910
  Commands: {
748
911
  insertTable: [{
749
912
  row: number;
@@ -752,10 +915,16 @@ header: boolean;
752
915
  }];
753
916
  exitTable: [];
754
917
  };
755
- }>;
918
+ Nodes: never;
919
+ Marks: never;
920
+ }>]>;
756
921
 
757
922
  declare function defineTableCellSpec(): Extension< {
758
- Nodes: "tableCell";
923
+ Nodes: {
924
+ tableCell: {
925
+ [x: string]: any;
926
+ };
927
+ };
759
928
  Marks: never;
760
929
  Commands: never;
761
930
  }>;
@@ -783,7 +952,11 @@ export { defineTableCommands }
783
952
  export { defineTableCommands as defineTableCommands_alias_1 }
784
953
 
785
954
  declare function defineTableHeaderCellSpec(): Extension< {
786
- Nodes: "tableHeaderCell";
955
+ Nodes: {
956
+ tableHeaderCell: {
957
+ [x: string]: any;
958
+ };
959
+ };
787
960
  Marks: never;
788
961
  Commands: never;
789
962
  }>;
@@ -798,7 +971,9 @@ export { defineTablePlugins }
798
971
  export { defineTablePlugins as defineTablePlugins_alias_1 }
799
972
 
800
973
  declare function defineTableRowSpec(): Extension< {
801
- Nodes: "tableRow";
974
+ Nodes: {
975
+ tableRow: Attrs_2;
976
+ };
802
977
  Marks: never;
803
978
  Commands: never;
804
979
  }>;
@@ -806,7 +981,9 @@ export { defineTableRowSpec }
806
981
  export { defineTableRowSpec as defineTableRowSpec_alias_1 }
807
982
 
808
983
  declare function defineTableSpec(): Extension< {
809
- Nodes: "table";
984
+ Nodes: {
985
+ table: Attrs_2;
986
+ };
810
987
  Marks: never;
811
988
  Commands: never;
812
989
  }>;
@@ -816,57 +993,222 @@ export { defineTableSpec as defineTableSpec_alias_1 }
816
993
  /**
817
994
  * @internal
818
995
  */
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
- }>;
996
+ export declare function defineTestExtension(): UnionExtension<readonly [Extension<{
997
+ Nodes: {
998
+ doc: Attrs;
999
+ };
1000
+ Marks: never;
1001
+ Commands: never;
1002
+ }>, Extension<{
1003
+ Nodes: {
1004
+ text: Attrs;
1005
+ };
1006
+ Marks: never;
1007
+ Commands: never;
1008
+ }>, UnionExtension<readonly [Extension<{
1009
+ Nodes: {
1010
+ heading: {
1011
+ level: number;
1012
+ };
1013
+ };
1014
+ Marks: never;
1015
+ Commands: never;
1016
+ }>, Extension<ExtensionTyping<any, any, any>>, Extension<ExtensionTyping<any, any, any>>, Extension<{
1017
+ Commands: {
1018
+ setHeading: [attrs?: HeadingAttrs | undefined];
1019
+ insertHeading: [attrs?: HeadingAttrs | undefined];
1020
+ toggleHeading: [attrs?: HeadingAttrs | undefined];
1021
+ };
1022
+ Nodes: never;
1023
+ Marks: never;
1024
+ }>]>, UnionExtension<readonly [Extension<ExtensionTyping<any, any, any>>, Extension<ExtensionTyping<any, any, any>>, Extension<{
1025
+ Commands: {
1026
+ readonly undo: [];
1027
+ readonly redo: [];
1028
+ };
1029
+ Nodes: never;
1030
+ Marks: never;
1031
+ }>]>, UnionExtension<readonly [Extension<{
1032
+ Nodes: {
1033
+ list: ListAttrs;
1034
+ };
1035
+ Marks: never;
1036
+ Commands: never;
1037
+ }>, Extension<ExtensionTyping<any, any, any>>, Extension<ExtensionTyping<any, any, any>>, Extension<ExtensionTyping<any, any, any>>, Extension<{
1038
+ Commands: {
1039
+ dedentList: [options?: DedentListOptions | undefined];
1040
+ indentList: [options?: IndentListOptions | undefined];
1041
+ moveList: [direction: "up" | "down"];
1042
+ splitList: [];
1043
+ toggleCollapsed: [(ToggleCollapsedOptions | undefined)?];
1044
+ toggleList: [attrs: ListAttributes];
1045
+ unwrapList: [options?: UnwrapListOptions | undefined];
1046
+ wrapInList: [getAttrs: WrapInListGetAttrs<ListAttributes>];
1047
+ insertList: [attrs?: ListAttributes | undefined];
1048
+ };
1049
+ Nodes: never;
1050
+ Marks: never;
1051
+ }>]>, UnionExtension<readonly [Extension<{
1052
+ Nodes: {
1053
+ blockquote: Attrs;
1054
+ };
1055
+ Marks: never;
1056
+ Commands: never;
1057
+ }>, Extension<ExtensionTyping<any, any, any>>]>, Extension<ExtensionTyping<any, any, any>>, Extension<{
1058
+ Commands: {
1059
+ insertText: [{
1060
+ text: string;
1061
+ from?: number;
1062
+ to?: number;
1063
+ }];
1064
+ insertNode: [options: InsertNodeOptions];
1065
+ removeNode: [options: RemoveNodeOptions];
1066
+ wrap: [WrapOptions];
1067
+ setBlockType: [options: SetBlockTypeOptions];
1068
+ setNodeAttrs: [options: SetNodeAttrsOptions];
1069
+ selectAll: [];
1070
+ addMark: [options: AddMarkOptions];
1071
+ removeMark: [options: RemoveMarkOptions];
1072
+ unsetBlockType: [options?: UnsetBlockTypeOptions | undefined];
1073
+ unsetMark: [options?: UnsetMarkOptions | undefined];
1074
+ };
1075
+ Nodes: never;
1076
+ Marks: never;
1077
+ }>, UnionExtension<readonly [Extension<{
1078
+ Marks: {
1079
+ italic: Attrs;
1080
+ };
1081
+ Nodes: never;
1082
+ Commands: never;
1083
+ }>, Extension<{
1084
+ Commands: {
1085
+ toggleItalic: [];
1086
+ };
1087
+ Nodes: never;
1088
+ Marks: never;
1089
+ }>, Extension<ExtensionTyping<any, any, any>>, Extension<ExtensionTyping<any, any, any>>]>, UnionExtension<readonly [Extension<{
1090
+ Marks: {
1091
+ bold: Attrs;
1092
+ };
1093
+ Nodes: never;
1094
+ Commands: never;
1095
+ }>, Extension<{
1096
+ Commands: {
1097
+ toggleBold: [];
1098
+ };
1099
+ Nodes: never;
1100
+ Marks: never;
1101
+ }>, Extension<ExtensionTyping<any, any, any>>, Extension<ExtensionTyping<any, any, any>>]>, UnionExtension<readonly [Extension<{
1102
+ Marks: {
1103
+ underline: Attrs;
1104
+ };
1105
+ Nodes: never;
1106
+ Commands: never;
1107
+ }>, Extension<{
1108
+ Commands: {
1109
+ toggleUnderline: [];
1110
+ };
1111
+ Nodes: never;
1112
+ Marks: never;
1113
+ }>, Extension<ExtensionTyping<any, any, any>>]>, UnionExtension<readonly [Extension<{
1114
+ Marks: {
1115
+ strike: Attrs;
1116
+ };
1117
+ Nodes: never;
1118
+ Commands: never;
1119
+ }>, Extension<{
1120
+ Commands: {
1121
+ toggleStrike: [];
1122
+ };
1123
+ Nodes: never;
1124
+ Marks: never;
1125
+ }>, Extension<ExtensionTyping<any, any, any>>, Extension<ExtensionTyping<any, any, any>>]>, UnionExtension<readonly [Extension<{
1126
+ Marks: {
1127
+ code: Attrs;
1128
+ };
1129
+ Nodes: never;
1130
+ Commands: never;
1131
+ }>, Extension<{
1132
+ Commands: {
1133
+ toggleCode: [];
1134
+ };
1135
+ Nodes: never;
1136
+ Marks: never;
1137
+ }>, Extension<ExtensionTyping<any, any, any>>, Extension<ExtensionTyping<any, any, any>>]>, UnionExtension<readonly [Extension<{
1138
+ Marks: {
1139
+ link: LinkAttrs;
1140
+ };
1141
+ Nodes: never;
1142
+ Commands: never;
1143
+ }>, Extension<{
1144
+ Commands: {
1145
+ addLink: [attrs: LinkAttrs];
1146
+ removeLink: [];
1147
+ toggleLink: [attrs: LinkAttrs];
1148
+ expandLink: [];
1149
+ };
1150
+ Nodes: never;
1151
+ Marks: never;
1152
+ }>, Extension<ExtensionTyping<any, any, any>>, Extension<ExtensionTyping<any, any, any>>]>, UnionExtension<readonly [Extension<{
1153
+ Nodes: {
1154
+ image: {
1155
+ src: null;
1156
+ };
1157
+ };
1158
+ Marks: never;
1159
+ Commands: never;
1160
+ }>, Extension<{
1161
+ Commands: {
1162
+ insertImage: [attrs?: ImageAttrs | undefined];
1163
+ };
1164
+ Nodes: never;
1165
+ Marks: never;
1166
+ }>]>, Extension<{
1167
+ Nodes: {
1168
+ paragraph: Attrs;
1169
+ };
1170
+ Marks: never;
1171
+ Commands: never;
1172
+ }>, UnionExtension<readonly [Extension<{
1173
+ Nodes: {
1174
+ table: Attrs;
1175
+ };
1176
+ Marks: never;
1177
+ Commands: never;
1178
+ }>, Extension<{
1179
+ Nodes: {
1180
+ tableRow: Attrs;
1181
+ };
1182
+ Marks: never;
1183
+ Commands: never;
1184
+ }>, Extension<{
1185
+ Nodes: {
1186
+ tableCell: {
1187
+ [x: string]: any;
1188
+ };
1189
+ };
1190
+ Marks: never;
1191
+ Commands: never;
1192
+ }>, Extension<{
1193
+ Nodes: {
1194
+ tableHeaderCell: {
1195
+ [x: string]: any;
1196
+ };
1197
+ };
1198
+ Marks: never;
1199
+ Commands: never;
1200
+ }>, Extension<ExtensionTyping<any, any, any>>, Extension<{
1201
+ Commands: {
1202
+ insertTable: [{
1203
+ row: number;
1204
+ col: number;
1205
+ header: boolean;
1206
+ }];
1207
+ exitTable: [];
1208
+ };
1209
+ Nodes: never;
1210
+ Marks: never;
1211
+ }>]>]>;
870
1212
 
871
1213
  /**
872
1214
  * Adds a `textAlign` attribute to the specified nodes. This will be rendered as
@@ -874,23 +1216,23 @@ export declare function defineTestExtension(): Extension<{
874
1216
  *
875
1217
  * @public
876
1218
  */
877
- export declare function defineTextAlign(options: TextAlignOptions): Extension<{
878
- Nodes: never;
879
- Marks: never;
880
- Commands: {
881
- setTextAlign: [value: string | null];
1219
+ export declare function defineTextAlign<NodeName extends string = string>(options: TextAlignOptions<NodeName>): Extension<{
1220
+ Nodes: {
1221
+ [K in NodeName]: {
1222
+ textAlign: string | null;
1223
+ };
882
1224
  };
1225
+ Marks: never;
1226
+ Commands: TextAlignCommandTyping;
883
1227
  }>;
884
1228
 
885
1229
  /**
886
1230
  * @internal
887
1231
  */
888
1232
  export declare function defineTextAlignCommands(types: string[]): Extension<{
889
- Commands: {
890
- setTextAlign: [value: string | null];
891
- };
892
1233
  Nodes: never;
893
1234
  Marks: never;
1235
+ Commands: TextAlignCommandTyping;
894
1236
  }>;
895
1237
 
896
1238
  /**
@@ -929,19 +1271,25 @@ export declare function defineTextBlockInputRule({ regex, type, attrs, }: {
929
1271
  /**
930
1272
  * Attributes to set on the node.
931
1273
  */
932
- attrs?: Attrs | null | ((match: RegExpMatchArray) => Attrs | null);
1274
+ attrs?: Attrs_2 | null | ((match: RegExpMatchArray) => Attrs_2 | null);
933
1275
  }): Extension;
934
1276
 
935
1277
  /**
936
1278
  * @public
937
1279
  */
938
- export declare function defineUnderline(): Extension< {
1280
+ export declare function defineUnderline(): UnionExtension<readonly [Extension< {
1281
+ Marks: {
1282
+ underline: Attrs;
1283
+ };
939
1284
  Nodes: never;
940
- Marks: "underline";
1285
+ Commands: never;
1286
+ }>, Extension< {
941
1287
  Commands: {
942
1288
  toggleUnderline: [];
943
1289
  };
944
- }>;
1290
+ Nodes: never;
1291
+ Marks: never;
1292
+ }>, Extension<ExtensionTyping<any, any, any>>]>;
945
1293
 
946
1294
  export declare function defineUnderlineCommands(): Extension< {
947
1295
  Commands: {
@@ -954,7 +1302,9 @@ Marks: never;
954
1302
  export declare function defineUnderlineKeymap(): Extension<ExtensionTyping<any, any, any>>;
955
1303
 
956
1304
  export declare function defineUnderlineSpec(): Extension< {
957
- Marks: "underline";
1305
+ Marks: {
1306
+ underline: Attrs;
1307
+ };
958
1308
  Nodes: never;
959
1309
  Commands: never;
960
1310
  }>;
@@ -993,7 +1343,7 @@ export declare function defineWrappingInputRule({ regex, type, attrs, join, }: {
993
1343
  /**
994
1344
  * Attributes to set on the node.
995
1345
  */
996
- attrs?: Attrs | null | ((match: RegExpMatchArray) => Attrs | null);
1346
+ attrs?: Attrs_2 | null | ((match: RegExpMatchArray) => Attrs_2 | null);
997
1347
  /**
998
1348
  * By default, if there's a node with the same type above the newly wrapped
999
1349
  * node, the rule will try to
@@ -1076,6 +1426,8 @@ export declare type EnterRuleOptions = {
1076
1426
  */
1077
1427
  export declare const exitTable: Command;
1078
1428
 
1429
+ export { GapCursor }
1430
+
1079
1431
  export declare function getCheckRanges(transactions: readonly Transaction[], oldState: EditorState, newState: EditorState): Array<[number, number]>;
1080
1432
 
1081
1433
  export declare function getPluginState(state: EditorState): PredictionPluginState | undefined;
@@ -1144,7 +1496,31 @@ export declare interface LinkAttrs {
1144
1496
  href: string;
1145
1497
  }
1146
1498
 
1147
- export { ListAttributes }
1499
+ /**
1500
+ * The attributes of a list node.
1501
+ *
1502
+ * @public
1503
+ */
1504
+ declare interface ListAttrs {
1505
+ /**
1506
+ * The kind of list node.
1507
+ */
1508
+ kind?: 'bullet' | 'ordered' | 'task' | 'toggle';
1509
+ /**
1510
+ * The optional order of the list node.
1511
+ */
1512
+ order?: number | null;
1513
+ /**
1514
+ * Whether the list node is checked if its `kind` is `"task"`.
1515
+ */
1516
+ checked?: boolean;
1517
+ /**
1518
+ * Whether the list node is collapsed if its `kind` is `"toggle"`.
1519
+ */
1520
+ collapsed?: boolean;
1521
+ }
1522
+ export { ListAttrs }
1523
+ export { ListAttrs as ListAttrs_alias_1 }
1148
1524
 
1149
1525
  export { ListDOMSerializer }
1150
1526
 
@@ -1167,7 +1543,7 @@ export declare interface MarkInputRuleOptions {
1167
1543
  /**
1168
1544
  * Attributes to set on the mark.
1169
1545
  */
1170
- attrs?: Attrs | null | ((match: RegExpMatchArray) => Attrs | null);
1546
+ attrs?: Attrs_2 | null | ((match: RegExpMatchArray) => Attrs_2 | null);
1171
1547
  }
1172
1548
 
1173
1549
  /**
@@ -1191,7 +1567,7 @@ declare interface MarkRuleOptions {
1191
1567
  *
1192
1568
  * @default null
1193
1569
  */
1194
- attrs?: Attrs | null | ((match: RegExpMatchArray) => Attrs | null);
1570
+ attrs?: Attrs_2 | null | ((match: RegExpMatchArray) => Attrs_2 | null);
1195
1571
  }
1196
1572
  export { MarkRuleOptions }
1197
1573
  export { MarkRuleOptions as MarkRuleOptions_alias_1 }
@@ -1209,8 +1585,8 @@ export { MatchHandler as MatchHandler_alias_1 }
1209
1585
 
1210
1586
  export declare interface MentionAttrs {
1211
1587
  id: string;
1212
- kind: string;
1213
1588
  value: string;
1589
+ kind: string;
1214
1590
  }
1215
1591
 
1216
1592
  export declare interface PlaceholderOptions {
@@ -1311,59 +1687,295 @@ export declare function setTrMeta(tr: Transaction, meta: PredictionPluginState):
1311
1687
  * @internal
1312
1688
  */
1313
1689
  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
- };
1690
+ editor: TestEditor<UnionExtension<readonly [Extension<{
1691
+ Nodes: {
1692
+ doc: Attrs;
1693
+ };
1694
+ Marks: never;
1695
+ Commands: never;
1696
+ }>, Extension<{
1697
+ Nodes: {
1698
+ text: Attrs;
1699
+ };
1700
+ Marks: never;
1701
+ Commands: never;
1702
+ }>, UnionExtension<readonly [Extension<{
1703
+ Nodes: {
1704
+ heading: {
1705
+ level: number;
1706
+ };
1707
+ };
1708
+ Marks: never;
1709
+ Commands: never;
1710
+ }>, Extension<ExtensionTyping<any, any, any>>, Extension<ExtensionTyping<any, any, any>>, Extension<{
1711
+ Commands: {
1712
+ setHeading: [attrs?: HeadingAttrs | undefined];
1713
+ insertHeading: [attrs?: HeadingAttrs | undefined];
1714
+ toggleHeading: [attrs?: HeadingAttrs | undefined];
1715
+ };
1716
+ Nodes: never;
1717
+ Marks: never;
1718
+ }>]>, UnionExtension<readonly [Extension<ExtensionTyping<any, any, any>>, Extension<ExtensionTyping<any, any, any>>, Extension<{
1719
+ Commands: {
1720
+ readonly undo: [];
1721
+ readonly redo: [];
1722
+ };
1723
+ Nodes: never;
1724
+ Marks: never;
1725
+ }>]>, UnionExtension<readonly [Extension<{
1726
+ Nodes: {
1727
+ list: ListAttrs;
1728
+ };
1729
+ Marks: never;
1730
+ Commands: never;
1731
+ }>, Extension<ExtensionTyping<any, any, any>>, Extension<ExtensionTyping<any, any, any>>, Extension<ExtensionTyping<any, any, any>>, Extension<{
1732
+ Commands: {
1733
+ dedentList: [options?: DedentListOptions | undefined];
1734
+ indentList: [options?: IndentListOptions | undefined];
1735
+ moveList: [direction: "up" | "down"];
1736
+ splitList: [];
1737
+ toggleCollapsed: [(ToggleCollapsedOptions | undefined)?];
1738
+ toggleList: [attrs: ListAttributes];
1739
+ unwrapList: [options?: UnwrapListOptions | undefined];
1740
+ wrapInList: [getAttrs: WrapInListGetAttrs<ListAttributes>];
1741
+ insertList: [attrs?: ListAttributes | undefined];
1742
+ };
1743
+ Nodes: never;
1744
+ Marks: never;
1745
+ }>]>, UnionExtension<readonly [Extension<{
1746
+ Nodes: {
1747
+ blockquote: Attrs;
1748
+ };
1749
+ Marks: never;
1750
+ Commands: never;
1751
+ }>, Extension<ExtensionTyping<any, any, any>>]>, Extension<ExtensionTyping<any, any, any>>, Extension<{
1752
+ Commands: {
1753
+ insertText: [{
1754
+ text: string;
1755
+ from?: number;
1756
+ to?: number;
1757
+ }];
1758
+ insertNode: [options: InsertNodeOptions];
1759
+ removeNode: [options: RemoveNodeOptions];
1760
+ wrap: [WrapOptions];
1761
+ setBlockType: [options: SetBlockTypeOptions];
1762
+ setNodeAttrs: [options: SetNodeAttrsOptions];
1763
+ selectAll: [];
1764
+ addMark: [options: AddMarkOptions];
1765
+ removeMark: [options: RemoveMarkOptions];
1766
+ unsetBlockType: [options?: UnsetBlockTypeOptions | undefined];
1767
+ unsetMark: [options?: UnsetMarkOptions | undefined];
1768
+ };
1769
+ Nodes: never;
1770
+ Marks: never;
1771
+ }>, UnionExtension<readonly [Extension<{
1772
+ Marks: {
1773
+ italic: Attrs;
1774
+ };
1775
+ Nodes: never;
1776
+ Commands: never;
1777
+ }>, Extension<{
1778
+ Commands: {
1779
+ toggleItalic: [];
1780
+ };
1781
+ Nodes: never;
1782
+ Marks: never;
1783
+ }>, Extension<ExtensionTyping<any, any, any>>, Extension<ExtensionTyping<any, any, any>>]>, UnionExtension<readonly [Extension<{
1784
+ Marks: {
1785
+ bold: Attrs;
1786
+ };
1787
+ Nodes: never;
1788
+ Commands: never;
1789
+ }>, Extension<{
1790
+ Commands: {
1791
+ toggleBold: [];
1792
+ };
1793
+ Nodes: never;
1794
+ Marks: never;
1795
+ }>, Extension<ExtensionTyping<any, any, any>>, Extension<ExtensionTyping<any, any, any>>]>, UnionExtension<readonly [Extension<{
1796
+ Marks: {
1797
+ underline: Attrs;
1798
+ };
1799
+ Nodes: never;
1800
+ Commands: never;
1801
+ }>, Extension<{
1802
+ Commands: {
1803
+ toggleUnderline: [];
1804
+ };
1805
+ Nodes: never;
1806
+ Marks: never;
1807
+ }>, Extension<ExtensionTyping<any, any, any>>]>, UnionExtension<readonly [Extension<{
1808
+ Marks: {
1809
+ strike: Attrs;
1810
+ };
1811
+ Nodes: never;
1812
+ Commands: never;
1813
+ }>, Extension<{
1814
+ Commands: {
1815
+ toggleStrike: [];
1816
+ };
1817
+ Nodes: never;
1818
+ Marks: never;
1819
+ }>, Extension<ExtensionTyping<any, any, any>>, Extension<ExtensionTyping<any, any, any>>]>, UnionExtension<readonly [Extension<{
1820
+ Marks: {
1821
+ code: Attrs;
1822
+ };
1823
+ Nodes: never;
1824
+ Commands: never;
1825
+ }>, Extension<{
1826
+ Commands: {
1827
+ toggleCode: [];
1828
+ };
1829
+ Nodes: never;
1830
+ Marks: never;
1831
+ }>, Extension<ExtensionTyping<any, any, any>>, Extension<ExtensionTyping<any, any, any>>]>, UnionExtension<readonly [Extension<{
1832
+ Marks: {
1833
+ link: LinkAttrs;
1834
+ };
1835
+ Nodes: never;
1836
+ Commands: never;
1837
+ }>, Extension<{
1838
+ Commands: {
1839
+ addLink: [attrs: LinkAttrs];
1840
+ removeLink: [];
1841
+ toggleLink: [attrs: LinkAttrs];
1842
+ expandLink: [];
1843
+ };
1844
+ Nodes: never;
1845
+ Marks: never;
1846
+ }>, Extension<ExtensionTyping<any, any, any>>, Extension<ExtensionTyping<any, any, any>>]>, UnionExtension<readonly [Extension<{
1847
+ Nodes: {
1848
+ image: {
1849
+ src: null;
1850
+ };
1851
+ };
1852
+ Marks: never;
1853
+ Commands: never;
1854
+ }>, Extension<{
1855
+ Commands: {
1856
+ insertImage: [attrs?: ImageAttrs | undefined];
1857
+ };
1858
+ Nodes: never;
1859
+ Marks: never;
1860
+ }>]>, Extension<{
1861
+ Nodes: {
1862
+ paragraph: Attrs;
1863
+ };
1864
+ Marks: never;
1865
+ Commands: never;
1866
+ }>, UnionExtension<readonly [Extension<{
1867
+ Nodes: {
1868
+ table: Attrs;
1869
+ };
1870
+ Marks: never;
1871
+ Commands: never;
1872
+ }>, Extension<{
1873
+ Nodes: {
1874
+ tableRow: Attrs;
1875
+ };
1876
+ Marks: never;
1877
+ Commands: never;
1878
+ }>, Extension<{
1879
+ Nodes: {
1880
+ tableCell: {
1881
+ [x: string]: any;
1882
+ };
1883
+ };
1884
+ Marks: never;
1885
+ Commands: never;
1886
+ }>, Extension<{
1887
+ Nodes: {
1888
+ tableHeaderCell: {
1889
+ [x: string]: any;
1890
+ };
1891
+ };
1892
+ Marks: never;
1893
+ Commands: never;
1894
+ }>, Extension<ExtensionTyping<any, any, any>>, Extension<{
1895
+ Commands: {
1896
+ insertTable: [{
1897
+ row: number;
1898
+ col: number;
1899
+ header: boolean;
1900
+ }];
1901
+ exitTable: [];
1902
+ };
1903
+ Nodes: never;
1904
+ Marks: never;
1905
+ }>]>]>>;
1906
+ m: ToMarkAction<SimplifyDeeper< {
1907
+ underline: {
1908
+ readonly [x: string]: any;
1909
+ };
1910
+ strike: {
1911
+ readonly [x: string]: any;
1912
+ };
1913
+ link: {
1914
+ href: string;
1915
+ };
1916
+ italic: {
1917
+ readonly [x: string]: any;
1918
+ };
1919
+ code: {
1920
+ readonly [x: string]: any;
1921
+ };
1922
+ bold: {
1923
+ readonly [x: string]: any;
1924
+ };
1364
1925
  }>>;
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>;
1926
+ n: {
1927
+ p: NodeAction< {
1928
+ readonly [x: string]: any;
1929
+ }>;
1930
+ h1: (...children: NodeChild[]) => Node_2;
1931
+ h2: (...children: NodeChild[]) => Node_2;
1932
+ h3: (...children: NodeChild[]) => Node_2;
1933
+ h4: (...children: NodeChild[]) => Node_2;
1934
+ h5: (...children: NodeChild[]) => Node_2;
1935
+ h6: (...children: NodeChild[]) => Node_2;
1936
+ bullet: (...children: NodeChild[]) => Node_2;
1937
+ ordered: (...children: NodeChild[]) => Node_2;
1938
+ checked: (...children: NodeChild[]) => Node_2;
1939
+ unchecked: (...children: NodeChild[]) => Node_2;
1940
+ collapsed: (...children: NodeChild[]) => Node_2;
1941
+ expanded: (...children: NodeChild[]) => Node_2;
1942
+ paragraph: NodeAction< {
1943
+ readonly [x: string]: any;
1944
+ }>;
1945
+ tableHeaderCell: NodeAction< {
1946
+ [x: string]: any;
1947
+ }>;
1948
+ tableCell: NodeAction< {
1949
+ [x: string]: any;
1950
+ }>;
1951
+ tableRow: NodeAction< {
1952
+ readonly [x: string]: any;
1953
+ }>;
1954
+ table: NodeAction< {
1955
+ readonly [x: string]: any;
1956
+ }>;
1957
+ list: NodeAction< {
1958
+ kind?: "bullet" | "ordered" | "task" | "toggle";
1959
+ order?: number | null;
1960
+ checked?: boolean;
1961
+ collapsed?: boolean;
1962
+ }>;
1963
+ image: NodeAction< {
1964
+ src: null;
1965
+ }>;
1966
+ heading: NodeAction< {
1967
+ level: number;
1968
+ }>;
1969
+ blockquote: NodeAction< {
1970
+ readonly [x: string]: any;
1971
+ }>;
1972
+ text: NodeAction< {
1973
+ readonly [x: string]: any;
1974
+ }>;
1975
+ doc: NodeAction< {
1976
+ readonly [x: string]: any;
1977
+ }>;
1978
+ };
1367
1979
  };
1368
1980
 
1369
1981
  /**
@@ -1371,11 +1983,18 @@ export declare function setupTest(): {
1371
1983
  */
1372
1984
  export declare function setupTestFromExtension<E extends Extension>(extension: E): {
1373
1985
  editor: TestEditor<E>;
1374
- n: Record<ExtractNodes<E>, NodeBuilder>;
1375
- m: Record<ExtractMarks<E>, MarkBuilder>;
1986
+ n: ExtractNodeActions<E>;
1987
+ m: ExtractMarkActions<E>;
1376
1988
  };
1377
1989
 
1378
- export declare interface TextAlignOptions {
1990
+ /**
1991
+ * @internal
1992
+ */
1993
+ export declare type TextAlignCommandTyping = {
1994
+ setTextAlign: [value: string | null];
1995
+ };
1996
+
1997
+ export declare interface TextAlignOptions<NodeName extends string = string> {
1379
1998
  /**
1380
1999
  * The names of node to add the attribute to.
1381
2000
  *
@@ -1383,7 +2002,7 @@ export declare interface TextAlignOptions {
1383
2002
  *
1384
2003
  * ["paragraph", "heading"]
1385
2004
  */
1386
- types: string[];
2005
+ types: NodeName[];
1387
2006
  /**
1388
2007
  * The default value for the attribute.
1389
2008
  *
@@ -1410,7 +2029,7 @@ export declare type TextBlockEnterRuleOptions = {
1410
2029
  * Attributes to set on the node. If a function is provided, it will be called
1411
2030
  * with the matched result from the regular expression.
1412
2031
  */
1413
- attrs?: Attrs | null | ((match: RegExpMatchArray) => Attrs | null);
2032
+ attrs?: Attrs_2 | null | ((match: RegExpMatchArray) => Attrs_2 | null);
1414
2033
  /**
1415
2034
  * Whether to stop further handlers from being called if this rule is triggered.
1416
2035
  *