@prosekit/extensions 0.0.0-next-20240621205958 → 0.0.0-next-20240626133927

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,4 +1,5 @@
1
1
  import { Attrs } from '@prosekit/pm/model';
2
+ import { Attrs as Attrs_2 } from 'prosemirror-model';
2
3
  import { BundledLanguage } from 'shiki';
3
4
  import { BundledLanguageInfo } from 'shiki';
4
5
  import { bundledLanguagesInfo } from 'shiki';
@@ -7,23 +8,33 @@ import { BundledThemeInfo } from 'shiki';
7
8
  import { bundledThemesInfo } from 'shiki';
8
9
  import { Command } from '@prosekit/pm/state';
9
10
  import { DedentListOptions } from 'prosemirror-flat-list';
11
+ import { config as default_alias_1 } from '@prosekit/dev/config-vitest';
10
12
  import { EditorState } from '@prosekit/pm/state';
11
13
  import { Extension } from '@prosekit/core';
14
+ import { ExtensionTyping } from '@prosekit/core';
15
+ import { ExtractMarks } from '@prosekit/core';
16
+ import { ExtractNodes } from '@prosekit/core';
12
17
  import { getSingletonHighlighter } from 'shiki/bundle/full';
13
18
  import type { Highlighter } from 'shiki';
14
19
  import { IndentListOptions } from 'prosemirror-flat-list';
15
20
  import { InputRule } from '@prosekit/pm/inputrules';
16
21
  import { ListAttributes } from 'prosemirror-flat-list';
17
22
  import { ListDOMSerializer } from 'prosemirror-flat-list';
23
+ import { MarkBuilder } from '@prosekit/core';
18
24
  import { MarkType } from '@prosekit/pm/model';
25
+ import { MarkType as MarkType_2 } from 'prosemirror-model';
26
+ import { Node as Node_2 } from 'prosemirror-model';
27
+ import { NodeBuilder } from '@prosekit/core';
19
28
  import { NodeRange } from 'prosemirror-model';
20
29
  import { NodeType } from '@prosekit/pm/model';
30
+ import { NodeType as NodeType_2 } from 'prosemirror-model';
21
31
  import { Options } from 'tsup';
22
32
  import { Parser } from 'prosemirror-highlight';
23
33
  import { Plugin as Plugin_2 } from '@prosekit/pm/state';
24
34
  import { PluginKey } from '@prosekit/pm/state';
25
35
  import { ProseMirrorNode } from '@prosekit/pm/model';
26
36
  import type { SpecialLanguage } from 'shiki';
37
+ import { TestEditor } from '@prosekit/core/test';
27
38
  import { ToggleCollapsedOptions } from 'prosemirror-flat-list';
28
39
  import { Transaction } from '@prosekit/pm/state';
29
40
  import { UnwrapListOptions } from 'prosemirror-flat-list';
@@ -125,11 +136,7 @@ export declare function createMarkInputRule({ regex, type, attrs, }: MarkInputRu
125
136
 
126
137
  export declare const default_alias: Options | Options[] | ((overrideOptions: Options) => Options | Options[] | Promise<Options | Options[]>);
127
138
 
128
- export declare const default_alias_1: {
129
- test: {
130
- environment: "jsdom";
131
- };
132
- };
139
+ export { default_alias_1 }
133
140
 
134
141
  export declare function defaultCanMatch({ state }: {
135
142
  state: EditorState;
@@ -141,18 +148,16 @@ export declare function defineAutocomplete(rule: AutocompleteRule): Extension;
141
148
  * @public
142
149
  */
143
150
  export declare function defineBlockquote(): Extension< {
144
- Nodes: any;
145
- Marks: any;
146
- Commands: {
147
- [x: string]: any;
148
- };
151
+ Nodes: "blockquote";
152
+ Marks: never;
153
+ Commands: never;
149
154
  }>;
150
155
 
151
156
  /**
152
157
  * Wraps the text block in a blockquote when `>` is typed at the start of a new
153
158
  * line followed by a space.
154
159
  */
155
- export declare function defineBlockquoteInputRule(): Extension<any>;
160
+ export declare function defineBlockquoteInputRule(): Extension<ExtensionTyping<any, any, any>>;
156
161
 
157
162
  export declare function defineBlockquoteSpec(): Extension< {
158
163
  Nodes: "blockquote";
@@ -164,10 +169,10 @@ Commands: never;
164
169
  * @public
165
170
  */
166
171
  export declare function defineBold(): Extension< {
167
- Nodes: any;
168
- Marks: any;
172
+ Nodes: never;
173
+ Marks: "bold";
169
174
  Commands: {
170
- [x: string]: any;
175
+ toggleBold: [];
171
176
  };
172
177
  }>;
173
178
 
@@ -179,9 +184,9 @@ Nodes: never;
179
184
  Marks: never;
180
185
  }>;
181
186
 
182
- export declare function defineBoldInputRule(): Extension<any>;
187
+ export declare function defineBoldInputRule(): Extension<ExtensionTyping<any, any, any>>;
183
188
 
184
- export declare function defineBoldKeymap(): Extension<any>;
189
+ export declare function defineBoldKeymap(): Extension<ExtensionTyping<any, any, any>>;
185
190
 
186
191
  export declare function defineBoldSpec(): Extension< {
187
192
  Marks: "bold";
@@ -193,10 +198,10 @@ Commands: never;
193
198
  * @public
194
199
  */
195
200
  export declare function defineCode(): Extension< {
196
- Nodes: any;
197
- Marks: any;
201
+ Nodes: never;
202
+ Marks: "code";
198
203
  Commands: {
199
- [x: string]: any;
204
+ toggleCode: [];
200
205
  };
201
206
  }>;
202
207
 
@@ -212,10 +217,13 @@ Commands: {
212
217
  * @public
213
218
  */
214
219
  declare function defineCodeBlock(): Extension< {
215
- Nodes: any;
216
- Marks: any;
220
+ Nodes: "codeBlock";
221
+ Marks: never;
217
222
  Commands: {
218
- [x: string]: any;
223
+ setCodeBlock: [attrs?: CodeBlockAttrs | undefined];
224
+ insertCodeBlock: [attrs?: CodeBlockAttrs | undefined];
225
+ toggleCodeBlock: [attrs?: CodeBlockAttrs | undefined];
226
+ setCodeBlockAttrs: [attrs: CodeBlockAttrs];
219
227
  };
220
228
  }>;
221
229
  export { defineCodeBlock }
@@ -244,7 +252,7 @@ export { defineCodeBlockCommands as defineCodeBlockCommands_alias_1 }
244
252
  *
245
253
  * @public
246
254
  */
247
- declare function defineCodeBlockEnterRule(): Extension<any>;
255
+ declare function defineCodeBlockEnterRule(): Extension<ExtensionTyping<any, any, any>>;
248
256
  export { defineCodeBlockEnterRule }
249
257
  export { defineCodeBlockEnterRule as defineCodeBlockEnterRule_alias_1 }
250
258
 
@@ -267,14 +275,14 @@ export { defineCodeBlockHighlight as defineCodeBlockHighlight_alias_1 }
267
275
  *
268
276
  * @public
269
277
  */
270
- declare function defineCodeBlockInputRule(): Extension<any>;
278
+ declare function defineCodeBlockInputRule(): Extension<ExtensionTyping<any, any, any>>;
271
279
  export { defineCodeBlockInputRule }
272
280
  export { defineCodeBlockInputRule as defineCodeBlockInputRule_alias_1 }
273
281
 
274
282
  /**
275
283
  * Defines the keymap for code blocks.
276
284
  */
277
- export declare function defineCodeBlockKeymap(): Extension<any>;
285
+ export declare function defineCodeBlockKeymap(): Extension<ExtensionTyping<any, any, any>>;
278
286
 
279
287
  /**
280
288
  * Adds syntax highlighting to code blocks using the [shiki](https://github.com/shikijs/shiki) package.
@@ -306,9 +314,9 @@ Nodes: never;
306
314
  Marks: never;
307
315
  }>;
308
316
 
309
- export declare function defineCodeInputRule(): Extension<any>;
317
+ export declare function defineCodeInputRule(): Extension<ExtensionTyping<any, any, any>>;
310
318
 
311
- export declare function defineCodeKeymap(): Extension<any>;
319
+ export declare function defineCodeKeymap(): Extension<ExtensionTyping<any, any, any>>;
312
320
 
313
321
  /**
314
322
  * @public
@@ -326,7 +334,7 @@ Commands: never;
326
334
  *
327
335
  * @public
328
336
  */
329
- export declare function defineDropCursor(options?: DropCursorOptions): Extension<any>;
337
+ export declare function defineDropCursor(options?: DropCursorOptions): Extension<ExtensionTyping<any, any, any>>;
330
338
 
331
339
  /**
332
340
  * Defines an enter rule. An enter rule applies when the text directly in front of
@@ -341,10 +349,12 @@ export declare function defineEnterRule({ regex, handler, stop, }: EnterRuleOpti
341
349
  * @public
342
350
  */
343
351
  export declare function defineHeading(): Extension< {
344
- Nodes: any;
345
- Marks: any;
352
+ Nodes: "heading";
353
+ Marks: never;
346
354
  Commands: {
347
- [x: string]: any;
355
+ setHeading: [attrs?: HeadingAttrs | undefined];
356
+ insertHeading: [attrs?: HeadingAttrs | undefined];
357
+ toggleHeading: [attrs?: HeadingAttrs | undefined];
348
358
  };
349
359
  }>;
350
360
 
@@ -362,9 +372,9 @@ Marks: never;
362
372
  * Converts the text block to a heading when `#` is typed at the start of a new
363
373
  * line followed by a space.
364
374
  */
365
- export declare function defineHeadingInputRule(): Extension<any>;
375
+ export declare function defineHeadingInputRule(): Extension<ExtensionTyping<any, any, any>>;
366
376
 
367
- export declare function defineHeadingKeymap(): Extension<any>;
377
+ export declare function defineHeadingKeymap(): Extension<ExtensionTyping<any, any, any>>;
368
378
 
369
379
  export declare function defineHeadingSpec(): Extension< {
370
380
  Nodes: "heading";
@@ -410,10 +420,10 @@ export declare function defineInputRule(rule: InputRule): Extension;
410
420
  * @public
411
421
  */
412
422
  export declare function defineItalic(): Extension< {
413
- Nodes: any;
414
- Marks: any;
423
+ Nodes: never;
424
+ Marks: "italic";
415
425
  Commands: {
416
- [x: string]: any;
426
+ toggleItalic: [];
417
427
  };
418
428
  }>;
419
429
 
@@ -425,9 +435,9 @@ Nodes: never;
425
435
  Marks: never;
426
436
  }>;
427
437
 
428
- export declare function defineItalicInputRule(): Extension<any>;
438
+ export declare function defineItalicInputRule(): Extension<ExtensionTyping<any, any, any>>;
429
439
 
430
- export declare function defineItalicKeymap(): Extension<any>;
440
+ export declare function defineItalicKeymap(): Extension<ExtensionTyping<any, any, any>>;
431
441
 
432
442
  export declare function defineItalicSpec(): Extension< {
433
443
  Marks: "italic";
@@ -439,10 +449,13 @@ Commands: never;
439
449
  * @public
440
450
  */
441
451
  export declare function defineLink(): Extension< {
442
- Nodes: any;
443
- Marks: any;
452
+ Nodes: never;
453
+ Marks: "link";
444
454
  Commands: {
445
- [x: string]: any;
455
+ addLink: [attrs: LinkAttrs];
456
+ removeLink: [];
457
+ toggleLink: [attrs: LinkAttrs];
458
+ expandLink: [];
446
459
  };
447
460
  }>;
448
461
 
@@ -460,17 +473,17 @@ Marks: never;
460
473
  /**
461
474
  * Apply link marks after typing Enter.
462
475
  */
463
- export declare function defineLinkEnterRule(): Extension<any>;
476
+ export declare function defineLinkEnterRule(): Extension<ExtensionTyping<any, any, any>>;
464
477
 
465
478
  /**
466
479
  * Apply link marks after pressing Space.
467
480
  */
468
- export declare function defineLinkInputRule(): Extension<any>;
481
+ export declare function defineLinkInputRule(): Extension<ExtensionTyping<any, any, any>>;
469
482
 
470
483
  /**
471
484
  * Apply and remove link marks to the text during typing.
472
485
  */
473
- export declare function defineLinkMarkRule(): Extension<any>;
486
+ export declare function defineLinkMarkRule(): Extension<ExtensionTyping<any, any, any>>;
474
487
 
475
488
  export declare function defineLinkSpec(): Extension< {
476
489
  Marks: "link";
@@ -482,10 +495,18 @@ Commands: never;
482
495
  * @public
483
496
  */
484
497
  export declare function defineList(): Extension<{
485
- Nodes: any;
486
- Marks: any;
498
+ Nodes: "list";
499
+ Marks: never;
487
500
  Commands: {
488
- [x: string]: any;
501
+ dedentList: [options?: DedentListOptions | undefined];
502
+ indentList: [options?: IndentListOptions | undefined];
503
+ moveList: [direction: "up" | "down"];
504
+ splitList: [];
505
+ toggleCollapsed: [(ToggleCollapsedOptions | undefined)?];
506
+ toggleList: [attrs: ListAttributes];
507
+ unwrapList: [options?: UnwrapListOptions | undefined];
508
+ wrapInList: [getAttrs: ListAttributes | ((range: NodeRange) => ListAttributes | null)];
509
+ insertList: [attrs?: ListAttributes | undefined];
489
510
  };
490
511
  }>;
491
512
 
@@ -512,9 +533,9 @@ export declare function defineListInputRules(): Extension;
512
533
  *
513
534
  * @public
514
535
  */
515
- export declare function defineListKeymap(): Extension<any>;
536
+ export declare function defineListKeymap(): Extension<ExtensionTyping<any, any, any>>;
516
537
 
517
- export declare function defineListPlugins(): Extension<any>;
538
+ export declare function defineListPlugins(): Extension<ExtensionTyping<any, any, any>>;
518
539
 
519
540
  export declare function defineListSpec(): Extension<{
520
541
  Nodes: "list";
@@ -534,7 +555,7 @@ export declare function defineMarkInputRule(options: MarkInputRuleOptions): Exte
534
555
  * A mark rule is something that can automatically apply marks to text if it
535
556
  * matches a certain pattern, and remove them if it doesn't match anymore.
536
557
  */
537
- declare function defineMarkRule(options: MarkRuleOptions): Extension<any>;
558
+ declare function defineMarkRule(options: MarkRuleOptions): Extension<ExtensionTyping<any, any, any>>;
538
559
  export { defineMarkRule }
539
560
  export { defineMarkRule as defineMarkRule_alias_1 }
540
561
 
@@ -578,12 +599,12 @@ export declare function defineModClickPrevention(): Extension;
578
599
  * Add a placeholder text to the editor when the current block or document is
579
600
  * empty.
580
601
  */
581
- export declare function definePlaceholder(options: PlaceholderOptions): Extension<any>;
602
+ export declare function definePlaceholder(options: PlaceholderOptions): Extension<ExtensionTyping<any, any, any>>;
582
603
 
583
604
  /**
584
605
  * Make the editor read-only.
585
606
  */
586
- export declare function defineReadonly(): Extension<any>;
607
+ export declare function defineReadonly(): Extension<ExtensionTyping<any, any, any>>;
587
608
 
588
609
  /**
589
610
  * Defines commands for search and replace.
@@ -610,16 +631,16 @@ Marks: never;
610
631
  *
611
632
  * @public
612
633
  */
613
- export declare function defineSearchQuery(options: SearchQueryOptions): Extension<any>;
634
+ export declare function defineSearchQuery(options: SearchQueryOptions): Extension<ExtensionTyping<any, any, any>>;
614
635
 
615
636
  /**
616
637
  * @public
617
638
  */
618
639
  export declare function defineStrike(): Extension< {
619
- Nodes: any;
620
- Marks: any;
640
+ Nodes: never;
641
+ Marks: "strike";
621
642
  Commands: {
622
- [x: string]: any;
643
+ toggleStrike: [];
623
644
  };
624
645
  }>;
625
646
 
@@ -631,9 +652,9 @@ Nodes: never;
631
652
  Marks: never;
632
653
  }>;
633
654
 
634
- export declare function defineStrikeInputRule(): Extension<any>;
655
+ export declare function defineStrikeInputRule(): Extension<ExtensionTyping<any, any, any>>;
635
656
 
636
- export declare function defineStrikeKeymap(): Extension<any>;
657
+ export declare function defineStrikeKeymap(): Extension<ExtensionTyping<any, any, any>>;
637
658
 
638
659
  export declare function defineStrikeSpec(): Extension< {
639
660
  Marks: "strike";
@@ -645,10 +666,15 @@ Commands: never;
645
666
  * @public
646
667
  */
647
668
  export declare function defineTable(): Extension< {
648
- Nodes: any;
649
- Marks: any;
669
+ Nodes: "table" | "tableRow" | "tableCell" | "tableHeaderCell";
670
+ Marks: never;
650
671
  Commands: {
651
- [x: string]: any;
672
+ insertTable: [{
673
+ row: number;
674
+ col: number;
675
+ header: boolean;
676
+ }];
677
+ exitTable: [];
652
678
  };
653
679
  }>;
654
680
 
@@ -691,7 +717,7 @@ export { defineTableHeaderCellSpec as defineTableHeaderCellSpec_alias_1 }
691
717
  /**
692
718
  * @public
693
719
  */
694
- declare function defineTablePlugins(): Extension<any>;
720
+ declare function defineTablePlugins(): Extension<ExtensionTyping<any, any, any>>;
695
721
  export { defineTablePlugins }
696
722
  export { defineTablePlugins as defineTablePlugins_alias_1 }
697
723
 
@@ -711,6 +737,94 @@ Commands: never;
711
737
  export { defineTableSpec }
712
738
  export { defineTableSpec as defineTableSpec_alias_1 }
713
739
 
740
+ /**
741
+ * @internal
742
+ */
743
+ export declare function defineTestExtension(): Extension<{
744
+ Nodes: "blockquote" | "table" | "text" | "doc" | "paragraph" | "heading" | "image" | "list" | "tableRow" | "tableCell" | "tableHeaderCell";
745
+ Marks: "code" | "link" | "bold" | "strike" | "italic" | "underline";
746
+ Commands: {
747
+ insertText: [{
748
+ text: string;
749
+ from?: number;
750
+ to?: number;
751
+ }];
752
+ insertNode: [options: {
753
+ node: Node_2;
754
+ pos?: number;
755
+ type?: undefined;
756
+ attrs?: undefined;
757
+ } | {
758
+ node?: undefined;
759
+ pos?: number;
760
+ type: string;
761
+ attrs?: Attrs_2;
762
+ }];
763
+ removeNode: [options: {
764
+ type: string | NodeType_2;
765
+ pos?: number;
766
+ }];
767
+ wrap: [{
768
+ nodeType: NodeType_2;
769
+ attrs?: Attrs_2 | null;
770
+ }];
771
+ setBlockType: [options: {
772
+ type: NodeType_2 | string;
773
+ attrs?: Attrs_2 | null;
774
+ from?: number;
775
+ to?: number;
776
+ }];
777
+ setNodeAttrs: [options: {
778
+ type: string | NodeType_2 | string[] | NodeType_2[];
779
+ attrs: Attrs_2;
780
+ pos?: number;
781
+ }];
782
+ selectAll: [];
783
+ addMark: [options: {
784
+ type: string | MarkType_2;
785
+ attrs?: Attrs_2 | null;
786
+ from?: number;
787
+ to?: number;
788
+ }];
789
+ removeMark: [options: {
790
+ type: string | MarkType_2;
791
+ attrs?: Attrs_2 | null;
792
+ from?: number;
793
+ to?: number;
794
+ }];
795
+ toggleItalic: [];
796
+ undo: [];
797
+ redo: [];
798
+ toggleBold: [];
799
+ toggleCode: [];
800
+ setHeading: [attrs?: HeadingAttrs | undefined];
801
+ insertHeading: [attrs?: HeadingAttrs | undefined];
802
+ toggleHeading: [attrs?: HeadingAttrs | undefined];
803
+ insertImage: [attrs?: ImageAttrs | undefined];
804
+ addLink: [attrs: LinkAttrs];
805
+ removeLink: [];
806
+ toggleLink: [attrs: LinkAttrs];
807
+ expandLink: [];
808
+ dedentList: [options?: DedentListOptions | undefined];
809
+ indentList: [options?: IndentListOptions | undefined];
810
+ moveList: [direction: "up" | "down"];
811
+ splitList: [];
812
+ toggleCollapsed: [(ToggleCollapsedOptions | undefined)?];
813
+ toggleList: [attrs: ListAttributes];
814
+ unwrapList: [options?: UnwrapListOptions | undefined];
815
+ wrapInList: [getAttrs: ListAttributes | ((range: NodeRange) => ListAttributes | null)];
816
+ insertList: [attrs?: ListAttributes | undefined];
817
+ toggleStrike: [];
818
+ insertTable: [{
819
+ row: number;
820
+ col: number;
821
+ header: boolean;
822
+ }];
823
+ exitTable: [];
824
+ toggleUnderline: [];
825
+ };
826
+ }>;
827
+
714
828
  /**
715
829
  * Adds a `textAlign` attribute to the specified nodes. This will be rendered as
716
830
  * a CSS `text-align` style.
@@ -718,10 +832,10 @@ export { defineTableSpec as defineTableSpec_alias_1 }
718
832
  * @public
719
833
  */
720
834
  export declare function defineTextAlign(options: TextAlignOptions): Extension<{
721
- Nodes: any;
722
- Marks: any;
835
+ Nodes: never;
836
+ Marks: never;
723
837
  Commands: {
724
- [x: string]: any;
838
+ setTextAlign: [value: string | null];
725
839
  };
726
840
  }>;
727
841
 
@@ -739,7 +853,7 @@ export declare function defineTextAlignCommands(types: string[]): Extension<{
739
853
  /**
740
854
  * @internal
741
855
  */
742
- export declare function defineTextAlignKeymap(types: string[]): Extension<any>;
856
+ export declare function defineTextAlignKeymap(types: string[]): Extension<ExtensionTyping<any, any, any>>;
743
857
 
744
858
  /**
745
859
  * Defines an enter rule that replaces the matched text with a block node.
@@ -779,10 +893,10 @@ export declare function defineTextBlockInputRule({ regex, type, attrs, }: {
779
893
  * @public
780
894
  */
781
895
  export declare function defineUnderline(): Extension< {
782
- Nodes: any;
783
- Marks: any;
896
+ Nodes: never;
897
+ Marks: "underline";
784
898
  Commands: {
785
- [x: string]: any;
899
+ toggleUnderline: [];
786
900
  };
787
901
  }>;
788
902
 
@@ -794,7 +908,7 @@ Nodes: never;
794
908
  Marks: never;
795
909
  }>;
796
910
 
797
- export declare function defineUnderlineKeymap(): Extension<any>;
911
+ export declare function defineUnderlineKeymap(): Extension<ExtensionTyping<any, any, any>>;
798
912
 
799
913
  export declare function defineUnderlineSpec(): Extension< {
800
914
  Marks: "underline";
@@ -1132,6 +1246,107 @@ export declare function setTextAlign({ types, value, }: {
1132
1246
 
1133
1247
  export declare function setTrMeta(tr: Transaction, meta: PredictionPluginState): Transaction;
1134
1248
 
1249
+ /**
1250
+ * @internal
1251
+ */
1252
+ export declare function setupDefaultTest(): {
1253
+ editor: TestEditor<Extension<{
1254
+ Nodes: "blockquote" | "table" | "text" | "doc" | "paragraph" | "heading" | "image" | "list" | "tableRow" | "tableCell" | "tableHeaderCell";
1255
+ Marks: "code" | "link" | "bold" | "strike" | "italic" | "underline";
1256
+ Commands: {
1257
+ insertText: [{
1258
+ text: string;
1259
+ from?: number;
1260
+ to?: number;
1261
+ }];
1262
+ insertNode: [options: {
1263
+ node: Node_2;
1264
+ pos?: number;
1265
+ type?: undefined;
1266
+ attrs?: undefined;
1267
+ } | {
1268
+ node?: undefined;
1269
+ pos?: number;
1270
+ type: string;
1271
+ attrs?: Attrs_2;
1272
+ }];
1273
+ removeNode: [options: {
1274
+ type: string | NodeType_2;
1275
+ pos?: number;
1276
+ }];
1277
+ wrap: [{
1278
+ nodeType: NodeType_2;
1279
+ attrs?: Attrs_2 | null;
1280
+ }];
1281
+ setBlockType: [options: {
1282
+ type: NodeType_2 | string;
1283
+ attrs?: Attrs_2 | null;
1284
+ from?: number;
1285
+ to?: number;
1286
+ }];
1287
+ setNodeAttrs: [options: {
1288
+ type: string | NodeType_2 | string[] | NodeType_2[];
1289
+ attrs: Attrs_2;
1290
+ pos?: number;
1291
+ }];
1292
+ selectAll: [];
1293
+ addMark: [options: {
1294
+ type: string | MarkType_2;
1295
+ attrs?: Attrs_2 | null;
1296
+ from?: number;
1297
+ to?: number;
1298
+ }];
1299
+ removeMark: [options: {
1300
+ type: string | MarkType_2;
1301
+ attrs?: Attrs_2 | null;
1302
+ from?: number;
1303
+ to?: number;
1304
+ }];
1305
+ toggleItalic: [];
1306
+ undo: [];
1307
+ redo: [];
1308
+ toggleBold: [];
1309
+ toggleCode: [];
1310
+ setHeading: [attrs?: HeadingAttrs | undefined];
1311
+ insertHeading: [attrs?: HeadingAttrs | undefined];
1312
+ toggleHeading: [attrs?: HeadingAttrs | undefined];
1313
+ insertImage: [attrs?: ImageAttrs | undefined];
1314
+ addLink: [attrs: LinkAttrs];
1315
+ removeLink: [];
1316
+ toggleLink: [attrs: LinkAttrs];
1317
+ expandLink: [];
1318
+ dedentList: [options?: DedentListOptions | undefined];
1319
+ indentList: [options?: IndentListOptions | undefined];
1320
+ moveList: [direction: "up" | "down"];
1321
+ splitList: [];
1322
+ toggleCollapsed: [(ToggleCollapsedOptions | undefined)?];
1323
+ toggleList: [attrs: ListAttributes];
1324
+ unwrapList: [options?: UnwrapListOptions | undefined];
1325
+ wrapInList: [getAttrs: ListAttributes | ((range: NodeRange) => ListAttributes | null)];
1326
+ insertList: [attrs?: ListAttributes | undefined];
1327
+ toggleStrike: [];
1328
+ insertTable: [{
1329
+ row: number;
1330
+ col: number;
1331
+ header: boolean;
1332
+ }];
1333
+ exitTable: [];
1334
+ toggleUnderline: [];
1335
+ };
1336
+ }>>;
1337
+ n: Record<"blockquote" | "table" | "text" | "doc" | "paragraph" | "heading" | "image" | "list" | "tableRow" | "tableCell" | "tableHeaderCell", NodeBuilder>;
1338
+ m: Record<"code" | "link" | "bold" | "strike" | "italic" | "underline", MarkBuilder>;
1339
+ };
1340
+
1341
+ /**
1342
+ * @internal
1343
+ */
1344
+ export declare function setupTest<E extends Extension>(extension: E): {
1345
+ editor: TestEditor<E>;
1346
+ n: Record<ExtractNodes<E>, NodeBuilder>;
1347
+ m: Record<ExtractMarks<E>, MarkBuilder>;
1348
+ };
1349
+
1135
1350
  export declare interface TextAlignOptions {
1136
1351
  /**
1137
1352
  * The names of node to add the attribute to.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@prosekit/extensions",
3
3
  "type": "module",
4
- "version": "0.0.0-next-20240621205958",
4
+ "version": "0.0.0-next-20240626133927",
5
5
  "private": false,
6
6
  "author": {
7
7
  "name": "ocavue",
@@ -176,13 +176,14 @@
176
176
  "prosemirror-search": "^0.1.0",
177
177
  "prosemirror-tables": "^1.3.7",
178
178
  "shiki": "^1.9.0",
179
- "@prosekit/core": "^0.0.0-next-20240621205958",
180
- "@prosekit/pm": "^0.0.0-next-20240621205958"
179
+ "@prosekit/pm": "^0.0.0-next-20240626133927",
180
+ "@prosekit/core": "^0.0.0-next-20240626133927"
181
181
  },
182
182
  "devDependencies": {
183
+ "@vitest/browser": "^2.0.0-beta.12",
183
184
  "tsup": "^8.1.0",
184
- "typescript": "^5.4.5",
185
- "vitest": "^1.6.0",
185
+ "typescript": "^5.5.2",
186
+ "vitest": "^2.0.0-beta.12",
186
187
  "@prosekit/dev": "0.0.0"
187
188
  },
188
189
  "scripts": {