crumbtrail-react-native 0.2.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 +21 -0
- package/README.md +212 -0
- package/dist/index.cjs +799 -0
- package/dist/index.d.cts +231 -0
- package/dist/index.d.ts +231 -0
- package/dist/index.js +766 -0
- package/package.json +68 -0
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
import { SessionStore, PersistedSession, TargetDescriptor, Crumbtrail, CrumbtrailConfig } from 'crumbtrail-core';
|
|
2
|
+
import { ReactNode, Component, ErrorInfo } from 'react';
|
|
3
|
+
|
|
4
|
+
declare const REACT_NATIVE_CAPABILITY_BITS: {
|
|
5
|
+
readonly asyncStorage: number;
|
|
6
|
+
readonly navigation: number;
|
|
7
|
+
readonly viewShot: number;
|
|
8
|
+
};
|
|
9
|
+
type ReactNativeOptionalModuleName = "asyncStorage" | "navigation" | "viewShot";
|
|
10
|
+
type ReactNativeCapabilityStatus = "present" | "absent";
|
|
11
|
+
interface ReactNativeCapabilityDetail {
|
|
12
|
+
packageName: string;
|
|
13
|
+
present: boolean;
|
|
14
|
+
status: ReactNativeCapabilityStatus;
|
|
15
|
+
}
|
|
16
|
+
type ReactNativeCapabilityModules = Record<ReactNativeOptionalModuleName, ReactNativeCapabilityDetail>;
|
|
17
|
+
interface ReactNativeCapabilities {
|
|
18
|
+
bitset: number;
|
|
19
|
+
capabilities: string[];
|
|
20
|
+
modules: ReactNativeCapabilityModules;
|
|
21
|
+
}
|
|
22
|
+
type OptionalModuleResolver = (packageName: string) => unknown;
|
|
23
|
+
interface DetectReactNativeCapabilitiesOptions {
|
|
24
|
+
resolver?: OptionalModuleResolver;
|
|
25
|
+
}
|
|
26
|
+
declare function detectReactNativeCapabilities(options?: DetectReactNativeCapabilitiesOptions): ReactNativeCapabilities;
|
|
27
|
+
|
|
28
|
+
interface AsyncStorageLike {
|
|
29
|
+
getItem(key: string): Promise<string | null> | string | null;
|
|
30
|
+
setItem(key: string, value: string): Promise<void> | void;
|
|
31
|
+
}
|
|
32
|
+
interface ReactNativeSessionStore extends SessionStore {
|
|
33
|
+
hydrate(): Promise<PersistedSession | undefined>;
|
|
34
|
+
}
|
|
35
|
+
declare function createReactNativeSessionStore(storage: AsyncStorageLike | null | undefined, key?: string): ReactNativeSessionStore | undefined;
|
|
36
|
+
|
|
37
|
+
interface ReactNativeTargetInput {
|
|
38
|
+
role?: string;
|
|
39
|
+
label?: string;
|
|
40
|
+
testID?: string;
|
|
41
|
+
testId?: string;
|
|
42
|
+
accessibilityId?: string;
|
|
43
|
+
accessibilityLabel?: string;
|
|
44
|
+
componentName?: string;
|
|
45
|
+
routePath?: string;
|
|
46
|
+
ancestryHash?: string;
|
|
47
|
+
bounds?: {
|
|
48
|
+
x: number;
|
|
49
|
+
y: number;
|
|
50
|
+
width: number;
|
|
51
|
+
height: number;
|
|
52
|
+
};
|
|
53
|
+
redaction?: unknown;
|
|
54
|
+
}
|
|
55
|
+
declare function createReactNativeTargetDescriptor(input: ReactNativeTargetInput): TargetDescriptor | undefined;
|
|
56
|
+
|
|
57
|
+
interface ReactNativeViewSnapshotNode {
|
|
58
|
+
id?: string;
|
|
59
|
+
componentName?: string;
|
|
60
|
+
role?: string;
|
|
61
|
+
label?: string;
|
|
62
|
+
testID?: string;
|
|
63
|
+
accessibilityId?: string;
|
|
64
|
+
bounds?: {
|
|
65
|
+
x: number;
|
|
66
|
+
y: number;
|
|
67
|
+
width: number;
|
|
68
|
+
height: number;
|
|
69
|
+
};
|
|
70
|
+
children?: ReactNativeViewSnapshotNode[];
|
|
71
|
+
}
|
|
72
|
+
interface ReactNativeViewSnapshot {
|
|
73
|
+
routePath?: string;
|
|
74
|
+
root: ReactNativeViewSnapshotNode;
|
|
75
|
+
}
|
|
76
|
+
interface ReactNativeTouchOverlay {
|
|
77
|
+
x: number;
|
|
78
|
+
y: number;
|
|
79
|
+
target?: TargetDescriptor | ReactNativeTargetInput;
|
|
80
|
+
phase?: "start" | "move" | "end" | "cancel" | "press";
|
|
81
|
+
}
|
|
82
|
+
interface ReactNativeViewShotModule {
|
|
83
|
+
captureRef?: (target: unknown, options?: Record<string, unknown>) => Promise<string> | string;
|
|
84
|
+
captureScreen?: (options?: Record<string, unknown>) => Promise<string> | string;
|
|
85
|
+
}
|
|
86
|
+
interface ReplayLiteLogger {
|
|
87
|
+
addEvent(partial: {
|
|
88
|
+
type: string;
|
|
89
|
+
data: Record<string, unknown>;
|
|
90
|
+
platform?: "react-native";
|
|
91
|
+
sdk?: {
|
|
92
|
+
name: string;
|
|
93
|
+
version?: string;
|
|
94
|
+
};
|
|
95
|
+
capabilities?: string[];
|
|
96
|
+
target?: TargetDescriptor;
|
|
97
|
+
}): void;
|
|
98
|
+
}
|
|
99
|
+
interface ReactNativeReplayLiteOptions {
|
|
100
|
+
logger: ReplayLiteLogger;
|
|
101
|
+
capabilities: string[];
|
|
102
|
+
viewShot?: ReactNativeViewShotModule | null;
|
|
103
|
+
}
|
|
104
|
+
interface ReactNativeReplayLiteController {
|
|
105
|
+
recordViewSnapshot(snapshot: ReactNativeViewSnapshot): void;
|
|
106
|
+
recordTouch(overlay: ReactNativeTouchOverlay): void;
|
|
107
|
+
captureCrashScreenshot(target?: unknown): Promise<string | undefined>;
|
|
108
|
+
}
|
|
109
|
+
declare function createReactNativeReplayLite(options: ReactNativeReplayLiteOptions): ReactNativeReplayLiteController;
|
|
110
|
+
|
|
111
|
+
type ReactNativeCollectorName = "console" | "errors" | "network" | "appState" | "environment" | "navigation" | "replayLite";
|
|
112
|
+
type ReactNativeCollectorConfig = boolean | Partial<Record<ReactNativeCollectorName, boolean>>;
|
|
113
|
+
interface ReactNativeAppStateModule {
|
|
114
|
+
currentState?: string;
|
|
115
|
+
addEventListener?: (type: string, listener: (state: string) => void) => {
|
|
116
|
+
remove?: () => void;
|
|
117
|
+
} | (() => void);
|
|
118
|
+
}
|
|
119
|
+
interface ReactNativePlatformModule {
|
|
120
|
+
OS?: string;
|
|
121
|
+
Version?: string | number;
|
|
122
|
+
constants?: Record<string, unknown>;
|
|
123
|
+
}
|
|
124
|
+
interface ReactNativeDimensionsModule {
|
|
125
|
+
get?: (dimension: "window" | "screen") => {
|
|
126
|
+
width?: number;
|
|
127
|
+
height?: number;
|
|
128
|
+
scale?: number;
|
|
129
|
+
fontScale?: number;
|
|
130
|
+
};
|
|
131
|
+
addEventListener?: (type: string, listener: (event: Record<string, unknown>) => void) => {
|
|
132
|
+
remove?: () => void;
|
|
133
|
+
} | (() => void);
|
|
134
|
+
}
|
|
135
|
+
interface ReactNativeModule {
|
|
136
|
+
AppState?: ReactNativeAppStateModule;
|
|
137
|
+
Platform?: ReactNativePlatformModule;
|
|
138
|
+
Dimensions?: ReactNativeDimensionsModule;
|
|
139
|
+
}
|
|
140
|
+
interface ReactNativeNavigationLike {
|
|
141
|
+
getCurrentRoute?: () => {
|
|
142
|
+
name?: string;
|
|
143
|
+
path?: string;
|
|
144
|
+
key?: string;
|
|
145
|
+
} | undefined;
|
|
146
|
+
addListener?: (event: string, listener: () => void) => (() => void) | {
|
|
147
|
+
remove?: () => void;
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
interface ReactNativeErrorUtilsLike {
|
|
151
|
+
getGlobalHandler?: () => ((error: unknown, isFatal?: boolean) => void) | undefined;
|
|
152
|
+
setGlobalHandler?: (handler: (error: unknown, isFatal?: boolean) => void) => void;
|
|
153
|
+
}
|
|
154
|
+
interface ReactNativeCollectorRuntime {
|
|
155
|
+
globalObject?: typeof globalThis & Record<string, unknown>;
|
|
156
|
+
reactNative?: ReactNativeModule | null;
|
|
157
|
+
navigation?: ReactNativeNavigationLike | null;
|
|
158
|
+
errorUtils?: ReactNativeErrorUtilsLike | null;
|
|
159
|
+
}
|
|
160
|
+
interface StartReactNativeCollectorsOptions extends ReactNativeCollectorRuntime {
|
|
161
|
+
config?: ReactNativeCollectorConfig;
|
|
162
|
+
capabilities: ReactNativeCapabilities;
|
|
163
|
+
resolver?: OptionalModuleResolver;
|
|
164
|
+
}
|
|
165
|
+
interface ReactNativeCollectorController {
|
|
166
|
+
cleanup(): void;
|
|
167
|
+
replayLite?: ReactNativeReplayLiteController;
|
|
168
|
+
}
|
|
169
|
+
declare function startReactNativeCollectors(logger: Crumbtrail, options: StartReactNativeCollectorsOptions): ReactNativeCollectorController;
|
|
170
|
+
|
|
171
|
+
interface ReactNativeCrumbtrailOptions extends DetectReactNativeCapabilitiesOptions, ReactNativeCollectorRuntime {
|
|
172
|
+
config?: Partial<CrumbtrailConfig>;
|
|
173
|
+
asyncStorage?: AsyncStorageLike | null;
|
|
174
|
+
reportCapabilities?: boolean;
|
|
175
|
+
collectors?: ReactNativeCollectorConfig;
|
|
176
|
+
}
|
|
177
|
+
interface ReactNativeCrumbtrailResult {
|
|
178
|
+
logger: Crumbtrail;
|
|
179
|
+
capabilities: ReactNativeCapabilities;
|
|
180
|
+
collectors: ReactNativeCollectorController;
|
|
181
|
+
}
|
|
182
|
+
declare function createReactNativeCrumbtrail(options?: ReactNativeCrumbtrailOptions): ReactNativeCrumbtrailResult;
|
|
183
|
+
declare function createReactNativeCrumbtrailAsync(options?: ReactNativeCrumbtrailOptions): Promise<ReactNativeCrumbtrailResult>;
|
|
184
|
+
|
|
185
|
+
interface CrumbtrailReactNativeContextValue {
|
|
186
|
+
logger: Crumbtrail;
|
|
187
|
+
capabilities: ReactNativeCapabilities;
|
|
188
|
+
}
|
|
189
|
+
interface CrumbtrailReactNativeProviderProps {
|
|
190
|
+
children: ReactNode;
|
|
191
|
+
logger?: Crumbtrail;
|
|
192
|
+
config?: Partial<CrumbtrailConfig>;
|
|
193
|
+
asyncStorage?: AsyncStorageLike | null;
|
|
194
|
+
resolver?: OptionalModuleResolver;
|
|
195
|
+
reportCapabilities?: boolean;
|
|
196
|
+
fallback?: ReactNode;
|
|
197
|
+
}
|
|
198
|
+
declare function CrumbtrailReactNativeProvider(props: CrumbtrailReactNativeProviderProps): ReactNode;
|
|
199
|
+
declare function useCrumbtrailReactNative(): CrumbtrailReactNativeContextValue;
|
|
200
|
+
|
|
201
|
+
interface BugStateLogger {
|
|
202
|
+
registerStateProvider(name: string, provider: () => unknown): () => void;
|
|
203
|
+
}
|
|
204
|
+
interface UseBugStateOptions {
|
|
205
|
+
captureRawState?: boolean;
|
|
206
|
+
}
|
|
207
|
+
declare function redactReactNativeSnapshot(value: unknown, keyName?: string): unknown;
|
|
208
|
+
declare function useBugState(logger: BugStateLogger | null | undefined, name: string, value: unknown, options?: UseBugStateOptions): void;
|
|
209
|
+
|
|
210
|
+
interface CrumbtrailReactNativeErrorBoundaryProps {
|
|
211
|
+
logger: BugStateLogger & {
|
|
212
|
+
addEvent(partial: {
|
|
213
|
+
type: string;
|
|
214
|
+
data: Record<string, unknown>;
|
|
215
|
+
}): void;
|
|
216
|
+
};
|
|
217
|
+
children: ReactNode;
|
|
218
|
+
fallback?: ReactNode;
|
|
219
|
+
}
|
|
220
|
+
interface State {
|
|
221
|
+
hasError: boolean;
|
|
222
|
+
}
|
|
223
|
+
declare class CrumbtrailReactNativeErrorBoundary extends Component<CrumbtrailReactNativeErrorBoundaryProps, State> {
|
|
224
|
+
constructor(props: CrumbtrailReactNativeErrorBoundaryProps);
|
|
225
|
+
static getDerivedStateFromError(_error: Error): State;
|
|
226
|
+
componentDidCatch(error: Error, errorInfo: ErrorInfo): void;
|
|
227
|
+
resetError(): void;
|
|
228
|
+
render(): ReactNode;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
export { type AsyncStorageLike, type BugStateLogger, type CrumbtrailReactNativeContextValue, CrumbtrailReactNativeErrorBoundary, type CrumbtrailReactNativeErrorBoundaryProps, CrumbtrailReactNativeProvider, type CrumbtrailReactNativeProviderProps, type DetectReactNativeCapabilitiesOptions, type OptionalModuleResolver, REACT_NATIVE_CAPABILITY_BITS, type ReactNativeAppStateModule, type ReactNativeCapabilities, type ReactNativeCapabilityDetail, type ReactNativeCapabilityModules, type ReactNativeCapabilityStatus, type ReactNativeCollectorConfig, type ReactNativeCollectorController, type ReactNativeCollectorName, type ReactNativeCollectorRuntime, type ReactNativeCrumbtrailOptions, type ReactNativeCrumbtrailResult, type ReactNativeDimensionsModule, type ReactNativeErrorUtilsLike, type ReactNativeModule, type ReactNativeNavigationLike, type ReactNativeOptionalModuleName, type ReactNativePlatformModule, type ReactNativeReplayLiteController, type ReactNativeReplayLiteOptions, type ReactNativeSessionStore, type ReactNativeTargetInput, type ReactNativeTouchOverlay, type ReactNativeViewShotModule, type ReactNativeViewSnapshot, type ReactNativeViewSnapshotNode, type UseBugStateOptions, createReactNativeCrumbtrail, createReactNativeCrumbtrailAsync, createReactNativeReplayLite, createReactNativeSessionStore, createReactNativeTargetDescriptor, detectReactNativeCapabilities, redactReactNativeSnapshot, startReactNativeCollectors, useBugState, useCrumbtrailReactNative };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
import { SessionStore, PersistedSession, TargetDescriptor, Crumbtrail, CrumbtrailConfig } from 'crumbtrail-core';
|
|
2
|
+
import { ReactNode, Component, ErrorInfo } from 'react';
|
|
3
|
+
|
|
4
|
+
declare const REACT_NATIVE_CAPABILITY_BITS: {
|
|
5
|
+
readonly asyncStorage: number;
|
|
6
|
+
readonly navigation: number;
|
|
7
|
+
readonly viewShot: number;
|
|
8
|
+
};
|
|
9
|
+
type ReactNativeOptionalModuleName = "asyncStorage" | "navigation" | "viewShot";
|
|
10
|
+
type ReactNativeCapabilityStatus = "present" | "absent";
|
|
11
|
+
interface ReactNativeCapabilityDetail {
|
|
12
|
+
packageName: string;
|
|
13
|
+
present: boolean;
|
|
14
|
+
status: ReactNativeCapabilityStatus;
|
|
15
|
+
}
|
|
16
|
+
type ReactNativeCapabilityModules = Record<ReactNativeOptionalModuleName, ReactNativeCapabilityDetail>;
|
|
17
|
+
interface ReactNativeCapabilities {
|
|
18
|
+
bitset: number;
|
|
19
|
+
capabilities: string[];
|
|
20
|
+
modules: ReactNativeCapabilityModules;
|
|
21
|
+
}
|
|
22
|
+
type OptionalModuleResolver = (packageName: string) => unknown;
|
|
23
|
+
interface DetectReactNativeCapabilitiesOptions {
|
|
24
|
+
resolver?: OptionalModuleResolver;
|
|
25
|
+
}
|
|
26
|
+
declare function detectReactNativeCapabilities(options?: DetectReactNativeCapabilitiesOptions): ReactNativeCapabilities;
|
|
27
|
+
|
|
28
|
+
interface AsyncStorageLike {
|
|
29
|
+
getItem(key: string): Promise<string | null> | string | null;
|
|
30
|
+
setItem(key: string, value: string): Promise<void> | void;
|
|
31
|
+
}
|
|
32
|
+
interface ReactNativeSessionStore extends SessionStore {
|
|
33
|
+
hydrate(): Promise<PersistedSession | undefined>;
|
|
34
|
+
}
|
|
35
|
+
declare function createReactNativeSessionStore(storage: AsyncStorageLike | null | undefined, key?: string): ReactNativeSessionStore | undefined;
|
|
36
|
+
|
|
37
|
+
interface ReactNativeTargetInput {
|
|
38
|
+
role?: string;
|
|
39
|
+
label?: string;
|
|
40
|
+
testID?: string;
|
|
41
|
+
testId?: string;
|
|
42
|
+
accessibilityId?: string;
|
|
43
|
+
accessibilityLabel?: string;
|
|
44
|
+
componentName?: string;
|
|
45
|
+
routePath?: string;
|
|
46
|
+
ancestryHash?: string;
|
|
47
|
+
bounds?: {
|
|
48
|
+
x: number;
|
|
49
|
+
y: number;
|
|
50
|
+
width: number;
|
|
51
|
+
height: number;
|
|
52
|
+
};
|
|
53
|
+
redaction?: unknown;
|
|
54
|
+
}
|
|
55
|
+
declare function createReactNativeTargetDescriptor(input: ReactNativeTargetInput): TargetDescriptor | undefined;
|
|
56
|
+
|
|
57
|
+
interface ReactNativeViewSnapshotNode {
|
|
58
|
+
id?: string;
|
|
59
|
+
componentName?: string;
|
|
60
|
+
role?: string;
|
|
61
|
+
label?: string;
|
|
62
|
+
testID?: string;
|
|
63
|
+
accessibilityId?: string;
|
|
64
|
+
bounds?: {
|
|
65
|
+
x: number;
|
|
66
|
+
y: number;
|
|
67
|
+
width: number;
|
|
68
|
+
height: number;
|
|
69
|
+
};
|
|
70
|
+
children?: ReactNativeViewSnapshotNode[];
|
|
71
|
+
}
|
|
72
|
+
interface ReactNativeViewSnapshot {
|
|
73
|
+
routePath?: string;
|
|
74
|
+
root: ReactNativeViewSnapshotNode;
|
|
75
|
+
}
|
|
76
|
+
interface ReactNativeTouchOverlay {
|
|
77
|
+
x: number;
|
|
78
|
+
y: number;
|
|
79
|
+
target?: TargetDescriptor | ReactNativeTargetInput;
|
|
80
|
+
phase?: "start" | "move" | "end" | "cancel" | "press";
|
|
81
|
+
}
|
|
82
|
+
interface ReactNativeViewShotModule {
|
|
83
|
+
captureRef?: (target: unknown, options?: Record<string, unknown>) => Promise<string> | string;
|
|
84
|
+
captureScreen?: (options?: Record<string, unknown>) => Promise<string> | string;
|
|
85
|
+
}
|
|
86
|
+
interface ReplayLiteLogger {
|
|
87
|
+
addEvent(partial: {
|
|
88
|
+
type: string;
|
|
89
|
+
data: Record<string, unknown>;
|
|
90
|
+
platform?: "react-native";
|
|
91
|
+
sdk?: {
|
|
92
|
+
name: string;
|
|
93
|
+
version?: string;
|
|
94
|
+
};
|
|
95
|
+
capabilities?: string[];
|
|
96
|
+
target?: TargetDescriptor;
|
|
97
|
+
}): void;
|
|
98
|
+
}
|
|
99
|
+
interface ReactNativeReplayLiteOptions {
|
|
100
|
+
logger: ReplayLiteLogger;
|
|
101
|
+
capabilities: string[];
|
|
102
|
+
viewShot?: ReactNativeViewShotModule | null;
|
|
103
|
+
}
|
|
104
|
+
interface ReactNativeReplayLiteController {
|
|
105
|
+
recordViewSnapshot(snapshot: ReactNativeViewSnapshot): void;
|
|
106
|
+
recordTouch(overlay: ReactNativeTouchOverlay): void;
|
|
107
|
+
captureCrashScreenshot(target?: unknown): Promise<string | undefined>;
|
|
108
|
+
}
|
|
109
|
+
declare function createReactNativeReplayLite(options: ReactNativeReplayLiteOptions): ReactNativeReplayLiteController;
|
|
110
|
+
|
|
111
|
+
type ReactNativeCollectorName = "console" | "errors" | "network" | "appState" | "environment" | "navigation" | "replayLite";
|
|
112
|
+
type ReactNativeCollectorConfig = boolean | Partial<Record<ReactNativeCollectorName, boolean>>;
|
|
113
|
+
interface ReactNativeAppStateModule {
|
|
114
|
+
currentState?: string;
|
|
115
|
+
addEventListener?: (type: string, listener: (state: string) => void) => {
|
|
116
|
+
remove?: () => void;
|
|
117
|
+
} | (() => void);
|
|
118
|
+
}
|
|
119
|
+
interface ReactNativePlatformModule {
|
|
120
|
+
OS?: string;
|
|
121
|
+
Version?: string | number;
|
|
122
|
+
constants?: Record<string, unknown>;
|
|
123
|
+
}
|
|
124
|
+
interface ReactNativeDimensionsModule {
|
|
125
|
+
get?: (dimension: "window" | "screen") => {
|
|
126
|
+
width?: number;
|
|
127
|
+
height?: number;
|
|
128
|
+
scale?: number;
|
|
129
|
+
fontScale?: number;
|
|
130
|
+
};
|
|
131
|
+
addEventListener?: (type: string, listener: (event: Record<string, unknown>) => void) => {
|
|
132
|
+
remove?: () => void;
|
|
133
|
+
} | (() => void);
|
|
134
|
+
}
|
|
135
|
+
interface ReactNativeModule {
|
|
136
|
+
AppState?: ReactNativeAppStateModule;
|
|
137
|
+
Platform?: ReactNativePlatformModule;
|
|
138
|
+
Dimensions?: ReactNativeDimensionsModule;
|
|
139
|
+
}
|
|
140
|
+
interface ReactNativeNavigationLike {
|
|
141
|
+
getCurrentRoute?: () => {
|
|
142
|
+
name?: string;
|
|
143
|
+
path?: string;
|
|
144
|
+
key?: string;
|
|
145
|
+
} | undefined;
|
|
146
|
+
addListener?: (event: string, listener: () => void) => (() => void) | {
|
|
147
|
+
remove?: () => void;
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
interface ReactNativeErrorUtilsLike {
|
|
151
|
+
getGlobalHandler?: () => ((error: unknown, isFatal?: boolean) => void) | undefined;
|
|
152
|
+
setGlobalHandler?: (handler: (error: unknown, isFatal?: boolean) => void) => void;
|
|
153
|
+
}
|
|
154
|
+
interface ReactNativeCollectorRuntime {
|
|
155
|
+
globalObject?: typeof globalThis & Record<string, unknown>;
|
|
156
|
+
reactNative?: ReactNativeModule | null;
|
|
157
|
+
navigation?: ReactNativeNavigationLike | null;
|
|
158
|
+
errorUtils?: ReactNativeErrorUtilsLike | null;
|
|
159
|
+
}
|
|
160
|
+
interface StartReactNativeCollectorsOptions extends ReactNativeCollectorRuntime {
|
|
161
|
+
config?: ReactNativeCollectorConfig;
|
|
162
|
+
capabilities: ReactNativeCapabilities;
|
|
163
|
+
resolver?: OptionalModuleResolver;
|
|
164
|
+
}
|
|
165
|
+
interface ReactNativeCollectorController {
|
|
166
|
+
cleanup(): void;
|
|
167
|
+
replayLite?: ReactNativeReplayLiteController;
|
|
168
|
+
}
|
|
169
|
+
declare function startReactNativeCollectors(logger: Crumbtrail, options: StartReactNativeCollectorsOptions): ReactNativeCollectorController;
|
|
170
|
+
|
|
171
|
+
interface ReactNativeCrumbtrailOptions extends DetectReactNativeCapabilitiesOptions, ReactNativeCollectorRuntime {
|
|
172
|
+
config?: Partial<CrumbtrailConfig>;
|
|
173
|
+
asyncStorage?: AsyncStorageLike | null;
|
|
174
|
+
reportCapabilities?: boolean;
|
|
175
|
+
collectors?: ReactNativeCollectorConfig;
|
|
176
|
+
}
|
|
177
|
+
interface ReactNativeCrumbtrailResult {
|
|
178
|
+
logger: Crumbtrail;
|
|
179
|
+
capabilities: ReactNativeCapabilities;
|
|
180
|
+
collectors: ReactNativeCollectorController;
|
|
181
|
+
}
|
|
182
|
+
declare function createReactNativeCrumbtrail(options?: ReactNativeCrumbtrailOptions): ReactNativeCrumbtrailResult;
|
|
183
|
+
declare function createReactNativeCrumbtrailAsync(options?: ReactNativeCrumbtrailOptions): Promise<ReactNativeCrumbtrailResult>;
|
|
184
|
+
|
|
185
|
+
interface CrumbtrailReactNativeContextValue {
|
|
186
|
+
logger: Crumbtrail;
|
|
187
|
+
capabilities: ReactNativeCapabilities;
|
|
188
|
+
}
|
|
189
|
+
interface CrumbtrailReactNativeProviderProps {
|
|
190
|
+
children: ReactNode;
|
|
191
|
+
logger?: Crumbtrail;
|
|
192
|
+
config?: Partial<CrumbtrailConfig>;
|
|
193
|
+
asyncStorage?: AsyncStorageLike | null;
|
|
194
|
+
resolver?: OptionalModuleResolver;
|
|
195
|
+
reportCapabilities?: boolean;
|
|
196
|
+
fallback?: ReactNode;
|
|
197
|
+
}
|
|
198
|
+
declare function CrumbtrailReactNativeProvider(props: CrumbtrailReactNativeProviderProps): ReactNode;
|
|
199
|
+
declare function useCrumbtrailReactNative(): CrumbtrailReactNativeContextValue;
|
|
200
|
+
|
|
201
|
+
interface BugStateLogger {
|
|
202
|
+
registerStateProvider(name: string, provider: () => unknown): () => void;
|
|
203
|
+
}
|
|
204
|
+
interface UseBugStateOptions {
|
|
205
|
+
captureRawState?: boolean;
|
|
206
|
+
}
|
|
207
|
+
declare function redactReactNativeSnapshot(value: unknown, keyName?: string): unknown;
|
|
208
|
+
declare function useBugState(logger: BugStateLogger | null | undefined, name: string, value: unknown, options?: UseBugStateOptions): void;
|
|
209
|
+
|
|
210
|
+
interface CrumbtrailReactNativeErrorBoundaryProps {
|
|
211
|
+
logger: BugStateLogger & {
|
|
212
|
+
addEvent(partial: {
|
|
213
|
+
type: string;
|
|
214
|
+
data: Record<string, unknown>;
|
|
215
|
+
}): void;
|
|
216
|
+
};
|
|
217
|
+
children: ReactNode;
|
|
218
|
+
fallback?: ReactNode;
|
|
219
|
+
}
|
|
220
|
+
interface State {
|
|
221
|
+
hasError: boolean;
|
|
222
|
+
}
|
|
223
|
+
declare class CrumbtrailReactNativeErrorBoundary extends Component<CrumbtrailReactNativeErrorBoundaryProps, State> {
|
|
224
|
+
constructor(props: CrumbtrailReactNativeErrorBoundaryProps);
|
|
225
|
+
static getDerivedStateFromError(_error: Error): State;
|
|
226
|
+
componentDidCatch(error: Error, errorInfo: ErrorInfo): void;
|
|
227
|
+
resetError(): void;
|
|
228
|
+
render(): ReactNode;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
export { type AsyncStorageLike, type BugStateLogger, type CrumbtrailReactNativeContextValue, CrumbtrailReactNativeErrorBoundary, type CrumbtrailReactNativeErrorBoundaryProps, CrumbtrailReactNativeProvider, type CrumbtrailReactNativeProviderProps, type DetectReactNativeCapabilitiesOptions, type OptionalModuleResolver, REACT_NATIVE_CAPABILITY_BITS, type ReactNativeAppStateModule, type ReactNativeCapabilities, type ReactNativeCapabilityDetail, type ReactNativeCapabilityModules, type ReactNativeCapabilityStatus, type ReactNativeCollectorConfig, type ReactNativeCollectorController, type ReactNativeCollectorName, type ReactNativeCollectorRuntime, type ReactNativeCrumbtrailOptions, type ReactNativeCrumbtrailResult, type ReactNativeDimensionsModule, type ReactNativeErrorUtilsLike, type ReactNativeModule, type ReactNativeNavigationLike, type ReactNativeOptionalModuleName, type ReactNativePlatformModule, type ReactNativeReplayLiteController, type ReactNativeReplayLiteOptions, type ReactNativeSessionStore, type ReactNativeTargetInput, type ReactNativeTouchOverlay, type ReactNativeViewShotModule, type ReactNativeViewSnapshot, type ReactNativeViewSnapshotNode, type UseBugStateOptions, createReactNativeCrumbtrail, createReactNativeCrumbtrailAsync, createReactNativeReplayLite, createReactNativeSessionStore, createReactNativeTargetDescriptor, detectReactNativeCapabilities, redactReactNativeSnapshot, startReactNativeCollectors, useBugState, useCrumbtrailReactNative };
|