@depup/prosemirror-markdown 1.13.4-depup.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.
@@ -0,0 +1,335 @@
1
+ import { Schema, Attrs, Node, Mark } from 'prosemirror-model';
2
+ import MarkdownIt from 'markdown-it';
3
+ import Token from 'markdown-it/lib/token.mjs';
4
+
5
+ /**
6
+ Document schema for the data model used by CommonMark.
7
+ */
8
+ declare const schema: Schema<"blockquote" | "image" | "text" | "paragraph" | "code_block" | "doc" | "horizontal_rule" | "heading" | "ordered_list" | "bullet_list" | "list_item" | "hard_break", "link" | "code" | "em" | "strong">;
9
+
10
+ /**
11
+ Object type used to specify how Markdown tokens should be parsed.
12
+ */
13
+ interface ParseSpec {
14
+ /**
15
+ This token maps to a single node, whose type can be looked up
16
+ in the schema under the given name. Exactly one of `node`,
17
+ `block`, or `mark` must be set.
18
+ */
19
+ node?: string;
20
+ /**
21
+ This token (unless `noCloseToken` is true) comes in `_open`
22
+ and `_close` variants (which are appended to the base token
23
+ name provides a the object property), and wraps a block of
24
+ content. The block should be wrapped in a node of the type
25
+ named to by the property's value. If the token does not have
26
+ `_open` or `_close`, use the `noCloseToken` option.
27
+ */
28
+ block?: string;
29
+ /**
30
+ This token (again, unless `noCloseToken` is true) also comes
31
+ in `_open` and `_close` variants, but should add a mark
32
+ (named by the value) to its content, rather than wrapping it
33
+ in a node.
34
+ */
35
+ mark?: string;
36
+ /**
37
+ Attributes for the node or mark. When `getAttrs` is provided,
38
+ it takes precedence.
39
+ */
40
+ attrs?: Attrs | null;
41
+ /**
42
+ A function used to compute the attributes for the node or mark
43
+ that takes a [markdown-it
44
+ token](https://markdown-it.github.io/markdown-it/#Token) and
45
+ returns an attribute object.
46
+ */
47
+ getAttrs?: (token: Token, tokenStream: Token[], index: number) => Attrs | null;
48
+ /**
49
+ Indicates that the [markdown-it
50
+ token](https://markdown-it.github.io/markdown-it/#Token) has
51
+ no `_open` or `_close` for the nodes. This defaults to `true`
52
+ for `code_inline`, `code_block` and `fence`.
53
+ */
54
+ noCloseToken?: boolean;
55
+ /**
56
+ When true, ignore content for the matched token.
57
+ */
58
+ ignore?: boolean;
59
+ }
60
+ /**
61
+ A configuration of a Markdown parser. Such a parser uses
62
+ [markdown-it](https://github.com/markdown-it/markdown-it) to
63
+ tokenize a file, and then runs the custom rules it is given over
64
+ the tokens to create a ProseMirror document tree.
65
+ */
66
+ declare class MarkdownParser {
67
+ /**
68
+ The parser's document schema.
69
+ */
70
+ readonly schema: Schema;
71
+ /**
72
+ This parser's markdown-it tokenizer.
73
+ */
74
+ readonly tokenizer: MarkdownIt;
75
+ /**
76
+ The value of the `tokens` object used to construct this
77
+ parser. Can be useful to copy and modify to base other parsers
78
+ on.
79
+ */
80
+ readonly tokens: {
81
+ [name: string]: ParseSpec;
82
+ };
83
+ /**
84
+ Create a parser with the given configuration. You can configure
85
+ the markdown-it parser to parse the dialect you want, and provide
86
+ a description of the ProseMirror entities those tokens map to in
87
+ the `tokens` object, which maps token names to descriptions of
88
+ what to do with them. Such a description is an object, and may
89
+ have the following properties:
90
+ */
91
+ constructor(
92
+ /**
93
+ The parser's document schema.
94
+ */
95
+ schema: Schema,
96
+ /**
97
+ This parser's markdown-it tokenizer.
98
+ */
99
+ tokenizer: MarkdownIt,
100
+ /**
101
+ The value of the `tokens` object used to construct this
102
+ parser. Can be useful to copy and modify to base other parsers
103
+ on.
104
+ */
105
+ tokens: {
106
+ [name: string]: ParseSpec;
107
+ });
108
+ /**
109
+ Parse a string as [CommonMark](http://commonmark.org/) markup,
110
+ and create a ProseMirror document as prescribed by this parser's
111
+ rules.
112
+
113
+ The second argument, when given, is passed through to the
114
+ [Markdown
115
+ parser](https://markdown-it.github.io/markdown-it/#MarkdownIt.parse).
116
+ */
117
+ parse(text: string, markdownEnv?: Object): Node;
118
+ }
119
+ /**
120
+ A parser parsing unextended [CommonMark](http://commonmark.org/),
121
+ without inline HTML, and producing a document in the basic schema.
122
+ */
123
+ declare const defaultMarkdownParser: MarkdownParser;
124
+
125
+ type MarkSerializerSpec = {
126
+ /**
127
+ The string that should appear before a piece of content marked
128
+ by this mark, either directly or as a function that returns an
129
+ appropriate string.
130
+ */
131
+ open: string | ((state: MarkdownSerializerState, mark: Mark, parent: Node, index: number) => string);
132
+ /**
133
+ The string that should appear after a piece of content marked by
134
+ this mark.
135
+ */
136
+ close: string | ((state: MarkdownSerializerState, mark: Mark, parent: Node, index: number) => string);
137
+ /**
138
+ When `true`, this indicates that the order in which the mark's
139
+ opening and closing syntax appears relative to other mixable
140
+ marks can be varied. (For example, you can say `**a *b***` and
141
+ `*a **b***`, but not `` `a *b*` ``.)
142
+ */
143
+ mixable?: boolean;
144
+ /**
145
+ When enabled, causes the serializer to move enclosing whitespace
146
+ from inside the marks to outside the marks. This is necessary
147
+ for emphasis marks as CommonMark does not permit enclosing
148
+ whitespace inside emphasis marks, see:
149
+ http:spec.commonmark.org/0.26/#example-330
150
+ */
151
+ expelEnclosingWhitespace?: boolean;
152
+ /**
153
+ Can be set to `false` to disable character escaping in a mark. A
154
+ non-escaping mark has to have the highest precedence (must
155
+ always be the innermost mark).
156
+ */
157
+ escape?: boolean;
158
+ };
159
+ /**
160
+ A specification for serializing a ProseMirror document as
161
+ Markdown/CommonMark text.
162
+ */
163
+ declare class MarkdownSerializer {
164
+ /**
165
+ The node serializer functions for this serializer.
166
+ */
167
+ readonly nodes: {
168
+ [node: string]: (state: MarkdownSerializerState, node: Node, parent: Node, index: number) => void;
169
+ };
170
+ /**
171
+ The mark serializer info.
172
+ */
173
+ readonly marks: {
174
+ [mark: string]: MarkSerializerSpec;
175
+ };
176
+ readonly options: {
177
+ /**
178
+ Extra characters can be added for escaping. This is passed
179
+ directly to String.replace(), and the matching characters are
180
+ preceded by a backslash.
181
+ */
182
+ escapeExtraCharacters?: RegExp;
183
+ /**
184
+ Specify the node name of hard breaks.
185
+ Defaults to "hard_break"
186
+ */
187
+ hardBreakNodeName?: string;
188
+ /**
189
+ By default, the serializer raises an error when it finds a
190
+ node or mark type for which no serializer is defined. Set
191
+ this to `false` to make it just ignore such elements,
192
+ rendering only their content.
193
+ */
194
+ strict?: boolean;
195
+ };
196
+ /**
197
+ Construct a serializer with the given configuration. The `nodes`
198
+ object should map node names in a given schema to function that
199
+ take a serializer state and such a node, and serialize the node.
200
+ */
201
+ constructor(
202
+ /**
203
+ The node serializer functions for this serializer.
204
+ */
205
+ nodes: {
206
+ [node: string]: (state: MarkdownSerializerState, node: Node, parent: Node, index: number) => void;
207
+ },
208
+ /**
209
+ The mark serializer info.
210
+ */
211
+ marks: {
212
+ [mark: string]: MarkSerializerSpec;
213
+ }, options?: {
214
+ /**
215
+ Extra characters can be added for escaping. This is passed
216
+ directly to String.replace(), and the matching characters are
217
+ preceded by a backslash.
218
+ */
219
+ escapeExtraCharacters?: RegExp;
220
+ /**
221
+ Specify the node name of hard breaks.
222
+ Defaults to "hard_break"
223
+ */
224
+ hardBreakNodeName?: string;
225
+ /**
226
+ By default, the serializer raises an error when it finds a
227
+ node or mark type for which no serializer is defined. Set
228
+ this to `false` to make it just ignore such elements,
229
+ rendering only their content.
230
+ */
231
+ strict?: boolean;
232
+ });
233
+ /**
234
+ Serialize the content of the given node to
235
+ [CommonMark](http://commonmark.org/).
236
+ */
237
+ serialize(content: Node, options?: {
238
+ /**
239
+ Whether to render lists in a tight style. This can be overridden
240
+ on a node level by specifying a tight attribute on the node.
241
+ Defaults to false.
242
+ */
243
+ tightLists?: boolean;
244
+ }): string;
245
+ }
246
+ /**
247
+ A serializer for the [basic schema](https://prosemirror.net/docs/ref/#schema).
248
+ */
249
+ declare const defaultMarkdownSerializer: MarkdownSerializer;
250
+ /**
251
+ This is an object used to track state and expose
252
+ methods related to markdown serialization. Instances are passed to
253
+ node and mark serialization methods (see `toMarkdown`).
254
+ */
255
+ declare class MarkdownSerializerState {
256
+ /**
257
+ The options passed to the serializer.
258
+ */
259
+ readonly options: {
260
+ tightLists?: boolean;
261
+ escapeExtraCharacters?: RegExp;
262
+ hardBreakNodeName?: string;
263
+ strict?: boolean;
264
+ };
265
+ /**
266
+ Render a block, prefixing each line with `delim`, and the first
267
+ line in `firstDelim`. `node` should be the node that is closed at
268
+ the end of the block, and `f` is a function that renders the
269
+ content of the block.
270
+ */
271
+ wrapBlock(delim: string, firstDelim: string | null, node: Node, f: () => void): void;
272
+ /**
273
+ Ensure the current content ends with a newline.
274
+ */
275
+ ensureNewLine(): void;
276
+ /**
277
+ Prepare the state for writing output (closing closed paragraphs,
278
+ adding delimiters, and so on), and then optionally add content
279
+ (unescaped) to the output.
280
+ */
281
+ write(content?: string): void;
282
+ /**
283
+ Close the block for the given node.
284
+ */
285
+ closeBlock(node: Node): void;
286
+ /**
287
+ Add the given text to the document. When escape is not `false`,
288
+ it will be escaped.
289
+ */
290
+ text(text: string, escape?: boolean): void;
291
+ /**
292
+ Render the given node as a block.
293
+ */
294
+ render(node: Node, parent: Node, index: number): void;
295
+ /**
296
+ Render the contents of `parent` as block nodes.
297
+ */
298
+ renderContent(parent: Node): void;
299
+ /**
300
+ Render the contents of `parent` as inline content.
301
+ */
302
+ renderInline(parent: Node, fromBlockStart?: boolean): void;
303
+ /**
304
+ Render a node's content as a list. `delim` should be the extra
305
+ indentation added to all lines except the first in an item,
306
+ `firstDelim` is a function going from an item index to a
307
+ delimiter for the first line of the item.
308
+ */
309
+ renderList(node: Node, delim: string, firstDelim: (index: number) => string): void;
310
+ /**
311
+ Escape the given string so that it can safely appear in Markdown
312
+ content. If `startOfLine` is true, also escape characters that
313
+ have special meaning only at the start of the line.
314
+ */
315
+ esc(str: string, startOfLine?: boolean): string;
316
+ /**
317
+ Repeat the given string `n` times.
318
+ */
319
+ repeat(str: string, n: number): string;
320
+ /**
321
+ Get the markdown string for a given opening or closing mark.
322
+ */
323
+ markString(mark: Mark, open: boolean, parent: Node, index: number): string;
324
+ /**
325
+ Get leading and trailing whitespace from a string. Values of
326
+ leading or trailing property of the return object will be undefined
327
+ if there is no match.
328
+ */
329
+ getEnclosingWhitespace(text: string): {
330
+ leading?: string;
331
+ trailing?: string;
332
+ };
333
+ }
334
+
335
+ export { MarkdownParser, MarkdownSerializer, MarkdownSerializerState, type ParseSpec, defaultMarkdownParser, defaultMarkdownSerializer, schema };
@@ -0,0 +1,335 @@
1
+ import { Schema, Attrs, Node, Mark } from 'prosemirror-model';
2
+ import MarkdownIt from 'markdown-it';
3
+ import Token from 'markdown-it/lib/token.mjs';
4
+
5
+ /**
6
+ Document schema for the data model used by CommonMark.
7
+ */
8
+ declare const schema: Schema<"blockquote" | "image" | "text" | "paragraph" | "code_block" | "doc" | "horizontal_rule" | "heading" | "ordered_list" | "bullet_list" | "list_item" | "hard_break", "link" | "code" | "em" | "strong">;
9
+
10
+ /**
11
+ Object type used to specify how Markdown tokens should be parsed.
12
+ */
13
+ interface ParseSpec {
14
+ /**
15
+ This token maps to a single node, whose type can be looked up
16
+ in the schema under the given name. Exactly one of `node`,
17
+ `block`, or `mark` must be set.
18
+ */
19
+ node?: string;
20
+ /**
21
+ This token (unless `noCloseToken` is true) comes in `_open`
22
+ and `_close` variants (which are appended to the base token
23
+ name provides a the object property), and wraps a block of
24
+ content. The block should be wrapped in a node of the type
25
+ named to by the property's value. If the token does not have
26
+ `_open` or `_close`, use the `noCloseToken` option.
27
+ */
28
+ block?: string;
29
+ /**
30
+ This token (again, unless `noCloseToken` is true) also comes
31
+ in `_open` and `_close` variants, but should add a mark
32
+ (named by the value) to its content, rather than wrapping it
33
+ in a node.
34
+ */
35
+ mark?: string;
36
+ /**
37
+ Attributes for the node or mark. When `getAttrs` is provided,
38
+ it takes precedence.
39
+ */
40
+ attrs?: Attrs | null;
41
+ /**
42
+ A function used to compute the attributes for the node or mark
43
+ that takes a [markdown-it
44
+ token](https://markdown-it.github.io/markdown-it/#Token) and
45
+ returns an attribute object.
46
+ */
47
+ getAttrs?: (token: Token, tokenStream: Token[], index: number) => Attrs | null;
48
+ /**
49
+ Indicates that the [markdown-it
50
+ token](https://markdown-it.github.io/markdown-it/#Token) has
51
+ no `_open` or `_close` for the nodes. This defaults to `true`
52
+ for `code_inline`, `code_block` and `fence`.
53
+ */
54
+ noCloseToken?: boolean;
55
+ /**
56
+ When true, ignore content for the matched token.
57
+ */
58
+ ignore?: boolean;
59
+ }
60
+ /**
61
+ A configuration of a Markdown parser. Such a parser uses
62
+ [markdown-it](https://github.com/markdown-it/markdown-it) to
63
+ tokenize a file, and then runs the custom rules it is given over
64
+ the tokens to create a ProseMirror document tree.
65
+ */
66
+ declare class MarkdownParser {
67
+ /**
68
+ The parser's document schema.
69
+ */
70
+ readonly schema: Schema;
71
+ /**
72
+ This parser's markdown-it tokenizer.
73
+ */
74
+ readonly tokenizer: MarkdownIt;
75
+ /**
76
+ The value of the `tokens` object used to construct this
77
+ parser. Can be useful to copy and modify to base other parsers
78
+ on.
79
+ */
80
+ readonly tokens: {
81
+ [name: string]: ParseSpec;
82
+ };
83
+ /**
84
+ Create a parser with the given configuration. You can configure
85
+ the markdown-it parser to parse the dialect you want, and provide
86
+ a description of the ProseMirror entities those tokens map to in
87
+ the `tokens` object, which maps token names to descriptions of
88
+ what to do with them. Such a description is an object, and may
89
+ have the following properties:
90
+ */
91
+ constructor(
92
+ /**
93
+ The parser's document schema.
94
+ */
95
+ schema: Schema,
96
+ /**
97
+ This parser's markdown-it tokenizer.
98
+ */
99
+ tokenizer: MarkdownIt,
100
+ /**
101
+ The value of the `tokens` object used to construct this
102
+ parser. Can be useful to copy and modify to base other parsers
103
+ on.
104
+ */
105
+ tokens: {
106
+ [name: string]: ParseSpec;
107
+ });
108
+ /**
109
+ Parse a string as [CommonMark](http://commonmark.org/) markup,
110
+ and create a ProseMirror document as prescribed by this parser's
111
+ rules.
112
+
113
+ The second argument, when given, is passed through to the
114
+ [Markdown
115
+ parser](https://markdown-it.github.io/markdown-it/#MarkdownIt.parse).
116
+ */
117
+ parse(text: string, markdownEnv?: Object): Node;
118
+ }
119
+ /**
120
+ A parser parsing unextended [CommonMark](http://commonmark.org/),
121
+ without inline HTML, and producing a document in the basic schema.
122
+ */
123
+ declare const defaultMarkdownParser: MarkdownParser;
124
+
125
+ type MarkSerializerSpec = {
126
+ /**
127
+ The string that should appear before a piece of content marked
128
+ by this mark, either directly or as a function that returns an
129
+ appropriate string.
130
+ */
131
+ open: string | ((state: MarkdownSerializerState, mark: Mark, parent: Node, index: number) => string);
132
+ /**
133
+ The string that should appear after a piece of content marked by
134
+ this mark.
135
+ */
136
+ close: string | ((state: MarkdownSerializerState, mark: Mark, parent: Node, index: number) => string);
137
+ /**
138
+ When `true`, this indicates that the order in which the mark's
139
+ opening and closing syntax appears relative to other mixable
140
+ marks can be varied. (For example, you can say `**a *b***` and
141
+ `*a **b***`, but not `` `a *b*` ``.)
142
+ */
143
+ mixable?: boolean;
144
+ /**
145
+ When enabled, causes the serializer to move enclosing whitespace
146
+ from inside the marks to outside the marks. This is necessary
147
+ for emphasis marks as CommonMark does not permit enclosing
148
+ whitespace inside emphasis marks, see:
149
+ http:spec.commonmark.org/0.26/#example-330
150
+ */
151
+ expelEnclosingWhitespace?: boolean;
152
+ /**
153
+ Can be set to `false` to disable character escaping in a mark. A
154
+ non-escaping mark has to have the highest precedence (must
155
+ always be the innermost mark).
156
+ */
157
+ escape?: boolean;
158
+ };
159
+ /**
160
+ A specification for serializing a ProseMirror document as
161
+ Markdown/CommonMark text.
162
+ */
163
+ declare class MarkdownSerializer {
164
+ /**
165
+ The node serializer functions for this serializer.
166
+ */
167
+ readonly nodes: {
168
+ [node: string]: (state: MarkdownSerializerState, node: Node, parent: Node, index: number) => void;
169
+ };
170
+ /**
171
+ The mark serializer info.
172
+ */
173
+ readonly marks: {
174
+ [mark: string]: MarkSerializerSpec;
175
+ };
176
+ readonly options: {
177
+ /**
178
+ Extra characters can be added for escaping. This is passed
179
+ directly to String.replace(), and the matching characters are
180
+ preceded by a backslash.
181
+ */
182
+ escapeExtraCharacters?: RegExp;
183
+ /**
184
+ Specify the node name of hard breaks.
185
+ Defaults to "hard_break"
186
+ */
187
+ hardBreakNodeName?: string;
188
+ /**
189
+ By default, the serializer raises an error when it finds a
190
+ node or mark type for which no serializer is defined. Set
191
+ this to `false` to make it just ignore such elements,
192
+ rendering only their content.
193
+ */
194
+ strict?: boolean;
195
+ };
196
+ /**
197
+ Construct a serializer with the given configuration. The `nodes`
198
+ object should map node names in a given schema to function that
199
+ take a serializer state and such a node, and serialize the node.
200
+ */
201
+ constructor(
202
+ /**
203
+ The node serializer functions for this serializer.
204
+ */
205
+ nodes: {
206
+ [node: string]: (state: MarkdownSerializerState, node: Node, parent: Node, index: number) => void;
207
+ },
208
+ /**
209
+ The mark serializer info.
210
+ */
211
+ marks: {
212
+ [mark: string]: MarkSerializerSpec;
213
+ }, options?: {
214
+ /**
215
+ Extra characters can be added for escaping. This is passed
216
+ directly to String.replace(), and the matching characters are
217
+ preceded by a backslash.
218
+ */
219
+ escapeExtraCharacters?: RegExp;
220
+ /**
221
+ Specify the node name of hard breaks.
222
+ Defaults to "hard_break"
223
+ */
224
+ hardBreakNodeName?: string;
225
+ /**
226
+ By default, the serializer raises an error when it finds a
227
+ node or mark type for which no serializer is defined. Set
228
+ this to `false` to make it just ignore such elements,
229
+ rendering only their content.
230
+ */
231
+ strict?: boolean;
232
+ });
233
+ /**
234
+ Serialize the content of the given node to
235
+ [CommonMark](http://commonmark.org/).
236
+ */
237
+ serialize(content: Node, options?: {
238
+ /**
239
+ Whether to render lists in a tight style. This can be overridden
240
+ on a node level by specifying a tight attribute on the node.
241
+ Defaults to false.
242
+ */
243
+ tightLists?: boolean;
244
+ }): string;
245
+ }
246
+ /**
247
+ A serializer for the [basic schema](https://prosemirror.net/docs/ref/#schema).
248
+ */
249
+ declare const defaultMarkdownSerializer: MarkdownSerializer;
250
+ /**
251
+ This is an object used to track state and expose
252
+ methods related to markdown serialization. Instances are passed to
253
+ node and mark serialization methods (see `toMarkdown`).
254
+ */
255
+ declare class MarkdownSerializerState {
256
+ /**
257
+ The options passed to the serializer.
258
+ */
259
+ readonly options: {
260
+ tightLists?: boolean;
261
+ escapeExtraCharacters?: RegExp;
262
+ hardBreakNodeName?: string;
263
+ strict?: boolean;
264
+ };
265
+ /**
266
+ Render a block, prefixing each line with `delim`, and the first
267
+ line in `firstDelim`. `node` should be the node that is closed at
268
+ the end of the block, and `f` is a function that renders the
269
+ content of the block.
270
+ */
271
+ wrapBlock(delim: string, firstDelim: string | null, node: Node, f: () => void): void;
272
+ /**
273
+ Ensure the current content ends with a newline.
274
+ */
275
+ ensureNewLine(): void;
276
+ /**
277
+ Prepare the state for writing output (closing closed paragraphs,
278
+ adding delimiters, and so on), and then optionally add content
279
+ (unescaped) to the output.
280
+ */
281
+ write(content?: string): void;
282
+ /**
283
+ Close the block for the given node.
284
+ */
285
+ closeBlock(node: Node): void;
286
+ /**
287
+ Add the given text to the document. When escape is not `false`,
288
+ it will be escaped.
289
+ */
290
+ text(text: string, escape?: boolean): void;
291
+ /**
292
+ Render the given node as a block.
293
+ */
294
+ render(node: Node, parent: Node, index: number): void;
295
+ /**
296
+ Render the contents of `parent` as block nodes.
297
+ */
298
+ renderContent(parent: Node): void;
299
+ /**
300
+ Render the contents of `parent` as inline content.
301
+ */
302
+ renderInline(parent: Node, fromBlockStart?: boolean): void;
303
+ /**
304
+ Render a node's content as a list. `delim` should be the extra
305
+ indentation added to all lines except the first in an item,
306
+ `firstDelim` is a function going from an item index to a
307
+ delimiter for the first line of the item.
308
+ */
309
+ renderList(node: Node, delim: string, firstDelim: (index: number) => string): void;
310
+ /**
311
+ Escape the given string so that it can safely appear in Markdown
312
+ content. If `startOfLine` is true, also escape characters that
313
+ have special meaning only at the start of the line.
314
+ */
315
+ esc(str: string, startOfLine?: boolean): string;
316
+ /**
317
+ Repeat the given string `n` times.
318
+ */
319
+ repeat(str: string, n: number): string;
320
+ /**
321
+ Get the markdown string for a given opening or closing mark.
322
+ */
323
+ markString(mark: Mark, open: boolean, parent: Node, index: number): string;
324
+ /**
325
+ Get leading and trailing whitespace from a string. Values of
326
+ leading or trailing property of the return object will be undefined
327
+ if there is no match.
328
+ */
329
+ getEnclosingWhitespace(text: string): {
330
+ leading?: string;
331
+ trailing?: string;
332
+ };
333
+ }
334
+
335
+ export { MarkdownParser, MarkdownSerializer, MarkdownSerializerState, type ParseSpec, defaultMarkdownParser, defaultMarkdownSerializer, schema };