@docen/export-docx 0.0.8 → 0.0.10
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.
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +1084 -368
- package/dist/index.d.mts +1084 -368
- package/dist/index.d.ts +1084 -368
- package/dist/index.mjs +1 -1
- package/package.json +4 -3
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
-
import { OutputType, ISectionOptions, IPropertiesOptions, ITableOfContentsOptions, IParagraphStyleOptions, IImageOptions as IImageOptions$1, ITableOptions, IParagraphOptions, ITableRowOptions, ITableCellOptions,
|
|
2
|
+
import { PositiveUniversalMeasure as PositiveUniversalMeasure$1, OutputType, ISectionOptions, IPropertiesOptions, ITableOfContentsOptions, IParagraphStyleOptions, IImageOptions as IImageOptions$1, ITableOptions, IParagraphOptions, ITableRowOptions, ITableCellOptions, FileChild, OutputByType, TextRun, ExternalHyperlink, ImageRun, Table, TableRow, TableCell } from 'docx';
|
|
3
3
|
import { ImageMeta } from 'image-meta';
|
|
4
4
|
|
|
5
5
|
declare class OrderedMap$1<T = any> {
|
|
@@ -129,7 +129,7 @@ declare class DOMSerializer$1 {
|
|
|
129
129
|
The node serialization functions.
|
|
130
130
|
*/
|
|
131
131
|
readonly nodes: {
|
|
132
|
-
[node: string]: (node: Node$
|
|
132
|
+
[node: string]: (node: Node$4) => DOMOutputSpec$1;
|
|
133
133
|
};
|
|
134
134
|
/**
|
|
135
135
|
The mark serialization functions.
|
|
@@ -151,7 +151,7 @@ declare class DOMSerializer$1 {
|
|
|
151
151
|
The node serialization functions.
|
|
152
152
|
*/
|
|
153
153
|
nodes: {
|
|
154
|
-
[node: string]: (node: Node$
|
|
154
|
+
[node: string]: (node: Node$4) => DOMOutputSpec$1;
|
|
155
155
|
},
|
|
156
156
|
/**
|
|
157
157
|
The mark serialization functions.
|
|
@@ -175,7 +175,7 @@ declare class DOMSerializer$1 {
|
|
|
175
175
|
[`serializeFragment`](https://prosemirror.net/docs/ref/#model.DOMSerializer.serializeFragment) on
|
|
176
176
|
its [content](https://prosemirror.net/docs/ref/#model.Node.content).
|
|
177
177
|
*/
|
|
178
|
-
serializeNode(node: Node$
|
|
178
|
+
serializeNode(node: Node$4, options?: {
|
|
179
179
|
document?: Document;
|
|
180
180
|
}): globalThis.Node;
|
|
181
181
|
/**
|
|
@@ -197,7 +197,7 @@ declare class DOMSerializer$1 {
|
|
|
197
197
|
This can be useful as a base to build a custom serializer from.
|
|
198
198
|
*/
|
|
199
199
|
static nodesFromSchema(schema: Schema$1): {
|
|
200
|
-
[node: string]: (node: Node$
|
|
200
|
+
[node: string]: (node: Node$4) => DOMOutputSpec$1;
|
|
201
201
|
};
|
|
202
202
|
/**
|
|
203
203
|
Gather the serializers in a schema's mark specs into an object.
|
|
@@ -237,16 +237,16 @@ declare class ResolvedPos$1 {
|
|
|
237
237
|
a position points into a text node, that node is not considered
|
|
238
238
|
the parent—text nodes are ‘flat’ in this model, and have no content.
|
|
239
239
|
*/
|
|
240
|
-
get parent(): Node$
|
|
240
|
+
get parent(): Node$4;
|
|
241
241
|
/**
|
|
242
242
|
The root node in which the position was resolved.
|
|
243
243
|
*/
|
|
244
|
-
get doc(): Node$
|
|
244
|
+
get doc(): Node$4;
|
|
245
245
|
/**
|
|
246
246
|
The ancestor node at the given level. `p.node(p.depth)` is the
|
|
247
247
|
same as `p.parent`.
|
|
248
248
|
*/
|
|
249
|
-
node(depth?: number | null): Node$
|
|
249
|
+
node(depth?: number | null): Node$4;
|
|
250
250
|
/**
|
|
251
251
|
The index into the ancestor at the given level. If this points
|
|
252
252
|
at the 3rd node in the 2nd paragraph on the top level, for
|
|
@@ -290,13 +290,13 @@ declare class ResolvedPos$1 {
|
|
|
290
290
|
points into a text node, only the part of that node after the
|
|
291
291
|
position is returned.
|
|
292
292
|
*/
|
|
293
|
-
get nodeAfter(): Node$
|
|
293
|
+
get nodeAfter(): Node$4 | null;
|
|
294
294
|
/**
|
|
295
295
|
Get the node directly before the position, if any. If the
|
|
296
296
|
position points into a text node, only the part of that node
|
|
297
297
|
before the position is returned.
|
|
298
298
|
*/
|
|
299
|
-
get nodeBefore(): Node$
|
|
299
|
+
get nodeBefore(): Node$4 | null;
|
|
300
300
|
/**
|
|
301
301
|
Get the position at the given index in the parent node at the
|
|
302
302
|
given depth (which defaults to `this.depth`).
|
|
@@ -332,7 +332,7 @@ declare class ResolvedPos$1 {
|
|
|
332
332
|
pass in an optional predicate that will be called with a parent
|
|
333
333
|
node to see if a range into that parent is acceptable.
|
|
334
334
|
*/
|
|
335
|
-
blockRange(other?: ResolvedPos$1, pred?: (node: Node$
|
|
335
|
+
blockRange(other?: ResolvedPos$1, pred?: (node: Node$4) => boolean): NodeRange$1 | null;
|
|
336
336
|
/**
|
|
337
337
|
Query whether the given position shares the same parent node.
|
|
338
338
|
*/
|
|
@@ -400,7 +400,7 @@ declare class NodeRange$1 {
|
|
|
400
400
|
/**
|
|
401
401
|
The parent node that the range points into.
|
|
402
402
|
*/
|
|
403
|
-
get parent(): Node$
|
|
403
|
+
get parent(): Node$4;
|
|
404
404
|
/**
|
|
405
405
|
The start index of the range in the parent node.
|
|
406
406
|
*/
|
|
@@ -519,7 +519,7 @@ interface ParseOptions$1 {
|
|
|
519
519
|
option to use the type and attributes from a different node
|
|
520
520
|
as the top container.
|
|
521
521
|
*/
|
|
522
|
-
topNode?: Node$
|
|
522
|
+
topNode?: Node$4;
|
|
523
523
|
/**
|
|
524
524
|
Provide the starting content match that content parsed into the
|
|
525
525
|
top node is matched against.
|
|
@@ -709,7 +709,7 @@ declare class DOMParser$1 {
|
|
|
709
709
|
/**
|
|
710
710
|
Parse a document from the content of a DOM node.
|
|
711
711
|
*/
|
|
712
|
-
parse(dom: DOMNode$3, options?: ParseOptions$1): Node$
|
|
712
|
+
parse(dom: DOMNode$3, options?: ParseOptions$1): Node$4;
|
|
713
713
|
/**
|
|
714
714
|
Parses the content of the given DOM node, like
|
|
715
715
|
[`parse`](https://prosemirror.net/docs/ref/#model.DOMParser.parse), and takes the same set of
|
|
@@ -817,13 +817,13 @@ declare class NodeType$3 {
|
|
|
817
817
|
`null`. Similarly `marks` may be `null` to default to the empty
|
|
818
818
|
set of marks.
|
|
819
819
|
*/
|
|
820
|
-
create(attrs?: Attrs$1 | null, content?: Fragment$1 | Node$
|
|
820
|
+
create(attrs?: Attrs$1 | null, content?: Fragment$1 | Node$4 | readonly Node$4[] | null, marks?: readonly Mark$4[]): Node$4;
|
|
821
821
|
/**
|
|
822
822
|
Like [`create`](https://prosemirror.net/docs/ref/#model.NodeType.create), but check the given content
|
|
823
823
|
against the node type's content restrictions, and throw an error
|
|
824
824
|
if it doesn't match.
|
|
825
825
|
*/
|
|
826
|
-
createChecked(attrs?: Attrs$1 | null, content?: Fragment$1 | Node$
|
|
826
|
+
createChecked(attrs?: Attrs$1 | null, content?: Fragment$1 | Node$4 | readonly Node$4[] | null, marks?: readonly Mark$4[]): Node$4;
|
|
827
827
|
/**
|
|
828
828
|
Like [`create`](https://prosemirror.net/docs/ref/#model.NodeType.create), but see if it is
|
|
829
829
|
necessary to add nodes to the start or end of the given fragment
|
|
@@ -832,7 +832,7 @@ declare class NodeType$3 {
|
|
|
832
832
|
always be created, this will always succeed if you pass null or
|
|
833
833
|
`Fragment.empty` as content.
|
|
834
834
|
*/
|
|
835
|
-
createAndFill(attrs?: Attrs$1 | null, content?: Fragment$1 | Node$
|
|
835
|
+
createAndFill(attrs?: Attrs$1 | null, content?: Fragment$1 | Node$4 | readonly Node$4[] | null, marks?: readonly Mark$4[]): Node$4 | null;
|
|
836
836
|
/**
|
|
837
837
|
Returns true if the given fragment is valid content for this node
|
|
838
838
|
type.
|
|
@@ -1030,7 +1030,7 @@ interface NodeSpec$1 {
|
|
|
1030
1030
|
differently, this is not supported inside the editor, so you
|
|
1031
1031
|
shouldn't override that in your text node spec.
|
|
1032
1032
|
*/
|
|
1033
|
-
toDOM?: (node: Node$
|
|
1033
|
+
toDOM?: (node: Node$4) => DOMOutputSpec$1;
|
|
1034
1034
|
/**
|
|
1035
1035
|
Associates DOM parser information with this node, which can be
|
|
1036
1036
|
used by [`DOMParser.fromSchema`](https://prosemirror.net/docs/ref/#model.DOMParser^fromSchema) to
|
|
@@ -1044,14 +1044,14 @@ interface NodeSpec$1 {
|
|
|
1044
1044
|
Defines the default way a node of this type should be serialized
|
|
1045
1045
|
to a string representation for debugging (e.g. in error messages).
|
|
1046
1046
|
*/
|
|
1047
|
-
toDebugString?: (node: Node$
|
|
1047
|
+
toDebugString?: (node: Node$4) => string;
|
|
1048
1048
|
/**
|
|
1049
1049
|
Defines the default way a [leaf node](https://prosemirror.net/docs/ref/#model.NodeType.isLeaf) of
|
|
1050
1050
|
this type should be serialized to a string (as used by
|
|
1051
1051
|
[`Node.textBetween`](https://prosemirror.net/docs/ref/#model.Node.textBetween) and
|
|
1052
1052
|
[`Node.textContent`](https://prosemirror.net/docs/ref/#model.Node.textContent)).
|
|
1053
1053
|
*/
|
|
1054
|
-
leafText?: (node: Node$
|
|
1054
|
+
leafText?: (node: Node$4) => string;
|
|
1055
1055
|
/**
|
|
1056
1056
|
A single inline node in a schema can be set to be a linebreak
|
|
1057
1057
|
equivalent. When converting between block types that support the
|
|
@@ -1225,12 +1225,12 @@ declare class Schema$1<Nodes extends string = any, Marks extends string = any> {
|
|
|
1225
1225
|
`content` may be a `Fragment`, `null`, a `Node`, or an array of
|
|
1226
1226
|
nodes.
|
|
1227
1227
|
*/
|
|
1228
|
-
node(type: string | NodeType$3, attrs?: Attrs$1 | null, content?: Fragment$1 | Node$
|
|
1228
|
+
node(type: string | NodeType$3, attrs?: Attrs$1 | null, content?: Fragment$1 | Node$4 | readonly Node$4[], marks?: readonly Mark$4[]): Node$4;
|
|
1229
1229
|
/**
|
|
1230
1230
|
Create a text node in the schema. Empty text nodes are not
|
|
1231
1231
|
allowed.
|
|
1232
1232
|
*/
|
|
1233
|
-
text(text: string, marks?: readonly Mark$4[] | null): Node$
|
|
1233
|
+
text(text: string, marks?: readonly Mark$4[] | null): Node$4;
|
|
1234
1234
|
/**
|
|
1235
1235
|
Create a mark with the given type and attributes.
|
|
1236
1236
|
*/
|
|
@@ -1239,7 +1239,7 @@ declare class Schema$1<Nodes extends string = any, Marks extends string = any> {
|
|
|
1239
1239
|
Deserialize a node from its JSON representation. This method is
|
|
1240
1240
|
bound.
|
|
1241
1241
|
*/
|
|
1242
|
-
nodeFromJSON: (json: any) => Node$
|
|
1242
|
+
nodeFromJSON: (json: any) => Node$4;
|
|
1243
1243
|
/**
|
|
1244
1244
|
Deserialize a mark from its JSON representation. This method is
|
|
1245
1245
|
bound.
|
|
@@ -1258,7 +1258,7 @@ declare class Fragment$1 {
|
|
|
1258
1258
|
/**
|
|
1259
1259
|
The child nodes in this fragment.
|
|
1260
1260
|
*/
|
|
1261
|
-
readonly content: readonly Node$
|
|
1261
|
+
readonly content: readonly Node$4[];
|
|
1262
1262
|
/**
|
|
1263
1263
|
The size of the fragment, which is the total of the size of
|
|
1264
1264
|
its content nodes.
|
|
@@ -1269,18 +1269,18 @@ declare class Fragment$1 {
|
|
|
1269
1269
|
positions (relative to start of this fragment). Doesn't descend
|
|
1270
1270
|
into a node when the callback returns `false`.
|
|
1271
1271
|
*/
|
|
1272
|
-
nodesBetween(from: number, to: number, f: (node: Node$
|
|
1272
|
+
nodesBetween(from: number, to: number, f: (node: Node$4, start: number, parent: Node$4 | null, index: number) => boolean | void, nodeStart?: number, parent?: Node$4): void;
|
|
1273
1273
|
/**
|
|
1274
1274
|
Call the given callback for every descendant node. `pos` will be
|
|
1275
1275
|
relative to the start of the fragment. The callback may return
|
|
1276
1276
|
`false` to prevent traversal of a given node's children.
|
|
1277
1277
|
*/
|
|
1278
|
-
descendants(f: (node: Node$
|
|
1278
|
+
descendants(f: (node: Node$4, pos: number, parent: Node$4 | null, index: number) => boolean | void): void;
|
|
1279
1279
|
/**
|
|
1280
1280
|
Extract the text between `from` and `to`. See the same method on
|
|
1281
1281
|
[`Node`](https://prosemirror.net/docs/ref/#model.Node.textBetween).
|
|
1282
1282
|
*/
|
|
1283
|
-
textBetween(from: number, to: number, blockSeparator?: string | null, leafText?: string | null | ((leafNode: Node$
|
|
1283
|
+
textBetween(from: number, to: number, blockSeparator?: string | null, leafText?: string | null | ((leafNode: Node$4) => string)): string;
|
|
1284
1284
|
/**
|
|
1285
1285
|
Create a new fragment containing the combined content of this
|
|
1286
1286
|
fragment and the other.
|
|
@@ -1294,17 +1294,17 @@ declare class Fragment$1 {
|
|
|
1294
1294
|
Create a new fragment in which the node at the given index is
|
|
1295
1295
|
replaced by the given node.
|
|
1296
1296
|
*/
|
|
1297
|
-
replaceChild(index: number, node: Node$
|
|
1297
|
+
replaceChild(index: number, node: Node$4): Fragment$1;
|
|
1298
1298
|
/**
|
|
1299
1299
|
Create a new fragment by prepending the given node to this
|
|
1300
1300
|
fragment.
|
|
1301
1301
|
*/
|
|
1302
|
-
addToStart(node: Node$
|
|
1302
|
+
addToStart(node: Node$4): Fragment$1;
|
|
1303
1303
|
/**
|
|
1304
1304
|
Create a new fragment by appending the given node to this
|
|
1305
1305
|
fragment.
|
|
1306
1306
|
*/
|
|
1307
|
-
addToEnd(node: Node$
|
|
1307
|
+
addToEnd(node: Node$4): Fragment$1;
|
|
1308
1308
|
/**
|
|
1309
1309
|
Compare this fragment to another one.
|
|
1310
1310
|
*/
|
|
@@ -1312,11 +1312,11 @@ declare class Fragment$1 {
|
|
|
1312
1312
|
/**
|
|
1313
1313
|
The first child of the fragment, or `null` if it is empty.
|
|
1314
1314
|
*/
|
|
1315
|
-
get firstChild(): Node$
|
|
1315
|
+
get firstChild(): Node$4 | null;
|
|
1316
1316
|
/**
|
|
1317
1317
|
The last child of the fragment, or `null` if it is empty.
|
|
1318
1318
|
*/
|
|
1319
|
-
get lastChild(): Node$
|
|
1319
|
+
get lastChild(): Node$4 | null;
|
|
1320
1320
|
/**
|
|
1321
1321
|
The number of child nodes in this fragment.
|
|
1322
1322
|
*/
|
|
@@ -1325,16 +1325,16 @@ declare class Fragment$1 {
|
|
|
1325
1325
|
Get the child node at the given index. Raise an error when the
|
|
1326
1326
|
index is out of range.
|
|
1327
1327
|
*/
|
|
1328
|
-
child(index: number): Node$
|
|
1328
|
+
child(index: number): Node$4;
|
|
1329
1329
|
/**
|
|
1330
1330
|
Get the child node at the given index, if it exists.
|
|
1331
1331
|
*/
|
|
1332
|
-
maybeChild(index: number): Node$
|
|
1332
|
+
maybeChild(index: number): Node$4 | null;
|
|
1333
1333
|
/**
|
|
1334
1334
|
Call `f` for every child node, passing the node, its offset
|
|
1335
1335
|
into this parent node, and its index.
|
|
1336
1336
|
*/
|
|
1337
|
-
forEach(f: (node: Node$
|
|
1337
|
+
forEach(f: (node: Node$4, offset: number, index: number) => void): void;
|
|
1338
1338
|
/**
|
|
1339
1339
|
Find the first position at which this fragment and another
|
|
1340
1340
|
fragment differ, or `null` if they are the same.
|
|
@@ -1366,14 +1366,14 @@ declare class Fragment$1 {
|
|
|
1366
1366
|
Build a fragment from an array of nodes. Ensures that adjacent
|
|
1367
1367
|
text nodes with the same marks are joined together.
|
|
1368
1368
|
*/
|
|
1369
|
-
static fromArray(array: readonly Node$
|
|
1369
|
+
static fromArray(array: readonly Node$4[]): Fragment$1;
|
|
1370
1370
|
/**
|
|
1371
1371
|
Create a fragment from something that can be interpreted as a
|
|
1372
1372
|
set of nodes. For `null`, it returns the empty fragment. For a
|
|
1373
1373
|
fragment, the fragment itself. For a node or array of nodes, a
|
|
1374
1374
|
fragment containing those nodes.
|
|
1375
1375
|
*/
|
|
1376
|
-
static from(nodes?: Fragment$1 | Node$
|
|
1376
|
+
static from(nodes?: Fragment$1 | Node$4 | readonly Node$4[] | null): Fragment$1;
|
|
1377
1377
|
/**
|
|
1378
1378
|
An empty fragment. Intended to be reused whenever a node doesn't
|
|
1379
1379
|
contain anything (rather than allocating a new empty fragment for
|
|
@@ -1454,7 +1454,7 @@ tree shape like this (without back pointers) makes easy.
|
|
|
1454
1454
|
**Do not** directly mutate the properties of a `Node` object. See
|
|
1455
1455
|
[the guide](https://prosemirror.net/docs/guide/#doc) for more information.
|
|
1456
1456
|
*/
|
|
1457
|
-
declare class Node$
|
|
1457
|
+
declare class Node$4 {
|
|
1458
1458
|
/**
|
|
1459
1459
|
The type of node that this is.
|
|
1460
1460
|
*/
|
|
@@ -1477,7 +1477,7 @@ declare class Node$3 {
|
|
|
1477
1477
|
/**
|
|
1478
1478
|
The array of this node's child nodes.
|
|
1479
1479
|
*/
|
|
1480
|
-
get children(): readonly Node$
|
|
1480
|
+
get children(): readonly Node$4[];
|
|
1481
1481
|
/**
|
|
1482
1482
|
For text nodes, this contains the node's text content.
|
|
1483
1483
|
*/
|
|
@@ -1498,16 +1498,16 @@ declare class Node$3 {
|
|
|
1498
1498
|
Get the child node at the given index. Raises an error when the
|
|
1499
1499
|
index is out of range.
|
|
1500
1500
|
*/
|
|
1501
|
-
child(index: number): Node$
|
|
1501
|
+
child(index: number): Node$4;
|
|
1502
1502
|
/**
|
|
1503
1503
|
Get the child node at the given index, if it exists.
|
|
1504
1504
|
*/
|
|
1505
|
-
maybeChild(index: number): Node$
|
|
1505
|
+
maybeChild(index: number): Node$4 | null;
|
|
1506
1506
|
/**
|
|
1507
1507
|
Call `f` for every child node, passing the node, its offset
|
|
1508
1508
|
into this parent node, and its index.
|
|
1509
1509
|
*/
|
|
1510
|
-
forEach(f: (node: Node$
|
|
1510
|
+
forEach(f: (node: Node$4, offset: number, index: number) => void): void;
|
|
1511
1511
|
/**
|
|
1512
1512
|
Invoke a callback for all descendant nodes recursively between
|
|
1513
1513
|
the given two positions that are relative to start of this
|
|
@@ -1518,12 +1518,12 @@ declare class Node$3 {
|
|
|
1518
1518
|
recursed over. The last parameter can be used to specify a
|
|
1519
1519
|
starting position to count from.
|
|
1520
1520
|
*/
|
|
1521
|
-
nodesBetween(from: number, to: number, f: (node: Node$
|
|
1521
|
+
nodesBetween(from: number, to: number, f: (node: Node$4, pos: number, parent: Node$4 | null, index: number) => void | boolean, startPos?: number): void;
|
|
1522
1522
|
/**
|
|
1523
1523
|
Call the given callback for every descendant node. Doesn't
|
|
1524
1524
|
descend into a node when the callback returns `false`.
|
|
1525
1525
|
*/
|
|
1526
|
-
descendants(f: (node: Node$
|
|
1526
|
+
descendants(f: (node: Node$4, pos: number, parent: Node$4 | null, index: number) => void | boolean): void;
|
|
1527
1527
|
/**
|
|
1528
1528
|
Concatenates all the text nodes found in this fragment and its
|
|
1529
1529
|
children.
|
|
@@ -1536,26 +1536,26 @@ declare class Node$3 {
|
|
|
1536
1536
|
inserted for every non-text leaf node encountered, otherwise
|
|
1537
1537
|
[`leafText`](https://prosemirror.net/docs/ref/#model.NodeSpec.leafText) will be used.
|
|
1538
1538
|
*/
|
|
1539
|
-
textBetween(from: number, to: number, blockSeparator?: string | null, leafText?: null | string | ((leafNode: Node$
|
|
1539
|
+
textBetween(from: number, to: number, blockSeparator?: string | null, leafText?: null | string | ((leafNode: Node$4) => string)): string;
|
|
1540
1540
|
/**
|
|
1541
1541
|
Returns this node's first child, or `null` if there are no
|
|
1542
1542
|
children.
|
|
1543
1543
|
*/
|
|
1544
|
-
get firstChild(): Node$
|
|
1544
|
+
get firstChild(): Node$4 | null;
|
|
1545
1545
|
/**
|
|
1546
1546
|
Returns this node's last child, or `null` if there are no
|
|
1547
1547
|
children.
|
|
1548
1548
|
*/
|
|
1549
|
-
get lastChild(): Node$
|
|
1549
|
+
get lastChild(): Node$4 | null;
|
|
1550
1550
|
/**
|
|
1551
1551
|
Test whether two nodes represent the same piece of document.
|
|
1552
1552
|
*/
|
|
1553
|
-
eq(other: Node$
|
|
1553
|
+
eq(other: Node$4): boolean;
|
|
1554
1554
|
/**
|
|
1555
1555
|
Compare the markup (type, attributes, and marks) of this node to
|
|
1556
1556
|
those of another. Returns `true` if both have the same markup.
|
|
1557
1557
|
*/
|
|
1558
|
-
sameMarkup(other: Node$
|
|
1558
|
+
sameMarkup(other: Node$4): boolean;
|
|
1559
1559
|
/**
|
|
1560
1560
|
Check whether this node's markup correspond to the given type,
|
|
1561
1561
|
attributes, and marks.
|
|
@@ -1565,18 +1565,18 @@ declare class Node$3 {
|
|
|
1565
1565
|
Create a new node with the same markup as this node, containing
|
|
1566
1566
|
the given content (or empty, if no content is given).
|
|
1567
1567
|
*/
|
|
1568
|
-
copy(content?: Fragment$1 | null): Node$
|
|
1568
|
+
copy(content?: Fragment$1 | null): Node$4;
|
|
1569
1569
|
/**
|
|
1570
1570
|
Create a copy of this node, with the given set of marks instead
|
|
1571
1571
|
of the node's own marks.
|
|
1572
1572
|
*/
|
|
1573
|
-
mark(marks: readonly Mark$4[]): Node$
|
|
1573
|
+
mark(marks: readonly Mark$4[]): Node$4;
|
|
1574
1574
|
/**
|
|
1575
1575
|
Create a copy of this node with only the content between the
|
|
1576
1576
|
given positions. If `to` is not given, it defaults to the end of
|
|
1577
1577
|
the node.
|
|
1578
1578
|
*/
|
|
1579
|
-
cut(from: number, to?: number): Node$
|
|
1579
|
+
cut(from: number, to?: number): Node$4;
|
|
1580
1580
|
/**
|
|
1581
1581
|
Cut out the part of the document between the given positions, and
|
|
1582
1582
|
return it as a `Slice` object.
|
|
@@ -1590,18 +1590,18 @@ declare class Node$3 {
|
|
|
1590
1590
|
into. If any of this is violated, an error of type
|
|
1591
1591
|
[`ReplaceError`](https://prosemirror.net/docs/ref/#model.ReplaceError) is thrown.
|
|
1592
1592
|
*/
|
|
1593
|
-
replace(from: number, to: number, slice: Slice$1): Node$
|
|
1593
|
+
replace(from: number, to: number, slice: Slice$1): Node$4;
|
|
1594
1594
|
/**
|
|
1595
1595
|
Find the node directly after the given position.
|
|
1596
1596
|
*/
|
|
1597
|
-
nodeAt(pos: number): Node$
|
|
1597
|
+
nodeAt(pos: number): Node$4 | null;
|
|
1598
1598
|
/**
|
|
1599
1599
|
Find the (direct) child node after the given offset, if any,
|
|
1600
1600
|
and return it along with its index and offset relative to this
|
|
1601
1601
|
node.
|
|
1602
1602
|
*/
|
|
1603
1603
|
childAfter(pos: number): {
|
|
1604
|
-
node: Node$
|
|
1604
|
+
node: Node$4 | null;
|
|
1605
1605
|
index: number;
|
|
1606
1606
|
offset: number;
|
|
1607
1607
|
};
|
|
@@ -1611,7 +1611,7 @@ declare class Node$3 {
|
|
|
1611
1611
|
node.
|
|
1612
1612
|
*/
|
|
1613
1613
|
childBefore(pos: number): {
|
|
1614
|
-
node: Node$
|
|
1614
|
+
node: Node$4 | null;
|
|
1615
1615
|
index: number;
|
|
1616
1616
|
offset: number;
|
|
1617
1617
|
};
|
|
@@ -1687,7 +1687,7 @@ declare class Node$3 {
|
|
|
1687
1687
|
is at least one node type that can appear in both nodes (to avoid
|
|
1688
1688
|
merging completely incompatible nodes).
|
|
1689
1689
|
*/
|
|
1690
|
-
canAppend(other: Node$
|
|
1690
|
+
canAppend(other: Node$4): boolean;
|
|
1691
1691
|
/**
|
|
1692
1692
|
Check whether this node and its descendants conform to the
|
|
1693
1693
|
schema, and raise an exception when they do not.
|
|
@@ -1700,7 +1700,7 @@ declare class Node$3 {
|
|
|
1700
1700
|
/**
|
|
1701
1701
|
Deserialize a node from its JSON representation.
|
|
1702
1702
|
*/
|
|
1703
|
-
static fromJSON(schema: Schema$1, json: any): Node$
|
|
1703
|
+
static fromJSON(schema: Schema$1, json: any): Node$4;
|
|
1704
1704
|
}
|
|
1705
1705
|
|
|
1706
1706
|
/**
|
|
@@ -1898,7 +1898,7 @@ declare abstract class Step$1 {
|
|
|
1898
1898
|
applied to this document, or indicates success by containing a
|
|
1899
1899
|
transformed document.
|
|
1900
1900
|
*/
|
|
1901
|
-
abstract apply(doc: Node$
|
|
1901
|
+
abstract apply(doc: Node$4): StepResult$1;
|
|
1902
1902
|
/**
|
|
1903
1903
|
Get the step map that represents the changes made by this step,
|
|
1904
1904
|
and which can be used to transform between positions in the old
|
|
@@ -1909,7 +1909,7 @@ declare abstract class Step$1 {
|
|
|
1909
1909
|
Create an inverted version of this step. Needs the document as it
|
|
1910
1910
|
was before the step as argument.
|
|
1911
1911
|
*/
|
|
1912
|
-
abstract invert(doc: Node$
|
|
1912
|
+
abstract invert(doc: Node$4): Step$1;
|
|
1913
1913
|
/**
|
|
1914
1914
|
Map this step through a mappable thing, returning either a
|
|
1915
1915
|
version of that step with its positions adjusted, or `null` if
|
|
@@ -1954,7 +1954,7 @@ declare class StepResult$1 {
|
|
|
1954
1954
|
/**
|
|
1955
1955
|
The transformed document, if successful.
|
|
1956
1956
|
*/
|
|
1957
|
-
readonly doc: Node$
|
|
1957
|
+
readonly doc: Node$4 | null;
|
|
1958
1958
|
/**
|
|
1959
1959
|
The failure message, if unsuccessful.
|
|
1960
1960
|
*/
|
|
@@ -1962,7 +1962,7 @@ declare class StepResult$1 {
|
|
|
1962
1962
|
/**
|
|
1963
1963
|
Create a successful step result.
|
|
1964
1964
|
*/
|
|
1965
|
-
static ok(doc: Node$
|
|
1965
|
+
static ok(doc: Node$4): StepResult$1;
|
|
1966
1966
|
/**
|
|
1967
1967
|
Create a failed step result.
|
|
1968
1968
|
*/
|
|
@@ -1972,7 +1972,7 @@ declare class StepResult$1 {
|
|
|
1972
1972
|
arguments. Create a successful result if it succeeds, and a
|
|
1973
1973
|
failed one if it throws a `ReplaceError`.
|
|
1974
1974
|
*/
|
|
1975
|
-
static fromReplace(doc: Node$
|
|
1975
|
+
static fromReplace(doc: Node$4, from: number, to: number, slice: Slice$1): StepResult$1;
|
|
1976
1976
|
}
|
|
1977
1977
|
|
|
1978
1978
|
/**
|
|
@@ -1987,7 +1987,7 @@ declare class Transform$1 {
|
|
|
1987
1987
|
The current document (the result of applying the steps in the
|
|
1988
1988
|
transform).
|
|
1989
1989
|
*/
|
|
1990
|
-
doc: Node$
|
|
1990
|
+
doc: Node$4;
|
|
1991
1991
|
/**
|
|
1992
1992
|
The steps in this transform.
|
|
1993
1993
|
*/
|
|
@@ -1995,7 +1995,7 @@ declare class Transform$1 {
|
|
|
1995
1995
|
/**
|
|
1996
1996
|
The documents before each of the steps.
|
|
1997
1997
|
*/
|
|
1998
|
-
readonly docs: Node$
|
|
1998
|
+
readonly docs: Node$4[];
|
|
1999
1999
|
/**
|
|
2000
2000
|
A mapping with the maps for each of the steps in this transform.
|
|
2001
2001
|
*/
|
|
@@ -2008,11 +2008,11 @@ declare class Transform$1 {
|
|
|
2008
2008
|
The current document (the result of applying the steps in the
|
|
2009
2009
|
transform).
|
|
2010
2010
|
*/
|
|
2011
|
-
doc: Node$
|
|
2011
|
+
doc: Node$4);
|
|
2012
2012
|
/**
|
|
2013
2013
|
The starting document.
|
|
2014
2014
|
*/
|
|
2015
|
-
get before(): Node$
|
|
2015
|
+
get before(): Node$4;
|
|
2016
2016
|
/**
|
|
2017
2017
|
Apply a new step in this transform, saving the result. Throws an
|
|
2018
2018
|
error when the step fails.
|
|
@@ -2029,6 +2029,16 @@ declare class Transform$1 {
|
|
|
2029
2029
|
*/
|
|
2030
2030
|
get docChanged(): boolean;
|
|
2031
2031
|
/**
|
|
2032
|
+
Return a single range, in post-transform document positions,
|
|
2033
|
+
that covers all content changed by this transform. Returns null
|
|
2034
|
+
if no replacements are made. Note that this will ignore changes
|
|
2035
|
+
that add/remove marks without replacing the underlying content.
|
|
2036
|
+
*/
|
|
2037
|
+
changedRange(): {
|
|
2038
|
+
from: number;
|
|
2039
|
+
to: number;
|
|
2040
|
+
} | null;
|
|
2041
|
+
/**
|
|
2032
2042
|
Replace the part of the document between `from` and `to` with the
|
|
2033
2043
|
given `slice`.
|
|
2034
2044
|
*/
|
|
@@ -2037,7 +2047,7 @@ declare class Transform$1 {
|
|
|
2037
2047
|
Replace the given range with the given content, which may be a
|
|
2038
2048
|
fragment, node, or array of nodes.
|
|
2039
2049
|
*/
|
|
2040
|
-
replaceWith(from: number, to: number, content: Fragment$1 | Node$
|
|
2050
|
+
replaceWith(from: number, to: number, content: Fragment$1 | Node$4 | readonly Node$4[]): this;
|
|
2041
2051
|
/**
|
|
2042
2052
|
Delete the content between the given positions.
|
|
2043
2053
|
*/
|
|
@@ -2045,7 +2055,7 @@ declare class Transform$1 {
|
|
|
2045
2055
|
/**
|
|
2046
2056
|
Insert the given content at the given position.
|
|
2047
2057
|
*/
|
|
2048
|
-
insert(pos: number, content: Fragment$1 | Node$
|
|
2058
|
+
insert(pos: number, content: Fragment$1 | Node$4 | readonly Node$4[]): this;
|
|
2049
2059
|
/**
|
|
2050
2060
|
Replace a range of the document with a given slice, using
|
|
2051
2061
|
`from`, `to`, and the slice's
|
|
@@ -2075,7 +2085,7 @@ declare class Transform$1 {
|
|
|
2075
2085
|
completely covers a parent node, this method may completely replace
|
|
2076
2086
|
that parent node.
|
|
2077
2087
|
*/
|
|
2078
|
-
replaceRangeWith(from: number, to: number, node: Node$
|
|
2088
|
+
replaceRangeWith(from: number, to: number, node: Node$4): this;
|
|
2079
2089
|
/**
|
|
2080
2090
|
Delete the given range, expanding it to cover fully covered
|
|
2081
2091
|
parent nodes until a valid replace is found.
|
|
@@ -2107,7 +2117,7 @@ declare class Transform$1 {
|
|
|
2107
2117
|
Set the type of all textblocks (partly) between `from` and `to` to
|
|
2108
2118
|
the given node type with the given attributes.
|
|
2109
2119
|
*/
|
|
2110
|
-
setBlockType(from: number, to: number | undefined, type: NodeType$3, attrs?: Attrs$1 | null | ((oldNode: Node$
|
|
2120
|
+
setBlockType(from: number, to: number | undefined, type: NodeType$3, attrs?: Attrs$1 | null | ((oldNode: Node$4) => Attrs$1)): this;
|
|
2111
2121
|
/**
|
|
2112
2122
|
Change the type, attributes, and/or marks of the node at `pos`.
|
|
2113
2123
|
When `type` isn't given, the existing node type is preserved,
|
|
@@ -2330,11 +2340,11 @@ interface DecorationSource$1 {
|
|
|
2330
2340
|
Map the set of decorations in response to a change in the
|
|
2331
2341
|
document.
|
|
2332
2342
|
*/
|
|
2333
|
-
map: (mapping: Mapping$1, node: Node$
|
|
2343
|
+
map: (mapping: Mapping$1, node: Node$4) => DecorationSource$1;
|
|
2334
2344
|
/**
|
|
2335
2345
|
Extract a DecorationSource containing decorations for the given child node at the given offset.
|
|
2336
2346
|
*/
|
|
2337
|
-
forChild(offset: number, child: Node$
|
|
2347
|
+
forChild(offset: number, child: Node$4): DecorationSource$1;
|
|
2338
2348
|
/**
|
|
2339
2349
|
Call the given function for each decoration set in the group.
|
|
2340
2350
|
*/
|
|
@@ -2352,7 +2362,7 @@ declare class DecorationSet$1 implements DecorationSource$1 {
|
|
|
2352
2362
|
document. This will consume (modify) the `decorations` array, so
|
|
2353
2363
|
you must make a copy if you want need to preserve that.
|
|
2354
2364
|
*/
|
|
2355
|
-
static create(doc: Node$
|
|
2365
|
+
static create(doc: Node$4, decorations: Decoration$1[]): DecorationSet$1;
|
|
2356
2366
|
/**
|
|
2357
2367
|
Find all decorations in this set which touch the given range
|
|
2358
2368
|
(including decorations that start or end directly at the
|
|
@@ -2367,7 +2377,7 @@ declare class DecorationSet$1 implements DecorationSource$1 {
|
|
|
2367
2377
|
Map the set of decorations in response to a change in the
|
|
2368
2378
|
document.
|
|
2369
2379
|
*/
|
|
2370
|
-
map(mapping: Mapping$1, doc: Node$
|
|
2380
|
+
map(mapping: Mapping$1, doc: Node$4, options?: {
|
|
2371
2381
|
/**
|
|
2372
2382
|
When given, this function will be called for each decoration
|
|
2373
2383
|
that gets dropped as a result of the mapping, passing the
|
|
@@ -2381,7 +2391,7 @@ declare class DecorationSet$1 implements DecorationSource$1 {
|
|
|
2381
2391
|
access to the current document to create the appropriate tree
|
|
2382
2392
|
structure.
|
|
2383
2393
|
*/
|
|
2384
|
-
add(doc: Node$
|
|
2394
|
+
add(doc: Node$4, decorations: Decoration$1[]): DecorationSet$1;
|
|
2385
2395
|
private addInner;
|
|
2386
2396
|
/**
|
|
2387
2397
|
Create a new set that contains the decorations in this set, minus
|
|
@@ -2389,7 +2399,7 @@ declare class DecorationSet$1 implements DecorationSource$1 {
|
|
|
2389
2399
|
*/
|
|
2390
2400
|
remove(decorations: Decoration$1[]): DecorationSet$1;
|
|
2391
2401
|
private removeInner;
|
|
2392
|
-
forChild(offset: number, node: Node$
|
|
2402
|
+
forChild(offset: number, node: Node$4): DecorationSet$1 | DecorationGroup$1;
|
|
2393
2403
|
/**
|
|
2394
2404
|
The empty set of decorations.
|
|
2395
2405
|
*/
|
|
@@ -2399,10 +2409,10 @@ declare class DecorationSet$1 implements DecorationSource$1 {
|
|
|
2399
2409
|
declare class DecorationGroup$1 implements DecorationSource$1 {
|
|
2400
2410
|
readonly members: readonly DecorationSet$1[];
|
|
2401
2411
|
constructor(members: readonly DecorationSet$1[]);
|
|
2402
|
-
map(mapping: Mapping$1, doc: Node$
|
|
2403
|
-
forChild(offset: number, child: Node$
|
|
2412
|
+
map(mapping: Mapping$1, doc: Node$4): DecorationSource$1;
|
|
2413
|
+
forChild(offset: number, child: Node$4): DecorationSource$1 | DecorationSet$1;
|
|
2404
2414
|
eq(other: DecorationGroup$1): boolean;
|
|
2405
|
-
locals(node: Node$
|
|
2415
|
+
locals(node: Node$4): readonly any[];
|
|
2406
2416
|
static from(members: readonly DecorationSource$1[]): DecorationSource$1;
|
|
2407
2417
|
forEachSet(f: (set: DecorationSet$1) => void): void;
|
|
2408
2418
|
}
|
|
@@ -2458,7 +2468,7 @@ interface NodeView$1 {
|
|
|
2458
2468
|
`contentDOM` property (or no `dom` property), updating its child
|
|
2459
2469
|
nodes will be handled by ProseMirror.
|
|
2460
2470
|
*/
|
|
2461
|
-
update?: (node: Node$
|
|
2471
|
+
update?: (node: Node$4, decorations: readonly Decoration$1[], innerDecorations: DecorationSource$1) => boolean;
|
|
2462
2472
|
/**
|
|
2463
2473
|
By default, `update` will only be called when a node of the same
|
|
2464
2474
|
node type appears in this view's position. When you set this to
|
|
@@ -2767,7 +2777,7 @@ declare class EditorView$1 {
|
|
|
2767
2777
|
The type of function [provided](https://prosemirror.net/docs/ref/#view.EditorProps.nodeViews) to
|
|
2768
2778
|
create [node views](https://prosemirror.net/docs/ref/#view.NodeView).
|
|
2769
2779
|
*/
|
|
2770
|
-
type NodeViewConstructor$1 = (node: Node$
|
|
2780
|
+
type NodeViewConstructor$1 = (node: Node$4, view: EditorView$1, getPos: () => number | undefined, decorations: readonly Decoration$1[], innerDecorations: DecorationSource$1) => NodeView$1;
|
|
2771
2781
|
/**
|
|
2772
2782
|
The function types [used](https://prosemirror.net/docs/ref/#view.EditorProps.markViews) to create
|
|
2773
2783
|
mark views.
|
|
@@ -2831,7 +2841,7 @@ interface EditorProps$1<P = any> {
|
|
|
2831
2841
|
Called for each node around a click, from the inside out. The
|
|
2832
2842
|
`direct` flag will be true for the inner node.
|
|
2833
2843
|
*/
|
|
2834
|
-
handleClickOn?: (this: P, view: EditorView$1, pos: number, node: Node$
|
|
2844
|
+
handleClickOn?: (this: P, view: EditorView$1, pos: number, node: Node$4, nodePos: number, event: MouseEvent, direct: boolean) => boolean | void;
|
|
2835
2845
|
/**
|
|
2836
2846
|
Called when the editor is clicked, after `handleClickOn` handlers
|
|
2837
2847
|
have been called.
|
|
@@ -2840,7 +2850,7 @@ interface EditorProps$1<P = any> {
|
|
|
2840
2850
|
/**
|
|
2841
2851
|
Called for each node around a double click.
|
|
2842
2852
|
*/
|
|
2843
|
-
handleDoubleClickOn?: (this: P, view: EditorView$1, pos: number, node: Node$
|
|
2853
|
+
handleDoubleClickOn?: (this: P, view: EditorView$1, pos: number, node: Node$4, nodePos: number, event: MouseEvent, direct: boolean) => boolean | void;
|
|
2844
2854
|
/**
|
|
2845
2855
|
Called when the editor is double-clicked, after `handleDoubleClickOn`.
|
|
2846
2856
|
*/
|
|
@@ -2848,7 +2858,7 @@ interface EditorProps$1<P = any> {
|
|
|
2848
2858
|
/**
|
|
2849
2859
|
Called for each node around a triple click.
|
|
2850
2860
|
*/
|
|
2851
|
-
handleTripleClickOn?: (this: P, view: EditorView$1, pos: number, node: Node$
|
|
2861
|
+
handleTripleClickOn?: (this: P, view: EditorView$1, pos: number, node: Node$4, nodePos: number, event: MouseEvent, direct: boolean) => boolean | void;
|
|
2852
2862
|
/**
|
|
2853
2863
|
Called when the editor is triple-clicked, after `handleTripleClickOn`.
|
|
2854
2864
|
*/
|
|
@@ -3075,7 +3085,7 @@ interface EditorStateConfig$1 {
|
|
|
3075
3085
|
The starting document. Either this or `schema` _must_ be
|
|
3076
3086
|
provided.
|
|
3077
3087
|
*/
|
|
3078
|
-
doc?: Node$
|
|
3088
|
+
doc?: Node$4;
|
|
3079
3089
|
/**
|
|
3080
3090
|
A valid selection in the document.
|
|
3081
3091
|
*/
|
|
@@ -3102,7 +3112,7 @@ declare class EditorState$1 {
|
|
|
3102
3112
|
/**
|
|
3103
3113
|
The current document.
|
|
3104
3114
|
*/
|
|
3105
|
-
doc: Node$
|
|
3115
|
+
doc: Node$4;
|
|
3106
3116
|
/**
|
|
3107
3117
|
The selection.
|
|
3108
3118
|
*/
|
|
@@ -3421,7 +3431,7 @@ declare class Transaction$1 extends Transform$1 {
|
|
|
3421
3431
|
true and the content is inline, it inherits the marks from the
|
|
3422
3432
|
place where it is inserted.
|
|
3423
3433
|
*/
|
|
3424
|
-
replaceSelectionWith(node: Node$
|
|
3434
|
+
replaceSelectionWith(node: Node$4, inheritMarks?: boolean): this;
|
|
3425
3435
|
/**
|
|
3426
3436
|
Delete the selection.
|
|
3427
3437
|
*/
|
|
@@ -3527,7 +3537,7 @@ declare abstract class Selection$1 {
|
|
|
3527
3537
|
Map this selection through a [mappable](https://prosemirror.net/docs/ref/#transform.Mappable)
|
|
3528
3538
|
thing. `doc` should be the new document to which we are mapping.
|
|
3529
3539
|
*/
|
|
3530
|
-
abstract map(doc: Node$
|
|
3540
|
+
abstract map(doc: Node$4, mapping: Mappable$1): Selection$1;
|
|
3531
3541
|
/**
|
|
3532
3542
|
Get the content of this selection as a slice.
|
|
3533
3543
|
*/
|
|
@@ -3541,7 +3551,7 @@ declare abstract class Selection$1 {
|
|
|
3541
3551
|
Replace the selection with the given node, appending the changes
|
|
3542
3552
|
to the given transaction.
|
|
3543
3553
|
*/
|
|
3544
|
-
replaceWith(tr: Transaction$1, node: Node$
|
|
3554
|
+
replaceWith(tr: Transaction$1, node: Node$4): void;
|
|
3545
3555
|
/**
|
|
3546
3556
|
Convert the selection to a JSON representation. When implementing
|
|
3547
3557
|
this for a custom selection class, make sure to give the object a
|
|
@@ -3569,17 +3579,17 @@ declare abstract class Selection$1 {
|
|
|
3569
3579
|
[`AllSelection`](https://prosemirror.net/docs/ref/#state.AllSelection) if no valid position
|
|
3570
3580
|
exists.
|
|
3571
3581
|
*/
|
|
3572
|
-
static atStart(doc: Node$
|
|
3582
|
+
static atStart(doc: Node$4): Selection$1;
|
|
3573
3583
|
/**
|
|
3574
3584
|
Find the cursor or leaf node selection closest to the end of the
|
|
3575
3585
|
given document.
|
|
3576
3586
|
*/
|
|
3577
|
-
static atEnd(doc: Node$
|
|
3587
|
+
static atEnd(doc: Node$4): Selection$1;
|
|
3578
3588
|
/**
|
|
3579
3589
|
Deserialize the JSON representation of a selection. Must be
|
|
3580
3590
|
implemented for custom classes (as a static class method).
|
|
3581
3591
|
*/
|
|
3582
|
-
static fromJSON(doc: Node$
|
|
3592
|
+
static fromJSON(doc: Node$4, json: any): Selection$1;
|
|
3583
3593
|
/**
|
|
3584
3594
|
To be able to deserialize selections from JSON, custom selection
|
|
3585
3595
|
classes must register themselves with an ID string, so that they
|
|
@@ -3587,9 +3597,9 @@ declare abstract class Selection$1 {
|
|
|
3587
3597
|
clash with classes from other modules.
|
|
3588
3598
|
*/
|
|
3589
3599
|
static jsonID(id: string, selectionClass: {
|
|
3590
|
-
fromJSON: (doc: Node$
|
|
3600
|
+
fromJSON: (doc: Node$4, json: any) => Selection$1;
|
|
3591
3601
|
}): {
|
|
3592
|
-
fromJSON: (doc: Node$
|
|
3602
|
+
fromJSON: (doc: Node$4, json: any) => Selection$1;
|
|
3593
3603
|
};
|
|
3594
3604
|
/**
|
|
3595
3605
|
Get a [bookmark](https://prosemirror.net/docs/ref/#state.SelectionBookmark) for this selection,
|
|
@@ -3624,7 +3634,7 @@ interface SelectionBookmark$1 {
|
|
|
3624
3634
|
[`TextSelection.between`](https://prosemirror.net/docs/ref/#state.TextSelection^between)) if
|
|
3625
3635
|
mapping made the bookmark invalid.
|
|
3626
3636
|
*/
|
|
3627
|
-
resolve: (doc: Node$
|
|
3637
|
+
resolve: (doc: Node$4) => Selection$1;
|
|
3628
3638
|
}
|
|
3629
3639
|
/**
|
|
3630
3640
|
Represents a selected range in a document.
|
|
@@ -4067,7 +4077,7 @@ interface NodeConfig$1<Options = any, Storage = any> extends ExtendableConfig$1<
|
|
|
4067
4077
|
parent: ParentConfig$1<NodeConfig$1<Options, Storage>>['renderHTML'];
|
|
4068
4078
|
editor?: Editor$1;
|
|
4069
4079
|
}, props: {
|
|
4070
|
-
node: Node$
|
|
4080
|
+
node: Node$4;
|
|
4071
4081
|
HTMLAttributes: Record<string, any>;
|
|
4072
4082
|
}) => DOMOutputSpec$1) | null;
|
|
4073
4083
|
/**
|
|
@@ -4081,9 +4091,9 @@ interface NodeConfig$1<Options = any, Storage = any> extends ExtendableConfig$1<
|
|
|
4081
4091
|
parent: ParentConfig$1<NodeConfig$1<Options, Storage>>['renderText'];
|
|
4082
4092
|
editor?: Editor$1;
|
|
4083
4093
|
}, props: {
|
|
4084
|
-
node: Node$
|
|
4094
|
+
node: Node$4;
|
|
4085
4095
|
pos: number;
|
|
4086
|
-
parent: Node$
|
|
4096
|
+
parent: Node$4;
|
|
4087
4097
|
index: number;
|
|
4088
4098
|
}) => string) | null;
|
|
4089
4099
|
/**
|
|
@@ -4102,21 +4112,21 @@ interface NodeConfig$1<Options = any, Storage = any> extends ExtendableConfig$1<
|
|
|
4102
4112
|
* The Node class is used to create custom node extensions.
|
|
4103
4113
|
* @see https://tiptap.dev/api/extensions#create-a-new-extension
|
|
4104
4114
|
*/
|
|
4105
|
-
declare class Node$
|
|
4115
|
+
declare class Node$3<Options = any, Storage = any> extends Extendable$1<Options, Storage, NodeConfig$1<Options, Storage>> {
|
|
4106
4116
|
type: string;
|
|
4107
4117
|
/**
|
|
4108
4118
|
* Create a new Node instance
|
|
4109
4119
|
* @param config - Node configuration object or a function that returns a configuration object
|
|
4110
4120
|
*/
|
|
4111
|
-
static create<O = any, S = any>(config?: Partial<NodeConfig$1<O, S>> | (() => Partial<NodeConfig$1<O, S>>)): Node$
|
|
4112
|
-
configure(options?: Partial<Options>): Node$
|
|
4121
|
+
static create<O = any, S = any>(config?: Partial<NodeConfig$1<O, S>> | (() => Partial<NodeConfig$1<O, S>>)): Node$3<O, S>;
|
|
4122
|
+
configure(options?: Partial<Options>): Node$3<Options, Storage>;
|
|
4113
4123
|
extend<ExtendedOptions = Options, ExtendedStorage = Storage, ExtendedConfig extends NodeConfig$1<ExtendedOptions, ExtendedStorage> = NodeConfig$1<ExtendedOptions, ExtendedStorage>>(extendedConfig?: (() => Partial<ExtendedConfig>) | (Partial<ExtendedConfig> & ThisType<{
|
|
4114
4124
|
name: string;
|
|
4115
4125
|
options: ExtendedOptions;
|
|
4116
4126
|
storage: ExtendedStorage;
|
|
4117
4127
|
editor: Editor$1;
|
|
4118
4128
|
type: NodeType$3;
|
|
4119
|
-
}>)): Node$
|
|
4129
|
+
}>)): Node$3<ExtendedOptions, ExtendedStorage>;
|
|
4120
4130
|
}
|
|
4121
4131
|
|
|
4122
4132
|
type PasteRuleMatch$1 = {
|
|
@@ -4231,7 +4241,7 @@ interface ExtendableConfig$1<Options = any, Storage = any, Config extends Extens
|
|
|
4231
4241
|
name: string;
|
|
4232
4242
|
options: Options;
|
|
4233
4243
|
storage: Storage;
|
|
4234
|
-
extensions: (Node$
|
|
4244
|
+
extensions: (Node$3 | Mark$3)[];
|
|
4235
4245
|
parent: ParentConfig$1<Config>['addGlobalAttributes'];
|
|
4236
4246
|
}) => GlobalAttributes$1;
|
|
4237
4247
|
/**
|
|
@@ -4397,7 +4407,7 @@ interface ExtendableConfig$1<Options = any, Storage = any, Config extends Extens
|
|
|
4397
4407
|
options: Options;
|
|
4398
4408
|
storage: Storage;
|
|
4399
4409
|
parent: ParentConfig$1<Config>['extendNodeSchema'];
|
|
4400
|
-
}, extension: Node$
|
|
4410
|
+
}, extension: Node$3) => Record<string, any>) | null;
|
|
4401
4411
|
/**
|
|
4402
4412
|
* This function extends the schema of the mark.
|
|
4403
4413
|
* @example
|
|
@@ -4736,7 +4746,7 @@ interface EditorEvents$1 {
|
|
|
4736
4746
|
* The node which the deletion occurred in
|
|
4737
4747
|
* @note This can be a parent node of the deleted content
|
|
4738
4748
|
*/
|
|
4739
|
-
node: Node$
|
|
4749
|
+
node: Node$4;
|
|
4740
4750
|
/**
|
|
4741
4751
|
* The new start position of the node in the document (after the deletion)
|
|
4742
4752
|
*/
|
|
@@ -5139,7 +5149,7 @@ interface NodeViewRendererProps$1 {
|
|
|
5139
5149
|
/**
|
|
5140
5150
|
* The extension that is responsible for the node.
|
|
5141
5151
|
*/
|
|
5142
|
-
extension: Node$
|
|
5152
|
+
extension: Node$3;
|
|
5143
5153
|
/**
|
|
5144
5154
|
* The HTML attributes that should be added to the node's DOM element.
|
|
5145
5155
|
*/
|
|
@@ -5195,9 +5205,9 @@ type Range$1 = {
|
|
|
5195
5205
|
to: number;
|
|
5196
5206
|
};
|
|
5197
5207
|
type TextSerializer$1 = (props: {
|
|
5198
|
-
node: Node$
|
|
5208
|
+
node: Node$4;
|
|
5199
5209
|
pos: number;
|
|
5200
|
-
parent: Node$
|
|
5210
|
+
parent: Node$4;
|
|
5201
5211
|
index: number;
|
|
5202
5212
|
range: Range$1;
|
|
5203
5213
|
}) => string;
|
|
@@ -5438,9 +5448,9 @@ declare class NodePos$1 {
|
|
|
5438
5448
|
private isBlock;
|
|
5439
5449
|
private editor;
|
|
5440
5450
|
private get name();
|
|
5441
|
-
constructor(pos: ResolvedPos$1, editor: Editor$1, isBlock?: boolean, node?: Node$
|
|
5451
|
+
constructor(pos: ResolvedPos$1, editor: Editor$1, isBlock?: boolean, node?: Node$4 | null);
|
|
5442
5452
|
private currentNode;
|
|
5443
|
-
get node(): Node$
|
|
5453
|
+
get node(): Node$4;
|
|
5444
5454
|
get element(): HTMLElement;
|
|
5445
5455
|
actualDepth: number | null;
|
|
5446
5456
|
get depth(): number;
|
|
@@ -5777,7 +5787,7 @@ declare module '@tiptap/core' {
|
|
|
5777
5787
|
/**
|
|
5778
5788
|
* The ProseMirror content to insert.
|
|
5779
5789
|
*/
|
|
5780
|
-
value: Content$1 | Node$
|
|
5790
|
+
value: Content$1 | Node$4 | Fragment$1,
|
|
5781
5791
|
/**
|
|
5782
5792
|
* Optional options
|
|
5783
5793
|
*/
|
|
@@ -5800,7 +5810,7 @@ declare module '@tiptap/core' {
|
|
|
5800
5810
|
/**
|
|
5801
5811
|
* The ProseMirror content to insert.
|
|
5802
5812
|
*/
|
|
5803
|
-
value: Content$1 | Node$
|
|
5813
|
+
value: Content$1 | Node$4 | Fragment$1,
|
|
5804
5814
|
/**
|
|
5805
5815
|
* Optional options
|
|
5806
5816
|
*/
|
|
@@ -6068,7 +6078,7 @@ declare module '@tiptap/core' {
|
|
|
6068
6078
|
/**
|
|
6069
6079
|
* The new content.
|
|
6070
6080
|
*/
|
|
6071
|
-
content: Content$1 | Fragment$1 | Node$
|
|
6081
|
+
content: Content$1 | Fragment$1 | Node$4,
|
|
6072
6082
|
/**
|
|
6073
6083
|
* Options for `setContent`.
|
|
6074
6084
|
*/
|
|
@@ -6567,6 +6577,62 @@ interface Commands$1<ReturnType = any> {
|
|
|
6567
6577
|
interface Storage$1 {
|
|
6568
6578
|
}
|
|
6569
6579
|
|
|
6580
|
+
type DocxImageExportHandler = (src: string) => Promise<Uint8Array>;
|
|
6581
|
+
/**
|
|
6582
|
+
* Convert image MIME type to DOCX type
|
|
6583
|
+
*/
|
|
6584
|
+
declare function convertToDocxImageType(mimeType?: string): "jpg" | "png" | "gif" | "bmp";
|
|
6585
|
+
/**
|
|
6586
|
+
* Extract image type from URL or base64 data
|
|
6587
|
+
*/
|
|
6588
|
+
declare function getImageTypeFromSrc(src: string): "png" | "jpeg" | "gif" | "bmp" | "tiff";
|
|
6589
|
+
/**
|
|
6590
|
+
* Create floating options for full-width images
|
|
6591
|
+
*/
|
|
6592
|
+
declare function createFloatingOptions(): {
|
|
6593
|
+
horizontalPosition: {
|
|
6594
|
+
relative: string;
|
|
6595
|
+
align: string;
|
|
6596
|
+
};
|
|
6597
|
+
verticalPosition: {
|
|
6598
|
+
relative: string;
|
|
6599
|
+
align: string;
|
|
6600
|
+
};
|
|
6601
|
+
lockAnchor: boolean;
|
|
6602
|
+
behindDocument: boolean;
|
|
6603
|
+
inFrontOfText: boolean;
|
|
6604
|
+
};
|
|
6605
|
+
/**
|
|
6606
|
+
* Get image width with priority: node attrs > image meta > calculated > default
|
|
6607
|
+
*/
|
|
6608
|
+
declare function getImageWidth(node: {
|
|
6609
|
+
attrs?: {
|
|
6610
|
+
width?: number | null;
|
|
6611
|
+
};
|
|
6612
|
+
}, imageMeta?: {
|
|
6613
|
+
width?: number;
|
|
6614
|
+
height?: number;
|
|
6615
|
+
}, maxWidth?: number | PositiveUniversalMeasure$1): number;
|
|
6616
|
+
/**
|
|
6617
|
+
* Get image height with priority: node attrs > image meta > calculated > default
|
|
6618
|
+
*/
|
|
6619
|
+
declare function getImageHeight(node: {
|
|
6620
|
+
attrs?: {
|
|
6621
|
+
height?: number | null;
|
|
6622
|
+
};
|
|
6623
|
+
}, width: number, imageMeta?: {
|
|
6624
|
+
width?: number;
|
|
6625
|
+
height?: number;
|
|
6626
|
+
}, maxWidth?: number | PositiveUniversalMeasure$1): number;
|
|
6627
|
+
/**
|
|
6628
|
+
* Fetch image data and metadata from HTTP/HTTPS URL
|
|
6629
|
+
* (Only for use without custom handler)
|
|
6630
|
+
*/
|
|
6631
|
+
declare function getImageDataAndMeta(url: string): Promise<{
|
|
6632
|
+
data: Uint8Array;
|
|
6633
|
+
meta: ImageMeta;
|
|
6634
|
+
}>;
|
|
6635
|
+
|
|
6570
6636
|
/**
|
|
6571
6637
|
* Options for exporting TipTap content to DOCX
|
|
6572
6638
|
*/
|
|
@@ -6598,6 +6664,7 @@ interface DocxExportOptions<T extends OutputType = OutputType> {
|
|
|
6598
6664
|
run?: Partial<ITableOfContentsOptions>;
|
|
6599
6665
|
};
|
|
6600
6666
|
image?: {
|
|
6667
|
+
handler?: DocxImageExportHandler;
|
|
6601
6668
|
style?: IParagraphStyleOptions;
|
|
6602
6669
|
run?: Partial<IImageOptions$1>;
|
|
6603
6670
|
};
|
|
@@ -6617,6 +6684,9 @@ interface DocxExportOptions<T extends OutputType = OutputType> {
|
|
|
6617
6684
|
run?: Partial<ITableCellOptions>;
|
|
6618
6685
|
};
|
|
6619
6686
|
};
|
|
6687
|
+
code?: {
|
|
6688
|
+
style?: IParagraphStyleOptions;
|
|
6689
|
+
};
|
|
6620
6690
|
details?: {
|
|
6621
6691
|
summary?: {
|
|
6622
6692
|
paragraph?: Partial<IParagraphOptions>;
|
|
@@ -6642,9 +6712,16 @@ declare function generateDOCX<T extends OutputType>(docJson: JSONContent$1, opti
|
|
|
6642
6712
|
/**
|
|
6643
6713
|
* Convert document content to DOCX elements
|
|
6644
6714
|
*/
|
|
6645
|
-
declare function
|
|
6715
|
+
declare function convertDocument(node: JSONContent$1, params: {
|
|
6716
|
+
options: DocxExportOptions;
|
|
6717
|
+
}): Promise<FileChild[]>;
|
|
6646
6718
|
/**
|
|
6647
6719
|
* Convert a single node to DOCX element(s)
|
|
6720
|
+
*
|
|
6721
|
+
* This function implements a three-layer architecture:
|
|
6722
|
+
* 1. Data Transformation: Convert node.attrs → IParagraphOptions (pure data)
|
|
6723
|
+
* 2. Style Application: Apply styleId references (if configured)
|
|
6724
|
+
* 3. Object Creation: Create actual DOCX instances (Paragraph, Table, etc.)
|
|
6648
6725
|
*/
|
|
6649
6726
|
declare function convertNode(node: JSONContent$1, options: DocxExportOptions, effectiveContentWidth: number): Promise<FileChild | FileChild[] | null>;
|
|
6650
6727
|
|
|
@@ -6775,7 +6852,7 @@ declare class DOMSerializer {
|
|
|
6775
6852
|
The node serialization functions.
|
|
6776
6853
|
*/
|
|
6777
6854
|
readonly nodes: {
|
|
6778
|
-
[node: string]: (node: Node$1) => DOMOutputSpec;
|
|
6855
|
+
[node: string]: (node: Node$1$1) => DOMOutputSpec;
|
|
6779
6856
|
};
|
|
6780
6857
|
/**
|
|
6781
6858
|
The mark serialization functions.
|
|
@@ -6797,7 +6874,7 @@ declare class DOMSerializer {
|
|
|
6797
6874
|
The node serialization functions.
|
|
6798
6875
|
*/
|
|
6799
6876
|
nodes: {
|
|
6800
|
-
[node: string]: (node: Node$1) => DOMOutputSpec;
|
|
6877
|
+
[node: string]: (node: Node$1$1) => DOMOutputSpec;
|
|
6801
6878
|
},
|
|
6802
6879
|
/**
|
|
6803
6880
|
The mark serialization functions.
|
|
@@ -6821,7 +6898,7 @@ declare class DOMSerializer {
|
|
|
6821
6898
|
[`serializeFragment`](https://prosemirror.net/docs/ref/#model.DOMSerializer.serializeFragment) on
|
|
6822
6899
|
its [content](https://prosemirror.net/docs/ref/#model.Node.content).
|
|
6823
6900
|
*/
|
|
6824
|
-
serializeNode(node: Node$1, options?: {
|
|
6901
|
+
serializeNode(node: Node$1$1, options?: {
|
|
6825
6902
|
document?: Document;
|
|
6826
6903
|
}): globalThis.Node;
|
|
6827
6904
|
/**
|
|
@@ -6843,7 +6920,7 @@ declare class DOMSerializer {
|
|
|
6843
6920
|
This can be useful as a base to build a custom serializer from.
|
|
6844
6921
|
*/
|
|
6845
6922
|
static nodesFromSchema(schema: Schema): {
|
|
6846
|
-
[node: string]: (node: Node$1) => DOMOutputSpec;
|
|
6923
|
+
[node: string]: (node: Node$1$1) => DOMOutputSpec;
|
|
6847
6924
|
};
|
|
6848
6925
|
/**
|
|
6849
6926
|
Gather the serializers in a schema's mark specs into an object.
|
|
@@ -6883,16 +6960,16 @@ declare class ResolvedPos {
|
|
|
6883
6960
|
a position points into a text node, that node is not considered
|
|
6884
6961
|
the parent—text nodes are ‘flat’ in this model, and have no content.
|
|
6885
6962
|
*/
|
|
6886
|
-
get parent(): Node$1;
|
|
6963
|
+
get parent(): Node$1$1;
|
|
6887
6964
|
/**
|
|
6888
6965
|
The root node in which the position was resolved.
|
|
6889
6966
|
*/
|
|
6890
|
-
get doc(): Node$1;
|
|
6967
|
+
get doc(): Node$1$1;
|
|
6891
6968
|
/**
|
|
6892
6969
|
The ancestor node at the given level. `p.node(p.depth)` is the
|
|
6893
6970
|
same as `p.parent`.
|
|
6894
6971
|
*/
|
|
6895
|
-
node(depth?: number | null): Node$1;
|
|
6972
|
+
node(depth?: number | null): Node$1$1;
|
|
6896
6973
|
/**
|
|
6897
6974
|
The index into the ancestor at the given level. If this points
|
|
6898
6975
|
at the 3rd node in the 2nd paragraph on the top level, for
|
|
@@ -6936,13 +7013,13 @@ declare class ResolvedPos {
|
|
|
6936
7013
|
points into a text node, only the part of that node after the
|
|
6937
7014
|
position is returned.
|
|
6938
7015
|
*/
|
|
6939
|
-
get nodeAfter(): Node$1 | null;
|
|
7016
|
+
get nodeAfter(): Node$1$1 | null;
|
|
6940
7017
|
/**
|
|
6941
7018
|
Get the node directly before the position, if any. If the
|
|
6942
7019
|
position points into a text node, only the part of that node
|
|
6943
7020
|
before the position is returned.
|
|
6944
7021
|
*/
|
|
6945
|
-
get nodeBefore(): Node$1 | null;
|
|
7022
|
+
get nodeBefore(): Node$1$1 | null;
|
|
6946
7023
|
/**
|
|
6947
7024
|
Get the position at the given index in the parent node at the
|
|
6948
7025
|
given depth (which defaults to `this.depth`).
|
|
@@ -6978,7 +7055,7 @@ declare class ResolvedPos {
|
|
|
6978
7055
|
pass in an optional predicate that will be called with a parent
|
|
6979
7056
|
node to see if a range into that parent is acceptable.
|
|
6980
7057
|
*/
|
|
6981
|
-
blockRange(other?: ResolvedPos, pred?: (node: Node$1) => boolean): NodeRange | null;
|
|
7058
|
+
blockRange(other?: ResolvedPos, pred?: (node: Node$1$1) => boolean): NodeRange | null;
|
|
6982
7059
|
/**
|
|
6983
7060
|
Query whether the given position shares the same parent node.
|
|
6984
7061
|
*/
|
|
@@ -7046,7 +7123,7 @@ declare class NodeRange {
|
|
|
7046
7123
|
/**
|
|
7047
7124
|
The parent node that the range points into.
|
|
7048
7125
|
*/
|
|
7049
|
-
get parent(): Node$1;
|
|
7126
|
+
get parent(): Node$1$1;
|
|
7050
7127
|
/**
|
|
7051
7128
|
The start index of the range in the parent node.
|
|
7052
7129
|
*/
|
|
@@ -7165,7 +7242,7 @@ interface ParseOptions {
|
|
|
7165
7242
|
option to use the type and attributes from a different node
|
|
7166
7243
|
as the top container.
|
|
7167
7244
|
*/
|
|
7168
|
-
topNode?: Node$1;
|
|
7245
|
+
topNode?: Node$1$1;
|
|
7169
7246
|
/**
|
|
7170
7247
|
Provide the starting content match that content parsed into the
|
|
7171
7248
|
top node is matched against.
|
|
@@ -7355,7 +7432,7 @@ declare class DOMParser {
|
|
|
7355
7432
|
/**
|
|
7356
7433
|
Parse a document from the content of a DOM node.
|
|
7357
7434
|
*/
|
|
7358
|
-
parse(dom: DOMNode$1, options?: ParseOptions): Node$1;
|
|
7435
|
+
parse(dom: DOMNode$1, options?: ParseOptions): Node$1$1;
|
|
7359
7436
|
/**
|
|
7360
7437
|
Parses the content of the given DOM node, like
|
|
7361
7438
|
[`parse`](https://prosemirror.net/docs/ref/#model.DOMParser.parse), and takes the same set of
|
|
@@ -7463,13 +7540,13 @@ declare class NodeType$1 {
|
|
|
7463
7540
|
`null`. Similarly `marks` may be `null` to default to the empty
|
|
7464
7541
|
set of marks.
|
|
7465
7542
|
*/
|
|
7466
|
-
create(attrs?: Attrs | null, content?: Fragment | Node$1 | readonly Node$1[] | null, marks?: readonly Mark$1[]): Node$1;
|
|
7543
|
+
create(attrs?: Attrs | null, content?: Fragment | Node$1$1 | readonly Node$1$1[] | null, marks?: readonly Mark$1[]): Node$1$1;
|
|
7467
7544
|
/**
|
|
7468
7545
|
Like [`create`](https://prosemirror.net/docs/ref/#model.NodeType.create), but check the given content
|
|
7469
7546
|
against the node type's content restrictions, and throw an error
|
|
7470
7547
|
if it doesn't match.
|
|
7471
7548
|
*/
|
|
7472
|
-
createChecked(attrs?: Attrs | null, content?: Fragment | Node$1 | readonly Node$1[] | null, marks?: readonly Mark$1[]): Node$1;
|
|
7549
|
+
createChecked(attrs?: Attrs | null, content?: Fragment | Node$1$1 | readonly Node$1$1[] | null, marks?: readonly Mark$1[]): Node$1$1;
|
|
7473
7550
|
/**
|
|
7474
7551
|
Like [`create`](https://prosemirror.net/docs/ref/#model.NodeType.create), but see if it is
|
|
7475
7552
|
necessary to add nodes to the start or end of the given fragment
|
|
@@ -7478,7 +7555,7 @@ declare class NodeType$1 {
|
|
|
7478
7555
|
always be created, this will always succeed if you pass null or
|
|
7479
7556
|
`Fragment.empty` as content.
|
|
7480
7557
|
*/
|
|
7481
|
-
createAndFill(attrs?: Attrs | null, content?: Fragment | Node$1 | readonly Node$1[] | null, marks?: readonly Mark$1[]): Node$1 | null;
|
|
7558
|
+
createAndFill(attrs?: Attrs | null, content?: Fragment | Node$1$1 | readonly Node$1$1[] | null, marks?: readonly Mark$1[]): Node$1$1 | null;
|
|
7482
7559
|
/**
|
|
7483
7560
|
Returns true if the given fragment is valid content for this node
|
|
7484
7561
|
type.
|
|
@@ -7676,7 +7753,7 @@ interface NodeSpec {
|
|
|
7676
7753
|
differently, this is not supported inside the editor, so you
|
|
7677
7754
|
shouldn't override that in your text node spec.
|
|
7678
7755
|
*/
|
|
7679
|
-
toDOM?: (node: Node$1) => DOMOutputSpec;
|
|
7756
|
+
toDOM?: (node: Node$1$1) => DOMOutputSpec;
|
|
7680
7757
|
/**
|
|
7681
7758
|
Associates DOM parser information with this node, which can be
|
|
7682
7759
|
used by [`DOMParser.fromSchema`](https://prosemirror.net/docs/ref/#model.DOMParser^fromSchema) to
|
|
@@ -7690,14 +7767,14 @@ interface NodeSpec {
|
|
|
7690
7767
|
Defines the default way a node of this type should be serialized
|
|
7691
7768
|
to a string representation for debugging (e.g. in error messages).
|
|
7692
7769
|
*/
|
|
7693
|
-
toDebugString?: (node: Node$1) => string;
|
|
7770
|
+
toDebugString?: (node: Node$1$1) => string;
|
|
7694
7771
|
/**
|
|
7695
7772
|
Defines the default way a [leaf node](https://prosemirror.net/docs/ref/#model.NodeType.isLeaf) of
|
|
7696
7773
|
this type should be serialized to a string (as used by
|
|
7697
7774
|
[`Node.textBetween`](https://prosemirror.net/docs/ref/#model.Node.textBetween) and
|
|
7698
7775
|
[`Node.textContent`](https://prosemirror.net/docs/ref/#model.Node.textContent)).
|
|
7699
7776
|
*/
|
|
7700
|
-
leafText?: (node: Node$1) => string;
|
|
7777
|
+
leafText?: (node: Node$1$1) => string;
|
|
7701
7778
|
/**
|
|
7702
7779
|
A single inline node in a schema can be set to be a linebreak
|
|
7703
7780
|
equivalent. When converting between block types that support the
|
|
@@ -7871,12 +7948,12 @@ declare class Schema<Nodes extends string = any, Marks extends string = any> {
|
|
|
7871
7948
|
`content` may be a `Fragment`, `null`, a `Node`, or an array of
|
|
7872
7949
|
nodes.
|
|
7873
7950
|
*/
|
|
7874
|
-
node(type: string | NodeType$1, attrs?: Attrs | null, content?: Fragment | Node$1 | readonly Node$1[], marks?: readonly Mark$1[]): Node$1;
|
|
7951
|
+
node(type: string | NodeType$1, attrs?: Attrs | null, content?: Fragment | Node$1$1 | readonly Node$1$1[], marks?: readonly Mark$1[]): Node$1$1;
|
|
7875
7952
|
/**
|
|
7876
7953
|
Create a text node in the schema. Empty text nodes are not
|
|
7877
7954
|
allowed.
|
|
7878
7955
|
*/
|
|
7879
|
-
text(text: string, marks?: readonly Mark$1[] | null): Node$1;
|
|
7956
|
+
text(text: string, marks?: readonly Mark$1[] | null): Node$1$1;
|
|
7880
7957
|
/**
|
|
7881
7958
|
Create a mark with the given type and attributes.
|
|
7882
7959
|
*/
|
|
@@ -7885,7 +7962,7 @@ declare class Schema<Nodes extends string = any, Marks extends string = any> {
|
|
|
7885
7962
|
Deserialize a node from its JSON representation. This method is
|
|
7886
7963
|
bound.
|
|
7887
7964
|
*/
|
|
7888
|
-
nodeFromJSON: (json: any) => Node$1;
|
|
7965
|
+
nodeFromJSON: (json: any) => Node$1$1;
|
|
7889
7966
|
/**
|
|
7890
7967
|
Deserialize a mark from its JSON representation. This method is
|
|
7891
7968
|
bound.
|
|
@@ -7904,7 +7981,7 @@ declare class Fragment {
|
|
|
7904
7981
|
/**
|
|
7905
7982
|
The child nodes in this fragment.
|
|
7906
7983
|
*/
|
|
7907
|
-
readonly content: readonly Node$1[];
|
|
7984
|
+
readonly content: readonly Node$1$1[];
|
|
7908
7985
|
/**
|
|
7909
7986
|
The size of the fragment, which is the total of the size of
|
|
7910
7987
|
its content nodes.
|
|
@@ -7915,18 +7992,18 @@ declare class Fragment {
|
|
|
7915
7992
|
positions (relative to start of this fragment). Doesn't descend
|
|
7916
7993
|
into a node when the callback returns `false`.
|
|
7917
7994
|
*/
|
|
7918
|
-
nodesBetween(from: number, to: number, f: (node: Node$1, start: number, parent: Node$1 | null, index: number) => boolean | void, nodeStart?: number, parent?: Node$1): void;
|
|
7995
|
+
nodesBetween(from: number, to: number, f: (node: Node$1$1, start: number, parent: Node$1$1 | null, index: number) => boolean | void, nodeStart?: number, parent?: Node$1$1): void;
|
|
7919
7996
|
/**
|
|
7920
7997
|
Call the given callback for every descendant node. `pos` will be
|
|
7921
7998
|
relative to the start of the fragment. The callback may return
|
|
7922
7999
|
`false` to prevent traversal of a given node's children.
|
|
7923
8000
|
*/
|
|
7924
|
-
descendants(f: (node: Node$1, pos: number, parent: Node$1 | null, index: number) => boolean | void): void;
|
|
8001
|
+
descendants(f: (node: Node$1$1, pos: number, parent: Node$1$1 | null, index: number) => boolean | void): void;
|
|
7925
8002
|
/**
|
|
7926
8003
|
Extract the text between `from` and `to`. See the same method on
|
|
7927
8004
|
[`Node`](https://prosemirror.net/docs/ref/#model.Node.textBetween).
|
|
7928
8005
|
*/
|
|
7929
|
-
textBetween(from: number, to: number, blockSeparator?: string | null, leafText?: string | null | ((leafNode: Node$1) => string)): string;
|
|
8006
|
+
textBetween(from: number, to: number, blockSeparator?: string | null, leafText?: string | null | ((leafNode: Node$1$1) => string)): string;
|
|
7930
8007
|
/**
|
|
7931
8008
|
Create a new fragment containing the combined content of this
|
|
7932
8009
|
fragment and the other.
|
|
@@ -7940,17 +8017,17 @@ declare class Fragment {
|
|
|
7940
8017
|
Create a new fragment in which the node at the given index is
|
|
7941
8018
|
replaced by the given node.
|
|
7942
8019
|
*/
|
|
7943
|
-
replaceChild(index: number, node: Node$1): Fragment;
|
|
8020
|
+
replaceChild(index: number, node: Node$1$1): Fragment;
|
|
7944
8021
|
/**
|
|
7945
8022
|
Create a new fragment by prepending the given node to this
|
|
7946
8023
|
fragment.
|
|
7947
8024
|
*/
|
|
7948
|
-
addToStart(node: Node$1): Fragment;
|
|
8025
|
+
addToStart(node: Node$1$1): Fragment;
|
|
7949
8026
|
/**
|
|
7950
8027
|
Create a new fragment by appending the given node to this
|
|
7951
8028
|
fragment.
|
|
7952
8029
|
*/
|
|
7953
|
-
addToEnd(node: Node$1): Fragment;
|
|
8030
|
+
addToEnd(node: Node$1$1): Fragment;
|
|
7954
8031
|
/**
|
|
7955
8032
|
Compare this fragment to another one.
|
|
7956
8033
|
*/
|
|
@@ -7958,11 +8035,11 @@ declare class Fragment {
|
|
|
7958
8035
|
/**
|
|
7959
8036
|
The first child of the fragment, or `null` if it is empty.
|
|
7960
8037
|
*/
|
|
7961
|
-
get firstChild(): Node$1 | null;
|
|
8038
|
+
get firstChild(): Node$1$1 | null;
|
|
7962
8039
|
/**
|
|
7963
8040
|
The last child of the fragment, or `null` if it is empty.
|
|
7964
8041
|
*/
|
|
7965
|
-
get lastChild(): Node$1 | null;
|
|
8042
|
+
get lastChild(): Node$1$1 | null;
|
|
7966
8043
|
/**
|
|
7967
8044
|
The number of child nodes in this fragment.
|
|
7968
8045
|
*/
|
|
@@ -7971,16 +8048,16 @@ declare class Fragment {
|
|
|
7971
8048
|
Get the child node at the given index. Raise an error when the
|
|
7972
8049
|
index is out of range.
|
|
7973
8050
|
*/
|
|
7974
|
-
child(index: number): Node$1;
|
|
8051
|
+
child(index: number): Node$1$1;
|
|
7975
8052
|
/**
|
|
7976
8053
|
Get the child node at the given index, if it exists.
|
|
7977
8054
|
*/
|
|
7978
|
-
maybeChild(index: number): Node$1 | null;
|
|
8055
|
+
maybeChild(index: number): Node$1$1 | null;
|
|
7979
8056
|
/**
|
|
7980
8057
|
Call `f` for every child node, passing the node, its offset
|
|
7981
8058
|
into this parent node, and its index.
|
|
7982
8059
|
*/
|
|
7983
|
-
forEach(f: (node: Node$1, offset: number, index: number) => void): void;
|
|
8060
|
+
forEach(f: (node: Node$1$1, offset: number, index: number) => void): void;
|
|
7984
8061
|
/**
|
|
7985
8062
|
Find the first position at which this fragment and another
|
|
7986
8063
|
fragment differ, or `null` if they are the same.
|
|
@@ -8012,14 +8089,14 @@ declare class Fragment {
|
|
|
8012
8089
|
Build a fragment from an array of nodes. Ensures that adjacent
|
|
8013
8090
|
text nodes with the same marks are joined together.
|
|
8014
8091
|
*/
|
|
8015
|
-
static fromArray(array: readonly Node$1[]): Fragment;
|
|
8092
|
+
static fromArray(array: readonly Node$1$1[]): Fragment;
|
|
8016
8093
|
/**
|
|
8017
8094
|
Create a fragment from something that can be interpreted as a
|
|
8018
8095
|
set of nodes. For `null`, it returns the empty fragment. For a
|
|
8019
8096
|
fragment, the fragment itself. For a node or array of nodes, a
|
|
8020
8097
|
fragment containing those nodes.
|
|
8021
8098
|
*/
|
|
8022
|
-
static from(nodes?: Fragment | Node$1 | readonly Node$1[] | null): Fragment;
|
|
8099
|
+
static from(nodes?: Fragment | Node$1$1 | readonly Node$1$1[] | null): Fragment;
|
|
8023
8100
|
/**
|
|
8024
8101
|
An empty fragment. Intended to be reused whenever a node doesn't
|
|
8025
8102
|
contain anything (rather than allocating a new empty fragment for
|
|
@@ -8100,7 +8177,7 @@ tree shape like this (without back pointers) makes easy.
|
|
|
8100
8177
|
**Do not** directly mutate the properties of a `Node` object. See
|
|
8101
8178
|
[the guide](https://prosemirror.net/docs/guide/#doc) for more information.
|
|
8102
8179
|
*/
|
|
8103
|
-
declare class Node$1 {
|
|
8180
|
+
declare class Node$1$1 {
|
|
8104
8181
|
/**
|
|
8105
8182
|
The type of node that this is.
|
|
8106
8183
|
*/
|
|
@@ -8123,7 +8200,7 @@ declare class Node$1 {
|
|
|
8123
8200
|
/**
|
|
8124
8201
|
The array of this node's child nodes.
|
|
8125
8202
|
*/
|
|
8126
|
-
get children(): readonly Node$1[];
|
|
8203
|
+
get children(): readonly Node$1$1[];
|
|
8127
8204
|
/**
|
|
8128
8205
|
For text nodes, this contains the node's text content.
|
|
8129
8206
|
*/
|
|
@@ -8144,16 +8221,16 @@ declare class Node$1 {
|
|
|
8144
8221
|
Get the child node at the given index. Raises an error when the
|
|
8145
8222
|
index is out of range.
|
|
8146
8223
|
*/
|
|
8147
|
-
child(index: number): Node$1;
|
|
8224
|
+
child(index: number): Node$1$1;
|
|
8148
8225
|
/**
|
|
8149
8226
|
Get the child node at the given index, if it exists.
|
|
8150
8227
|
*/
|
|
8151
|
-
maybeChild(index: number): Node$1 | null;
|
|
8228
|
+
maybeChild(index: number): Node$1$1 | null;
|
|
8152
8229
|
/**
|
|
8153
8230
|
Call `f` for every child node, passing the node, its offset
|
|
8154
8231
|
into this parent node, and its index.
|
|
8155
8232
|
*/
|
|
8156
|
-
forEach(f: (node: Node$1, offset: number, index: number) => void): void;
|
|
8233
|
+
forEach(f: (node: Node$1$1, offset: number, index: number) => void): void;
|
|
8157
8234
|
/**
|
|
8158
8235
|
Invoke a callback for all descendant nodes recursively between
|
|
8159
8236
|
the given two positions that are relative to start of this
|
|
@@ -8164,12 +8241,12 @@ declare class Node$1 {
|
|
|
8164
8241
|
recursed over. The last parameter can be used to specify a
|
|
8165
8242
|
starting position to count from.
|
|
8166
8243
|
*/
|
|
8167
|
-
nodesBetween(from: number, to: number, f: (node: Node$1, pos: number, parent: Node$1 | null, index: number) => void | boolean, startPos?: number): void;
|
|
8244
|
+
nodesBetween(from: number, to: number, f: (node: Node$1$1, pos: number, parent: Node$1$1 | null, index: number) => void | boolean, startPos?: number): void;
|
|
8168
8245
|
/**
|
|
8169
8246
|
Call the given callback for every descendant node. Doesn't
|
|
8170
8247
|
descend into a node when the callback returns `false`.
|
|
8171
8248
|
*/
|
|
8172
|
-
descendants(f: (node: Node$1, pos: number, parent: Node$1 | null, index: number) => void | boolean): void;
|
|
8249
|
+
descendants(f: (node: Node$1$1, pos: number, parent: Node$1$1 | null, index: number) => void | boolean): void;
|
|
8173
8250
|
/**
|
|
8174
8251
|
Concatenates all the text nodes found in this fragment and its
|
|
8175
8252
|
children.
|
|
@@ -8182,26 +8259,26 @@ declare class Node$1 {
|
|
|
8182
8259
|
inserted for every non-text leaf node encountered, otherwise
|
|
8183
8260
|
[`leafText`](https://prosemirror.net/docs/ref/#model.NodeSpec.leafText) will be used.
|
|
8184
8261
|
*/
|
|
8185
|
-
textBetween(from: number, to: number, blockSeparator?: string | null, leafText?: null | string | ((leafNode: Node$1) => string)): string;
|
|
8262
|
+
textBetween(from: number, to: number, blockSeparator?: string | null, leafText?: null | string | ((leafNode: Node$1$1) => string)): string;
|
|
8186
8263
|
/**
|
|
8187
8264
|
Returns this node's first child, or `null` if there are no
|
|
8188
8265
|
children.
|
|
8189
8266
|
*/
|
|
8190
|
-
get firstChild(): Node$1 | null;
|
|
8267
|
+
get firstChild(): Node$1$1 | null;
|
|
8191
8268
|
/**
|
|
8192
8269
|
Returns this node's last child, or `null` if there are no
|
|
8193
8270
|
children.
|
|
8194
8271
|
*/
|
|
8195
|
-
get lastChild(): Node$1 | null;
|
|
8272
|
+
get lastChild(): Node$1$1 | null;
|
|
8196
8273
|
/**
|
|
8197
8274
|
Test whether two nodes represent the same piece of document.
|
|
8198
8275
|
*/
|
|
8199
|
-
eq(other: Node$1): boolean;
|
|
8276
|
+
eq(other: Node$1$1): boolean;
|
|
8200
8277
|
/**
|
|
8201
8278
|
Compare the markup (type, attributes, and marks) of this node to
|
|
8202
8279
|
those of another. Returns `true` if both have the same markup.
|
|
8203
8280
|
*/
|
|
8204
|
-
sameMarkup(other: Node$1): boolean;
|
|
8281
|
+
sameMarkup(other: Node$1$1): boolean;
|
|
8205
8282
|
/**
|
|
8206
8283
|
Check whether this node's markup correspond to the given type,
|
|
8207
8284
|
attributes, and marks.
|
|
@@ -8211,18 +8288,18 @@ declare class Node$1 {
|
|
|
8211
8288
|
Create a new node with the same markup as this node, containing
|
|
8212
8289
|
the given content (or empty, if no content is given).
|
|
8213
8290
|
*/
|
|
8214
|
-
copy(content?: Fragment | null): Node$1;
|
|
8291
|
+
copy(content?: Fragment | null): Node$1$1;
|
|
8215
8292
|
/**
|
|
8216
8293
|
Create a copy of this node, with the given set of marks instead
|
|
8217
8294
|
of the node's own marks.
|
|
8218
8295
|
*/
|
|
8219
|
-
mark(marks: readonly Mark$1[]): Node$1;
|
|
8296
|
+
mark(marks: readonly Mark$1[]): Node$1$1;
|
|
8220
8297
|
/**
|
|
8221
8298
|
Create a copy of this node with only the content between the
|
|
8222
8299
|
given positions. If `to` is not given, it defaults to the end of
|
|
8223
8300
|
the node.
|
|
8224
8301
|
*/
|
|
8225
|
-
cut(from: number, to?: number): Node$1;
|
|
8302
|
+
cut(from: number, to?: number): Node$1$1;
|
|
8226
8303
|
/**
|
|
8227
8304
|
Cut out the part of the document between the given positions, and
|
|
8228
8305
|
return it as a `Slice` object.
|
|
@@ -8236,18 +8313,18 @@ declare class Node$1 {
|
|
|
8236
8313
|
into. If any of this is violated, an error of type
|
|
8237
8314
|
[`ReplaceError`](https://prosemirror.net/docs/ref/#model.ReplaceError) is thrown.
|
|
8238
8315
|
*/
|
|
8239
|
-
replace(from: number, to: number, slice: Slice): Node$1;
|
|
8316
|
+
replace(from: number, to: number, slice: Slice): Node$1$1;
|
|
8240
8317
|
/**
|
|
8241
8318
|
Find the node directly after the given position.
|
|
8242
8319
|
*/
|
|
8243
|
-
nodeAt(pos: number): Node$1 | null;
|
|
8320
|
+
nodeAt(pos: number): Node$1$1 | null;
|
|
8244
8321
|
/**
|
|
8245
8322
|
Find the (direct) child node after the given offset, if any,
|
|
8246
8323
|
and return it along with its index and offset relative to this
|
|
8247
8324
|
node.
|
|
8248
8325
|
*/
|
|
8249
8326
|
childAfter(pos: number): {
|
|
8250
|
-
node: Node$1 | null;
|
|
8327
|
+
node: Node$1$1 | null;
|
|
8251
8328
|
index: number;
|
|
8252
8329
|
offset: number;
|
|
8253
8330
|
};
|
|
@@ -8257,7 +8334,7 @@ declare class Node$1 {
|
|
|
8257
8334
|
node.
|
|
8258
8335
|
*/
|
|
8259
8336
|
childBefore(pos: number): {
|
|
8260
|
-
node: Node$1 | null;
|
|
8337
|
+
node: Node$1$1 | null;
|
|
8261
8338
|
index: number;
|
|
8262
8339
|
offset: number;
|
|
8263
8340
|
};
|
|
@@ -8333,7 +8410,7 @@ declare class Node$1 {
|
|
|
8333
8410
|
is at least one node type that can appear in both nodes (to avoid
|
|
8334
8411
|
merging completely incompatible nodes).
|
|
8335
8412
|
*/
|
|
8336
|
-
canAppend(other: Node$1): boolean;
|
|
8413
|
+
canAppend(other: Node$1$1): boolean;
|
|
8337
8414
|
/**
|
|
8338
8415
|
Check whether this node and its descendants conform to the
|
|
8339
8416
|
schema, and raise an exception when they do not.
|
|
@@ -8346,7 +8423,7 @@ declare class Node$1 {
|
|
|
8346
8423
|
/**
|
|
8347
8424
|
Deserialize a node from its JSON representation.
|
|
8348
8425
|
*/
|
|
8349
|
-
static fromJSON(schema: Schema, json: any): Node$1;
|
|
8426
|
+
static fromJSON(schema: Schema, json: any): Node$1$1;
|
|
8350
8427
|
}
|
|
8351
8428
|
|
|
8352
8429
|
/**
|
|
@@ -8544,7 +8621,7 @@ declare abstract class Step {
|
|
|
8544
8621
|
applied to this document, or indicates success by containing a
|
|
8545
8622
|
transformed document.
|
|
8546
8623
|
*/
|
|
8547
|
-
abstract apply(doc: Node$1): StepResult;
|
|
8624
|
+
abstract apply(doc: Node$1$1): StepResult;
|
|
8548
8625
|
/**
|
|
8549
8626
|
Get the step map that represents the changes made by this step,
|
|
8550
8627
|
and which can be used to transform between positions in the old
|
|
@@ -8555,7 +8632,7 @@ declare abstract class Step {
|
|
|
8555
8632
|
Create an inverted version of this step. Needs the document as it
|
|
8556
8633
|
was before the step as argument.
|
|
8557
8634
|
*/
|
|
8558
|
-
abstract invert(doc: Node$1): Step;
|
|
8635
|
+
abstract invert(doc: Node$1$1): Step;
|
|
8559
8636
|
/**
|
|
8560
8637
|
Map this step through a mappable thing, returning either a
|
|
8561
8638
|
version of that step with its positions adjusted, or `null` if
|
|
@@ -8600,7 +8677,7 @@ declare class StepResult {
|
|
|
8600
8677
|
/**
|
|
8601
8678
|
The transformed document, if successful.
|
|
8602
8679
|
*/
|
|
8603
|
-
readonly doc: Node$1 | null;
|
|
8680
|
+
readonly doc: Node$1$1 | null;
|
|
8604
8681
|
/**
|
|
8605
8682
|
The failure message, if unsuccessful.
|
|
8606
8683
|
*/
|
|
@@ -8608,7 +8685,7 @@ declare class StepResult {
|
|
|
8608
8685
|
/**
|
|
8609
8686
|
Create a successful step result.
|
|
8610
8687
|
*/
|
|
8611
|
-
static ok(doc: Node$1): StepResult;
|
|
8688
|
+
static ok(doc: Node$1$1): StepResult;
|
|
8612
8689
|
/**
|
|
8613
8690
|
Create a failed step result.
|
|
8614
8691
|
*/
|
|
@@ -8618,7 +8695,7 @@ declare class StepResult {
|
|
|
8618
8695
|
arguments. Create a successful result if it succeeds, and a
|
|
8619
8696
|
failed one if it throws a `ReplaceError`.
|
|
8620
8697
|
*/
|
|
8621
|
-
static fromReplace(doc: Node$1, from: number, to: number, slice: Slice): StepResult;
|
|
8698
|
+
static fromReplace(doc: Node$1$1, from: number, to: number, slice: Slice): StepResult;
|
|
8622
8699
|
}
|
|
8623
8700
|
|
|
8624
8701
|
/**
|
|
@@ -8633,7 +8710,7 @@ declare class Transform {
|
|
|
8633
8710
|
The current document (the result of applying the steps in the
|
|
8634
8711
|
transform).
|
|
8635
8712
|
*/
|
|
8636
|
-
doc: Node$1;
|
|
8713
|
+
doc: Node$1$1;
|
|
8637
8714
|
/**
|
|
8638
8715
|
The steps in this transform.
|
|
8639
8716
|
*/
|
|
@@ -8641,7 +8718,7 @@ declare class Transform {
|
|
|
8641
8718
|
/**
|
|
8642
8719
|
The documents before each of the steps.
|
|
8643
8720
|
*/
|
|
8644
|
-
readonly docs: Node$1[];
|
|
8721
|
+
readonly docs: Node$1$1[];
|
|
8645
8722
|
/**
|
|
8646
8723
|
A mapping with the maps for each of the steps in this transform.
|
|
8647
8724
|
*/
|
|
@@ -8654,11 +8731,11 @@ declare class Transform {
|
|
|
8654
8731
|
The current document (the result of applying the steps in the
|
|
8655
8732
|
transform).
|
|
8656
8733
|
*/
|
|
8657
|
-
doc: Node$1);
|
|
8734
|
+
doc: Node$1$1);
|
|
8658
8735
|
/**
|
|
8659
8736
|
The starting document.
|
|
8660
8737
|
*/
|
|
8661
|
-
get before(): Node$1;
|
|
8738
|
+
get before(): Node$1$1;
|
|
8662
8739
|
/**
|
|
8663
8740
|
Apply a new step in this transform, saving the result. Throws an
|
|
8664
8741
|
error when the step fails.
|
|
@@ -8675,6 +8752,16 @@ declare class Transform {
|
|
|
8675
8752
|
*/
|
|
8676
8753
|
get docChanged(): boolean;
|
|
8677
8754
|
/**
|
|
8755
|
+
Return a single range, in post-transform document positions,
|
|
8756
|
+
that covers all content changed by this transform. Returns null
|
|
8757
|
+
if no replacements are made. Note that this will ignore changes
|
|
8758
|
+
that add/remove marks without replacing the underlying content.
|
|
8759
|
+
*/
|
|
8760
|
+
changedRange(): {
|
|
8761
|
+
from: number;
|
|
8762
|
+
to: number;
|
|
8763
|
+
} | null;
|
|
8764
|
+
/**
|
|
8678
8765
|
Replace the part of the document between `from` and `to` with the
|
|
8679
8766
|
given `slice`.
|
|
8680
8767
|
*/
|
|
@@ -8683,7 +8770,7 @@ declare class Transform {
|
|
|
8683
8770
|
Replace the given range with the given content, which may be a
|
|
8684
8771
|
fragment, node, or array of nodes.
|
|
8685
8772
|
*/
|
|
8686
|
-
replaceWith(from: number, to: number, content: Fragment | Node$1 | readonly Node$1[]): this;
|
|
8773
|
+
replaceWith(from: number, to: number, content: Fragment | Node$1$1 | readonly Node$1$1[]): this;
|
|
8687
8774
|
/**
|
|
8688
8775
|
Delete the content between the given positions.
|
|
8689
8776
|
*/
|
|
@@ -8691,7 +8778,7 @@ declare class Transform {
|
|
|
8691
8778
|
/**
|
|
8692
8779
|
Insert the given content at the given position.
|
|
8693
8780
|
*/
|
|
8694
|
-
insert(pos: number, content: Fragment | Node$1 | readonly Node$1[]): this;
|
|
8781
|
+
insert(pos: number, content: Fragment | Node$1$1 | readonly Node$1$1[]): this;
|
|
8695
8782
|
/**
|
|
8696
8783
|
Replace a range of the document with a given slice, using
|
|
8697
8784
|
`from`, `to`, and the slice's
|
|
@@ -8721,7 +8808,7 @@ declare class Transform {
|
|
|
8721
8808
|
completely covers a parent node, this method may completely replace
|
|
8722
8809
|
that parent node.
|
|
8723
8810
|
*/
|
|
8724
|
-
replaceRangeWith(from: number, to: number, node: Node$1): this;
|
|
8811
|
+
replaceRangeWith(from: number, to: number, node: Node$1$1): this;
|
|
8725
8812
|
/**
|
|
8726
8813
|
Delete the given range, expanding it to cover fully covered
|
|
8727
8814
|
parent nodes until a valid replace is found.
|
|
@@ -8753,7 +8840,7 @@ declare class Transform {
|
|
|
8753
8840
|
Set the type of all textblocks (partly) between `from` and `to` to
|
|
8754
8841
|
the given node type with the given attributes.
|
|
8755
8842
|
*/
|
|
8756
|
-
setBlockType(from: number, to: number | undefined, type: NodeType$1, attrs?: Attrs | null | ((oldNode: Node$1) => Attrs)): this;
|
|
8843
|
+
setBlockType(from: number, to: number | undefined, type: NodeType$1, attrs?: Attrs | null | ((oldNode: Node$1$1) => Attrs)): this;
|
|
8757
8844
|
/**
|
|
8758
8845
|
Change the type, attributes, and/or marks of the node at `pos`.
|
|
8759
8846
|
When `type` isn't given, the existing node type is preserved,
|
|
@@ -8976,11 +9063,11 @@ interface DecorationSource {
|
|
|
8976
9063
|
Map the set of decorations in response to a change in the
|
|
8977
9064
|
document.
|
|
8978
9065
|
*/
|
|
8979
|
-
map: (mapping: Mapping, node: Node$1) => DecorationSource;
|
|
9066
|
+
map: (mapping: Mapping, node: Node$1$1) => DecorationSource;
|
|
8980
9067
|
/**
|
|
8981
9068
|
Extract a DecorationSource containing decorations for the given child node at the given offset.
|
|
8982
9069
|
*/
|
|
8983
|
-
forChild(offset: number, child: Node$1): DecorationSource;
|
|
9070
|
+
forChild(offset: number, child: Node$1$1): DecorationSource;
|
|
8984
9071
|
/**
|
|
8985
9072
|
Call the given function for each decoration set in the group.
|
|
8986
9073
|
*/
|
|
@@ -8998,7 +9085,7 @@ declare class DecorationSet implements DecorationSource {
|
|
|
8998
9085
|
document. This will consume (modify) the `decorations` array, so
|
|
8999
9086
|
you must make a copy if you want need to preserve that.
|
|
9000
9087
|
*/
|
|
9001
|
-
static create(doc: Node$1, decorations: Decoration[]): DecorationSet;
|
|
9088
|
+
static create(doc: Node$1$1, decorations: Decoration[]): DecorationSet;
|
|
9002
9089
|
/**
|
|
9003
9090
|
Find all decorations in this set which touch the given range
|
|
9004
9091
|
(including decorations that start or end directly at the
|
|
@@ -9013,7 +9100,7 @@ declare class DecorationSet implements DecorationSource {
|
|
|
9013
9100
|
Map the set of decorations in response to a change in the
|
|
9014
9101
|
document.
|
|
9015
9102
|
*/
|
|
9016
|
-
map(mapping: Mapping, doc: Node$1, options?: {
|
|
9103
|
+
map(mapping: Mapping, doc: Node$1$1, options?: {
|
|
9017
9104
|
/**
|
|
9018
9105
|
When given, this function will be called for each decoration
|
|
9019
9106
|
that gets dropped as a result of the mapping, passing the
|
|
@@ -9027,7 +9114,7 @@ declare class DecorationSet implements DecorationSource {
|
|
|
9027
9114
|
access to the current document to create the appropriate tree
|
|
9028
9115
|
structure.
|
|
9029
9116
|
*/
|
|
9030
|
-
add(doc: Node$1, decorations: Decoration[]): DecorationSet;
|
|
9117
|
+
add(doc: Node$1$1, decorations: Decoration[]): DecorationSet;
|
|
9031
9118
|
private addInner;
|
|
9032
9119
|
/**
|
|
9033
9120
|
Create a new set that contains the decorations in this set, minus
|
|
@@ -9035,7 +9122,7 @@ declare class DecorationSet implements DecorationSource {
|
|
|
9035
9122
|
*/
|
|
9036
9123
|
remove(decorations: Decoration[]): DecorationSet;
|
|
9037
9124
|
private removeInner;
|
|
9038
|
-
forChild(offset: number, node: Node$1): DecorationSet | DecorationGroup;
|
|
9125
|
+
forChild(offset: number, node: Node$1$1): DecorationSet | DecorationGroup;
|
|
9039
9126
|
/**
|
|
9040
9127
|
The empty set of decorations.
|
|
9041
9128
|
*/
|
|
@@ -9045,10 +9132,10 @@ declare class DecorationSet implements DecorationSource {
|
|
|
9045
9132
|
declare class DecorationGroup implements DecorationSource {
|
|
9046
9133
|
readonly members: readonly DecorationSet[];
|
|
9047
9134
|
constructor(members: readonly DecorationSet[]);
|
|
9048
|
-
map(mapping: Mapping, doc: Node$1): DecorationSource;
|
|
9049
|
-
forChild(offset: number, child: Node$1): DecorationSource | DecorationSet;
|
|
9135
|
+
map(mapping: Mapping, doc: Node$1$1): DecorationSource;
|
|
9136
|
+
forChild(offset: number, child: Node$1$1): DecorationSource | DecorationSet;
|
|
9050
9137
|
eq(other: DecorationGroup): boolean;
|
|
9051
|
-
locals(node: Node$1): readonly any[];
|
|
9138
|
+
locals(node: Node$1$1): readonly any[];
|
|
9052
9139
|
static from(members: readonly DecorationSource[]): DecorationSource;
|
|
9053
9140
|
forEachSet(f: (set: DecorationSet) => void): void;
|
|
9054
9141
|
}
|
|
@@ -9104,7 +9191,7 @@ interface NodeView {
|
|
|
9104
9191
|
`contentDOM` property (or no `dom` property), updating its child
|
|
9105
9192
|
nodes will be handled by ProseMirror.
|
|
9106
9193
|
*/
|
|
9107
|
-
update?: (node: Node$1, decorations: readonly Decoration[], innerDecorations: DecorationSource) => boolean;
|
|
9194
|
+
update?: (node: Node$1$1, decorations: readonly Decoration[], innerDecorations: DecorationSource) => boolean;
|
|
9108
9195
|
/**
|
|
9109
9196
|
By default, `update` will only be called when a node of the same
|
|
9110
9197
|
node type appears in this view's position. When you set this to
|
|
@@ -9413,7 +9500,7 @@ declare class EditorView {
|
|
|
9413
9500
|
The type of function [provided](https://prosemirror.net/docs/ref/#view.EditorProps.nodeViews) to
|
|
9414
9501
|
create [node views](https://prosemirror.net/docs/ref/#view.NodeView).
|
|
9415
9502
|
*/
|
|
9416
|
-
type NodeViewConstructor = (node: Node$1, view: EditorView, getPos: () => number | undefined, decorations: readonly Decoration[], innerDecorations: DecorationSource) => NodeView;
|
|
9503
|
+
type NodeViewConstructor = (node: Node$1$1, view: EditorView, getPos: () => number | undefined, decorations: readonly Decoration[], innerDecorations: DecorationSource) => NodeView;
|
|
9417
9504
|
/**
|
|
9418
9505
|
The function types [used](https://prosemirror.net/docs/ref/#view.EditorProps.markViews) to create
|
|
9419
9506
|
mark views.
|
|
@@ -9477,7 +9564,7 @@ interface EditorProps<P = any> {
|
|
|
9477
9564
|
Called for each node around a click, from the inside out. The
|
|
9478
9565
|
`direct` flag will be true for the inner node.
|
|
9479
9566
|
*/
|
|
9480
|
-
handleClickOn?: (this: P, view: EditorView, pos: number, node: Node$1, nodePos: number, event: MouseEvent, direct: boolean) => boolean | void;
|
|
9567
|
+
handleClickOn?: (this: P, view: EditorView, pos: number, node: Node$1$1, nodePos: number, event: MouseEvent, direct: boolean) => boolean | void;
|
|
9481
9568
|
/**
|
|
9482
9569
|
Called when the editor is clicked, after `handleClickOn` handlers
|
|
9483
9570
|
have been called.
|
|
@@ -9486,7 +9573,7 @@ interface EditorProps<P = any> {
|
|
|
9486
9573
|
/**
|
|
9487
9574
|
Called for each node around a double click.
|
|
9488
9575
|
*/
|
|
9489
|
-
handleDoubleClickOn?: (this: P, view: EditorView, pos: number, node: Node$1, nodePos: number, event: MouseEvent, direct: boolean) => boolean | void;
|
|
9576
|
+
handleDoubleClickOn?: (this: P, view: EditorView, pos: number, node: Node$1$1, nodePos: number, event: MouseEvent, direct: boolean) => boolean | void;
|
|
9490
9577
|
/**
|
|
9491
9578
|
Called when the editor is double-clicked, after `handleDoubleClickOn`.
|
|
9492
9579
|
*/
|
|
@@ -9494,7 +9581,7 @@ interface EditorProps<P = any> {
|
|
|
9494
9581
|
/**
|
|
9495
9582
|
Called for each node around a triple click.
|
|
9496
9583
|
*/
|
|
9497
|
-
handleTripleClickOn?: (this: P, view: EditorView, pos: number, node: Node$1, nodePos: number, event: MouseEvent, direct: boolean) => boolean | void;
|
|
9584
|
+
handleTripleClickOn?: (this: P, view: EditorView, pos: number, node: Node$1$1, nodePos: number, event: MouseEvent, direct: boolean) => boolean | void;
|
|
9498
9585
|
/**
|
|
9499
9586
|
Called when the editor is triple-clicked, after `handleTripleClickOn`.
|
|
9500
9587
|
*/
|
|
@@ -9721,7 +9808,7 @@ interface EditorStateConfig {
|
|
|
9721
9808
|
The starting document. Either this or `schema` _must_ be
|
|
9722
9809
|
provided.
|
|
9723
9810
|
*/
|
|
9724
|
-
doc?: Node$1;
|
|
9811
|
+
doc?: Node$1$1;
|
|
9725
9812
|
/**
|
|
9726
9813
|
A valid selection in the document.
|
|
9727
9814
|
*/
|
|
@@ -9748,7 +9835,7 @@ declare class EditorState {
|
|
|
9748
9835
|
/**
|
|
9749
9836
|
The current document.
|
|
9750
9837
|
*/
|
|
9751
|
-
doc: Node$1;
|
|
9838
|
+
doc: Node$1$1;
|
|
9752
9839
|
/**
|
|
9753
9840
|
The selection.
|
|
9754
9841
|
*/
|
|
@@ -10067,7 +10154,7 @@ declare class Transaction extends Transform {
|
|
|
10067
10154
|
true and the content is inline, it inherits the marks from the
|
|
10068
10155
|
place where it is inserted.
|
|
10069
10156
|
*/
|
|
10070
|
-
replaceSelectionWith(node: Node$1, inheritMarks?: boolean): this;
|
|
10157
|
+
replaceSelectionWith(node: Node$1$1, inheritMarks?: boolean): this;
|
|
10071
10158
|
/**
|
|
10072
10159
|
Delete the selection.
|
|
10073
10160
|
*/
|
|
@@ -10173,7 +10260,7 @@ declare abstract class Selection {
|
|
|
10173
10260
|
Map this selection through a [mappable](https://prosemirror.net/docs/ref/#transform.Mappable)
|
|
10174
10261
|
thing. `doc` should be the new document to which we are mapping.
|
|
10175
10262
|
*/
|
|
10176
|
-
abstract map(doc: Node$1, mapping: Mappable): Selection;
|
|
10263
|
+
abstract map(doc: Node$1$1, mapping: Mappable): Selection;
|
|
10177
10264
|
/**
|
|
10178
10265
|
Get the content of this selection as a slice.
|
|
10179
10266
|
*/
|
|
@@ -10187,7 +10274,7 @@ declare abstract class Selection {
|
|
|
10187
10274
|
Replace the selection with the given node, appending the changes
|
|
10188
10275
|
to the given transaction.
|
|
10189
10276
|
*/
|
|
10190
|
-
replaceWith(tr: Transaction, node: Node$1): void;
|
|
10277
|
+
replaceWith(tr: Transaction, node: Node$1$1): void;
|
|
10191
10278
|
/**
|
|
10192
10279
|
Convert the selection to a JSON representation. When implementing
|
|
10193
10280
|
this for a custom selection class, make sure to give the object a
|
|
@@ -10215,17 +10302,17 @@ declare abstract class Selection {
|
|
|
10215
10302
|
[`AllSelection`](https://prosemirror.net/docs/ref/#state.AllSelection) if no valid position
|
|
10216
10303
|
exists.
|
|
10217
10304
|
*/
|
|
10218
|
-
static atStart(doc: Node$1): Selection;
|
|
10305
|
+
static atStart(doc: Node$1$1): Selection;
|
|
10219
10306
|
/**
|
|
10220
10307
|
Find the cursor or leaf node selection closest to the end of the
|
|
10221
10308
|
given document.
|
|
10222
10309
|
*/
|
|
10223
|
-
static atEnd(doc: Node$1): Selection;
|
|
10310
|
+
static atEnd(doc: Node$1$1): Selection;
|
|
10224
10311
|
/**
|
|
10225
10312
|
Deserialize the JSON representation of a selection. Must be
|
|
10226
10313
|
implemented for custom classes (as a static class method).
|
|
10227
10314
|
*/
|
|
10228
|
-
static fromJSON(doc: Node$1, json: any): Selection;
|
|
10315
|
+
static fromJSON(doc: Node$1$1, json: any): Selection;
|
|
10229
10316
|
/**
|
|
10230
10317
|
To be able to deserialize selections from JSON, custom selection
|
|
10231
10318
|
classes must register themselves with an ID string, so that they
|
|
@@ -10233,9 +10320,9 @@ declare abstract class Selection {
|
|
|
10233
10320
|
clash with classes from other modules.
|
|
10234
10321
|
*/
|
|
10235
10322
|
static jsonID(id: string, selectionClass: {
|
|
10236
|
-
fromJSON: (doc: Node$1, json: any) => Selection;
|
|
10323
|
+
fromJSON: (doc: Node$1$1, json: any) => Selection;
|
|
10237
10324
|
}): {
|
|
10238
|
-
fromJSON: (doc: Node$1, json: any) => Selection;
|
|
10325
|
+
fromJSON: (doc: Node$1$1, json: any) => Selection;
|
|
10239
10326
|
};
|
|
10240
10327
|
/**
|
|
10241
10328
|
Get a [bookmark](https://prosemirror.net/docs/ref/#state.SelectionBookmark) for this selection,
|
|
@@ -10270,7 +10357,7 @@ interface SelectionBookmark {
|
|
|
10270
10357
|
[`TextSelection.between`](https://prosemirror.net/docs/ref/#state.TextSelection^between)) if
|
|
10271
10358
|
mapping made the bookmark invalid.
|
|
10272
10359
|
*/
|
|
10273
|
-
resolve: (doc: Node$1) => Selection;
|
|
10360
|
+
resolve: (doc: Node$1$1) => Selection;
|
|
10274
10361
|
}
|
|
10275
10362
|
/**
|
|
10276
10363
|
Represents a selected range in a document.
|
|
@@ -10713,7 +10800,7 @@ interface NodeConfig<Options = any, Storage = any> extends ExtendableConfig<Opti
|
|
|
10713
10800
|
parent: ParentConfig<NodeConfig<Options, Storage>>['renderHTML'];
|
|
10714
10801
|
editor?: Editor;
|
|
10715
10802
|
}, props: {
|
|
10716
|
-
node: Node$1;
|
|
10803
|
+
node: Node$1$1;
|
|
10717
10804
|
HTMLAttributes: Record<string, any>;
|
|
10718
10805
|
}) => DOMOutputSpec) | null;
|
|
10719
10806
|
/**
|
|
@@ -10727,9 +10814,9 @@ interface NodeConfig<Options = any, Storage = any> extends ExtendableConfig<Opti
|
|
|
10727
10814
|
parent: ParentConfig<NodeConfig<Options, Storage>>['renderText'];
|
|
10728
10815
|
editor?: Editor;
|
|
10729
10816
|
}, props: {
|
|
10730
|
-
node: Node$1;
|
|
10817
|
+
node: Node$1$1;
|
|
10731
10818
|
pos: number;
|
|
10732
|
-
parent: Node$1;
|
|
10819
|
+
parent: Node$1$1;
|
|
10733
10820
|
index: number;
|
|
10734
10821
|
}) => string) | null;
|
|
10735
10822
|
/**
|
|
@@ -10748,21 +10835,21 @@ interface NodeConfig<Options = any, Storage = any> extends ExtendableConfig<Opti
|
|
|
10748
10835
|
* The Node class is used to create custom node extensions.
|
|
10749
10836
|
* @see https://tiptap.dev/api/extensions#create-a-new-extension
|
|
10750
10837
|
*/
|
|
10751
|
-
declare class Node<Options = any, Storage = any> extends Extendable<Options, Storage, NodeConfig<Options, Storage>> {
|
|
10838
|
+
declare class Node$2<Options = any, Storage = any> extends Extendable<Options, Storage, NodeConfig<Options, Storage>> {
|
|
10752
10839
|
type: string;
|
|
10753
10840
|
/**
|
|
10754
10841
|
* Create a new Node instance
|
|
10755
10842
|
* @param config - Node configuration object or a function that returns a configuration object
|
|
10756
10843
|
*/
|
|
10757
|
-
static create<O = any, S = any>(config?: Partial<NodeConfig<O, S>> | (() => Partial<NodeConfig<O, S>>)): Node<O, S>;
|
|
10758
|
-
configure(options?: Partial<Options>): Node<Options, Storage>;
|
|
10844
|
+
static create<O = any, S = any>(config?: Partial<NodeConfig<O, S>> | (() => Partial<NodeConfig<O, S>>)): Node$2<O, S>;
|
|
10845
|
+
configure(options?: Partial<Options>): Node$2<Options, Storage>;
|
|
10759
10846
|
extend<ExtendedOptions = Options, ExtendedStorage = Storage, ExtendedConfig extends NodeConfig<ExtendedOptions, ExtendedStorage> = NodeConfig<ExtendedOptions, ExtendedStorage>>(extendedConfig?: (() => Partial<ExtendedConfig>) | (Partial<ExtendedConfig> & ThisType<{
|
|
10760
10847
|
name: string;
|
|
10761
10848
|
options: ExtendedOptions;
|
|
10762
10849
|
storage: ExtendedStorage;
|
|
10763
10850
|
editor: Editor;
|
|
10764
10851
|
type: NodeType$1;
|
|
10765
|
-
}>)): Node<ExtendedOptions, ExtendedStorage>;
|
|
10852
|
+
}>)): Node$2<ExtendedOptions, ExtendedStorage>;
|
|
10766
10853
|
}
|
|
10767
10854
|
|
|
10768
10855
|
type PasteRuleMatch = {
|
|
@@ -10877,7 +10964,7 @@ interface ExtendableConfig<Options = any, Storage = any, Config extends Extensio
|
|
|
10877
10964
|
name: string;
|
|
10878
10965
|
options: Options;
|
|
10879
10966
|
storage: Storage;
|
|
10880
|
-
extensions: (Node | Mark$2)[];
|
|
10967
|
+
extensions: (Node$2 | Mark$2)[];
|
|
10881
10968
|
parent: ParentConfig<Config>['addGlobalAttributes'];
|
|
10882
10969
|
}) => GlobalAttributes;
|
|
10883
10970
|
/**
|
|
@@ -11043,7 +11130,7 @@ interface ExtendableConfig<Options = any, Storage = any, Config extends Extensio
|
|
|
11043
11130
|
options: Options;
|
|
11044
11131
|
storage: Storage;
|
|
11045
11132
|
parent: ParentConfig<Config>['extendNodeSchema'];
|
|
11046
|
-
}, extension: Node) => Record<string, any>) | null;
|
|
11133
|
+
}, extension: Node$2) => Record<string, any>) | null;
|
|
11047
11134
|
/**
|
|
11048
11135
|
* This function extends the schema of the mark.
|
|
11049
11136
|
* @example
|
|
@@ -11382,7 +11469,7 @@ interface EditorEvents {
|
|
|
11382
11469
|
* The node which the deletion occurred in
|
|
11383
11470
|
* @note This can be a parent node of the deleted content
|
|
11384
11471
|
*/
|
|
11385
|
-
node: Node$1;
|
|
11472
|
+
node: Node$1$1;
|
|
11386
11473
|
/**
|
|
11387
11474
|
* The new start position of the node in the document (after the deletion)
|
|
11388
11475
|
*/
|
|
@@ -11785,7 +11872,7 @@ interface NodeViewRendererProps {
|
|
|
11785
11872
|
/**
|
|
11786
11873
|
* The extension that is responsible for the node.
|
|
11787
11874
|
*/
|
|
11788
|
-
extension: Node;
|
|
11875
|
+
extension: Node$2;
|
|
11789
11876
|
/**
|
|
11790
11877
|
* The HTML attributes that should be added to the node's DOM element.
|
|
11791
11878
|
*/
|
|
@@ -11841,9 +11928,9 @@ type Range = {
|
|
|
11841
11928
|
to: number;
|
|
11842
11929
|
};
|
|
11843
11930
|
type TextSerializer = (props: {
|
|
11844
|
-
node: Node$1;
|
|
11931
|
+
node: Node$1$1;
|
|
11845
11932
|
pos: number;
|
|
11846
|
-
parent: Node$1;
|
|
11933
|
+
parent: Node$1$1;
|
|
11847
11934
|
index: number;
|
|
11848
11935
|
range: Range;
|
|
11849
11936
|
}) => string;
|
|
@@ -12084,9 +12171,9 @@ declare class NodePos {
|
|
|
12084
12171
|
private isBlock;
|
|
12085
12172
|
private editor;
|
|
12086
12173
|
private get name();
|
|
12087
|
-
constructor(pos: ResolvedPos, editor: Editor, isBlock?: boolean, node?: Node$1 | null);
|
|
12174
|
+
constructor(pos: ResolvedPos, editor: Editor, isBlock?: boolean, node?: Node$1$1 | null);
|
|
12088
12175
|
private currentNode;
|
|
12089
|
-
get node(): Node$1;
|
|
12176
|
+
get node(): Node$1$1;
|
|
12090
12177
|
get element(): HTMLElement;
|
|
12091
12178
|
actualDepth: number | null;
|
|
12092
12179
|
get depth(): number;
|
|
@@ -12423,7 +12510,7 @@ declare module '@tiptap/core' {
|
|
|
12423
12510
|
/**
|
|
12424
12511
|
* The ProseMirror content to insert.
|
|
12425
12512
|
*/
|
|
12426
|
-
value: Content | Node$1 | Fragment,
|
|
12513
|
+
value: Content | Node$1$1 | Fragment,
|
|
12427
12514
|
/**
|
|
12428
12515
|
* Optional options
|
|
12429
12516
|
*/
|
|
@@ -12446,7 +12533,7 @@ declare module '@tiptap/core' {
|
|
|
12446
12533
|
/**
|
|
12447
12534
|
* The ProseMirror content to insert.
|
|
12448
12535
|
*/
|
|
12449
|
-
value: Content | Node$1 | Fragment,
|
|
12536
|
+
value: Content | Node$1$1 | Fragment,
|
|
12450
12537
|
/**
|
|
12451
12538
|
* Optional options
|
|
12452
12539
|
*/
|
|
@@ -12714,7 +12801,7 @@ declare module '@tiptap/core' {
|
|
|
12714
12801
|
/**
|
|
12715
12802
|
* The new content.
|
|
12716
12803
|
*/
|
|
12717
|
-
content: Content | Fragment | Node$1,
|
|
12804
|
+
content: Content | Fragment | Node$1$1,
|
|
12718
12805
|
/**
|
|
12719
12806
|
* Options for `setContent`.
|
|
12720
12807
|
*/
|
|
@@ -13538,9 +13625,9 @@ interface TableRowNode extends JSONContent {
|
|
|
13538
13625
|
interface TableCellNode extends JSONContent {
|
|
13539
13626
|
type: "tableCell";
|
|
13540
13627
|
attrs?: {
|
|
13541
|
-
|
|
13542
|
-
|
|
13543
|
-
|
|
13628
|
+
colspan?: number;
|
|
13629
|
+
rowspan?: number;
|
|
13630
|
+
colwidth?: number[] | null;
|
|
13544
13631
|
backgroundColor?: string | null;
|
|
13545
13632
|
verticalAlign?: "top" | "middle" | "bottom" | null;
|
|
13546
13633
|
borderTop?: TableCellBorder | null;
|
|
@@ -13553,9 +13640,9 @@ interface TableCellNode extends JSONContent {
|
|
|
13553
13640
|
interface TableHeaderNode extends JSONContent {
|
|
13554
13641
|
type: "tableHeader";
|
|
13555
13642
|
attrs?: {
|
|
13556
|
-
|
|
13557
|
-
|
|
13558
|
-
|
|
13643
|
+
colspan?: number;
|
|
13644
|
+
rowspan?: number;
|
|
13645
|
+
colwidth?: number[] | null;
|
|
13559
13646
|
backgroundColor?: string | null;
|
|
13560
13647
|
verticalAlign?: "top" | "middle" | "bottom" | null;
|
|
13561
13648
|
borderTop?: TableCellBorder | null;
|
|
@@ -13608,40 +13695,739 @@ declare function convertHardBreak(marks?: Array<{
|
|
|
13608
13695
|
* Convert array of text nodes (text, hardBreak) to DOCX elements
|
|
13609
13696
|
* Returns flattened array of TextRun or ExternalHyperlink
|
|
13610
13697
|
*/
|
|
13611
|
-
declare
|
|
13698
|
+
declare function convertTextNodes(nodes?: JSONContent$1[]): Array<TextRun | ExternalHyperlink | undefined>;
|
|
13612
13699
|
|
|
13613
13700
|
/**
|
|
13614
|
-
* Convert TipTap paragraph node to DOCX
|
|
13701
|
+
* Convert TipTap paragraph node to DOCX paragraph options
|
|
13702
|
+
*
|
|
13703
|
+
* This converter only handles data transformation from node.attrs to DOCX format properties.
|
|
13704
|
+
* It returns pure data objects (IParagraphOptions), not DOCX instances.
|
|
13615
13705
|
*
|
|
13616
13706
|
* @param node - TipTap paragraph node
|
|
13617
13707
|
* @param params - Conversion parameters
|
|
13618
|
-
* @returns Promise<DOCX
|
|
13708
|
+
* @returns Promise<DOCX paragraph options (pure data object)>
|
|
13619
13709
|
*/
|
|
13620
13710
|
declare function convertParagraph(node: ParagraphNode, params?: {
|
|
13621
13711
|
options?: IParagraphOptions;
|
|
13622
13712
|
/** Image conversion parameters */
|
|
13623
13713
|
image?: {
|
|
13624
13714
|
/** Maximum available width for inline images (number = pixels, or string like "6in", "152.4mm") */
|
|
13625
|
-
maxWidth?: number | PositiveUniversalMeasure;
|
|
13715
|
+
maxWidth?: number | PositiveUniversalMeasure$1;
|
|
13716
|
+
/** Additional image options to apply */
|
|
13717
|
+
options?: Partial<IImageOptions$1>;
|
|
13718
|
+
/** Custom image handler for fetching image data */
|
|
13719
|
+
handler?: DocxImageExportHandler;
|
|
13626
13720
|
};
|
|
13627
|
-
}): Promise<
|
|
13721
|
+
}): Promise<IParagraphOptions>;
|
|
13628
13722
|
|
|
13629
13723
|
/**
|
|
13630
|
-
* Convert TipTap heading node to DOCX paragraph
|
|
13724
|
+
* Convert TipTap heading node to DOCX paragraph options
|
|
13725
|
+
*
|
|
13726
|
+
* This converter only handles data transformation from node.attrs to DOCX format properties.
|
|
13727
|
+
* It returns pure data objects (IParagraphOptions), not DOCX instances.
|
|
13631
13728
|
*
|
|
13632
13729
|
* @param node - TipTap heading node
|
|
13633
|
-
* @returns DOCX
|
|
13730
|
+
* @returns DOCX paragraph options (pure data object)
|
|
13634
13731
|
*/
|
|
13635
|
-
declare function convertHeading(node: HeadingNode):
|
|
13732
|
+
declare function convertHeading(node: HeadingNode): IParagraphOptions;
|
|
13636
13733
|
|
|
13637
13734
|
/**
|
|
13638
|
-
* Convert TipTap blockquote node to array of
|
|
13639
|
-
*
|
|
13735
|
+
* Convert TipTap blockquote node to array of paragraph options
|
|
13736
|
+
*
|
|
13737
|
+
* This converter only handles data transformation from node content to DOCX format properties.
|
|
13738
|
+
* It returns pure data objects (IParagraphOptions[]), not DOCX instances.
|
|
13640
13739
|
*
|
|
13641
13740
|
* @param node - TipTap blockquote node
|
|
13642
|
-
* @returns Array of
|
|
13741
|
+
* @returns Array of paragraph options (pure data objects)
|
|
13742
|
+
*/
|
|
13743
|
+
declare function convertBlockquote(node: BlockquoteNode): IParagraphOptions[];
|
|
13744
|
+
|
|
13745
|
+
// ## Interfaces
|
|
13746
|
+
|
|
13747
|
+
/**
|
|
13748
|
+
* Info associated with nodes by the ecosystem.
|
|
13749
|
+
*
|
|
13750
|
+
* This space is guaranteed to never be specified by unist or specifications
|
|
13751
|
+
* implementing unist.
|
|
13752
|
+
* But you can use it in utilities and plugins to store data.
|
|
13753
|
+
*
|
|
13754
|
+
* This type can be augmented to register custom data.
|
|
13755
|
+
* For example:
|
|
13756
|
+
*
|
|
13757
|
+
* ```ts
|
|
13758
|
+
* declare module 'unist' {
|
|
13759
|
+
* interface Data {
|
|
13760
|
+
* // `someNode.data.myId` is typed as `number | undefined`
|
|
13761
|
+
* myId?: number | undefined
|
|
13762
|
+
* }
|
|
13763
|
+
* }
|
|
13764
|
+
* ```
|
|
13765
|
+
*/
|
|
13766
|
+
interface Data$1 {}
|
|
13767
|
+
|
|
13768
|
+
/**
|
|
13769
|
+
* One place in a source file.
|
|
13770
|
+
*/
|
|
13771
|
+
interface Point {
|
|
13772
|
+
/**
|
|
13773
|
+
* Line in a source file (1-indexed integer).
|
|
13774
|
+
*/
|
|
13775
|
+
line: number;
|
|
13776
|
+
|
|
13777
|
+
/**
|
|
13778
|
+
* Column in a source file (1-indexed integer).
|
|
13779
|
+
*/
|
|
13780
|
+
column: number;
|
|
13781
|
+
/**
|
|
13782
|
+
* Character in a source file (0-indexed integer).
|
|
13783
|
+
*/
|
|
13784
|
+
offset?: number | undefined;
|
|
13785
|
+
}
|
|
13786
|
+
|
|
13787
|
+
/**
|
|
13788
|
+
* Position of a node in a source document.
|
|
13789
|
+
*
|
|
13790
|
+
* A position is a range between two points.
|
|
13791
|
+
*/
|
|
13792
|
+
interface Position {
|
|
13793
|
+
/**
|
|
13794
|
+
* Place of the first character of the parsed source region.
|
|
13795
|
+
*/
|
|
13796
|
+
start: Point;
|
|
13797
|
+
|
|
13798
|
+
/**
|
|
13799
|
+
* Place of the first character after the parsed source region.
|
|
13800
|
+
*/
|
|
13801
|
+
end: Point;
|
|
13802
|
+
}
|
|
13803
|
+
|
|
13804
|
+
/**
|
|
13805
|
+
* Abstract unist node.
|
|
13806
|
+
*
|
|
13807
|
+
* The syntactic unit in unist syntax trees are called nodes.
|
|
13808
|
+
*
|
|
13809
|
+
* This interface is supposed to be extended.
|
|
13810
|
+
* If you can use {@link Literal} or {@link Parent}, you should.
|
|
13811
|
+
* But for example in markdown, a `thematicBreak` (`***`), is neither literal
|
|
13812
|
+
* nor parent, but still a node.
|
|
13813
|
+
*/
|
|
13814
|
+
interface Node$1 {
|
|
13815
|
+
/**
|
|
13816
|
+
* Node type.
|
|
13817
|
+
*/
|
|
13818
|
+
type: string;
|
|
13819
|
+
|
|
13820
|
+
/**
|
|
13821
|
+
* Info from the ecosystem.
|
|
13822
|
+
*/
|
|
13823
|
+
data?: Data$1 | undefined;
|
|
13824
|
+
|
|
13825
|
+
/**
|
|
13826
|
+
* Position of a node in a source document.
|
|
13827
|
+
*
|
|
13828
|
+
* Nodes that are generated (not in the original source document) must not
|
|
13829
|
+
* have a position.
|
|
13830
|
+
*/
|
|
13831
|
+
position?: Position | undefined;
|
|
13832
|
+
}
|
|
13833
|
+
|
|
13834
|
+
// ## Interfaces
|
|
13835
|
+
|
|
13836
|
+
/**
|
|
13837
|
+
* Info associated with an element.
|
|
13838
|
+
*/
|
|
13839
|
+
interface Attributes {
|
|
13840
|
+
[name: string]: string | null | undefined;
|
|
13841
|
+
}
|
|
13842
|
+
|
|
13843
|
+
/**
|
|
13844
|
+
* Info associated with xast nodes by the ecosystem.
|
|
13845
|
+
*
|
|
13846
|
+
* This space is guaranteed to never be specified by unist or xast.
|
|
13847
|
+
* But you can use it in utilities and plugins to store data.
|
|
13848
|
+
*
|
|
13849
|
+
* This type can be augmented to register custom data.
|
|
13850
|
+
* For example:
|
|
13851
|
+
*
|
|
13852
|
+
* ```ts
|
|
13853
|
+
* declare module 'xast' {
|
|
13854
|
+
* interface Data {
|
|
13855
|
+
* // `someNode.data.myId` is typed as `number | undefined`
|
|
13856
|
+
* myId?: number | undefined
|
|
13857
|
+
* }
|
|
13858
|
+
* }
|
|
13859
|
+
* ```
|
|
13860
|
+
*/
|
|
13861
|
+
interface Data extends Data$1 {}
|
|
13862
|
+
|
|
13863
|
+
// ## Content maps
|
|
13864
|
+
|
|
13865
|
+
/**
|
|
13866
|
+
* Union of registered xast nodes that can occur in {@link Element}.
|
|
13867
|
+
*
|
|
13868
|
+
* To register more custom xast nodes, add them to {@link ElementContentMap}.
|
|
13869
|
+
* They will be automatically added here.
|
|
13870
|
+
*/
|
|
13871
|
+
type ElementContent = ElementContentMap[keyof ElementContentMap];
|
|
13872
|
+
|
|
13873
|
+
/**
|
|
13874
|
+
* Registry of all xast nodes that can occur as children of {@link Element}.
|
|
13875
|
+
*
|
|
13876
|
+
* For a union of all {@link Element} children, see {@link ElementContent}.
|
|
13877
|
+
*/
|
|
13878
|
+
interface ElementContentMap {
|
|
13879
|
+
cdata: Cdata;
|
|
13880
|
+
comment: Comment;
|
|
13881
|
+
element: Element$1;
|
|
13882
|
+
instruction: Instruction;
|
|
13883
|
+
text: Text;
|
|
13884
|
+
}
|
|
13885
|
+
|
|
13886
|
+
/**
|
|
13887
|
+
* Union of registered xast nodes that can occur in {@link Root}.
|
|
13888
|
+
*
|
|
13889
|
+
* To register custom xast nodes, add them to {@link RootContentMap}.
|
|
13890
|
+
* They will be automatically added here.
|
|
13891
|
+
*/
|
|
13892
|
+
type RootContent = RootContentMap[keyof RootContentMap];
|
|
13893
|
+
|
|
13894
|
+
/**
|
|
13895
|
+
* Registry of all xast nodes that can occur as children of {@link Root}.
|
|
13896
|
+
*
|
|
13897
|
+
* > 👉 **Note**: {@link Root} does not need to be an entire document.
|
|
13898
|
+
* > it can also be a fragment.
|
|
13899
|
+
*
|
|
13900
|
+
* For a union of all {@link Root} children, see {@link RootContent}.
|
|
13901
|
+
*/
|
|
13902
|
+
interface RootContentMap {
|
|
13903
|
+
cdata: Cdata;
|
|
13904
|
+
comment: Comment;
|
|
13905
|
+
doctype: Doctype;
|
|
13906
|
+
element: Element$1;
|
|
13907
|
+
instruction: Instruction;
|
|
13908
|
+
text: Text;
|
|
13909
|
+
}
|
|
13910
|
+
|
|
13911
|
+
// ## Abstract nodes
|
|
13912
|
+
|
|
13913
|
+
/**
|
|
13914
|
+
* Abstract xast node that contains the smallest possible value.
|
|
13915
|
+
*
|
|
13916
|
+
* This interface is supposed to be extended if you make custom xast nodes.
|
|
13917
|
+
*
|
|
13918
|
+
* For a union of all registered xast literals, see {@link Literals}.
|
|
13919
|
+
*/
|
|
13920
|
+
interface Literal extends Node {
|
|
13921
|
+
/**
|
|
13922
|
+
* Plain-text value.
|
|
13923
|
+
*/
|
|
13924
|
+
value: string;
|
|
13925
|
+
}
|
|
13926
|
+
|
|
13927
|
+
/**
|
|
13928
|
+
* Abstract xast node.
|
|
13929
|
+
*
|
|
13930
|
+
* This interface is supposed to be extended.
|
|
13931
|
+
* If you can use {@link Literal} or {@link Parent}, you should.
|
|
13932
|
+
* But for example in XML, a `Doctype` is neither literal nor parent, but
|
|
13933
|
+
* still a node.
|
|
13934
|
+
*
|
|
13935
|
+
* To register custom xast nodes, add them to {@link RootContentMap} and other
|
|
13936
|
+
* places where relevant (such as {@link ElementContentMap}).
|
|
13937
|
+
*
|
|
13938
|
+
* For a union of all registered xast nodes, see {@link Nodes}.
|
|
13939
|
+
*/
|
|
13940
|
+
interface Node extends Node$1 {
|
|
13941
|
+
/**
|
|
13942
|
+
* Info from the ecosystem.
|
|
13943
|
+
*/
|
|
13944
|
+
data?: Data | undefined;
|
|
13945
|
+
}
|
|
13946
|
+
|
|
13947
|
+
/**
|
|
13948
|
+
* Abstract xast node that contains other xast nodes (*children*).
|
|
13949
|
+
*
|
|
13950
|
+
* This interface is supposed to be extended if you make custom xast nodes.
|
|
13951
|
+
*
|
|
13952
|
+
* For a union of all registered xast parents, see {@link Parents}.
|
|
13953
|
+
*/
|
|
13954
|
+
interface Parent extends Node {
|
|
13955
|
+
/**
|
|
13956
|
+
* List of children.
|
|
13957
|
+
*/
|
|
13958
|
+
children: RootContent[];
|
|
13959
|
+
}
|
|
13960
|
+
|
|
13961
|
+
// ## Concrete nodes
|
|
13962
|
+
|
|
13963
|
+
/**
|
|
13964
|
+
* XML CDATA section.
|
|
13965
|
+
*/
|
|
13966
|
+
interface Cdata extends Literal {
|
|
13967
|
+
/**
|
|
13968
|
+
* Node type of XML CDATA sections in xast.
|
|
13969
|
+
*/
|
|
13970
|
+
type: "cdata";
|
|
13971
|
+
/**
|
|
13972
|
+
* Data associated with the cdata.
|
|
13973
|
+
*/
|
|
13974
|
+
data?: CdataData | undefined;
|
|
13975
|
+
}
|
|
13976
|
+
|
|
13977
|
+
/**
|
|
13978
|
+
* Info associated with xast instructions by the ecosystem.
|
|
13979
|
+
*/
|
|
13980
|
+
interface CdataData extends Data {}
|
|
13981
|
+
|
|
13982
|
+
/**
|
|
13983
|
+
* XML comment.
|
|
13984
|
+
*/
|
|
13985
|
+
interface Comment extends Literal {
|
|
13986
|
+
/**
|
|
13987
|
+
* Node type of XML comments in xast.
|
|
13988
|
+
*/
|
|
13989
|
+
type: "comment";
|
|
13990
|
+
/**
|
|
13991
|
+
* Data associated with the comment.
|
|
13992
|
+
*/
|
|
13993
|
+
data?: CommentData | undefined;
|
|
13994
|
+
}
|
|
13995
|
+
|
|
13996
|
+
/**
|
|
13997
|
+
* Info associated with xast comments by the ecosystem.
|
|
13998
|
+
*/
|
|
13999
|
+
interface CommentData extends Data {}
|
|
14000
|
+
|
|
14001
|
+
/**
|
|
14002
|
+
* XML document type.
|
|
14003
|
+
*/
|
|
14004
|
+
interface Doctype extends Node {
|
|
14005
|
+
/**
|
|
14006
|
+
* Node type of XML document types in xast.
|
|
14007
|
+
*/
|
|
14008
|
+
type: "doctype";
|
|
14009
|
+
/**
|
|
14010
|
+
* Name of the root element.
|
|
14011
|
+
*
|
|
14012
|
+
* To illustrate, for `<!DOCTYPE html>`, `name` is `'html'`.
|
|
14013
|
+
*/
|
|
14014
|
+
name: string;
|
|
14015
|
+
/**
|
|
14016
|
+
* Public identifier of the document.
|
|
14017
|
+
*/
|
|
14018
|
+
public?: string | undefined;
|
|
14019
|
+
/**
|
|
14020
|
+
* System identifier of the document.
|
|
14021
|
+
*/
|
|
14022
|
+
system?: string | undefined;
|
|
14023
|
+
/**
|
|
14024
|
+
* Data associated with the doctype.
|
|
14025
|
+
*/
|
|
14026
|
+
data?: DoctypeData | undefined;
|
|
14027
|
+
}
|
|
14028
|
+
|
|
14029
|
+
/**
|
|
14030
|
+
* Info associated with xast doctypes by the ecosystem.
|
|
13643
14031
|
*/
|
|
13644
|
-
|
|
14032
|
+
interface DoctypeData extends Data {}
|
|
14033
|
+
|
|
14034
|
+
/**
|
|
14035
|
+
* XML processing instruction.
|
|
14036
|
+
*/
|
|
14037
|
+
interface Instruction extends Literal {
|
|
14038
|
+
/**
|
|
14039
|
+
* Node type of XML processing instructions in xast.
|
|
14040
|
+
*/
|
|
14041
|
+
type: "instruction";
|
|
14042
|
+
/**
|
|
14043
|
+
* Name of the instruction.
|
|
14044
|
+
*
|
|
14045
|
+
* To illustrate, for `<?php?>`, `name` is `'php'`.
|
|
14046
|
+
*/
|
|
14047
|
+
name: string;
|
|
14048
|
+
/**
|
|
14049
|
+
* Data associated with the instruction.
|
|
14050
|
+
*/
|
|
14051
|
+
data?: InstructionData | undefined;
|
|
14052
|
+
}
|
|
14053
|
+
|
|
14054
|
+
/**
|
|
14055
|
+
* Info associated with xast instructions by the ecosystem.
|
|
14056
|
+
*/
|
|
14057
|
+
interface InstructionData extends Data {}
|
|
14058
|
+
|
|
14059
|
+
/**
|
|
14060
|
+
* XML element.
|
|
14061
|
+
*/
|
|
14062
|
+
interface Element$1 extends Parent {
|
|
14063
|
+
/**
|
|
14064
|
+
* Node type of elements.
|
|
14065
|
+
*/
|
|
14066
|
+
type: "element";
|
|
14067
|
+
/**
|
|
14068
|
+
* Qualified name (such as `'artist'` or `'svg:rect'`) of the element.
|
|
14069
|
+
*/
|
|
14070
|
+
name: string;
|
|
14071
|
+
/**
|
|
14072
|
+
* Info associated with the element.
|
|
14073
|
+
*/
|
|
14074
|
+
attributes: Attributes;
|
|
14075
|
+
/**
|
|
14076
|
+
* Children of element.
|
|
14077
|
+
*/
|
|
14078
|
+
children: ElementContent[];
|
|
14079
|
+
/**
|
|
14080
|
+
* Data associated with the element.
|
|
14081
|
+
*/
|
|
14082
|
+
data?: ElementData | undefined;
|
|
14083
|
+
}
|
|
14084
|
+
|
|
14085
|
+
/**
|
|
14086
|
+
* Info associated with xast elements by the ecosystem.
|
|
14087
|
+
*/
|
|
14088
|
+
interface ElementData extends Data {}
|
|
14089
|
+
|
|
14090
|
+
/**
|
|
14091
|
+
* Document fragment or a whole document.
|
|
14092
|
+
*
|
|
14093
|
+
* Should be used as the root of a tree and must not be used as a child.
|
|
14094
|
+
*
|
|
14095
|
+
* XML specifies that documents should have exactly one element child, so a
|
|
14096
|
+
* root should have exactly one element child when representing a whole
|
|
14097
|
+
* document.
|
|
14098
|
+
*/
|
|
14099
|
+
interface Root extends Parent {
|
|
14100
|
+
/**
|
|
14101
|
+
* Node type of xast root.
|
|
14102
|
+
*/
|
|
14103
|
+
type: "root";
|
|
14104
|
+
/**
|
|
14105
|
+
* Data associated with the xast root.
|
|
14106
|
+
*/
|
|
14107
|
+
data?: RootData | undefined;
|
|
14108
|
+
}
|
|
14109
|
+
|
|
14110
|
+
/**
|
|
14111
|
+
* Info associated with xast root nodes by the ecosystem.
|
|
14112
|
+
*/
|
|
14113
|
+
interface RootData extends Data {}
|
|
14114
|
+
|
|
14115
|
+
/**
|
|
14116
|
+
* XML character data (plain text).
|
|
14117
|
+
*/
|
|
14118
|
+
interface Text extends Literal {
|
|
14119
|
+
/**
|
|
14120
|
+
* Node type of XML character data (plain text) in xast.
|
|
14121
|
+
*/
|
|
14122
|
+
type: "text";
|
|
14123
|
+
/**
|
|
14124
|
+
* Data associated with the text.
|
|
14125
|
+
*/
|
|
14126
|
+
data?: TextData | undefined;
|
|
14127
|
+
}
|
|
14128
|
+
|
|
14129
|
+
/**
|
|
14130
|
+
* Info associated with xast texts by the ecosystem.
|
|
14131
|
+
*/
|
|
14132
|
+
interface TextData extends Data {}
|
|
14133
|
+
|
|
14134
|
+
/**
|
|
14135
|
+
* Unit conversion utilities for DOCX processing
|
|
14136
|
+
* Handles conversions between TWIPs, EMUs, pixels, and other units
|
|
14137
|
+
*/
|
|
14138
|
+
/**
|
|
14139
|
+
* Convert TWIPs to CSS pixels (returns number)
|
|
14140
|
+
* @param twip - Value in TWIPs (1 inch = 1440 TWIPs)
|
|
14141
|
+
* @returns Number value in pixels
|
|
14142
|
+
*
|
|
14143
|
+
* @example
|
|
14144
|
+
* convertTwipToPixels(1440) // returns 96
|
|
14145
|
+
*/
|
|
14146
|
+
declare function convertTwipToPixels(twip: number): number;
|
|
14147
|
+
/**
|
|
14148
|
+
* Convert TWIPs to CSS string (returns "px" string)
|
|
14149
|
+
* @param twip - Value in TWIPs
|
|
14150
|
+
* @returns CSS value string in pixels (e.g., "20px")
|
|
14151
|
+
*
|
|
14152
|
+
* @example
|
|
14153
|
+
* convertTwipToCssString(1440) // returns "96px"
|
|
14154
|
+
*/
|
|
14155
|
+
declare function convertTwipToCssString(twip: number): string;
|
|
14156
|
+
/**
|
|
14157
|
+
* Convert pixels to TWIPs
|
|
14158
|
+
* @param px - Value in pixels
|
|
14159
|
+
* @returns Value in TWIPs
|
|
14160
|
+
*
|
|
14161
|
+
* @example
|
|
14162
|
+
* convertPixelsToTwip(96) // returns 1440
|
|
14163
|
+
*/
|
|
14164
|
+
declare function convertPixelsToTwip(px: number): number;
|
|
14165
|
+
/**
|
|
14166
|
+
* Convert EMUs to pixels
|
|
14167
|
+
* EMU = English Metric Unit (1 inch = 914400 EMUs)
|
|
14168
|
+
* @param emu - Value in EMUs
|
|
14169
|
+
* @returns Value in pixels
|
|
14170
|
+
*
|
|
14171
|
+
* @example
|
|
14172
|
+
* convertEmuToPixels(914400) // returns 96
|
|
14173
|
+
*/
|
|
14174
|
+
declare function convertEmuToPixels(emu: number): number;
|
|
14175
|
+
/**
|
|
14176
|
+
* Convert pixels to EMUs
|
|
14177
|
+
* @param px - Value in pixels
|
|
14178
|
+
* @returns Value in EMUs
|
|
14179
|
+
*
|
|
14180
|
+
* @example
|
|
14181
|
+
* convertPixelsToEmu(96) // returns 914400
|
|
14182
|
+
*/
|
|
14183
|
+
declare function convertPixelsToEmu(px: number): number;
|
|
14184
|
+
/**
|
|
14185
|
+
* Convert EMU string to pixels
|
|
14186
|
+
* @param emuStr - EMU value as string
|
|
14187
|
+
* @returns Pixel value or undefined if invalid
|
|
14188
|
+
*
|
|
14189
|
+
* @example
|
|
14190
|
+
* convertEmuStringToPixels("914400") // returns 96
|
|
14191
|
+
* convertEmuStringToPixels("invalid") // returns undefined
|
|
14192
|
+
*/
|
|
14193
|
+
declare function convertEmuStringToPixels(emuStr: string): number | undefined;
|
|
14194
|
+
/**
|
|
14195
|
+
* Parse CSS length value to pixels
|
|
14196
|
+
* Supports: px, pt, em, rem, %, and unitless values
|
|
14197
|
+
* @param value - CSS length value (e.g., "20px", "1.5em", "100%")
|
|
14198
|
+
* @returns Value in pixels
|
|
14199
|
+
*
|
|
14200
|
+
* @example
|
|
14201
|
+
* convertCssLengthToPixels("20px") // returns 20
|
|
14202
|
+
* convertCssLengthToPixels("1.5em") // returns 24
|
|
14203
|
+
* convertCssLengthToPixels("100%") // returns 16
|
|
14204
|
+
* convertCssLengthToPixels("20") // returns 20 (unitless treated as px)
|
|
14205
|
+
*/
|
|
14206
|
+
declare function convertCssLengthToPixels(value: string): number;
|
|
14207
|
+
/**
|
|
14208
|
+
* Type for universal measure values in DOCX
|
|
14209
|
+
* Can be a number (already in inches) or a string with unit suffix
|
|
14210
|
+
*/
|
|
14211
|
+
type PositiveUniversalMeasure = `${number}${"in" | "mm" | "cm" | "pt" | "pc" | "pi"}`;
|
|
14212
|
+
/**
|
|
14213
|
+
* Convert universal measure to inches
|
|
14214
|
+
* Compatible with docx.js UniversalMeasure type
|
|
14215
|
+
* @param value - Value in various units (number or string)
|
|
14216
|
+
* @returns Value in inches
|
|
14217
|
+
*
|
|
14218
|
+
* @example
|
|
14219
|
+
* convertMeasureToInches(6.5) // returns 6.5
|
|
14220
|
+
* convertMeasureToInches("1in") // returns 1
|
|
14221
|
+
* convertMeasureToInches("25.4mm") // returns ~1
|
|
14222
|
+
*/
|
|
14223
|
+
declare function convertMeasureToInches(value: number | PositiveUniversalMeasure): number;
|
|
14224
|
+
/**
|
|
14225
|
+
* Convert universal measure to pixels
|
|
14226
|
+
* Compatible with docx.js UniversalMeasure type
|
|
14227
|
+
* @param value - Value in various units (number or string)
|
|
14228
|
+
* @returns Value in pixels
|
|
14229
|
+
*
|
|
14230
|
+
* @example
|
|
14231
|
+
* convertMeasureToPixels("1in") // returns 96
|
|
14232
|
+
* convertMeasureToPixels(6.5) // returns 624
|
|
14233
|
+
*/
|
|
14234
|
+
declare function convertMeasureToPixels(value: number | PositiveUniversalMeasure): number;
|
|
14235
|
+
|
|
14236
|
+
/**
|
|
14237
|
+
* Color conversion utilities for DOCX processing
|
|
14238
|
+
* Handles conversion between color names and hex values
|
|
14239
|
+
*/
|
|
14240
|
+
/**
|
|
14241
|
+
* Color name to hex value mapping
|
|
14242
|
+
* Includes common HTML/CSS color names
|
|
14243
|
+
*/
|
|
14244
|
+
declare const COLOR_NAME_TO_HEX: Record<string, string>;
|
|
14245
|
+
/**
|
|
14246
|
+
* Convert color name or hex to normalized hex value
|
|
14247
|
+
* @param color - Color as name (e.g., "red") or hex (e.g., "#FF0000" or "FF0000")
|
|
14248
|
+
* @returns Normalized hex color string (e.g., "#FF0000") or undefined if invalid
|
|
14249
|
+
*
|
|
14250
|
+
* @example
|
|
14251
|
+
* convertColorToHex("red") // returns "#FF0000"
|
|
14252
|
+
* convertColorToHex("#FF0000") // returns "#FF0000"
|
|
14253
|
+
* convertColorToHex("FF0000") // returns "#FF0000"
|
|
14254
|
+
* convertColorToHex("invalid") // returns undefined
|
|
14255
|
+
*/
|
|
14256
|
+
declare function convertColorToHex(color?: string): string | undefined;
|
|
14257
|
+
/**
|
|
14258
|
+
* Normalize hex color to ensure it has a # prefix
|
|
14259
|
+
* @param color - Color value with or without # prefix
|
|
14260
|
+
* @returns Hex color with # prefix
|
|
14261
|
+
*
|
|
14262
|
+
* @example
|
|
14263
|
+
* normalizeHexColor("FF0000") // returns "#FF0000"
|
|
14264
|
+
* normalizeHexColor("#FF0000") // returns "#FF0000"
|
|
14265
|
+
*/
|
|
14266
|
+
declare function normalizeHexColor(color: string): string;
|
|
14267
|
+
|
|
14268
|
+
/**
|
|
14269
|
+
* XML utility functions for DOCX processing
|
|
14270
|
+
* Provides helper functions for traversing and parsing XML trees (xast)
|
|
14271
|
+
*/
|
|
14272
|
+
|
|
14273
|
+
/**
|
|
14274
|
+
* Find direct child element with specified name
|
|
14275
|
+
* @param node - Parent XML element or root node
|
|
14276
|
+
* @param name - Child element name to find (can include namespace prefix, e.g., "w:p")
|
|
14277
|
+
* @returns Child element if found, null otherwise
|
|
14278
|
+
*
|
|
14279
|
+
* @example
|
|
14280
|
+
* const paragraph = findChild(document, "w:p");
|
|
14281
|
+
*/
|
|
14282
|
+
declare function findChild(node: Root | Element$1, name: string): Element$1 | null;
|
|
14283
|
+
/**
|
|
14284
|
+
* Find deep descendant element with specified name (recursive)
|
|
14285
|
+
* Searches through all descendants, not just direct children
|
|
14286
|
+
* @param node - Root XML element
|
|
14287
|
+
* @param name - Descendant element name to find
|
|
14288
|
+
* @returns Descendant element if found, null otherwise
|
|
14289
|
+
*
|
|
14290
|
+
* @example
|
|
14291
|
+
* const textElement = findDeepChild(run, "w:t");
|
|
14292
|
+
*/
|
|
14293
|
+
declare function findDeepChild(node: Root | Element$1, name: string): Element$1 | null;
|
|
14294
|
+
/**
|
|
14295
|
+
* Find all deep descendant elements with specified name (recursive)
|
|
14296
|
+
* @param node - Root XML element
|
|
14297
|
+
* @param name - Descendant element name to find
|
|
14298
|
+
* @returns Array of matching descendant elements
|
|
14299
|
+
*
|
|
14300
|
+
* @example
|
|
14301
|
+
* const allTextRuns = findDeepChildren(paragraph, "w:r");
|
|
14302
|
+
*/
|
|
14303
|
+
declare function findDeepChildren(node: Root | Element$1, name: string): Element$1[];
|
|
14304
|
+
/**
|
|
14305
|
+
* Parse TWIP attribute value from element attributes
|
|
14306
|
+
* TWIP = Twentieth of a Point (1 inch = 1440 TWIPs)
|
|
14307
|
+
* @param attributes - Element attributes object
|
|
14308
|
+
* @param name - Attribute name to parse
|
|
14309
|
+
* @returns TWIP value as string, or undefined if not found
|
|
14310
|
+
*
|
|
14311
|
+
* @example
|
|
14312
|
+
* const leftIndent = parseTwipAttr(pPr.attributes, "w:left");
|
|
14313
|
+
*/
|
|
14314
|
+
declare function parseTwipAttr(attributes: Record<string, any> | {
|
|
14315
|
+
[key: string]: string | undefined;
|
|
14316
|
+
}, name: string): string | undefined;
|
|
14317
|
+
|
|
14318
|
+
/**
|
|
14319
|
+
* Shared constants for DOCX processing
|
|
14320
|
+
* Used across @docen/export-docx and @docen/import-docx packages
|
|
14321
|
+
*/
|
|
14322
|
+
/**
|
|
14323
|
+
* DOCX DPI (dots per inch) for pixel conversions
|
|
14324
|
+
* Word uses 96 DPI internally
|
|
14325
|
+
*/
|
|
14326
|
+
declare const DOCX_DPI = 96;
|
|
14327
|
+
/**
|
|
14328
|
+
* TWIP (Twentieth of a Point) conversion constants
|
|
14329
|
+
* 1 inch = 1440 TWIPs
|
|
14330
|
+
*/
|
|
14331
|
+
declare const TWIPS_PER_INCH = 1440;
|
|
14332
|
+
/**
|
|
14333
|
+
* EMU (English Metric Unit) conversion constants
|
|
14334
|
+
* 1 inch = 914400 EMUs
|
|
14335
|
+
*/
|
|
14336
|
+
declare const EMUS_PER_INCH = 914400;
|
|
14337
|
+
/**
|
|
14338
|
+
* Font size conversion factors
|
|
14339
|
+
* DOCX uses half-points, TipTap uses pixels
|
|
14340
|
+
* 1px ≈ 0.75pt, 1pt = 2 half-points
|
|
14341
|
+
* So: px * 0.75 * 2 = px * 1.5
|
|
14342
|
+
*/
|
|
14343
|
+
declare const HALF_POINTS_PER_PIXEL = 1.5;
|
|
14344
|
+
declare const PIXELS_PER_HALF_POINT: number;
|
|
14345
|
+
/**
|
|
14346
|
+
* Default code font family
|
|
14347
|
+
*/
|
|
14348
|
+
declare const DEFAULT_CODE_FONT = "Consolas";
|
|
14349
|
+
/**
|
|
14350
|
+
* Checkbox symbols for task lists
|
|
14351
|
+
*/
|
|
14352
|
+
declare const CHECKBOX_SYMBOLS: {
|
|
14353
|
+
readonly checked: "☑";
|
|
14354
|
+
readonly unchecked: "☐";
|
|
14355
|
+
};
|
|
14356
|
+
/**
|
|
14357
|
+
* DOCX style names
|
|
14358
|
+
*/
|
|
14359
|
+
declare const DOCX_STYLE_NAMES: {
|
|
14360
|
+
readonly CODE_BLOCK: "CodeBlock";
|
|
14361
|
+
readonly CODE_PREFIX: "Code";
|
|
14362
|
+
};
|
|
14363
|
+
/**
|
|
14364
|
+
* Text alignment mappings
|
|
14365
|
+
*/
|
|
14366
|
+
declare const TEXT_ALIGN_MAP: {
|
|
14367
|
+
/** TipTap to DOCX alignment mapping */
|
|
14368
|
+
readonly tiptapToDocx: {
|
|
14369
|
+
readonly left: "left";
|
|
14370
|
+
readonly right: "right";
|
|
14371
|
+
readonly center: "center";
|
|
14372
|
+
readonly justify: "both";
|
|
14373
|
+
};
|
|
14374
|
+
/** DOCX to TipTap alignment mapping */
|
|
14375
|
+
readonly docxToTipTap: {
|
|
14376
|
+
readonly left: "left";
|
|
14377
|
+
readonly right: "right";
|
|
14378
|
+
readonly center: "center";
|
|
14379
|
+
readonly both: "justify";
|
|
14380
|
+
};
|
|
14381
|
+
};
|
|
14382
|
+
/**
|
|
14383
|
+
* Common page dimensions in TWIPs
|
|
14384
|
+
*/
|
|
14385
|
+
declare const PAGE_DIMENSIONS: {
|
|
14386
|
+
/** A4 width in TWIPs (8.27 inches = 11906 TWIPs) */
|
|
14387
|
+
readonly A4_WIDTH_TWIP: 11906;
|
|
14388
|
+
/** Default 1 inch margin in TWIPs */
|
|
14389
|
+
readonly DEFAULT_MARGIN_TWIP: 1440;
|
|
14390
|
+
};
|
|
14391
|
+
|
|
14392
|
+
/**
|
|
14393
|
+
* Type guard utilities for DOCX processing
|
|
14394
|
+
*/
|
|
14395
|
+
/**
|
|
14396
|
+
* Type guard factory function
|
|
14397
|
+
* Creates a type guard function that checks if a value is one of the valid values
|
|
14398
|
+
*
|
|
14399
|
+
* @param validValues - Readonly array of valid string values
|
|
14400
|
+
* @returns Type guard function
|
|
14401
|
+
*
|
|
14402
|
+
* @example
|
|
14403
|
+
* const isValidAlign = createStringValidator(["left", "right", "center"] as const);
|
|
14404
|
+
* if (isValidAlign(value)) {
|
|
14405
|
+
* // value is typed as "left" | "right" | "center"
|
|
14406
|
+
* }
|
|
14407
|
+
*/
|
|
14408
|
+
declare function createStringValidator<T extends string>(validValues: readonly T[]): (value: string) => value is T;
|
|
14409
|
+
|
|
14410
|
+
/**
|
|
14411
|
+
* Calculate effective content width from document options
|
|
14412
|
+
*/
|
|
14413
|
+
declare function calculateEffectiveContentWidth(options?: DocxExportOptions): number;
|
|
14414
|
+
|
|
14415
|
+
/**
|
|
14416
|
+
* Apply paragraph style attributes to options
|
|
14417
|
+
*/
|
|
14418
|
+
declare const applyParagraphStyleAttributes: <T extends Record<string, unknown>>(options: T, attrs?: ParagraphNode["attrs"]) => T;
|
|
14419
|
+
|
|
14420
|
+
/**
|
|
14421
|
+
* Convert TipTap border to DOCX border format
|
|
14422
|
+
*
|
|
14423
|
+
* @param border - TipTap table cell border definition
|
|
14424
|
+
* @returns DOCX border options or undefined if no border
|
|
14425
|
+
*/
|
|
14426
|
+
declare function convertBorder(border: TableCellBorder | null | undefined): {
|
|
14427
|
+
color?: string;
|
|
14428
|
+
size?: number;
|
|
14429
|
+
style: "single" | "dashed" | "dotted" | "double" | "none";
|
|
14430
|
+
} | undefined;
|
|
13645
14431
|
|
|
13646
14432
|
/**
|
|
13647
14433
|
* Convert TipTap image node to DOCX ImageRun
|
|
@@ -13652,11 +14438,17 @@ declare function convertBlockquote(node: BlockquoteNode): Paragraph[];
|
|
|
13652
14438
|
*/
|
|
13653
14439
|
declare function convertImage(node: ImageNode, params?: {
|
|
13654
14440
|
/** Maximum available width (number = pixels, or string like "6in", "152.4mm") */
|
|
13655
|
-
maxWidth?: number | PositiveUniversalMeasure;
|
|
14441
|
+
maxWidth?: number | PositiveUniversalMeasure$1;
|
|
13656
14442
|
/** Additional image options to apply */
|
|
13657
14443
|
options?: Partial<IImageOptions$1>;
|
|
14444
|
+
/** Custom image handler for fetching image data */
|
|
14445
|
+
handler?: DocxImageExportHandler;
|
|
13658
14446
|
}): Promise<ImageRun>;
|
|
13659
14447
|
|
|
14448
|
+
/**
|
|
14449
|
+
* Apply table margins to table options
|
|
14450
|
+
*/
|
|
14451
|
+
declare const applyTableMargins: <T extends ITableOptions>(options: T, node: TableNode) => T;
|
|
13660
14452
|
/**
|
|
13661
14453
|
* Convert TipTap table node to DOCX Table
|
|
13662
14454
|
*
|
|
@@ -13702,12 +14494,15 @@ declare function convertTableHeader(node: TableHeaderNode, params: {
|
|
|
13702
14494
|
}): Promise<TableCell>;
|
|
13703
14495
|
|
|
13704
14496
|
/**
|
|
13705
|
-
* Convert TipTap codeBlock node to DOCX
|
|
14497
|
+
* Convert TipTap codeBlock node to DOCX paragraph options
|
|
14498
|
+
*
|
|
14499
|
+
* This converter only handles data transformation from node.attrs to DOCX format properties.
|
|
14500
|
+
* It returns pure data objects (IParagraphOptions), not DOCX instances.
|
|
13706
14501
|
*
|
|
13707
14502
|
* @param node - TipTap codeBlock node
|
|
13708
|
-
* @returns DOCX
|
|
14503
|
+
* @returns DOCX paragraph options (pure data object)
|
|
13709
14504
|
*/
|
|
13710
|
-
declare function convertCodeBlock(node: CodeBlockNode):
|
|
14505
|
+
declare function convertCodeBlock(node: CodeBlockNode): IParagraphOptions;
|
|
13711
14506
|
|
|
13712
14507
|
interface ListOptions {
|
|
13713
14508
|
numbering: {
|
|
@@ -13720,13 +14515,19 @@ declare function convertBulletList(): ListOptions;
|
|
|
13720
14515
|
declare function convertOrderedList(node: OrderedListNode): ListOptions;
|
|
13721
14516
|
/**
|
|
13722
14517
|
* Convert list nodes (bullet or ordered) with proper numbering
|
|
14518
|
+
*
|
|
14519
|
+
* This converter only handles data transformation from node content to DOCX format properties.
|
|
14520
|
+
* It returns pure data objects (IParagraphOptions[]), not DOCX instances.
|
|
13723
14521
|
*/
|
|
13724
14522
|
declare function convertList(node: BulletListNode | OrderedListNode, params: {
|
|
13725
14523
|
listType: "bullet" | "ordered";
|
|
13726
|
-
}): Promise<
|
|
14524
|
+
}): Promise<IParagraphOptions[]>;
|
|
13727
14525
|
|
|
13728
14526
|
/**
|
|
13729
|
-
* Convert TipTap list item node to
|
|
14527
|
+
* Convert TipTap list item node to paragraph options
|
|
14528
|
+
*
|
|
14529
|
+
* This converter only handles data transformation from node content to DOCX format properties.
|
|
14530
|
+
* It returns pure data objects (IParagraphOptions), not DOCX instances.
|
|
13730
14531
|
*
|
|
13731
14532
|
* Note: The numbering reference (including start value) is typically
|
|
13732
14533
|
* handled by the parent list converter. This function focuses on
|
|
@@ -13734,150 +14535,65 @@ declare function convertList(node: BulletListNode | OrderedListNode, params: {
|
|
|
13734
14535
|
*
|
|
13735
14536
|
* @param node - TipTap list item node
|
|
13736
14537
|
* @param params - Conversion parameters
|
|
13737
|
-
* @returns Promise<
|
|
14538
|
+
* @returns Promise<Paragraph options (pure data object)>
|
|
13738
14539
|
*/
|
|
13739
14540
|
declare function convertListItem(node: ListItemNode, params: {
|
|
13740
14541
|
options?: IParagraphOptions;
|
|
13741
|
-
}): Promise<
|
|
14542
|
+
}): Promise<IParagraphOptions>;
|
|
13742
14543
|
|
|
13743
14544
|
/**
|
|
13744
|
-
* Convert TipTap task list node to
|
|
14545
|
+
* Convert TipTap task list node to array of paragraph options
|
|
14546
|
+
*
|
|
14547
|
+
* This converter only handles data transformation from node content to DOCX format properties.
|
|
14548
|
+
* It returns pure data objects (IParagraphOptions[]), not DOCX instances.
|
|
13745
14549
|
*
|
|
13746
14550
|
* @param node - TipTap task list node
|
|
13747
|
-
* @returns Array of
|
|
14551
|
+
* @returns Array of paragraph options (pure data objects) with checkboxes
|
|
13748
14552
|
*/
|
|
13749
|
-
declare function convertTaskList(node: TaskListNode):
|
|
14553
|
+
declare function convertTaskList(node: TaskListNode): IParagraphOptions[];
|
|
13750
14554
|
|
|
13751
14555
|
/**
|
|
13752
|
-
* Convert TipTap task item node to
|
|
14556
|
+
* Convert TipTap task item node to paragraph options with checkbox
|
|
14557
|
+
*
|
|
14558
|
+
* This converter only handles data transformation from node content to DOCX format properties.
|
|
14559
|
+
* It returns pure data objects (IParagraphOptions), not DOCX instances.
|
|
13753
14560
|
*
|
|
13754
14561
|
* @param node - TipTap task item node
|
|
13755
|
-
* @returns
|
|
14562
|
+
* @returns Paragraph options (pure data object) with checkbox
|
|
13756
14563
|
*/
|
|
13757
|
-
declare function convertTaskItem(node: TaskItemNode):
|
|
14564
|
+
declare function convertTaskItem(node: TaskItemNode): IParagraphOptions;
|
|
13758
14565
|
|
|
13759
14566
|
/**
|
|
13760
|
-
* Convert TipTap horizontalRule node to
|
|
14567
|
+
* Convert TipTap horizontalRule node to paragraph options
|
|
14568
|
+
*
|
|
14569
|
+
* This converter only handles data transformation from node to DOCX format properties.
|
|
14570
|
+
* It returns pure data objects (IParagraphOptions), not DOCX instances.
|
|
14571
|
+
*
|
|
13761
14572
|
* Uses page break by default (consistent with import-docx behavior)
|
|
13762
14573
|
*
|
|
13763
14574
|
* @param node - TipTap horizontalRule node
|
|
13764
14575
|
* @param params - Conversion parameters
|
|
13765
|
-
* @returns
|
|
14576
|
+
* @returns Paragraph options (pure data object) with page break or custom styling
|
|
13766
14577
|
*/
|
|
13767
14578
|
declare function convertHorizontalRule(node: HorizontalRuleNode, params: {
|
|
13768
14579
|
/** Export options for horizontal rule styling */
|
|
13769
14580
|
options?: DocxExportOptions["horizontalRule"];
|
|
13770
|
-
}):
|
|
14581
|
+
}): IParagraphOptions;
|
|
13771
14582
|
|
|
13772
14583
|
/**
|
|
13773
|
-
* Convert TipTap
|
|
13774
|
-
* Simulates collapsible content using indentation and borders
|
|
14584
|
+
* Convert TipTap detailsSummary node to paragraph options
|
|
13775
14585
|
*
|
|
13776
|
-
*
|
|
14586
|
+
* This converter only handles data transformation from node content to DOCX format properties.
|
|
14587
|
+
* It returns pure data objects (IParagraphOptions), not DOCX instances.
|
|
14588
|
+
*
|
|
14589
|
+
* @param node - TipTap detailsSummary node
|
|
13777
14590
|
* @param params - Conversion parameters
|
|
13778
|
-
* @returns
|
|
14591
|
+
* @returns Paragraph options (pure data object) with summary styling
|
|
13779
14592
|
*/
|
|
13780
|
-
declare function
|
|
14593
|
+
declare function convertDetailsSummary(node: DetailsSummaryNode, params: {
|
|
13781
14594
|
/** Export options for details styling */
|
|
13782
14595
|
options?: DocxExportOptions["details"];
|
|
13783
|
-
|
|
13784
|
-
exportOptions: DocxExportOptions;
|
|
13785
|
-
}): Promise<Paragraph[]>;
|
|
13786
|
-
|
|
13787
|
-
/**
|
|
13788
|
-
* Constants for unit conversion
|
|
13789
|
-
*/
|
|
13790
|
-
declare const DOCX_DPI = 96;
|
|
13791
|
-
/**
|
|
13792
|
-
* Convert TWIPs to pixels
|
|
13793
|
-
*/
|
|
13794
|
-
declare const convertTwipToPixels: (twip: number) => number;
|
|
13795
|
-
/**
|
|
13796
|
-
* Parse CSS length value to pixels
|
|
13797
|
-
* Supports: px, pt, em, rem, %, and unitless values
|
|
13798
|
-
*/
|
|
13799
|
-
declare const convertCssLengthToPixels: (value: string) => number;
|
|
13800
|
-
/**
|
|
13801
|
-
* Convert pixels to TWIPs (Twentieth of a Point)
|
|
13802
|
-
*/
|
|
13803
|
-
declare const convertPixelsToTwip: (px: number) => number;
|
|
13804
|
-
/**
|
|
13805
|
-
* Convert universal measure to inches
|
|
13806
|
-
* Compatible with docx.js UniversalMeasure type
|
|
13807
|
-
*/
|
|
13808
|
-
declare const convertMeasureToInches: (value: number | PositiveUniversalMeasure) => number;
|
|
13809
|
-
/**
|
|
13810
|
-
* Convert universal measure to pixels
|
|
13811
|
-
* Compatible with docx.js UniversalMeasure type
|
|
13812
|
-
*/
|
|
13813
|
-
declare const convertMeasureToPixels: (value: number | PositiveUniversalMeasure) => number;
|
|
13814
|
-
/**
|
|
13815
|
-
* Calculate effective content width from document options
|
|
13816
|
-
*/
|
|
13817
|
-
declare const calculateEffectiveContentWidth: (options?: DocxExportOptions) => number;
|
|
13818
|
-
|
|
13819
|
-
/**
|
|
13820
|
-
* Color name to hex value mapping
|
|
13821
|
-
*/
|
|
13822
|
-
/**
|
|
13823
|
-
* Convert color name or hex to normalized hex value
|
|
13824
|
-
*/
|
|
13825
|
-
declare const convertColorToHex: (color?: string) => string | undefined;
|
|
13826
|
-
|
|
13827
|
-
/**
|
|
13828
|
-
* Extract image type from URL or base64 data
|
|
13829
|
-
*/
|
|
13830
|
-
declare const getImageTypeFromSrc: (src: string) => "png" | "jpeg" | "gif" | "bmp" | "tiff";
|
|
13831
|
-
/**
|
|
13832
|
-
* Create floating options for full-width images
|
|
13833
|
-
*/
|
|
13834
|
-
declare const createFloatingOptions: () => {
|
|
13835
|
-
horizontalPosition: {
|
|
13836
|
-
relative: string;
|
|
13837
|
-
align: string;
|
|
13838
|
-
};
|
|
13839
|
-
verticalPosition: {
|
|
13840
|
-
relative: string;
|
|
13841
|
-
align: string;
|
|
13842
|
-
};
|
|
13843
|
-
lockAnchor: boolean;
|
|
13844
|
-
behindDocument: boolean;
|
|
13845
|
-
inFrontOfText: boolean;
|
|
13846
|
-
};
|
|
13847
|
-
/**
|
|
13848
|
-
* Get image width with priority: node attrs > image meta > calculated > default
|
|
13849
|
-
*/
|
|
13850
|
-
declare const getImageWidth: (node: {
|
|
13851
|
-
attrs?: {
|
|
13852
|
-
width?: number | null;
|
|
13853
|
-
};
|
|
13854
|
-
}, imageMeta?: {
|
|
13855
|
-
width?: number;
|
|
13856
|
-
height?: number;
|
|
13857
|
-
}, maxWidth?: number | PositiveUniversalMeasure) => number;
|
|
13858
|
-
/**
|
|
13859
|
-
* Get image height with priority: node attrs > image meta > calculated > default
|
|
13860
|
-
*/
|
|
13861
|
-
declare const getImageHeight: (node: {
|
|
13862
|
-
attrs?: {
|
|
13863
|
-
height?: number | null;
|
|
13864
|
-
};
|
|
13865
|
-
}, width: number, imageMeta?: {
|
|
13866
|
-
width?: number;
|
|
13867
|
-
height?: number;
|
|
13868
|
-
}, maxWidth?: number | PositiveUniversalMeasure) => number;
|
|
13869
|
-
/**
|
|
13870
|
-
* Fetch image data and metadata from URL
|
|
13871
|
-
*/
|
|
13872
|
-
declare const getImageDataAndMeta: (url: string) => Promise<{
|
|
13873
|
-
data: Uint8Array;
|
|
13874
|
-
meta: ImageMeta;
|
|
13875
|
-
}>;
|
|
13876
|
-
|
|
13877
|
-
/**
|
|
13878
|
-
* Apply paragraph style attributes to options
|
|
13879
|
-
*/
|
|
13880
|
-
declare const applyParagraphStyleAttributes: <T extends Record<string, unknown>>(options: T, attrs?: ParagraphNode["attrs"]) => T;
|
|
14596
|
+
}): IParagraphOptions;
|
|
13881
14597
|
|
|
13882
|
-
export { DOCX_DPI, applyParagraphStyleAttributes, calculateEffectiveContentWidth, convertBlockquote, convertBulletList, convertCodeBlock, convertColorToHex, convertCssLengthToPixels,
|
|
13883
|
-
export type { BlockNode, BlockquoteNode, BulletListNode, CodeBlockNode, DetailsContentNode, DetailsNode, DetailsSummaryNode, DocumentNode, DocxExportOptions, HardBreakNode, HeadingNode, HorizontalRuleNode, ImageFloatingOptions, ImageNode, ImageOutlineOptions, JSONContent, ListItemNode, ListOptions, Mark, OrderedListNode, ParagraphNode, TableCellBorder, TableCellNode, TableHeaderNode, TableNode, TableRowNode, TaskItemNode, TaskListNode, TextContent, TextNode };
|
|
14598
|
+
export { CHECKBOX_SYMBOLS, COLOR_NAME_TO_HEX, DEFAULT_CODE_FONT, DOCX_DPI, DOCX_STYLE_NAMES, EMUS_PER_INCH, HALF_POINTS_PER_PIXEL, PAGE_DIMENSIONS, PIXELS_PER_HALF_POINT, TEXT_ALIGN_MAP, TWIPS_PER_INCH, applyParagraphStyleAttributes, applyTableMargins, calculateEffectiveContentWidth, convertBlockquote, convertBorder, convertBulletList, convertCodeBlock, convertColorToHex, convertCssLengthToPixels, convertDetailsSummary, convertDocument, convertEmuStringToPixels, convertEmuToPixels, convertHardBreak, convertHeading, convertHorizontalRule, convertImage, convertList, convertListItem, convertMeasureToInches, convertMeasureToPixels, convertNode, convertOrderedList, convertParagraph, convertPixelsToEmu, convertPixelsToTwip, convertTable, convertTableCell, convertTableHeader, convertTableRow, convertTaskItem, convertTaskList, convertText, convertTextNodes, convertToDocxImageType, convertTwipToCssString, convertTwipToPixels, createFloatingOptions, createStringValidator, findChild, findDeepChild, findDeepChildren, generateDOCX, getImageDataAndMeta, getImageHeight, getImageTypeFromSrc, getImageWidth, normalizeHexColor, parseTwipAttr };
|
|
14599
|
+
export type { BlockNode, BlockquoteNode, BulletListNode, CodeBlockNode, DetailsContentNode, DetailsNode, DetailsSummaryNode, DocumentNode, DocxExportOptions, DocxImageExportHandler, HardBreakNode, HeadingNode, HorizontalRuleNode, ImageFloatingOptions, ImageNode, ImageOutlineOptions, JSONContent, ListItemNode, ListOptions, Mark, OrderedListNode, ParagraphNode, PositiveUniversalMeasure, TableCellBorder, TableCellNode, TableHeaderNode, TableNode, TableRowNode, TaskItemNode, TaskListNode, TextContent, TextNode };
|