@prosekit/extensions 0.7.24 → 0.9.0

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