@lexical/utils 0.42.1-nightly.20260408.0 → 0.43.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/LexicalUtils.js.flow +10 -10
- package/package.json +3 -3
package/LexicalUtils.js.flow
CHANGED
|
@@ -107,8 +107,8 @@ declare export function $restoreEditorState(
|
|
|
107
107
|
): void;
|
|
108
108
|
|
|
109
109
|
|
|
110
|
-
declare export function $insertNodeToNearestRoot<T
|
|
111
|
-
declare export function $insertNodeToNearestRootAtCaret<T
|
|
110
|
+
declare export function $insertNodeToNearestRoot<T extends LexicalNode>(node: T): T;
|
|
111
|
+
declare export function $insertNodeToNearestRootAtCaret<T extends LexicalNode>(node: T, caret: PointCaret<CaretDirection>, options?: SplitAtPointCaretNextOptions): T;
|
|
112
112
|
|
|
113
113
|
declare export function $insertNodeIntoLeaf(node: LexicalNode): void
|
|
114
114
|
|
|
@@ -177,21 +177,21 @@ declare export function $descendantsMatching(
|
|
|
177
177
|
): LexicalNode[];
|
|
178
178
|
|
|
179
179
|
declare export function $getAdjacentSiblingOrParentSiblingCaret<
|
|
180
|
-
D
|
|
180
|
+
D extends CaretDirection,
|
|
181
181
|
>(
|
|
182
182
|
startCaret: NodeCaret<D>,
|
|
183
183
|
rootMode?: RootMode,
|
|
184
184
|
): null | [NodeCaret<D>, number];
|
|
185
185
|
|
|
186
|
-
export type StateConfigWrapper<K
|
|
186
|
+
export type StateConfigWrapper<K extends string, V> = {
|
|
187
187
|
+stateConfig: StateConfig<K, V>;
|
|
188
|
-
+$get: <T
|
|
189
|
-
+$set: <T
|
|
188
|
+
+$get: <T extends LexicalNode>(node: T) => V;
|
|
189
|
+
+$set: <T extends LexicalNode>(
|
|
190
190
|
node: T,
|
|
191
191
|
valueOrUpdater: ValueOrUpdater<V>,
|
|
192
192
|
) => T;
|
|
193
193
|
/** `[$get, $set]` */
|
|
194
|
-
+accessors:
|
|
194
|
+
+accessors: Readonly<[$get: StateConfigWrapper<K, V>['$get'], $set: StateConfigWrapper<K, V>['$set']]>;
|
|
195
195
|
/**
|
|
196
196
|
* `() => function () { return $get(this) }`
|
|
197
197
|
*
|
|
@@ -205,7 +205,7 @@ export type StateConfigWrapper<K: string, V> = {
|
|
|
205
205
|
* }
|
|
206
206
|
* ```
|
|
207
207
|
*/
|
|
208
|
-
makeGetterMethod<T
|
|
208
|
+
makeGetterMethod<T extends LexicalNode>(): (this: T) => V;
|
|
209
209
|
/**
|
|
210
210
|
* `() => function (valueOrUpdater) { return $set(this, valueOrUpdater) }`
|
|
211
211
|
*
|
|
@@ -219,12 +219,12 @@ export type StateConfigWrapper<K: string, V> = {
|
|
|
219
219
|
* }
|
|
220
220
|
* ```
|
|
221
221
|
*/
|
|
222
|
-
makeSetterMethod<T
|
|
222
|
+
makeSetterMethod<T extends LexicalNode>(): (
|
|
223
223
|
this: T,
|
|
224
224
|
valueOrUpdater: ValueOrUpdater<V>,
|
|
225
225
|
) => T;
|
|
226
226
|
};
|
|
227
227
|
|
|
228
|
-
declare export function makeStateWrapper<K
|
|
228
|
+
declare export function makeStateWrapper<K extends string, V>(
|
|
229
229
|
stateConfig: StateConfig<K, V>,
|
|
230
230
|
): StateConfigWrapper<K, V>;
|
package/package.json
CHANGED
|
@@ -8,12 +8,12 @@
|
|
|
8
8
|
"utils"
|
|
9
9
|
],
|
|
10
10
|
"license": "MIT",
|
|
11
|
-
"version": "0.
|
|
11
|
+
"version": "0.43.0",
|
|
12
12
|
"main": "LexicalUtils.js",
|
|
13
13
|
"types": "index.d.ts",
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@lexical/selection": "0.
|
|
16
|
-
"lexical": "0.
|
|
15
|
+
"@lexical/selection": "0.43.0",
|
|
16
|
+
"lexical": "0.43.0"
|
|
17
17
|
},
|
|
18
18
|
"repository": {
|
|
19
19
|
"type": "git",
|