@thomasfosterau/effect-richtext 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (176) hide show
  1. package/LICENSE +48 -0
  2. package/README.md +118 -2
  3. package/dist/_virtual/_rolldown/runtime.js +12 -0
  4. package/dist/commands/commands.d.ts +323 -0
  5. package/dist/commands/commands.js +722 -0
  6. package/dist/commands/internal.js +43 -0
  7. package/dist/commands/keymaps.d.ts +46 -0
  8. package/dist/commands/keymaps.js +64 -0
  9. package/dist/commands.d.ts +3 -0
  10. package/dist/commands.js +3 -0
  11. package/dist/compat/commands.d.ts +250 -0
  12. package/dist/compat/commands.js +275 -0
  13. package/dist/compat/internal/core.d.ts +20 -0
  14. package/dist/compat/internal/core.js +148 -0
  15. package/dist/compat/internal/props.js +82 -0
  16. package/dist/compat/keymap.d.ts +21 -0
  17. package/dist/compat/keymap.js +38 -0
  18. package/dist/compat/model.d.ts +893 -0
  19. package/dist/compat/model.js +1212 -0
  20. package/dist/compat/orderedmap.d.ts +74 -0
  21. package/dist/compat/orderedmap.js +124 -0
  22. package/dist/compat/schema-basic.d.ts +38 -0
  23. package/dist/compat/schema-basic.js +238 -0
  24. package/dist/compat/schema-list.d.ts +81 -0
  25. package/dist/compat/schema-list.js +156 -0
  26. package/dist/compat/state.d.ts +415 -0
  27. package/dist/compat/state.js +689 -0
  28. package/dist/compat/test-builder.d.ts +98 -0
  29. package/dist/compat/test-builder.js +197 -0
  30. package/dist/compat/transform.d.ts +458 -0
  31. package/dist/compat/transform.js +803 -0
  32. package/dist/compat/view.d.ts +411 -0
  33. package/dist/compat/view.js +409 -0
  34. package/dist/dropcursor.d.ts +46 -0
  35. package/dist/dropcursor.js +176 -0
  36. package/dist/extensions/defaults.d.ts +716 -0
  37. package/dist/extensions/defaults.js +209 -0
  38. package/dist/extensions/editor.d.ts +246 -0
  39. package/dist/extensions/editor.js +271 -0
  40. package/dist/extensions/extension.d.ts +375 -0
  41. package/dist/extensions/extension.js +233 -0
  42. package/dist/extensions.d.ts +4 -0
  43. package/dist/extensions.js +4 -0
  44. package/dist/gapcursor.d.ts +66 -0
  45. package/dist/gapcursor.js +273 -0
  46. package/dist/history.d.ts +178 -0
  47. package/dist/history.js +412 -0
  48. package/dist/html.d.ts +158 -0
  49. package/dist/html.js +164 -0
  50. package/dist/inputrules.d.ts +271 -0
  51. package/dist/inputrules.js +321 -0
  52. package/dist/internal/attempt.js +15 -0
  53. package/dist/internal/json.js +29 -0
  54. package/dist/keymap/keymap.d.ts +130 -0
  55. package/dist/keymap/keymap.js +159 -0
  56. package/dist/keymap.d.ts +2 -0
  57. package/dist/keymap.js +1 -0
  58. package/dist/markdown/errors.d.ts +23 -0
  59. package/dist/markdown/errors.js +26 -0
  60. package/dist/markdown/from_markdown.d.ts +185 -0
  61. package/dist/markdown/from_markdown.js +266 -0
  62. package/dist/markdown/schema.d.ts +522 -0
  63. package/dist/markdown/schema.js +292 -0
  64. package/dist/markdown/to_markdown.d.ts +251 -0
  65. package/dist/markdown/to_markdown.js +413 -0
  66. package/dist/markdown.d.ts +5 -0
  67. package/dist/markdown.js +5 -0
  68. package/dist/model/attrsCodec.js +48 -0
  69. package/dist/model/comparedeep.js +17 -0
  70. package/dist/model/content.d.ts +232 -0
  71. package/dist/model/content.js +630 -0
  72. package/dist/model/diff.js +66 -0
  73. package/dist/model/dom.d.ts +3 -0
  74. package/dist/model/errors.d.ts +90 -0
  75. package/dist/model/errors.js +76 -0
  76. package/dist/model/fragment.d.ts +131 -0
  77. package/dist/model/fragment.js +262 -0
  78. package/dist/model/from_dom.d.ts +299 -0
  79. package/dist/model/from_dom.js +618 -0
  80. package/dist/model/json.d.ts +37 -0
  81. package/dist/model/json.js +126 -0
  82. package/dist/model/mark.d.ts +73 -0
  83. package/dist/model/mark.js +121 -0
  84. package/dist/model/node.d.ts +267 -0
  85. package/dist/model/node.js +434 -0
  86. package/dist/model/replace.d.ts +78 -0
  87. package/dist/model/replace.js +207 -0
  88. package/dist/model/resolvedpos.d.ts +196 -0
  89. package/dist/model/resolvedpos.js +305 -0
  90. package/dist/model/schema.d.ts +740 -0
  91. package/dist/model/schema.js +451 -0
  92. package/dist/model/to_dom.d.ts +169 -0
  93. package/dist/model/to_dom.js +238 -0
  94. package/dist/model.d.ts +12 -0
  95. package/dist/model.js +12 -0
  96. package/dist/placeholder.d.ts +53 -0
  97. package/dist/placeholder.js +79 -0
  98. package/dist/reactive/observer.d.ts +54 -0
  99. package/dist/reactive/observer.js +61 -0
  100. package/dist/reactive/selectors.d.ts +22 -0
  101. package/dist/reactive/selectors.js +61 -0
  102. package/dist/reactive/stateref.d.ts +72 -0
  103. package/dist/reactive/stateref.js +71 -0
  104. package/dist/reactive/streams.d.ts +83 -0
  105. package/dist/reactive/streams.js +85 -0
  106. package/dist/reactive.d.ts +16 -0
  107. package/dist/reactive.js +26 -0
  108. package/dist/schema-basic.d.ts +448 -0
  109. package/dist/schema-basic.js +269 -0
  110. package/dist/schema-list/commands.d.ts +66 -0
  111. package/dist/schema-list/commands.js +203 -0
  112. package/dist/schema-list.d.ts +92 -0
  113. package/dist/schema-list.js +100 -0
  114. package/dist/state/errors.d.ts +39 -0
  115. package/dist/state/errors.js +32 -0
  116. package/dist/state/plugin.d.ts +232 -0
  117. package/dist/state/plugin.js +82 -0
  118. package/dist/state/selection.d.ts +297 -0
  119. package/dist/state/selection.js +486 -0
  120. package/dist/state/state.d.ts +212 -0
  121. package/dist/state/state.js +489 -0
  122. package/dist/state/transaction.d.ts +145 -0
  123. package/dist/state/transaction.js +195 -0
  124. package/dist/state.d.ts +6 -0
  125. package/dist/state.js +6 -0
  126. package/dist/test-builder.d.ts +3582 -0
  127. package/dist/test-builder.js +239 -0
  128. package/dist/transform/attr_step.d.ts +60 -0
  129. package/dist/transform/attr_step.js +105 -0
  130. package/dist/transform/errors.d.ts +50 -0
  131. package/dist/transform/errors.js +35 -0
  132. package/dist/transform/map.d.ts +182 -0
  133. package/dist/transform/map.js +280 -0
  134. package/dist/transform/mark.js +98 -0
  135. package/dist/transform/mark_set_step.js +69 -0
  136. package/dist/transform/mark_step.d.ts +113 -0
  137. package/dist/transform/mark_step.js +225 -0
  138. package/dist/transform/replace.d.ts +18 -0
  139. package/dist/transform/replace.js +381 -0
  140. package/dist/transform/replace_step.d.ts +109 -0
  141. package/dist/transform/replace_step.js +175 -0
  142. package/dist/transform/step.d.ts +157 -0
  143. package/dist/transform/step.js +168 -0
  144. package/dist/transform/structure.d.ts +89 -0
  145. package/dist/transform/structure.js +350 -0
  146. package/dist/transform/transform.d.ts +248 -0
  147. package/dist/transform/transform.js +373 -0
  148. package/dist/transform.d.ts +10 -0
  149. package/dist/transform.js +10 -0
  150. package/dist/view/browser.js +39 -0
  151. package/dist/view/capturekeys.js +282 -0
  152. package/dist/view/clipboard.d.ts +8 -0
  153. package/dist/view/clipboard.js +245 -0
  154. package/dist/view/decoration.d.ts +339 -0
  155. package/dist/view/decoration.js +566 -0
  156. package/dist/view/dom.d.ts +18 -0
  157. package/dist/view/dom.js +140 -0
  158. package/dist/view/domchange.js +295 -0
  159. package/dist/view/domcoords.d.ts +22 -0
  160. package/dist/view/domcoords.js +448 -0
  161. package/dist/view/domobserver.d.ts +47 -0
  162. package/dist/view/domobserver.js +328 -0
  163. package/dist/view/errors.d.ts +18 -0
  164. package/dist/view/errors.js +21 -0
  165. package/dist/view/input.d.ts +58 -0
  166. package/dist/view/input.js +704 -0
  167. package/dist/view/selection.js +198 -0
  168. package/dist/view/view.d.ts +699 -0
  169. package/dist/view/view.js +623 -0
  170. package/dist/view/viewdesc.d.ts +236 -0
  171. package/dist/view/viewdesc.js +1205 -0
  172. package/dist/view-css.d.ts +43 -0
  173. package/dist/view-css.js +124 -0
  174. package/dist/view.d.ts +6 -0
  175. package/dist/view.js +4 -0
  176. package/package.json +206 -3
@@ -0,0 +1,893 @@
1
+ import { NodeRange as NodeRange$1, ResolvedPos as ResolvedPos$1 } from "../model/resolvedpos.js";
2
+ import { Slice as Slice$1 } from "../model/replace.js";
3
+ import { DOMParser as DOMParser$1, ParseOptions as ParseOptions$1 } from "../model/from_dom.js";
4
+ import { DOMOutputSpec as DOMOutputSpec$1, DOMSerializer as DOMSerializer$1 } from "../model/to_dom.js";
5
+ import { DocSchema, MarkType as MarkType$1, NodeType as NodeType$1 } from "../model/schema.js";
6
+ import { Mark as Mark$1 } from "../model/mark.js";
7
+ import { Node as Node$1, TextNode as TextNode$1 } from "../model/node.js";
8
+ import { Fragment as Fragment$1 } from "../model/fragment.js";
9
+ import { ContentMatch as ContentMatch$1 } from "../model/content.js";
10
+ import "../model.js";
11
+ import { CORE, ReplaceError } from "./internal/core.js";
12
+ import { OrderedMap } from "./orderedmap.js";
13
+ /**
14
+ * An object holding the attributes of a node or mark.
15
+ *
16
+ * @since 0.1.0
17
+ * @category models
18
+ */
19
+ export type Attrs = {
20
+ readonly [attr: string]: any;
21
+ };
22
+ /**
23
+ * A DOM output spec (see `prosemirror-model`).
24
+ *
25
+ * @since 0.1.0
26
+ * @category models
27
+ */
28
+ export type DOMOutputSpec = DOMOutputSpec$1;
29
+ /** @internal */
30
+ export declare const fragmentInput: (content: unknown) => any;
31
+ /**
32
+ * This class represents a node in the tree that makes up a ProseMirror
33
+ * document.
34
+ *
35
+ * @since 0.1.0
36
+ * @category models
37
+ */
38
+ export declare class Node {
39
+ /** @internal */
40
+ readonly [CORE]: Node$1;
41
+ /** @internal */
42
+ constructor(type: NodeType, attrs: Attrs, content?: Fragment | null, marks?: ReadonlyArray<Mark>);
43
+ /** The type of node that this is. */
44
+ get type(): NodeType;
45
+ /** An object mapping attribute names to values. */
46
+ get attrs(): Attrs;
47
+ /** A container holding the node's children. */
48
+ get content(): Fragment;
49
+ /** The marks (things like whether it is emphasized or part of a link) applied to this node. */
50
+ get marks(): ReadonlyArray<Mark>;
51
+ /** For text nodes, this contains the node's text content. */
52
+ get text(): string | undefined;
53
+ /** The array of this node's child nodes. */
54
+ get children(): ReadonlyArray<Node>;
55
+ /** The size of this node, as defined by the integer-based indexing scheme. */
56
+ get nodeSize(): number;
57
+ /** The number of children that the node has. */
58
+ get childCount(): number;
59
+ /** Get the child node at the given index. Raises an error when the index is out of range. */
60
+ child(index: number): Node;
61
+ /** Get the child node at the given index, if it exists. */
62
+ maybeChild(index: number): Node | null;
63
+ /** Call `f` for every child node. */
64
+ forEach(f: (node: Node, offset: number, index: number) => void): void;
65
+ /** Invoke a callback for all descendant nodes recursively overlapping the given two positions. */
66
+ nodesBetween(from: number, to: number, f: (node: Node, pos: number, parent: Node | null, index: number) => boolean | void, startPos?: number): void;
67
+ /** Call the given callback for every descendant node. */
68
+ descendants(f: (node: Node, pos: number, parent: Node | null, index: number) => boolean | void): void;
69
+ /** Concatenates all the text nodes found in this fragment and its children. */
70
+ get textContent(): string;
71
+ /** Get all text between positions `from` and `to`. */
72
+ textBetween(from: number, to: number, blockSeparator?: string | null, leafText?: null | string | ((leafNode: Node) => string)): string;
73
+ /** Returns this node's first child, or `null` if there are no children. */
74
+ get firstChild(): Node | null;
75
+ /** Returns this node's last child, or `null` if there are no children. */
76
+ get lastChild(): Node | null;
77
+ /** Test whether two nodes represent the same piece of document. */
78
+ eq(other: Node): boolean;
79
+ /** Compare the markup (type, attributes, and marks) of this node to those of another. */
80
+ sameMarkup(other: Node): boolean;
81
+ /** Check whether this node's markup correspond to the given type, attributes, and marks. */
82
+ hasMarkup(type: NodeType, attrs?: Attrs | null, marks?: ReadonlyArray<Mark>): boolean;
83
+ /** Create a new node with the same markup as this node, containing the given content. */
84
+ copy(content?: Fragment | null): Node;
85
+ /** Create a copy of this node, with the given set of marks instead of the node's own marks. */
86
+ mark(marks: ReadonlyArray<Mark>): Node;
87
+ /** Create a copy of this node with only the content between the given positions. */
88
+ cut(from: number, to?: number): Node;
89
+ /** Cut out the part of the document between the given positions, and return it as a `Slice` object. */
90
+ slice(from: number, to?: number, includeParents?: boolean): Slice;
91
+ /** Replace the part of the document between the given positions with the given slice. */
92
+ replace(from: number, to: number, slice: Slice): Node;
93
+ /** Find the node directly after the given position. */
94
+ nodeAt(pos: number): Node | null;
95
+ /** Find the (direct) child node after the given offset, if any. */
96
+ childAfter(pos: number): {
97
+ node: Node | null;
98
+ index: number;
99
+ offset: number;
100
+ };
101
+ /** Find the (direct) child node before the given offset, if any. */
102
+ childBefore(pos: number): {
103
+ node: Node | null;
104
+ index: number;
105
+ offset: number;
106
+ };
107
+ /** Resolve the given position in the document. */
108
+ resolve(pos: number): ResolvedPos;
109
+ /** @internal */
110
+ resolveNoCache(pos: number): ResolvedPos;
111
+ /** Test whether a given mark or mark type occurs in this document between the two given positions. */
112
+ rangeHasMark(from: number, to: number, type: Mark | MarkType): boolean;
113
+ /** True when this is a block (non-inline node). */
114
+ get isBlock(): boolean;
115
+ /** True when this is a textblock node, a block node with inline content. */
116
+ get isTextblock(): boolean;
117
+ /** True when this node allows inline content. */
118
+ get inlineContent(): boolean;
119
+ /** True when this is an inline node. */
120
+ get isInline(): boolean;
121
+ /** True when this is a text node. */
122
+ get isText(): boolean;
123
+ /** True when this is a leaf node. */
124
+ get isLeaf(): boolean;
125
+ /** True when this is an atom. */
126
+ get isAtom(): boolean;
127
+ /** Return a string representation of this node for debugging purposes. */
128
+ toString(): string;
129
+ /** Get the content match in this node at the given index. */
130
+ contentMatchAt(index: number): ContentMatch;
131
+ /**
132
+ * Test whether replacing the range between `from` and `to` (by child
133
+ * index) with the given replacement fragment would leave the node's
134
+ * content valid.
135
+ */
136
+ canReplace(from: number, to: number, replacement?: Fragment, start?: number, end?: number): boolean;
137
+ /** Test whether replacing the range `from` to `to` (by index) with a node of the given type would be valid. */
138
+ canReplaceWith(from: number, to: number, type: NodeType, marks?: ReadonlyArray<Mark>): boolean;
139
+ /** Test whether the given node's content could be appended to this node. */
140
+ canAppend(other: Node): boolean;
141
+ /** Check whether this node and its descendants conform to the schema, and raise an exception when they do not. */
142
+ check(): void;
143
+ /** Return a JSON-serializeable representation of this node. */
144
+ toJSON(): any;
145
+ /** Deserialize a node from its JSON representation. */
146
+ static fromJSON(schema: Schema, json: any): Node;
147
+ }
148
+ /** @internal */
149
+ export declare class TextNode extends Node {
150
+ /** @internal */
151
+ readonly [CORE]: TextNode$1;
152
+ get text(): string;
153
+ /** @internal */
154
+ withText(text: string): TextNode;
155
+ }
156
+ /**
157
+ * A fragment represents a node's collection of child nodes.
158
+ *
159
+ * @since 0.1.0
160
+ * @category models
161
+ */
162
+ export declare class Fragment {
163
+ /** @internal */
164
+ readonly [CORE]: Fragment$1;
165
+ /** @internal */
166
+ constructor(content: ReadonlyArray<Node>, size?: number);
167
+ /** The child nodes in this fragment. */
168
+ get content(): ReadonlyArray<Node>;
169
+ /** The size of the fragment, which is the total of the size of its content nodes. */
170
+ get size(): number;
171
+ /** Invoke a callback for all descendant nodes between the given two positions. */
172
+ nodesBetween(from: number, to: number, f: (node: Node, start: number, parent: Node | null, index: number) => boolean | void, nodeStart?: number, parent?: Node): void;
173
+ /** Call the given callback for every descendant node. */
174
+ descendants(f: (node: Node, pos: number, parent: Node | null, index: number) => boolean | void): void;
175
+ /** Extract the text between `from` and `to`. */
176
+ textBetween(from: number, to: number, blockSeparator?: string | null, leafText?: string | null | ((leafNode: Node) => string)): string;
177
+ /** Create a new fragment containing the combined content of this fragment and the other. */
178
+ append(other: Fragment): Fragment;
179
+ /** Cut out the sub-fragment between the two given positions. */
180
+ cut(from: number, to?: number): Fragment;
181
+ /** @internal */
182
+ cutByIndex(from: number, to: number): Fragment;
183
+ /** Create a new fragment in which the node at the given index is replaced by the given node. */
184
+ replaceChild(index: number, node: Node): Fragment;
185
+ /** Create a new fragment by prepending the given node to this fragment. */
186
+ addToStart(node: Node): Fragment;
187
+ /** Create a new fragment by appending the given node to this fragment. */
188
+ addToEnd(node: Node): Fragment;
189
+ /** Compare this fragment to another one. */
190
+ eq(other: Fragment): boolean;
191
+ /** The first child of the fragment, or `null` if it is empty. */
192
+ get firstChild(): Node | null;
193
+ /** The last child of the fragment, or `null` if it is empty. */
194
+ get lastChild(): Node | null;
195
+ /** The number of child nodes in this fragment. */
196
+ get childCount(): number;
197
+ /** Get the child node at the given index. Raise an error when the index is out of range. */
198
+ child(index: number): Node;
199
+ /** Get the child node at the given index, if it exists. */
200
+ maybeChild(index: number): Node | null;
201
+ /** Call `f` for every child node in this fragment. */
202
+ forEach(f: (node: Node, offset: number, index: number) => void): void;
203
+ /** Find the first position at which this fragment and another fragment differ, or `null` if they are the same. */
204
+ findDiffStart(other: Fragment, pos?: number): number | null;
205
+ /** Find the first position, searching from the end, at which this fragment and the given fragment differ. */
206
+ findDiffEnd(other: Fragment, pos?: number, otherPos?: number): {
207
+ a: number;
208
+ b: number;
209
+ } | null;
210
+ /** @internal */
211
+ findIndex(pos: number): {
212
+ index: number;
213
+ offset: number;
214
+ };
215
+ /** Return a debugging string that describes this fragment. */
216
+ toString(): string;
217
+ /** @internal */
218
+ toStringInner(): string;
219
+ /** Create a JSON-serializeable representation of this fragment. */
220
+ toJSON(): any;
221
+ /** Deserialize a fragment from its JSON representation. */
222
+ static fromJSON(schema: Schema, value: any): Fragment;
223
+ /** Build a fragment from an array of nodes. */
224
+ static fromArray(array: ReadonlyArray<Node>): Fragment;
225
+ /** Create a fragment from something that can be interpreted as a set of nodes. */
226
+ static from(nodes?: Fragment | Node | ReadonlyArray<Node> | null): Fragment;
227
+ /** An empty fragment. */
228
+ static empty: Fragment;
229
+ }
230
+ /**
231
+ * A mark is a piece of information that can be attached to a node.
232
+ *
233
+ * @since 0.1.0
234
+ * @category models
235
+ */
236
+ export declare class Mark {
237
+ /** @internal */
238
+ readonly [CORE]: Mark$1;
239
+ /** @internal */
240
+ constructor(type: MarkType, attrs: Attrs);
241
+ /** The type of this mark. */
242
+ get type(): MarkType;
243
+ /** The attributes associated with this mark. */
244
+ get attrs(): Attrs;
245
+ /** Given a set of marks, create a new set which contains this one as well. */
246
+ addToSet(set: ReadonlyArray<Mark>): ReadonlyArray<Mark>;
247
+ /** Remove this mark from the given set. */
248
+ removeFromSet(set: ReadonlyArray<Mark>): ReadonlyArray<Mark>;
249
+ /** Test whether this mark is in the given set of marks. */
250
+ isInSet(set: ReadonlyArray<Mark>): boolean;
251
+ /** Test whether this mark has the same type and attributes as another mark. */
252
+ eq(other: Mark): boolean;
253
+ /** Convert this mark to a JSON-serializeable representation. */
254
+ toJSON(): any;
255
+ /** @internal */
256
+ toString(): string;
257
+ /** Deserialize a mark from JSON. */
258
+ static fromJSON(schema: Schema, json: any): Mark;
259
+ /** Test whether two sets of marks are identical. */
260
+ static sameSet(a: ReadonlyArray<Mark>, b: ReadonlyArray<Mark>): boolean;
261
+ /** Create a properly sorted mark set from null, a single mark, or an unsorted array of marks. */
262
+ static setFrom(marks?: Mark | ReadonlyArray<Mark> | null): ReadonlyArray<Mark>;
263
+ /** The empty set of marks. */
264
+ static none: ReadonlyArray<Mark>;
265
+ }
266
+ /**
267
+ * A slice represents a piece cut out of a larger document.
268
+ *
269
+ * @since 0.1.0
270
+ * @category models
271
+ */
272
+ export declare class Slice {
273
+ /** @internal */
274
+ readonly [CORE]: Slice$1;
275
+ /** Create a slice. */
276
+ constructor(content: Fragment, openStart: number, openEnd: number);
277
+ /** The slice's content. */
278
+ get content(): Fragment;
279
+ /** The open depth at the start of the fragment. */
280
+ get openStart(): number;
281
+ /** The open depth at the end. */
282
+ get openEnd(): number;
283
+ /** The size this slice would add when inserted into a document. */
284
+ get size(): number;
285
+ /** @internal */
286
+ insertAt(pos: number, fragment: Fragment): Slice | null;
287
+ /** @internal */
288
+ removeBetween(from: number, to: number): Slice;
289
+ /** Tests whether this slice is equal to another slice. */
290
+ eq(other: Slice): boolean;
291
+ /** @internal */
292
+ toString(): string;
293
+ /** Convert a slice to a JSON-serializable representation. */
294
+ toJSON(): any;
295
+ /** Deserialize a slice from its JSON representation. */
296
+ static fromJSON(schema: Schema, json: any): Slice;
297
+ /** Create a slice from a fragment by taking the maximum possible open value on both side of the fragment. */
298
+ static maxOpen(fragment: Fragment, openIsolating?: boolean): Slice;
299
+ /** The empty slice. */
300
+ static empty: Slice;
301
+ }
302
+ /**
303
+ * You can resolve a position to get more information about it.
304
+ *
305
+ * @since 0.1.0
306
+ * @category models
307
+ */
308
+ export declare class ResolvedPos {
309
+ /** @internal */
310
+ readonly [CORE]: ResolvedPos$1;
311
+ /** @internal */
312
+ private _path?;
313
+ /** @internal */
314
+ constructor(pos: number, path: Array<any>, parentOffset: number);
315
+ /** The position that was resolved. */
316
+ get pos(): number;
317
+ /** @internal */
318
+ get path(): Array<any>;
319
+ /** The offset this position has into its parent node. */
320
+ get parentOffset(): number;
321
+ /** The number of levels the parent node is from the root. */
322
+ get depth(): number;
323
+ /** The parent node that the position points into. */
324
+ get parent(): Node;
325
+ /** The root node in which the position was resolved. */
326
+ get doc(): Node;
327
+ /** The ancestor node at the given level. */
328
+ node(depth?: number | null): Node;
329
+ /** The index into the ancestor at the given level. */
330
+ index(depth?: number | null): number;
331
+ /** The index pointing after this position into the ancestor at the given level. */
332
+ indexAfter(depth?: number | null): number;
333
+ /** The (absolute) position at the start of the node at the given level. */
334
+ start(depth?: number | null): number;
335
+ /** The (absolute) position at the end of the node at the given level. */
336
+ end(depth?: number | null): number;
337
+ /** The (absolute) position directly before the wrapping node at the given level. */
338
+ before(depth?: number | null): number;
339
+ /** The (absolute) position directly after the wrapping node at the given level. */
340
+ after(depth?: number | null): number;
341
+ /** When this position points into a text node, this returns the distance between the position and the start of the text node. */
342
+ get textOffset(): number;
343
+ /** Get the node directly after the position, if any. */
344
+ get nodeAfter(): Node | null;
345
+ /** Get the node directly before the position, if any. */
346
+ get nodeBefore(): Node | null;
347
+ /** Get the position at the given index in the parent node at the given depth. */
348
+ posAtIndex(index: number, depth?: number | null): number;
349
+ /** Get the marks at this position. */
350
+ marks(): ReadonlyArray<Mark>;
351
+ /** Get the marks after the current position, if any, except those that are non-inclusive and not present at position `$end`. */
352
+ marksAcross($end: ResolvedPos): ReadonlyArray<Mark> | null;
353
+ /** The depth up to which this position and the given (non-resolved) position share the same parent nodes. */
354
+ sharedDepth(pos: number): number;
355
+ /** Returns a range based on the place where this position and the given position diverge around block content. */
356
+ blockRange(other?: ResolvedPos, pred?: (node: Node) => boolean): NodeRange | null;
357
+ /** Query whether the given position shares the same parent node. */
358
+ sameParent(other: ResolvedPos): boolean;
359
+ /** Return the greater of this and the given position. */
360
+ max(other: ResolvedPos): ResolvedPos;
361
+ /** Return the smaller of this and the given position. */
362
+ min(other: ResolvedPos): ResolvedPos;
363
+ /** @internal */
364
+ toString(): string;
365
+ /** @internal */
366
+ static resolve(doc: Node, pos: number): ResolvedPos;
367
+ /** @internal */
368
+ static resolveCached(doc: Node, pos: number): ResolvedPos;
369
+ }
370
+ /**
371
+ * Represents a flat range of content, i.e. one that starts and ends in
372
+ * the same node.
373
+ *
374
+ * @since 0.1.0
375
+ * @category models
376
+ */
377
+ export declare class NodeRange {
378
+ /** @internal */
379
+ readonly [CORE]: NodeRange$1;
380
+ /** Construct a node range. */
381
+ constructor($from: ResolvedPos, $to: ResolvedPos, depth: number);
382
+ /** A resolved position along the start of the content. */
383
+ get $from(): ResolvedPos;
384
+ /** A position along the end of the content. */
385
+ get $to(): ResolvedPos;
386
+ /** The depth of the node that this range points into. */
387
+ get depth(): number;
388
+ /** The position at the start of the range. */
389
+ get start(): number;
390
+ /** The position at the end of the range. */
391
+ get end(): number;
392
+ /** The parent node that the range points into. */
393
+ get parent(): Node;
394
+ /** The start index of the range in the parent node. */
395
+ get startIndex(): number;
396
+ /** The end index of the range in the parent node. */
397
+ get endIndex(): number;
398
+ }
399
+ /**
400
+ * Instances of this class represent a match state of a node type's
401
+ * content expression.
402
+ *
403
+ * @since 0.1.0
404
+ * @category models
405
+ */
406
+ export declare class ContentMatch {
407
+ /** @internal */
408
+ readonly [CORE]: ContentMatch$1;
409
+ /** @internal */
410
+ constructor(validEnd: boolean);
411
+ /** True when this match state represents a valid end of the node. */
412
+ get validEnd(): boolean;
413
+ /** @internal */
414
+ get next(): ReadonlyArray<{
415
+ readonly type: NodeType;
416
+ readonly next: ContentMatch;
417
+ }>;
418
+ /** @internal */
419
+ static parse(string: string, nodeTypes: {
420
+ readonly [name: string]: NodeType;
421
+ }): ContentMatch;
422
+ /** Match a node type, returning a match after that node if successful. */
423
+ matchType(type: NodeType): ContentMatch | null;
424
+ /** Try to match a fragment. Returns the resulting match when successful. */
425
+ matchFragment(frag: Fragment, start?: number, end?: number): ContentMatch | null;
426
+ /** @internal */
427
+ get inlineContent(): boolean;
428
+ /** Get the first matching node type at this match position that can be generated. */
429
+ get defaultType(): NodeType | null;
430
+ /** @internal */
431
+ compatible(other: ContentMatch): boolean;
432
+ /** Try to match the given fragment, and if that fails, see if it can be made to match by inserting nodes in front of it. */
433
+ fillBefore(after: Fragment, toEnd?: boolean, startIndex?: number): Fragment | null;
434
+ /** Find a set of wrapping node types that would allow a node of the given type to appear at this position. */
435
+ findWrapping(target: NodeType): ReadonlyArray<NodeType> | null;
436
+ /** The number of outgoing edges this node has in the finite automaton that describes the content expression. */
437
+ get edgeCount(): number;
438
+ /** Get the _n_th outgoing edge from this node in the finite automaton that describes the content expression. */
439
+ edge(n: number): {
440
+ readonly type: NodeType;
441
+ readonly next: ContentMatch;
442
+ };
443
+ /** @internal */
444
+ toString(): string;
445
+ /** @internal */
446
+ static empty: ContentMatch;
447
+ }
448
+ /**
449
+ * Used to define attributes on nodes or marks.
450
+ *
451
+ * @since 0.1.0
452
+ * @category models
453
+ */
454
+ export interface AttributeSpec {
455
+ default?: any;
456
+ validate?: (string | ((value: any) => void)) | undefined;
457
+ }
458
+ /**
459
+ * A description of a node type, used when defining a schema.
460
+ *
461
+ * @since 0.1.0
462
+ * @category models
463
+ */
464
+ export interface NodeSpec {
465
+ content?: string | undefined;
466
+ marks?: string | undefined;
467
+ group?: string | undefined;
468
+ inline?: boolean | undefined;
469
+ atom?: boolean | undefined;
470
+ attrs?: {
471
+ [name: string]: AttributeSpec;
472
+ } | undefined;
473
+ selectable?: boolean | undefined;
474
+ draggable?: boolean | undefined;
475
+ code?: boolean | undefined;
476
+ whitespace?: "pre" | "normal" | undefined;
477
+ definingAsContext?: boolean | undefined;
478
+ definingForContent?: boolean | undefined;
479
+ defining?: boolean | undefined;
480
+ isolating?: boolean | undefined;
481
+ toDOM?: ((node: Node) => DOMOutputSpec) | undefined;
482
+ parseDOM?: ReadonlyArray<TagParseRule> | undefined;
483
+ toDebugString?: ((node: Node) => string) | undefined;
484
+ leafText?: ((node: Node) => string) | undefined;
485
+ linebreakReplacement?: boolean | undefined;
486
+ [key: string]: any;
487
+ }
488
+ /**
489
+ * Used to define marks when creating a schema.
490
+ *
491
+ * @since 0.1.0
492
+ * @category models
493
+ */
494
+ export interface MarkSpec {
495
+ attrs?: {
496
+ [name: string]: AttributeSpec;
497
+ } | undefined;
498
+ inclusive?: boolean | undefined;
499
+ excludes?: string | undefined;
500
+ group?: string | undefined;
501
+ spanning?: boolean | undefined;
502
+ code?: boolean | undefined;
503
+ toDOM?: ((mark: Mark, inline: boolean) => DOMOutputSpec) | undefined;
504
+ parseDOM?: ReadonlyArray<ParseRule> | undefined;
505
+ [key: string]: any;
506
+ }
507
+ /**
508
+ * An object describing a schema, as passed to the `Schema` constructor.
509
+ *
510
+ * @since 0.1.0
511
+ * @category models
512
+ */
513
+ export interface SchemaSpec<Nodes extends string = any, Marks extends string = any> {
514
+ nodes: { [name in Nodes]: NodeSpec; } | OrderedMap<NodeSpec>;
515
+ marks?: { [name in Marks]: MarkSpec; } | OrderedMap<MarkSpec> | undefined;
516
+ topNode?: string | undefined;
517
+ }
518
+ /**
519
+ * Fields that may be present in both tag and style parse rules.
520
+ *
521
+ * @since 0.1.0
522
+ * @category models
523
+ */
524
+ export interface GenericParseRule {
525
+ priority?: number | undefined;
526
+ consuming?: boolean | undefined;
527
+ context?: string | undefined;
528
+ mark?: string | undefined;
529
+ ignore?: boolean | undefined;
530
+ closeParent?: boolean | undefined;
531
+ skip?: boolean | undefined;
532
+ attrs?: Attrs | undefined;
533
+ }
534
+ /**
535
+ * Parse rule targeting a DOM element.
536
+ *
537
+ * @since 0.1.0
538
+ * @category models
539
+ */
540
+ export interface TagParseRule extends GenericParseRule {
541
+ tag: string;
542
+ style?: undefined;
543
+ namespace?: string | undefined;
544
+ node?: string | undefined;
545
+ getAttrs?: ((node: HTMLElement) => Attrs | false | null) | undefined;
546
+ contentElement?: (string | HTMLElement | ((node: HTMLElement) => HTMLElement)) | undefined;
547
+ getContent?: ((node: globalThis.Node, schema: Schema) => Fragment) | undefined;
548
+ preserveWhitespace?: boolean | "full" | undefined;
549
+ }
550
+ /**
551
+ * A parse rule targeting a style property.
552
+ *
553
+ * @since 0.1.0
554
+ * @category models
555
+ */
556
+ export interface StyleParseRule extends GenericParseRule {
557
+ style: string;
558
+ clearMark?: ((mark: Mark) => boolean) | undefined;
559
+ getAttrs?: ((node: string) => Attrs | false | null) | undefined;
560
+ }
561
+ /**
562
+ * A value that describes how to parse a given DOM node or inline style
563
+ * as a ProseMirror node or mark.
564
+ *
565
+ * @since 0.1.0
566
+ * @category models
567
+ */
568
+ export type ParseRule = TagParseRule | StyleParseRule;
569
+ /**
570
+ * Node types are objects allocated once per `Schema` and used to tag
571
+ * `Node` instances.
572
+ *
573
+ * @since 0.1.0
574
+ * @category models
575
+ */
576
+ export declare class NodeType {
577
+ /** @internal */
578
+ readonly [CORE]: NodeType$1;
579
+ /** The name the node type has in this schema. */
580
+ get name(): string;
581
+ /** A link back to the `Schema` the node type belongs to. */
582
+ get schema(): Schema;
583
+ /** The spec that this type is based on. */
584
+ get spec(): NodeSpec;
585
+ /** @internal */
586
+ get groups(): ReadonlyArray<string>;
587
+ /** @internal */
588
+ get attrs(): {
589
+ readonly [name: string]: {
590
+ readonly hasDefault: boolean;
591
+ readonly default: any;
592
+ };
593
+ };
594
+ /** @internal */
595
+ get defaultAttrs(): Attrs | null;
596
+ /** True if this is a block type. */
597
+ get isBlock(): boolean;
598
+ /** True if this is the text node type. */
599
+ get isText(): boolean;
600
+ /** True if this node type has inline content. */
601
+ get inlineContent(): boolean;
602
+ /** The starting match of the node type's content expression. */
603
+ get contentMatch(): ContentMatch;
604
+ /** The set of marks allowed in this node. `null` means all marks are allowed. */
605
+ get markSet(): ReadonlyArray<MarkType> | null;
606
+ /** True if this is an inline type. */
607
+ get isInline(): boolean;
608
+ /** True if this is a textblock type, a block that contains inline content. */
609
+ get isTextblock(): boolean;
610
+ /** True for node types that allow no content. */
611
+ get isLeaf(): boolean;
612
+ /** True when this node is an atom, i.e. when it does not have directly editable content. */
613
+ get isAtom(): boolean;
614
+ /** Return true when this node type is part of the given group. */
615
+ isInGroup(group: string): boolean;
616
+ /** The node type's whitespace option. */
617
+ get whitespace(): "pre" | "normal";
618
+ /** Tells you whether this node type has any required attributes. */
619
+ hasRequiredAttrs(): boolean;
620
+ /** Indicates whether this node allows some of the same content as the given node type. */
621
+ compatibleContent(other: NodeType): boolean;
622
+ /** @internal */
623
+ computeAttrs(attrs: Attrs | null | undefined): Attrs;
624
+ /** Create a `Node` of this type. */
625
+ create(attrs?: Attrs | null, content?: Fragment | Node | ReadonlyArray<Node> | null, marks?: ReadonlyArray<Mark>): Node;
626
+ /** Like `create`, but check the given content against the node type's content restrictions. */
627
+ createChecked(attrs?: Attrs | null, content?: Fragment | Node | ReadonlyArray<Node> | null, marks?: ReadonlyArray<Mark>): Node;
628
+ /** Like `create`, but see if it is necessary to add nodes to the start or end of the given fragment to make it fit the node. */
629
+ createAndFill(attrs?: Attrs | null, content?: Fragment | Node | ReadonlyArray<Node> | null, marks?: ReadonlyArray<Mark>): Node | null;
630
+ /** Returns true if the given fragment is valid content for this node type. */
631
+ validContent(content: Fragment): boolean;
632
+ /** @internal */
633
+ checkContent(content: Fragment): void;
634
+ /** @internal */
635
+ checkAttrs(attrs: Attrs): void;
636
+ /** Check whether the given mark type is allowed in this node. */
637
+ allowsMarkType(markType: MarkType): boolean;
638
+ /** Test whether the given set of marks are allowed in this node. */
639
+ allowsMarks(marks: ReadonlyArray<Mark>): boolean;
640
+ /** Removes the marks that are not allowed in this node from the given set. */
641
+ allowedMarks(marks: ReadonlyArray<Mark>): ReadonlyArray<Mark>;
642
+ /** @internal */
643
+ toString(): string;
644
+ }
645
+ /**
646
+ * Like nodes, marks (which are associated with nodes to signify things
647
+ * like emphasis or being part of a link) are tagged with type objects,
648
+ * which are instantiated once per `Schema`.
649
+ *
650
+ * @since 0.1.0
651
+ * @category models
652
+ */
653
+ export declare class MarkType {
654
+ /** @internal */
655
+ readonly [CORE]: MarkType$1;
656
+ /** The name of the mark type. */
657
+ get name(): string;
658
+ /** @internal */
659
+ get rank(): number;
660
+ /** The schema that this mark type instance is part of. */
661
+ get schema(): Schema;
662
+ /** The spec on which the type is based. */
663
+ get spec(): MarkSpec;
664
+ /** @internal */
665
+ get attrs(): {
666
+ readonly [name: string]: {
667
+ readonly hasDefault: boolean;
668
+ readonly default: any;
669
+ };
670
+ };
671
+ /** @internal */
672
+ get excluded(): ReadonlyArray<MarkType>;
673
+ /** @internal */
674
+ get instance(): Mark | null;
675
+ /** Create a mark of this type. */
676
+ create(attrs?: Attrs | null): Mark;
677
+ /** When there is a mark of this type in the given set, a new set without it is returned. */
678
+ removeFromSet(set: ReadonlyArray<Mark>): ReadonlyArray<Mark>;
679
+ /** Tests whether there is a mark of this type in the given set. */
680
+ isInSet(set: ReadonlyArray<Mark>): Mark | undefined;
681
+ /** @internal */
682
+ checkAttrs(attrs: Attrs): void;
683
+ /** Queries whether a given mark type is excluded by this one. */
684
+ excludes(other: MarkType): boolean;
685
+ /** @internal */
686
+ toString(): string;
687
+ }
688
+ /**
689
+ * A document schema. Holds node and mark type objects for the nodes and
690
+ * marks that may occur in conforming documents, and provides
691
+ * functionality for creating and deserializing such documents.
692
+ *
693
+ * @since 0.1.0
694
+ * @category models
695
+ */
696
+ export declare class Schema<Nodes extends string = any, Marks extends string = any> {
697
+ /** @internal */
698
+ readonly [CORE]: DocSchema;
699
+ /** The spec on which the schema is based. */
700
+ spec: {
701
+ nodes: OrderedMap<NodeSpec>;
702
+ marks: OrderedMap<MarkSpec>;
703
+ topNode?: string;
704
+ };
705
+ /** An object mapping the schema's node names to node type objects. */
706
+ nodes: { readonly [name in Nodes]: NodeType; } & {
707
+ readonly [key: string]: NodeType;
708
+ };
709
+ /** A map from mark names to mark type objects. */
710
+ marks: { readonly [name in Marks]: MarkType; } & {
711
+ readonly [key: string]: MarkType;
712
+ };
713
+ /** The linebreak replacement node defined in this schema, if any. */
714
+ linebreakReplacement: NodeType | null;
715
+ /** The type of the default top node for this schema. */
716
+ topNodeType: NodeType;
717
+ /** An object for storing whatever values modules may want to compute and cache per schema. */
718
+ cached: {
719
+ [key: string]: any;
720
+ };
721
+ /** Construct a schema from a schema specification. */
722
+ constructor(spec: SchemaSpec<Nodes, Marks>);
723
+ /** Create a node in this schema. */
724
+ node(type: string | NodeType, attrs?: Attrs | null, content?: Fragment | Node | ReadonlyArray<Node>, marks?: ReadonlyArray<Mark>): Node;
725
+ /** Create a text node in the schema. Empty text nodes are not allowed. */
726
+ text(text: string, marks?: ReadonlyArray<Mark> | null): Node;
727
+ /** Create a mark with the given type and attributes. */
728
+ mark(type: string | MarkType, attrs?: Attrs | null): Mark;
729
+ /** Deserialize a node from its JSON representation. */
730
+ nodeFromJSON(json: any): Node;
731
+ /** Deserialize a mark from its JSON representation. */
732
+ markFromJSON(json: any): Mark;
733
+ /** @internal */
734
+ nodeType(name: string): NodeType;
735
+ }
736
+ /**
737
+ * Options accepted by the parser methods.
738
+ *
739
+ * @since 0.1.0
740
+ * @category models
741
+ */
742
+ export interface ParseOptions {
743
+ preserveWhitespace?: boolean | "full" | undefined;
744
+ findPositions?: Array<{
745
+ node: globalThis.Node;
746
+ offset: number;
747
+ pos?: number;
748
+ }> | undefined;
749
+ from?: number | undefined;
750
+ to?: number | undefined;
751
+ topNode?: Node | undefined;
752
+ topMatch?: ContentMatch | undefined;
753
+ context?: ResolvedPos | undefined;
754
+ ruleFromNode?: ((node: globalThis.Node) => Omit<TagParseRule, "tag"> | null) | undefined;
755
+ topOpen?: boolean | undefined;
756
+ }
757
+ /** @internal */
758
+ export declare const parseOptions: (options: ParseOptions | undefined) => ParseOptions$1;
759
+ /**
760
+ * A DOM parser represents a strategy for parsing DOM content into a
761
+ * ProseMirror document conforming to a given schema.
762
+ *
763
+ * @since 0.1.0
764
+ * @category models
765
+ */
766
+ export declare class DOMParser {
767
+ /** @internal */
768
+ readonly [CORE]: DOMParser$1;
769
+ /** @internal */
770
+ private _rules?;
771
+ /** Create a parser that targets the given schema, using the given parsing rules. */
772
+ constructor(schema: Schema, rules: ReadonlyArray<ParseRule>);
773
+ /** The schema into which the parser parses. */
774
+ get schema(): Schema;
775
+ /** The set of parse rules that the parser uses, in order of precedence. */
776
+ get rules(): ReadonlyArray<ParseRule>;
777
+ /** @internal */
778
+ get tags(): ReadonlyArray<TagParseRule>;
779
+ /** @internal */
780
+ get styles(): ReadonlyArray<StyleParseRule>;
781
+ /** Parse a document from the content of a DOM node. */
782
+ parse(dom: globalThis.Node, options?: ParseOptions): Node;
783
+ /** Parses the content of the given DOM node, like `parse`, and returns a slice open at the sides. */
784
+ parseSlice(dom: globalThis.Node, options?: ParseOptions): Slice;
785
+ /** @internal */
786
+ matchTag(dom: globalThis.Node, context?: any, after?: TagParseRule): TagParseRule | null;
787
+ /** @internal */
788
+ matchStyle(prop: string, value: string, context?: any, after?: StyleParseRule): StyleParseRule | null;
789
+ /** @internal */
790
+ static schemaRules(schema: Schema): Array<ParseRule>;
791
+ /** Construct a DOM parser using the parsing rules listed in a schema's node specs, reordered by priority. */
792
+ static fromSchema(schema: Schema): DOMParser;
793
+ }
794
+ /**
795
+ * A DOM serializer knows how to convert ProseMirror nodes and marks of
796
+ * various types to DOM nodes.
797
+ *
798
+ * @since 0.1.0
799
+ * @category models
800
+ */
801
+ export declare class DOMSerializer {
802
+ /** @internal */
803
+ readonly [CORE]: DOMSerializer$1;
804
+ /** The node serialization functions. */
805
+ readonly nodes: {
806
+ readonly [node: string]: (node: Node) => DOMOutputSpec;
807
+ };
808
+ /** The mark serialization functions. */
809
+ readonly marks: {
810
+ readonly [mark: string]: (mark: Mark, inline: boolean) => DOMOutputSpec;
811
+ };
812
+ /** Create a serializer. */
813
+ constructor(nodes: {
814
+ readonly [node: string]: (node: Node) => DOMOutputSpec;
815
+ }, marks: {
816
+ readonly [mark: string]: ((mark: Mark, inline: boolean) => DOMOutputSpec) | null | undefined;
817
+ });
818
+ /** Serialize the content of this fragment to a DOM fragment. */
819
+ serializeFragment(fragment: Fragment, options?: {
820
+ document?: Document;
821
+ }, target?: HTMLElement | DocumentFragment): HTMLElement | DocumentFragment;
822
+ /** Serialize this node to a DOM node. */
823
+ serializeNode(node: Node, options?: {
824
+ document?: Document;
825
+ }): globalThis.Node;
826
+ /** @internal */
827
+ serializeMark(mark: Mark, inline: boolean, options?: {
828
+ document?: Document;
829
+ }): {
830
+ dom: globalThis.Node;
831
+ contentDOM?: HTMLElement;
832
+ } | null;
833
+ /** Render an output spec to a DOM node. */
834
+ static renderSpec(doc: Document, structure: DOMOutputSpec, xmlNS?: string | null, blockArraysIn?: {
835
+ [name: string]: any;
836
+ }): {
837
+ dom: globalThis.Node;
838
+ contentDOM?: HTMLElement;
839
+ };
840
+ /** Build a serializer using the `toDOM` properties in a schema's node and mark specs. */
841
+ static fromSchema(schema: Schema): DOMSerializer;
842
+ /** Gather the serializers in a schema's node specs into an object. */
843
+ static nodesFromSchema(schema: Schema): {
844
+ [node: string]: (node: Node) => DOMOutputSpec;
845
+ };
846
+ /** Gather the serializers in a schema's mark specs into an object. */
847
+ static marksFromSchema(schema: Schema): {
848
+ [mark: string]: (mark: Mark, inline: boolean) => DOMOutputSpec;
849
+ };
850
+ }
851
+ /**
852
+ * Get the core (Effect API) object behind a facade.
853
+ *
854
+ * @since 0.1.0
855
+ * @category conversions
856
+ */
857
+ export declare function toCore(node: Node): Node$1;
858
+ export declare function toCore(fragment: Fragment): Fragment$1;
859
+ export declare function toCore(mark: Mark): Mark$1;
860
+ export declare function toCore(slice: Slice): Slice$1;
861
+ export declare function toCore($pos: ResolvedPos): ResolvedPos$1;
862
+ export declare function toCore(range: NodeRange): NodeRange$1;
863
+ export declare function toCore(match: ContentMatch): ContentMatch$1;
864
+ export declare function toCore(type: NodeType): NodeType$1;
865
+ export declare function toCore(type: MarkType): MarkType$1;
866
+ export declare function toCore(schema: Schema): DocSchema;
867
+ export declare function toCore(parser: DOMParser): DOMParser$1;
868
+ export declare function toCore(serializer: DOMSerializer): DOMSerializer$1;
869
+ export declare function toCore(marks: ReadonlyArray<Mark>): ReadonlyArray<Mark$1>;
870
+ export declare function toCore(nodes: ReadonlyArray<Node>): ReadonlyArray<Node$1>;
871
+ /**
872
+ * Get the facade for a core (Effect API) object. The same core object
873
+ * always yields the same facade.
874
+ *
875
+ * @since 0.1.0
876
+ * @category conversions
877
+ */
878
+ export declare function fromCore(node: TextNode$1<any>): Node;
879
+ export declare function fromCore(node: Node$1<any, any>): Node;
880
+ export declare function fromCore(fragment: Fragment$1<any, any>): Fragment;
881
+ export declare function fromCore(mark: Mark$1<any, any>): Mark;
882
+ export declare function fromCore(slice: Slice$1<any>): Slice;
883
+ export declare function fromCore($pos: ResolvedPos$1<any>): ResolvedPos;
884
+ export declare function fromCore(range: NodeRange$1<any>): NodeRange;
885
+ export declare function fromCore(match: ContentMatch$1): ContentMatch;
886
+ export declare function fromCore(type: NodeType$1<any, any>): NodeType;
887
+ export declare function fromCore(type: MarkType$1<any, any>): MarkType;
888
+ export declare function fromCore(schema: DocSchema<any, any>): Schema;
889
+ export declare function fromCore(parser: DOMParser$1<any>): DOMParser;
890
+ export declare function fromCore(serializer: DOMSerializer$1<any>): DOMSerializer;
891
+ export declare function fromCore(marks: ReadonlyArray<Mark$1<any, any>>): ReadonlyArray<Mark>;
892
+ export declare function fromCore(nodes: ReadonlyArray<Node$1<any, any>>): ReadonlyArray<Node>;
893
+ export { OrderedMap, ReplaceError };