@lexical/utils 0.2.6 → 0.2.9

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/LexicalUtils.d.ts CHANGED
@@ -5,6 +5,8 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
7
  */
8
+ import {Class} from 'utility-types';
9
+
8
10
  import type {LexicalNode, ElementNode, LexicalEditor} from 'lexical';
9
11
  export type DFSNode = Readonly<{
10
12
  depth: number;
@@ -25,7 +27,7 @@ declare function $dfs(
25
27
  declare function $getDepth(node: LexicalNode): number;
26
28
  declare function $getNearestNodeOfType<T extends LexicalNode>(
27
29
  node: LexicalNode,
28
- klass: T,
30
+ klass: Class<T>,
29
31
  ): T | null;
30
32
  export type DOMNodeToLexicalConversion = (element: Node) => LexicalNode;
31
33
  export type DOMNodeToLexicalConversionMap = Record<
@@ -42,9 +44,9 @@ declare function $getNearestBlockElementAncestorOrThrow(
42
44
  startNode: LexicalNode,
43
45
  ): ElementNode;
44
46
 
45
- declare function registerNestedElementResolver<N extends ElementNode>(
47
+ declare function registerNestedElementResolver<N>(
46
48
  editor: LexicalEditor,
47
- targetNode: N,
49
+ targetNode: Class<N>,
48
50
  cloneNode: (from: N) => N,
49
51
  handleOverlap: (from: N, to: N) => void,
50
52
  ): () => void;
package/package.json CHANGED
@@ -8,14 +8,14 @@
8
8
  "utils"
9
9
  ],
10
10
  "license": "MIT",
11
- "version": "0.2.6",
11
+ "version": "0.2.9",
12
12
  "main": "LexicalUtils.js",
13
13
  "peerDependencies": {
14
- "lexical": "0.2.6"
14
+ "lexical": "0.2.9"
15
15
  },
16
16
  "dependencies": {
17
- "@lexical/list": "0.2.6",
18
- "@lexical/table": "0.2.6"
17
+ "@lexical/list": "0.2.9",
18
+ "@lexical/table": "0.2.9"
19
19
  },
20
20
  "repository": {
21
21
  "type": "git",