@lexical/utils 0.46.0 → 0.46.1-nightly.20260629.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +1 -1
- package/package.json +4 -4
- package/src/index.ts +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -239,7 +239,7 @@ export declare function $insertNodeIntoLeaf(node: LexicalNode): void;
|
|
|
239
239
|
* @param createElementNode - Creates a new lexical element to wrap the to-be-wrapped node and returns it.
|
|
240
240
|
* @returns A new lexical element with the previous node appended within (as a child, including its children).
|
|
241
241
|
*/
|
|
242
|
-
export declare function $wrapNodeInElement(node: LexicalNode, createElementNode: () =>
|
|
242
|
+
export declare function $wrapNodeInElement<T extends ElementNode>(node: LexicalNode, createElementNode: () => T): T;
|
|
243
243
|
export type ObjectKlass<T> = new (...args: any[]) => T;
|
|
244
244
|
/**
|
|
245
245
|
* @param object = The instance of the type
|
package/package.json
CHANGED
|
@@ -8,13 +8,13 @@
|
|
|
8
8
|
"utils"
|
|
9
9
|
],
|
|
10
10
|
"license": "MIT",
|
|
11
|
-
"version": "0.46.0",
|
|
11
|
+
"version": "0.46.1-nightly.20260629.0",
|
|
12
12
|
"main": "./dist/LexicalUtils.js",
|
|
13
13
|
"types": "./dist/typescript-too-old.d.ts",
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@lexical/internal": "0.46.0",
|
|
16
|
-
"@lexical/selection": "0.46.0",
|
|
17
|
-
"lexical": "0.46.0"
|
|
15
|
+
"@lexical/internal": "0.46.1-nightly.20260629.0",
|
|
16
|
+
"@lexical/selection": "0.46.1-nightly.20260629.0",
|
|
17
|
+
"lexical": "0.46.1-nightly.20260629.0"
|
|
18
18
|
},
|
|
19
19
|
"repository": {
|
|
20
20
|
"type": "git",
|
package/src/index.ts
CHANGED
|
@@ -814,10 +814,10 @@ export function $insertNodeIntoLeaf(node: LexicalNode): void {
|
|
|
814
814
|
* @param createElementNode - Creates a new lexical element to wrap the to-be-wrapped node and returns it.
|
|
815
815
|
* @returns A new lexical element with the previous node appended within (as a child, including its children).
|
|
816
816
|
*/
|
|
817
|
-
export function $wrapNodeInElement(
|
|
817
|
+
export function $wrapNodeInElement<T extends ElementNode>(
|
|
818
818
|
node: LexicalNode,
|
|
819
|
-
createElementNode: () =>
|
|
820
|
-
):
|
|
819
|
+
createElementNode: () => T,
|
|
820
|
+
): T {
|
|
821
821
|
const elementNode = createElementNode();
|
|
822
822
|
node.replace(elementNode);
|
|
823
823
|
elementNode.append(node);
|