@datadog/mobile-react-navigation 1.0.0-rc3 → 1.0.0-rc7
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/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/rum/instrumentation/DdRumReactNavigationTracking.js +67 -44
- package/lib/commonjs/rum/instrumentation/DdRumReactNavigationTracking.js.map +1 -1
- package/lib/commonjs/rum/instrumentation/react-navigation.js +2 -0
- package/lib/commonjs/rum/instrumentation/react-navigation.js.map +1 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/rum/instrumentation/DdRumReactNavigationTracking.js +63 -45
- package/lib/module/rum/instrumentation/DdRumReactNavigationTracking.js.map +1 -1
- package/lib/module/rum/instrumentation/react-navigation.js +2 -0
- package/lib/module/rum/instrumentation/react-navigation.js.map +1 -0
- package/lib/typescript/core/src/DdSdkReactNative.d.ts +7 -6
- package/lib/typescript/core/src/DdSdkReactNativeConfiguration.d.ts +15 -4
- package/lib/typescript/core/src/InternalLog.d.ts +11 -0
- package/lib/typescript/core/src/SdkVerbosity.d.ts +9 -0
- package/lib/typescript/core/src/TimeProvider.d.ts +20 -0
- package/lib/typescript/core/src/Timer.d.ts +3 -2
- package/lib/typescript/core/src/index.d.ts +4 -2
- package/lib/typescript/core/src/rum/instrumentation/DdEventsInterceptor.d.ts +1 -0
- package/lib/typescript/core/src/rum/instrumentation/DdRumErrorTracking.d.ts +3 -2
- package/lib/typescript/core/src/rum/instrumentation/DdRumResourceTracking.d.ts +13 -8
- package/lib/typescript/core/src/rum/instrumentation/DdRumUserInteractionTracking.d.ts +3 -3
- package/lib/typescript/core/src/rum/instrumentation/DdRumXhr.d.ts +13 -3
- package/lib/typescript/core/src/rum/instrumentation/ShallowObjectEqualityChecker.d.ts +4 -0
- package/lib/typescript/core/src/types.d.ts +12 -11
- package/lib/typescript/core/src/version.d.ts +1 -0
- package/lib/typescript/react-navigation/src/rum/instrumentation/DdRumReactNavigationTracking.d.ts +8 -3
- package/lib/typescript/react-navigation/src/rum/instrumentation/react-navigation.d.ts +116 -0
- package/package.json +12 -7
- package/src/__tests__/rum/instrumentation/DdRumReactNavigationTracking.test.tsx +467 -370
- package/src/__tests__/rum/instrumentation/__utils__/AppStateMock.ts +56 -0
- package/src/__tests__/rum/instrumentation/__utils__/Navigators/NavigatorsV5.tsx +105 -0
- package/src/__tests__/rum/instrumentation/__utils__/Navigators/NavigatorsV6.tsx +105 -0
- package/src/index.tsx +4 -1
- package/src/rum/instrumentation/DdRumReactNavigationTracking.tsx +136 -64
- package/src/rum/instrumentation/react-navigation.ts +158 -0
- package/lib/typescript/core/src/NativeSdkVerbosity.d.ts +0 -9
|
@@ -1,9 +1,12 @@
|
|
|
1
|
+
import { TimeProvider } from './TimeProvider';
|
|
1
2
|
/**
|
|
2
3
|
* Simple timer which records time ticks. Shouldn't be re-used once stopped.
|
|
3
4
|
* All timestamps/durations returned are in milliseconds.
|
|
4
5
|
*/
|
|
5
6
|
export default class Timer {
|
|
7
|
+
private timeProvider;
|
|
6
8
|
private times;
|
|
9
|
+
constructor(timeProvider?: TimeProvider);
|
|
7
10
|
get startTime(): number;
|
|
8
11
|
get stopTime(): number;
|
|
9
12
|
start(): void;
|
|
@@ -14,7 +17,5 @@ export default class Timer {
|
|
|
14
17
|
timeAt(label: string): number;
|
|
15
18
|
reset(): void;
|
|
16
19
|
private durationBetweenTicks;
|
|
17
|
-
private performanceNow;
|
|
18
|
-
private canUsePerformanceNow;
|
|
19
20
|
private checkLabelExists;
|
|
20
21
|
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import { DdLogs, DdTrace, DdRum } from './foundation';
|
|
2
1
|
import { DdSdkReactNativeConfiguration } from './DdSdkReactNativeConfiguration';
|
|
3
2
|
import { DdSdkReactNative } from './DdSdkReactNative';
|
|
3
|
+
import { InternalLog } from './InternalLog';
|
|
4
4
|
import { ProxyConfiguration, ProxyType } from './ProxyConfiguration';
|
|
5
|
+
import { SdkVerbosity } from './SdkVerbosity';
|
|
5
6
|
import { TrackingConsent } from './TrackingConsent';
|
|
6
|
-
|
|
7
|
+
import { DdLogs, DdTrace, DdRum } from './foundation';
|
|
8
|
+
export { DdLogs, DdTrace, DdRum, DdSdkReactNativeConfiguration, DdSdkReactNative, InternalLog, ProxyConfiguration, ProxyType, TrackingConsent, SdkVerbosity };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type EventsInterceptor from './EventsInterceptor';
|
|
2
2
|
export declare const UNKNOWN_TARGET_NAME = "unknown_target";
|
|
3
3
|
export declare class DdEventsInterceptor implements EventsInterceptor {
|
|
4
|
+
static ACTION_EVENT_DROPPED_WARN_MESSAGE: string;
|
|
4
5
|
private debouncingStartedTimestamp;
|
|
5
6
|
interceptOnPress(...args: any[]): void;
|
|
6
7
|
private handleTargetEvent;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Provides RUM auto-instrumentation feature to track errors as RUM events.
|
|
3
|
-
*/
|
|
2
|
+
* Provides RUM auto-instrumentation feature to track errors as RUM events.
|
|
3
|
+
*/
|
|
4
4
|
export declare class DdRumErrorTracking {
|
|
5
5
|
private static isTracking;
|
|
6
6
|
private static isInDefaultErrorHandler;
|
|
@@ -12,5 +12,6 @@ export declare class DdRumErrorTracking {
|
|
|
12
12
|
static startTracking(): void;
|
|
13
13
|
static onGlobalError(error: any, isFatal?: boolean): void;
|
|
14
14
|
static onConsoleError(...params: unknown[]): void;
|
|
15
|
+
private static getErrorMessage;
|
|
15
16
|
private static getErrorStackTrace;
|
|
16
17
|
}
|
|
@@ -1,22 +1,27 @@
|
|
|
1
|
+
/// <reference types="react-native" />
|
|
1
2
|
export declare const TRACE_ID_HEADER_KEY = "x-datadog-trace-id";
|
|
2
3
|
export declare const PARENT_ID_HEADER_KEY = "x-datadog-parent-id";
|
|
3
4
|
export declare const ORIGIN_HEADER_KEY = "x-datadog-origin";
|
|
5
|
+
export declare const SAMPLING_PRIORITY_HEADER_KEY = "x-datadog-sampling-priority";
|
|
4
6
|
export declare const ORIGIN_RUM = "rum";
|
|
7
|
+
export declare const RESOURCE_SIZE_ERROR_MESSAGE = "Couldn't get resource size, because an error occured: ";
|
|
8
|
+
export declare function calculateResponseSize(xhr: XMLHttpRequest): number;
|
|
5
9
|
/**
|
|
6
|
-
* Provides RUM auto-instrumentation feature to track resources (fetch, XHR, axios) as RUM events.
|
|
7
|
-
*/
|
|
10
|
+
* Provides RUM auto-instrumentation feature to track resources (fetch, XHR, axios) as RUM events.
|
|
11
|
+
*/
|
|
8
12
|
export declare class DdRumResourceTracking {
|
|
9
13
|
private static isTracking;
|
|
14
|
+
private static tracingSamplingRate;
|
|
10
15
|
private static originalXhrOpen;
|
|
11
16
|
private static originalXhrSend;
|
|
12
17
|
/**
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
static startTracking(): void;
|
|
18
|
+
* Starts tracking resources and sends a RUM Resource event every time a network request is detected.
|
|
19
|
+
*/
|
|
20
|
+
static startTracking(tracingSamplingRate: number): void;
|
|
16
21
|
/**
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
static startTrackingInternal(xhrType:
|
|
22
|
+
* Starts tracking resources and sends a RUM Resource event every time a fetch or XHR call is detected.
|
|
23
|
+
*/
|
|
24
|
+
static startTrackingInternal(xhrType: typeof XMLHttpRequest, tracingSamplingRate: number): void;
|
|
20
25
|
static stopTracking(): void;
|
|
21
26
|
static proxyXhr(xhrType: any): void;
|
|
22
27
|
private static proxyOpen;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Provides RUM auto-instrumentation feature to track user interaction as RUM events.
|
|
3
|
-
* For now we are only covering the "onPress" events.
|
|
4
|
-
*/
|
|
2
|
+
* Provides RUM auto-instrumentation feature to track user interaction as RUM events.
|
|
3
|
+
* For now we are only covering the "onPress" events.
|
|
4
|
+
*/
|
|
5
5
|
export declare class DdRumUserInteractionTracking {
|
|
6
6
|
private static isTracking;
|
|
7
7
|
private static eventsInterceptor;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react-native" />
|
|
2
|
-
import type Timer from
|
|
2
|
+
import type Timer from '../../Timer';
|
|
3
3
|
export interface DdRumXhr extends XMLHttpRequest {
|
|
4
4
|
_datadog_xhr: DdRumXhrContext;
|
|
5
5
|
}
|
|
@@ -8,6 +8,16 @@ export interface DdRumXhrContext {
|
|
|
8
8
|
url: string;
|
|
9
9
|
reported: boolean;
|
|
10
10
|
timer: Timer;
|
|
11
|
-
|
|
12
|
-
traceId: string;
|
|
11
|
+
tracingAttributes: DdRumResourceTracingAttributes;
|
|
13
12
|
}
|
|
13
|
+
export declare type DdRumResourceTracingAttributes = {
|
|
14
|
+
tracingStrategy: 'KEEP';
|
|
15
|
+
traceId: string;
|
|
16
|
+
spanId: string;
|
|
17
|
+
samplingPriorityHeader: '1';
|
|
18
|
+
} | {
|
|
19
|
+
tracingStrategy: 'DISCARD';
|
|
20
|
+
traceId?: void;
|
|
21
|
+
spanId?: void;
|
|
22
|
+
samplingPriorityHeader: '0';
|
|
23
|
+
};
|
|
@@ -74,14 +74,14 @@ export declare type DdTraceType = {
|
|
|
74
74
|
* Start a span, and returns a unique identifier for the span.
|
|
75
75
|
* @param operation: The operation name of the span.
|
|
76
76
|
* @param context: The additional context to send.
|
|
77
|
-
* @param timestampMs: The timestamp when the operation started (in milliseconds).
|
|
77
|
+
* @param timestampMs: The timestamp when the operation started (in milliseconds). If not provided, current timestamp will be used.
|
|
78
78
|
*/
|
|
79
79
|
startSpan(operation: string, context?: object, timestampMs?: number): Promise<string>;
|
|
80
80
|
/**
|
|
81
81
|
* Finish a started span.
|
|
82
82
|
* @param spanId: The unique identifier of the span.
|
|
83
83
|
* @param context: The additional context to send.
|
|
84
|
-
* @param timestampMs: The timestamp when the operation stopped (in milliseconds).
|
|
84
|
+
* @param timestampMs: The timestamp when the operation stopped (in milliseconds). If not provided, current timestamp will be used.
|
|
85
85
|
*/
|
|
86
86
|
finishSpan(spanId: string, context?: object, timestampMs?: number): Promise<void>;
|
|
87
87
|
};
|
|
@@ -94,14 +94,14 @@ export declare type DdRumType = {
|
|
|
94
94
|
* @param key: The view unique key identifier.
|
|
95
95
|
* @param name: The view name.
|
|
96
96
|
* @param context: The additional context to send.
|
|
97
|
-
* @param timestampMs: The timestamp when the view started (in milliseconds).
|
|
97
|
+
* @param timestampMs: The timestamp when the view started (in milliseconds). If not provided, current timestamp will be used.
|
|
98
98
|
*/
|
|
99
99
|
startView(key: string, name: string, context?: object, timestampMs?: number): Promise<void>;
|
|
100
100
|
/**
|
|
101
101
|
* Stop tracking a RUM View.
|
|
102
102
|
* @param key: The view unique key identifier.
|
|
103
103
|
* @param context: The additional context to send.
|
|
104
|
-
* @param timestampMs: The timestamp when the view stopped (in milliseconds).
|
|
104
|
+
* @param timestampMs: The timestamp when the view stopped (in milliseconds). If not provided, current timestamp will be used.
|
|
105
105
|
*/
|
|
106
106
|
stopView(key: string, context?: object, timestampMs?: number): Promise<void>;
|
|
107
107
|
/**
|
|
@@ -109,13 +109,13 @@ export declare type DdRumType = {
|
|
|
109
109
|
* @param type: The action type (tap, scroll, swipe, click, custom).
|
|
110
110
|
* @param name: The action name.
|
|
111
111
|
* @param context: The additional context to send.
|
|
112
|
-
* @param timestampMs: The timestamp when the action started (in milliseconds).
|
|
112
|
+
* @param timestampMs: The timestamp when the action started (in milliseconds). If not provided, current timestamp will be used.
|
|
113
113
|
*/
|
|
114
114
|
startAction(type: string, name: string, context?: object, timestampMs?: number): Promise<void>;
|
|
115
115
|
/**
|
|
116
116
|
* Stop tracking the ongoing RUM Action.
|
|
117
117
|
* @param context: The additional context to send.
|
|
118
|
-
* @param timestampMs: The timestamp when the action stopped (in milliseconds).
|
|
118
|
+
* @param timestampMs: The timestamp when the action stopped (in milliseconds). If not provided, current timestamp will be used.
|
|
119
119
|
*/
|
|
120
120
|
stopAction(context?: object, timestampMs?: number): Promise<void>;
|
|
121
121
|
/**
|
|
@@ -123,7 +123,7 @@ export declare type DdRumType = {
|
|
|
123
123
|
* @param type: The action type (tap, scroll, swipe, click, custom).
|
|
124
124
|
* @param name: The action name.
|
|
125
125
|
* @param context: The additional context to send.
|
|
126
|
-
* @param timestampMs: The timestamp when the action occurred (in milliseconds).
|
|
126
|
+
* @param timestampMs: The timestamp when the action occurred (in milliseconds). If not provided, current timestamp will be used.
|
|
127
127
|
*/
|
|
128
128
|
addAction(type: string, name: string, context?: object, timestampMs?: number): Promise<void>;
|
|
129
129
|
/**
|
|
@@ -132,7 +132,7 @@ export declare type DdRumType = {
|
|
|
132
132
|
* @param method: The resource method (GET, POST, …).
|
|
133
133
|
* @param url: The resource url.
|
|
134
134
|
* @param context: The additional context to send.
|
|
135
|
-
* @param timestampMs: The timestamp when the resource started (in milliseconds).
|
|
135
|
+
* @param timestampMs: The timestamp when the resource started (in milliseconds). If not provided, current timestamp will be used.
|
|
136
136
|
*/
|
|
137
137
|
startResource(key: string, method: string, url: string, context?: object, timestampMs?: number): Promise<void>;
|
|
138
138
|
/**
|
|
@@ -140,17 +140,18 @@ export declare type DdRumType = {
|
|
|
140
140
|
* @param key: The resource unique key identifier.
|
|
141
141
|
* @param statusCode: The resource status code.
|
|
142
142
|
* @param kind: The resource's kind (xhr, document, image, css, font, …).
|
|
143
|
+
* @param size: The resource size in bytes. If size is unknown, use -1.
|
|
143
144
|
* @param context: The additional context to send.
|
|
144
|
-
* @param timestampMs: The timestamp when the resource stopped (in milliseconds).
|
|
145
|
+
* @param timestampMs: The timestamp when the resource stopped (in milliseconds). If not provided, current timestamp will be used.
|
|
145
146
|
*/
|
|
146
|
-
stopResource(key: string, statusCode: number, kind: string, context?: object, timestampMs?: number): Promise<void>;
|
|
147
|
+
stopResource(key: string, statusCode: number, kind: string, size?: number, context?: object, timestampMs?: number): Promise<void>;
|
|
147
148
|
/**
|
|
148
149
|
* Add a RUM Error.
|
|
149
150
|
* @param message: The error message.
|
|
150
151
|
* @param source: The error source (network, source, console, logger, …).
|
|
151
152
|
* @param stacktrace: The error stacktrace.
|
|
152
153
|
* @param context: The additional context to send.
|
|
153
|
-
* @param timestampMs: The timestamp when the error occurred (in milliseconds).
|
|
154
|
+
* @param timestampMs: The timestamp when the error occurred (in milliseconds). If not provided, current timestamp will be used.
|
|
154
155
|
*/
|
|
155
156
|
addError(message: string, source: string, stacktrace: string, context?: object, timestampMs?: number): Promise<void>;
|
|
156
157
|
/**
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const version = "1.0.0-rc7";
|
package/lib/typescript/react-navigation/src/rum/instrumentation/DdRumReactNavigationTracking.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { NavigationContainerRef, Route } from
|
|
1
|
+
import type { NavigationContainerRef, Route } from './react-navigation';
|
|
2
2
|
export declare type ViewNamePredicate = (route: Route<string, any | undefined>, trackedName: string) => string;
|
|
3
3
|
/**
|
|
4
4
|
* Provides RUM integration for the [ReactNavigation](https://reactnavigation.org/) API.
|
|
@@ -6,8 +6,13 @@ export declare type ViewNamePredicate = (route: Route<string, any | undefined>,
|
|
|
6
6
|
export declare class DdRumReactNavigationTracking {
|
|
7
7
|
private static registeredContainer;
|
|
8
8
|
private static navigationStateChangeListener;
|
|
9
|
-
private static appStateListener;
|
|
10
9
|
private static viewNamePredicate;
|
|
10
|
+
private static backHandler;
|
|
11
|
+
static ROUTE_UNDEFINED_NAVIGATION_WARNING_MESSAGE: string;
|
|
12
|
+
static NULL_NAVIGATION_REF_ERROR_MESSAGE: string;
|
|
13
|
+
static NAVIGATION_REF_IN_USE_ERROR_MESSAGE: string;
|
|
14
|
+
static isAppExitingOnBackPress: () => boolean;
|
|
15
|
+
static onBackPress: () => boolean;
|
|
11
16
|
/**
|
|
12
17
|
* Starts tracking the NavigationContainer and sends a RUM View event every time the navigation route changed.
|
|
13
18
|
* @param navigationRef the reference to the real NavigationContainer.
|
|
@@ -20,5 +25,5 @@ export declare class DdRumReactNavigationTracking {
|
|
|
20
25
|
static stopTrackingViews(navigationRef: NavigationContainerRef | null): void;
|
|
21
26
|
private static handleRouteNavigation;
|
|
22
27
|
private static resolveNavigationStateChangeListener;
|
|
23
|
-
private static
|
|
28
|
+
private static appStateListener;
|
|
24
29
|
}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file contains copy/pastes from react-navigation types. The types have been simplified to be able to work with
|
|
3
|
+
* both v5 and v6.
|
|
4
|
+
* This is needed because NavigationContainerRef became NavigationContainerRef<T> in v6, and so we cannot keep compatibility
|
|
5
|
+
* between the 2 types. Also this way we never import '@react-navigation/native-vX' in our code.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Route
|
|
9
|
+
*/
|
|
10
|
+
export declare type Route<RouteName extends string, Params extends object | undefined = object | undefined> = Readonly<{
|
|
11
|
+
/**
|
|
12
|
+
* Unique key for the route.
|
|
13
|
+
*/
|
|
14
|
+
key: string;
|
|
15
|
+
/**
|
|
16
|
+
* User-provided name for the route.
|
|
17
|
+
*/
|
|
18
|
+
name: RouteName;
|
|
19
|
+
}> & (undefined extends Params ? Readonly<{
|
|
20
|
+
/**
|
|
21
|
+
* Params for this route
|
|
22
|
+
*/
|
|
23
|
+
params?: Readonly<Params>;
|
|
24
|
+
}> : Readonly<{
|
|
25
|
+
/**
|
|
26
|
+
* Params for this route
|
|
27
|
+
*/
|
|
28
|
+
params: Readonly<Params>;
|
|
29
|
+
}>);
|
|
30
|
+
/**
|
|
31
|
+
* Navigation Container
|
|
32
|
+
*/
|
|
33
|
+
export declare type NavigationContainerRef = EventConsumer<NavigationContainerEventMap> & {
|
|
34
|
+
canGoBack(): boolean;
|
|
35
|
+
getCurrentRoute(): Route<string> | undefined;
|
|
36
|
+
};
|
|
37
|
+
export declare type NavigationContainerEventMap = {
|
|
38
|
+
/**
|
|
39
|
+
* Event which fires when the navigation state changes.
|
|
40
|
+
*/
|
|
41
|
+
state: {
|
|
42
|
+
data: {
|
|
43
|
+
/**
|
|
44
|
+
* The updated state object after the state change.
|
|
45
|
+
*/
|
|
46
|
+
state: any;
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* Event which fires when current options changes.
|
|
51
|
+
*/
|
|
52
|
+
options: {
|
|
53
|
+
data: {
|
|
54
|
+
options: object;
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
/**
|
|
58
|
+
* Event which fires when an action is dispatched.
|
|
59
|
+
* Only intended for debugging purposes, don't use it for app logic.
|
|
60
|
+
* This event will be emitted before state changes have been applied.
|
|
61
|
+
*/
|
|
62
|
+
__unsafe_action__: {
|
|
63
|
+
data: {
|
|
64
|
+
/**
|
|
65
|
+
* The action object which was dispatched.
|
|
66
|
+
*/
|
|
67
|
+
action: any;
|
|
68
|
+
/**
|
|
69
|
+
* Whether the action was a no-op, i.e. resulted any state changes.
|
|
70
|
+
*/
|
|
71
|
+
noop: boolean;
|
|
72
|
+
/**
|
|
73
|
+
* Stack trace of the action, this will only be available during development.
|
|
74
|
+
*/
|
|
75
|
+
stack: string | undefined;
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
export declare type EventConsumer<EventMap extends EventMapBase> = {
|
|
80
|
+
/**
|
|
81
|
+
* Subscribe to events from the parent navigator.
|
|
82
|
+
*
|
|
83
|
+
* @param type Type of the event (e.g. `focus`, `blur`)
|
|
84
|
+
* @param callback Callback listener which is executed upon receiving the event.
|
|
85
|
+
*/
|
|
86
|
+
addListener<EventName extends Extract<keyof EventMap, string>>(type: EventName, callback: (...args: any[]) => any): () => void;
|
|
87
|
+
removeListener<EventName extends Extract<keyof EventMap, string>>(type: EventName, callback: (...args: any[]) => any): void;
|
|
88
|
+
};
|
|
89
|
+
export declare type EventMapBase = Record<string, {
|
|
90
|
+
data?: any;
|
|
91
|
+
canPreventDefault?: boolean;
|
|
92
|
+
}>;
|
|
93
|
+
/**
|
|
94
|
+
* NavigationListener
|
|
95
|
+
*/
|
|
96
|
+
export declare type NavigationListener = (event: EventArg<string, boolean, any>) => void | null;
|
|
97
|
+
export declare type EventArg<EventName extends string, CanPreventDefault extends boolean | undefined = false, Data = undefined> = {
|
|
98
|
+
/**
|
|
99
|
+
* Type of the event (e.g. `focus`, `blur`)
|
|
100
|
+
*/
|
|
101
|
+
readonly type: EventName;
|
|
102
|
+
readonly target?: string;
|
|
103
|
+
} & (CanPreventDefault extends true ? {
|
|
104
|
+
/**
|
|
105
|
+
* Whether `event.preventDefault()` was called on this event object.
|
|
106
|
+
*/
|
|
107
|
+
readonly defaultPrevented: boolean;
|
|
108
|
+
/**
|
|
109
|
+
* Prevent the default action which happens on this event.
|
|
110
|
+
*/
|
|
111
|
+
preventDefault(): void;
|
|
112
|
+
} : any) & (undefined extends Data ? {
|
|
113
|
+
readonly data?: Readonly<Data>;
|
|
114
|
+
} : {
|
|
115
|
+
readonly data: Readonly<Data>;
|
|
116
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@datadog/mobile-react-navigation",
|
|
3
|
-
"version": "1.0.0-
|
|
3
|
+
"version": "1.0.0-rc7",
|
|
4
4
|
"description": "A client-side React Native module to interact with Datadog",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"datadog",
|
|
@@ -36,17 +36,19 @@
|
|
|
36
36
|
"prepare": "bob build"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"@datadog/mobile-react-native": "^1.0.0-
|
|
40
|
-
"@react-navigation/native": "5.9.2",
|
|
41
|
-
"@react-navigation/
|
|
39
|
+
"@datadog/mobile-react-native": "^1.0.0-rc7",
|
|
40
|
+
"@react-navigation/native-v5": "npm:@react-navigation/native@5.9.2",
|
|
41
|
+
"@react-navigation/native-v6": "npm:@react-navigation/native@6.0.9",
|
|
42
|
+
"@react-navigation/stack-v5": "npm:@react-navigation/stack@5.14.2",
|
|
43
|
+
"@react-navigation/stack-v6": "npm:@react-navigation/stack@6.2.1",
|
|
44
|
+
"@testing-library/react-native": "7.0.2",
|
|
42
45
|
"react-native-gesture-handler": "1.10.3",
|
|
43
46
|
"react-native-safe-area-context": "3.1.9"
|
|
44
47
|
},
|
|
45
48
|
"peerDependencies": {
|
|
46
49
|
"@datadog/mobile-react-native": "^1.0.0-beta4",
|
|
47
|
-
"@react-navigation/native": "^5.6.0",
|
|
48
50
|
"react": ">=16.13.1",
|
|
49
|
-
"react-native": "
|
|
51
|
+
"react-native": ">=0.63.4 <1.0"
|
|
50
52
|
},
|
|
51
53
|
"jest": {
|
|
52
54
|
"preset": "react-native",
|
|
@@ -56,6 +58,9 @@
|
|
|
56
58
|
"setupFiles": [
|
|
57
59
|
"./../../node_modules/react-native-gesture-handler/jestSetup.js"
|
|
58
60
|
],
|
|
61
|
+
"testPathIgnorePatterns": [
|
|
62
|
+
"/__utils__/"
|
|
63
|
+
],
|
|
59
64
|
"transformIgnorePatterns": []
|
|
60
65
|
},
|
|
61
66
|
"react-native-builder-bob": {
|
|
@@ -72,5 +77,5 @@
|
|
|
72
77
|
]
|
|
73
78
|
]
|
|
74
79
|
},
|
|
75
|
-
"gitHead": "
|
|
80
|
+
"gitHead": "d789622b6a8f0c06885bc43fcc2ec4ca9f750557"
|
|
76
81
|
}
|