bippy 0.6.1 → 0.7.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/LICENSE +1 -1
- package/README.md +223 -463
- package/dist/core.cjs +1 -1
- package/dist/core.js +1 -1
- package/dist/errors.d.cts +410 -0
- package/dist/errors.d.ts +410 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +153 -3
- package/dist/index.d.ts +153 -3
- package/dist/index.js +1 -1
- package/dist/install-hook-only.cjs +1 -1
- package/dist/install-hook-only.d.cts +9 -1
- package/dist/install-hook-only.d.ts +9 -1
- package/dist/install-hook-only.js +1 -1
- package/dist/rdt-hook.cjs +1 -1
- package/dist/rdt-hook.js +1 -1
- package/dist/source.cjs +14 -5
- package/dist/source.d.cts +86 -69
- package/dist/source.d.ts +86 -69
- package/dist/source.js +14 -5
- package/package.json +26 -27
- package/src/core.ts +353 -685
- package/src/errors.ts +34 -0
- package/src/index.ts +1 -0
- package/src/install-hook-only.ts +2 -2
- package/src/rdt-hook.ts +160 -161
- package/src/react-internals/generated/react-work-tags.ts +318 -0
- package/src/react-internals/index.ts +67 -0
- package/src/react-internals/semver.ts +80 -0
- package/src/react-internals/types.ts +186 -0
- package/src/react.ts +76 -0
- package/src/source/constants.ts +1 -1
- package/src/source/error-stack.ts +11 -0
- package/src/source/get-display-name-from-source.ts +44 -40
- package/src/source/get-source.ts +43 -26
- package/src/source/index.ts +11 -1
- package/src/source/inspect-hooks.ts +220 -207
- package/src/source/owner-stack.ts +119 -174
- package/src/source/parse-debug-stack.ts +4 -4
- package/src/source/parse-hook-names.ts +14 -53
- package/src/source/parse-stack.ts +14 -31
- package/src/source/renderer-dispatchers.ts +30 -0
- package/src/source/symbolication.ts +709 -120
- package/dist/core.d.cts +0 -214
- package/dist/core.d.ts +0 -214
- package/dist/core2.d.cts +0 -3
- package/dist/core2.d.ts +0 -3
- package/dist/get-source.cjs +0 -19
- package/dist/get-source.js +0 -19
- package/dist/index.iife.js +0 -9
- package/dist/install-hook-only.iife.js +0 -9
- package/dist/react-refresh.cjs +0 -9
- package/dist/react-refresh.d.cts +0 -66
- package/dist/react-refresh.d.ts +0 -66
- package/dist/react-refresh.js +0 -9
- package/dist/unsubscribe.d.cts +0 -298
- package/dist/unsubscribe.d.ts +0 -298
- package/src/react-refresh/constants.ts +0 -9
- package/src/react-refresh/detect-hmr-transport.ts +0 -33
- package/src/react-refresh/index.ts +0 -173
- package/src/react-refresh/metro-hmr-transport.ts +0 -188
- package/src/react-refresh/next-webpack-hmr-transport.ts +0 -72
- package/src/react-refresh/normalize-hmr-file-path.ts +0 -24
- package/src/react-refresh/types.ts +0 -7
- package/src/react-refresh/vite-hmr-transport.ts +0 -116
- package/src/types.ts +0 -438
- package/src/unsubscribe.ts +0 -17
package/src/types.ts
DELETED
|
@@ -1,438 +0,0 @@
|
|
|
1
|
-
import type { ReactNode } from "react";
|
|
2
|
-
|
|
3
|
-
// @types/react-reconciler uses `export = ReactReconciler` (CJS namespace),
|
|
4
|
-
// which downstream bundlers can't resolve as ESM exports. These types are
|
|
5
|
-
// inlined from @types/react-reconciler@0.28 to avoid the dependency.
|
|
6
|
-
|
|
7
|
-
// Simple type aliases — most are opaque in the original
|
|
8
|
-
export type BundleType = 0 | 1;
|
|
9
|
-
export type Flags = number;
|
|
10
|
-
export type Lanes = number;
|
|
11
|
-
export type TypeOfMode = number;
|
|
12
|
-
export type RootTag = 0 | 1 | 2;
|
|
13
|
-
export type LanePriority =
|
|
14
|
-
| 0
|
|
15
|
-
| 1
|
|
16
|
-
| 2
|
|
17
|
-
| 3
|
|
18
|
-
| 4
|
|
19
|
-
| 5
|
|
20
|
-
| 6
|
|
21
|
-
| 7
|
|
22
|
-
| 8
|
|
23
|
-
| 9
|
|
24
|
-
| 10
|
|
25
|
-
| 11
|
|
26
|
-
| 12
|
|
27
|
-
| 13
|
|
28
|
-
| 14
|
|
29
|
-
| 15
|
|
30
|
-
| 16
|
|
31
|
-
| 17;
|
|
32
|
-
export type WorkTag =
|
|
33
|
-
| 0
|
|
34
|
-
| 1
|
|
35
|
-
| 2
|
|
36
|
-
| 3
|
|
37
|
-
| 4
|
|
38
|
-
| 5
|
|
39
|
-
| 6
|
|
40
|
-
| 7
|
|
41
|
-
| 8
|
|
42
|
-
| 9
|
|
43
|
-
| 10
|
|
44
|
-
| 11
|
|
45
|
-
| 12
|
|
46
|
-
| 13
|
|
47
|
-
| 14
|
|
48
|
-
| 15
|
|
49
|
-
| 16
|
|
50
|
-
| 17
|
|
51
|
-
| 18
|
|
52
|
-
| 19
|
|
53
|
-
| 20
|
|
54
|
-
| 21
|
|
55
|
-
| 22
|
|
56
|
-
| 23
|
|
57
|
-
| 24
|
|
58
|
-
| 25
|
|
59
|
-
| 26
|
|
60
|
-
| 27
|
|
61
|
-
| 28
|
|
62
|
-
| 29
|
|
63
|
-
| 30
|
|
64
|
-
| 31;
|
|
65
|
-
export type HookType =
|
|
66
|
-
| "useState"
|
|
67
|
-
| "useReducer"
|
|
68
|
-
| "useContext"
|
|
69
|
-
| "useRef"
|
|
70
|
-
| "useEffect"
|
|
71
|
-
| "useLayoutEffect"
|
|
72
|
-
| "useCallback"
|
|
73
|
-
| "useMemo"
|
|
74
|
-
| "useImperativeHandle"
|
|
75
|
-
| "useDebugValue"
|
|
76
|
-
| "useDeferredValue"
|
|
77
|
-
| "useTransition"
|
|
78
|
-
| "useMutableSource"
|
|
79
|
-
| "useOpaqueIdentifier"
|
|
80
|
-
| "useCacheRefresh";
|
|
81
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
82
|
-
export type FiberRoot = any;
|
|
83
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
84
|
-
export type MutableSource = any;
|
|
85
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
86
|
-
export type OpaqueHandle = any;
|
|
87
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
88
|
-
export type OpaqueRoot = any;
|
|
89
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
90
|
-
export type React$AbstractComponent<_Config, _Instance = unknown> = any;
|
|
91
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
92
|
-
export type HostConfig = Record<string, any>;
|
|
93
|
-
|
|
94
|
-
// Structural interfaces
|
|
95
|
-
export interface Source {
|
|
96
|
-
fileName: string;
|
|
97
|
-
lineNumber: number;
|
|
98
|
-
}
|
|
99
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
100
|
-
export interface RefObject {
|
|
101
|
-
current: any;
|
|
102
|
-
}
|
|
103
|
-
export interface Thenable<T> {
|
|
104
|
-
then(resolve: () => T, reject?: () => T): T;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
export interface ReactContext<T> {
|
|
108
|
-
$$typeof: symbol | number;
|
|
109
|
-
Consumer: ReactContext<T>;
|
|
110
|
-
Provider: ReactProviderType<T>;
|
|
111
|
-
_calculateChangedBits: ((a: T, b: T) => number) | null;
|
|
112
|
-
_currentValue: T;
|
|
113
|
-
_currentValue2: T;
|
|
114
|
-
_threadCount: number;
|
|
115
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
116
|
-
_currentRenderer?: Record<string, any> | null;
|
|
117
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
118
|
-
_currentRenderer2?: Record<string, any> | null;
|
|
119
|
-
displayName?: string;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
export interface ReactProviderType<T> {
|
|
123
|
-
$$typeof: symbol | number;
|
|
124
|
-
_context: ReactContext<T>;
|
|
125
|
-
}
|
|
126
|
-
export interface ReactProvider<T> {
|
|
127
|
-
$$typeof: symbol | number;
|
|
128
|
-
type: ReactProviderType<T>;
|
|
129
|
-
key: null | string;
|
|
130
|
-
ref: null;
|
|
131
|
-
props: { value: T; children?: ReactNode };
|
|
132
|
-
}
|
|
133
|
-
export interface ReactConsumer<T> {
|
|
134
|
-
$$typeof: symbol | number;
|
|
135
|
-
type: ReactContext<T>;
|
|
136
|
-
key: null | string;
|
|
137
|
-
ref: null;
|
|
138
|
-
props: { children: (value: T) => ReactNode; unstable_observedBits?: number };
|
|
139
|
-
}
|
|
140
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
141
|
-
export interface ReactPortal {
|
|
142
|
-
$$typeof: symbol | number;
|
|
143
|
-
key: null | string;
|
|
144
|
-
containerInfo: any;
|
|
145
|
-
children: ReactNode;
|
|
146
|
-
implementation: any;
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
export interface ComponentSelector {
|
|
150
|
-
$$typeof: symbol | number;
|
|
151
|
-
value: React$AbstractComponent<never, unknown>;
|
|
152
|
-
}
|
|
153
|
-
export interface HasPseudoClassSelector {
|
|
154
|
-
$$typeof: symbol | number;
|
|
155
|
-
value: Selector[];
|
|
156
|
-
}
|
|
157
|
-
export interface RoleSelector {
|
|
158
|
-
$$typeof: symbol | number;
|
|
159
|
-
value: string;
|
|
160
|
-
}
|
|
161
|
-
export interface TextSelector {
|
|
162
|
-
$$typeof: symbol | number;
|
|
163
|
-
value: string;
|
|
164
|
-
}
|
|
165
|
-
export interface TestNameSelector {
|
|
166
|
-
$$typeof: symbol | number;
|
|
167
|
-
value: string;
|
|
168
|
-
}
|
|
169
|
-
export type Selector =
|
|
170
|
-
| ComponentSelector
|
|
171
|
-
| HasPseudoClassSelector
|
|
172
|
-
| RoleSelector
|
|
173
|
-
| TextSelector
|
|
174
|
-
| TestNameSelector;
|
|
175
|
-
|
|
176
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
177
|
-
export interface DevToolsConfig<
|
|
178
|
-
Instance = any,
|
|
179
|
-
TextInstance = any,
|
|
180
|
-
RendererInspectionConfig = any,
|
|
181
|
-
> {
|
|
182
|
-
bundleType: BundleType;
|
|
183
|
-
version: string;
|
|
184
|
-
rendererPackageName: string;
|
|
185
|
-
findFiberByHostInstance?: (instance: Instance | TextInstance) => ReactFiber | null;
|
|
186
|
-
rendererConfig?: RendererInspectionConfig;
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
export interface SuspenseHydrationCallbacks<SuspenseInstance = unknown> {
|
|
190
|
-
onHydrated?: (suspenseInstance: SuspenseInstance) => void;
|
|
191
|
-
onDeleted?: (suspenseInstance: SuspenseInstance) => void;
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
export interface TransitionTracingCallbacks {
|
|
195
|
-
onTransitionStart?: (transitionName: string, startTime: number) => void;
|
|
196
|
-
onTransitionProgress?: (
|
|
197
|
-
transitionName: string,
|
|
198
|
-
startTime: number,
|
|
199
|
-
currentTime: number,
|
|
200
|
-
pending: Array<{ name: null | string }>,
|
|
201
|
-
) => void;
|
|
202
|
-
onTransitionIncomplete?: (
|
|
203
|
-
transitionName: string,
|
|
204
|
-
startTime: number,
|
|
205
|
-
deletions: Array<{ type: string; name?: string; newName?: string; endTime: number }>,
|
|
206
|
-
) => void;
|
|
207
|
-
onTransitionComplete?: (transitionName: string, startTime: number, endTime: number) => void;
|
|
208
|
-
onMarkerProgress?: (
|
|
209
|
-
transitionName: string,
|
|
210
|
-
marker: string,
|
|
211
|
-
startTime: number,
|
|
212
|
-
currentTime: number,
|
|
213
|
-
pending: Array<{ name: null | string }>,
|
|
214
|
-
) => void;
|
|
215
|
-
onMarkerIncomplete?: (
|
|
216
|
-
transitionName: string,
|
|
217
|
-
marker: string,
|
|
218
|
-
startTime: number,
|
|
219
|
-
deletions: Array<{ type: string; name?: string; newName?: string; endTime: number }>,
|
|
220
|
-
) => void;
|
|
221
|
-
onMarkerComplete?: (
|
|
222
|
-
transitionName: string,
|
|
223
|
-
marker: string,
|
|
224
|
-
startTime: number,
|
|
225
|
-
endTime: number,
|
|
226
|
-
) => void;
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
// The base Fiber interface from react-reconciler, used to derive bippy's Fiber below
|
|
230
|
-
interface ReactFiber {
|
|
231
|
-
tag: WorkTag;
|
|
232
|
-
key: null | string;
|
|
233
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
234
|
-
elementType: any;
|
|
235
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
236
|
-
type: any;
|
|
237
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
238
|
-
stateNode: any;
|
|
239
|
-
return: ReactFiber | null;
|
|
240
|
-
child: ReactFiber | null;
|
|
241
|
-
sibling: ReactFiber | null;
|
|
242
|
-
index: number;
|
|
243
|
-
ref: null | (((handle: unknown) => void) & { _stringRef?: string | null }) | RefObject;
|
|
244
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
245
|
-
pendingProps: any;
|
|
246
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
247
|
-
memoizedProps: any;
|
|
248
|
-
updateQueue: unknown;
|
|
249
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
250
|
-
memoizedState: any;
|
|
251
|
-
dependencies: Dependencies | null;
|
|
252
|
-
mode: TypeOfMode;
|
|
253
|
-
flags: Flags;
|
|
254
|
-
subtreeFlags: Flags;
|
|
255
|
-
deletions: ReactFiber[] | null;
|
|
256
|
-
nextEffect: ReactFiber | null;
|
|
257
|
-
firstEffect: ReactFiber | null;
|
|
258
|
-
lastEffect: ReactFiber | null;
|
|
259
|
-
lanes: Lanes;
|
|
260
|
-
childLanes: Lanes;
|
|
261
|
-
alternate: ReactFiber | null;
|
|
262
|
-
actualDuration?: number;
|
|
263
|
-
actualStartTime?: number;
|
|
264
|
-
selfBaseDuration?: number;
|
|
265
|
-
treeBaseDuration?: number;
|
|
266
|
-
_debugID?: number;
|
|
267
|
-
_debugSource?: Source | null;
|
|
268
|
-
_debugOwner?: ReactFiber | null;
|
|
269
|
-
_debugIsCurrentlyTiming?: boolean;
|
|
270
|
-
_debugNeedsRemount?: boolean;
|
|
271
|
-
_debugHookTypes?: HookType[] | null;
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
// ── bippy types (not from react-reconciler) ──
|
|
275
|
-
|
|
276
|
-
export interface ContextDependency<T> {
|
|
277
|
-
context: ReactContext<T>;
|
|
278
|
-
memoizedValue: T;
|
|
279
|
-
next: ContextDependency<unknown> | null;
|
|
280
|
-
observedBits: number;
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
export interface Dependencies {
|
|
284
|
-
firstContext: ContextDependency<unknown> | null;
|
|
285
|
-
lanes: Lanes;
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
export interface Effect {
|
|
289
|
-
[key: string]: unknown;
|
|
290
|
-
create: (...args: unknown[]) => unknown;
|
|
291
|
-
deps: null | unknown[];
|
|
292
|
-
destroy: ((...args: unknown[]) => unknown) | null;
|
|
293
|
-
next: Effect | null;
|
|
294
|
-
tag: number;
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
export interface Family {
|
|
298
|
-
current: unknown;
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
/**
|
|
302
|
-
* React 19 flight metadata for a server component owner (ReactComponentInfo).
|
|
303
|
-
* Unlike client owners it has no `tag`; the owner chain continues via `owner`.
|
|
304
|
-
*/
|
|
305
|
-
export interface ServerComponentInfo {
|
|
306
|
-
name?: string;
|
|
307
|
-
env?: string;
|
|
308
|
-
owner?: Fiber | ServerComponentInfo | null;
|
|
309
|
-
debugStack?: Error | null;
|
|
310
|
-
}
|
|
311
|
-
|
|
312
|
-
export interface RendererRefreshUpdate {
|
|
313
|
-
staleFamilies: Set<Family>;
|
|
314
|
-
updatedFamilies: Set<Family>;
|
|
315
|
-
}
|
|
316
|
-
|
|
317
|
-
/**
|
|
318
|
-
* Represents a react-internal Fiber node.
|
|
319
|
-
*/
|
|
320
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
321
|
-
export type Fiber<T = any> = Omit<
|
|
322
|
-
ReactFiber,
|
|
323
|
-
| "alternate"
|
|
324
|
-
| "child"
|
|
325
|
-
| "dependencies"
|
|
326
|
-
| "memoizedProps"
|
|
327
|
-
| "memoizedState"
|
|
328
|
-
| "pendingProps"
|
|
329
|
-
| "return"
|
|
330
|
-
| "sibling"
|
|
331
|
-
| "stateNode"
|
|
332
|
-
| "updateQueue"
|
|
333
|
-
> & {
|
|
334
|
-
_debugInfo?: Array<{
|
|
335
|
-
debugLocation?: unknown;
|
|
336
|
-
env?: string;
|
|
337
|
-
name?: string;
|
|
338
|
-
}>;
|
|
339
|
-
_debugOwner?: Fiber;
|
|
340
|
-
// react <19
|
|
341
|
-
_debugSource?: {
|
|
342
|
-
columnNumber?: number;
|
|
343
|
-
fileName: string;
|
|
344
|
-
lineNumber: number;
|
|
345
|
-
};
|
|
346
|
-
// react 19+
|
|
347
|
-
// https://github.com/facebook/react/issues/29092?utm_source=chatgpt.com
|
|
348
|
-
_debugStack?: Error & { stack: string };
|
|
349
|
-
alternate: Fiber | null;
|
|
350
|
-
child: Fiber | null;
|
|
351
|
-
dependencies: Dependencies | null;
|
|
352
|
-
memoizedProps: Props;
|
|
353
|
-
memoizedState: MemoizedState;
|
|
354
|
-
pendingProps: Props;
|
|
355
|
-
|
|
356
|
-
return: Fiber | null;
|
|
357
|
-
sibling: Fiber | null;
|
|
358
|
-
stateNode: T;
|
|
359
|
-
updateQueue: {
|
|
360
|
-
[key: string]: unknown;
|
|
361
|
-
lastEffect: Effect | null;
|
|
362
|
-
};
|
|
363
|
-
};
|
|
364
|
-
|
|
365
|
-
export interface MemoizedState {
|
|
366
|
-
[key: string]: unknown;
|
|
367
|
-
memoizedState: unknown;
|
|
368
|
-
next: MemoizedState | null;
|
|
369
|
-
}
|
|
370
|
-
|
|
371
|
-
export interface Props {
|
|
372
|
-
[key: string]: unknown;
|
|
373
|
-
}
|
|
374
|
-
|
|
375
|
-
export interface ReactDevToolsGlobalHook {
|
|
376
|
-
_instrumentationIsActive?: boolean;
|
|
377
|
-
_instrumentationSource?: string;
|
|
378
|
-
checkDCE: (fn: unknown) => void;
|
|
379
|
-
hasUnsupportedRendererAttached: boolean;
|
|
380
|
-
inject: (renderer: ReactRenderer) => number;
|
|
381
|
-
// https://github.com/aidenybai/bippy/issues/43
|
|
382
|
-
on: () => void;
|
|
383
|
-
onCommitFiberRoot: (rendererID: number, root: FiberRoot, priority: number | void) => void;
|
|
384
|
-
onCommitFiberUnmount: (rendererID: number, fiber: Fiber) => void;
|
|
385
|
-
onPostCommitFiberRoot: (rendererID: number, root: FiberRoot) => void;
|
|
386
|
-
// called by dev builds of react-reconciler on root schedule; absent from
|
|
387
|
-
// the hook react-refresh installs, so it stays optional
|
|
388
|
-
onScheduleFiberRoot?: (rendererID: number, root: FiberRoot, children: ReactNode) => void;
|
|
389
|
-
renderers: Map<number, ReactRenderer>;
|
|
390
|
-
supportsFiber: boolean;
|
|
391
|
-
|
|
392
|
-
supportsFlight: boolean;
|
|
393
|
-
}
|
|
394
|
-
|
|
395
|
-
// https://github.com/facebook/react/blob/6a4b46cd70d2672bc4be59dcb5b8dede22ed0cef/packages/react-devtools-shared/src/backend/types.js
|
|
396
|
-
export interface ReactRenderer {
|
|
397
|
-
bundleType: 0 /* PROD */ | 1 /* DEV */;
|
|
398
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
399
|
-
currentDispatcherRef: any;
|
|
400
|
-
// dev only: https://github.com/facebook/react/blob/main/packages/react-reconciler/src/ReactFiberReconciler.js#L842
|
|
401
|
-
findFiberByHostInstance?: (hostInstance: unknown) => Fiber | null;
|
|
402
|
-
// react devtools
|
|
403
|
-
getCurrentFiber?: (fiber: Fiber) => Fiber | null;
|
|
404
|
-
overrideContext?: (fiber: Fiber, contextType: unknown, path: string[], value: unknown) => void;
|
|
405
|
-
|
|
406
|
-
overrideHookState?: (fiber: Fiber, id: string, path: string[], value: unknown) => void;
|
|
407
|
-
overrideHookStateDeletePath?: (fiber: Fiber, id: number, path: Array<number | string>) => void;
|
|
408
|
-
overrideHookStateRenamePath?: (
|
|
409
|
-
fiber: Fiber,
|
|
410
|
-
id: number,
|
|
411
|
-
oldPath: Array<number | string>,
|
|
412
|
-
newPath: Array<number | string>,
|
|
413
|
-
) => void;
|
|
414
|
-
overrideProps?: (fiber: Fiber, path: string[], value: unknown) => void;
|
|
415
|
-
overridePropsDeletePath?: (fiber: Fiber, path: Array<number | string>) => void;
|
|
416
|
-
overridePropsRenamePath?: (
|
|
417
|
-
fiber: Fiber,
|
|
418
|
-
oldPath: Array<number | string>,
|
|
419
|
-
newPath: Array<number | string>,
|
|
420
|
-
) => void;
|
|
421
|
-
reconcilerVersion: string;
|
|
422
|
-
rendererPackageName: string;
|
|
423
|
-
// react refresh
|
|
424
|
-
scheduleRefresh?: (root: FiberRoot, update: RendererRefreshUpdate) => void;
|
|
425
|
-
scheduleRoot?: (root: FiberRoot, element: React.ReactNode) => void;
|
|
426
|
-
scheduleUpdate?: (fiber: Fiber) => void;
|
|
427
|
-
|
|
428
|
-
setErrorHandler?: (newShouldErrorImpl: (fiber: Fiber) => boolean) => void;
|
|
429
|
-
setRefreshHandler?: (handler: ((fiber: Fiber) => Family | null) | null) => void;
|
|
430
|
-
setSuspenseHandler?: (newShouldSuspendImpl: (suspenseInstance: unknown) => void) => void;
|
|
431
|
-
|
|
432
|
-
version: string;
|
|
433
|
-
}
|
|
434
|
-
|
|
435
|
-
declare global {
|
|
436
|
-
// eslint-disable-next-line no-var
|
|
437
|
-
var __REACT_DEVTOOLS_GLOBAL_HOOK__: ReactDevToolsGlobalHook | undefined;
|
|
438
|
-
}
|
package/src/unsubscribe.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export interface Unsubscribe extends Disposable {
|
|
2
|
-
(): void;
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Wraps a teardown callback so it is both callable and a `Disposable`,
|
|
7
|
-
* letting subscriptions compose through explicit resource management:
|
|
8
|
-
*
|
|
9
|
-
* @example
|
|
10
|
-
* ```ts
|
|
11
|
-
* using instrumentation = instrument({ onCommitFiberRoot });
|
|
12
|
-
* using refresh = instrumentReactRefresh({ onRefresh: handleRefresh });
|
|
13
|
-
* // both torn down automatically at scope exit
|
|
14
|
-
* ```
|
|
15
|
-
*/
|
|
16
|
-
export const toUnsubscribe = (dispose: () => void): Unsubscribe =>
|
|
17
|
-
Object.assign(dispose, { [Symbol.dispose]: dispose });
|