@prosekit/extensions 0.8.0 → 0.9.1

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