clintplay-react-native 0.1.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/app.plugin.js ADDED
@@ -0,0 +1,29 @@
1
+ // Expo config plugin for clintplay-react-native.
2
+ //
3
+ // Consumers add this to their `app.json` plugins array:
4
+ //
5
+ // {
6
+ // "expo": {
7
+ // "plugins": ["clintplay-react-native"]
8
+ // }
9
+ // }
10
+ //
11
+ // Today this plugin is a no-op: the SDK is JS-only and needs nothing
12
+ // at prebuild time. It exists now so consumers can wire it once and
13
+ // the upgrade path for the native TurboModule (PR 2) is seamless —
14
+ // when PR 2 lands, the same plugin reference will start emitting
15
+ // iOS AppDelegate hooks + Android MainApplication wiring without any
16
+ // app-side change.
17
+ //
18
+ // We expose this as `app.plugin.js` (not `dist/...`) because Expo's
19
+ // resolver looks for the plugin file relative to the package root,
20
+ // and the file must NOT be wrapped in a build step (Expo CLI requires
21
+ // CommonJS top-level export).
22
+
23
+ /**
24
+ * @param {import('@expo/config-plugins').ExpoConfig} config
25
+ * @returns {import('@expo/config-plugins').ExpoConfig}
26
+ */
27
+ const withClintplay = (config) => config;
28
+
29
+ module.exports = withClintplay;
@@ -0,0 +1,40 @@
1
+ require "json"
2
+
3
+ package = JSON.parse(File.read(File.join(__dir__, "package.json")))
4
+ folly_compiler_flags = "-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32"
5
+
6
+ Pod::Spec.new do |s|
7
+ s.name = "clintplay-react-native"
8
+ s.version = package["version"]
9
+ s.summary = package["description"]
10
+ s.homepage = package["homepage"]
11
+ s.license = package["license"]
12
+ s.authors = { "ThreadCode" => "" }
13
+
14
+ s.platforms = { :ios => "13.4" }
15
+ s.source = { :git => "https://github.com/clintdigital/clintplay.git" }
16
+
17
+ s.source_files = "ios/**/*.{h,m,mm,swift}"
18
+ s.resource_bundles = { "clintplay_react_native_privacy" => ["ios/PrivacyInfo.xcprivacy"] }
19
+
20
+ # New Arch (Fabric + TurboModules). Without this guard the install
21
+ # still works on legacy-arch apps — the .mm file branches on
22
+ # `RCT_NEW_ARCH_ENABLED` so the same source serves both.
23
+ if defined?(install_modules_dependencies()) != nil
24
+ install_modules_dependencies(s)
25
+ else
26
+ s.dependency "React-Core"
27
+
28
+ if ENV["RCT_NEW_ARCH_ENABLED"] == "1" then
29
+ s.compiler_flags = folly_compiler_flags + " -DRCT_NEW_ARCH_ENABLED=1"
30
+ s.pod_target_xcconfig = {
31
+ "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\""
32
+ }
33
+ s.dependency "React-Codegen"
34
+ s.dependency "RCT-Folly"
35
+ s.dependency "RCTRequired"
36
+ s.dependency "RCTTypeSafety"
37
+ s.dependency "ReactCommon/turbomodule/core"
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,280 @@
1
+ import React from 'react';
2
+ import { ViewProps, View, TextInputProps, TextInput, ImageProps, Image, StyleProp, ViewStyle } from 'react-native';
3
+ import * as react_jsx_runtime from 'react/jsx-runtime';
4
+
5
+ type EventType = 'meta' | 'screen' | 'lifecycle' | 'navigation' | 'touch' | 'error' | 'log' | 'identify' | 'network' | 'wireframe';
6
+ interface DeviceInfo {
7
+ platform: 'ios' | 'android' | 'web';
8
+ osVersion?: string;
9
+ }
10
+ interface MetaEvent {
11
+ type: 'meta';
12
+ ts: number;
13
+ sessionId: string;
14
+ sdkVersion: string;
15
+ device: DeviceInfo;
16
+ }
17
+ interface ScreenEvent {
18
+ type: 'screen';
19
+ ts: number;
20
+ width: number;
21
+ height: number;
22
+ scale: number;
23
+ orientation: 'portrait' | 'landscape';
24
+ }
25
+ interface LifecycleEvent {
26
+ type: 'lifecycle';
27
+ ts: number;
28
+ state: 'active' | 'background' | 'inactive';
29
+ }
30
+ interface NavigationEvent {
31
+ type: 'navigation';
32
+ ts: number;
33
+ from?: string;
34
+ to: string;
35
+ }
36
+ interface TouchEvent {
37
+ type: 'touch';
38
+ ts: number;
39
+ x: number;
40
+ y: number;
41
+ screenX?: number;
42
+ screenY?: number;
43
+ kind: 'start' | 'move' | 'end' | 'tap' | 'long-press';
44
+ }
45
+ interface ErrorEvent {
46
+ type: 'error';
47
+ ts: number;
48
+ message: string;
49
+ stack?: string;
50
+ name?: string;
51
+ fatal: boolean;
52
+ }
53
+ interface LogEvent {
54
+ type: 'log';
55
+ ts: number;
56
+ level: 'info' | 'warn' | 'error';
57
+ message: string;
58
+ }
59
+ interface IdentifyEvent {
60
+ type: 'identify';
61
+ ts: number;
62
+ userId: string | null;
63
+ traits?: Record<string, unknown>;
64
+ }
65
+ interface NetworkEvent {
66
+ type: 'network';
67
+ ts: number;
68
+ method: string;
69
+ url: string;
70
+ status?: number;
71
+ durationMs?: number;
72
+ error?: string;
73
+ }
74
+ interface WireframeNode {
75
+ id: number;
76
+ type: string;
77
+ className?: string;
78
+ x: number;
79
+ y: number;
80
+ w: number;
81
+ h: number;
82
+ width?: number;
83
+ height?: number;
84
+ bg?: string;
85
+ backgroundColor?: string;
86
+ text?: string;
87
+ masked?: boolean;
88
+ tag?: number;
89
+ accessibilityIdentifier?: string;
90
+ accessibilityLabel?: string;
91
+ children?: WireframeNode[];
92
+ }
93
+ interface WireframeEvent {
94
+ type: 'wireframe';
95
+ ts: number;
96
+ version: number;
97
+ nodes: WireframeNode[];
98
+ }
99
+ type ReplayEvent = MetaEvent | ScreenEvent | LifecycleEvent | NavigationEvent | TouchEvent | ErrorEvent | LogEvent | IdentifyEvent | NetworkEvent | WireframeEvent;
100
+ interface BackendEvent {
101
+ type: string;
102
+ timestamp: number;
103
+ sessionId: string;
104
+ data: unknown;
105
+ }
106
+ interface ReplayBatch {
107
+ projectId: string;
108
+ sessionId: string;
109
+ events: BackendEvent[];
110
+ sentAt: number;
111
+ anonId?: string;
112
+ sdkVersion?: string;
113
+ }
114
+ interface ClintplayReactNativeConfig {
115
+ apiUrl: string;
116
+ apiKey?: string;
117
+ projectId?: string;
118
+ anonId?: string;
119
+ flushIntervalMs?: number;
120
+ flushSize?: number;
121
+ maxBufferSize?: number;
122
+ enabled?: boolean;
123
+ debug?: boolean;
124
+ sampleRate?: number;
125
+ captureNetwork?: boolean;
126
+ captureConsole?: boolean;
127
+ captureConsoleLog?: boolean;
128
+ captureWireframe?: boolean;
129
+ wireframeIntervalMs?: number;
130
+ sanitizeUrl?: (url: string) => string;
131
+ excludeEventTypes?: ReadonlyArray<EventType>;
132
+ asyncStorage?: AsyncStorageLike;
133
+ }
134
+ interface AsyncStorageLike {
135
+ setItem(key: string, value: string): Promise<void>;
136
+ getItem(key: string): Promise<string | null>;
137
+ removeItem(key: string): Promise<void>;
138
+ getAllKeys(): Promise<readonly string[]>;
139
+ multiRemove(keys: readonly string[]): Promise<void>;
140
+ }
141
+
142
+ declare const CLINTPLAY_MASK_ID = "clintplay-mask";
143
+ interface ClintplayMaskViewProps extends ViewProps {
144
+ children?: React.ReactNode;
145
+ }
146
+ declare const ClintplayMaskView: React.ForwardRefExoticComponent<ClintplayMaskViewProps & React.RefAttributes<View>>;
147
+
148
+ type ClintplayMaskTextInputProps = TextInputProps;
149
+ declare const ClintplayMaskTextInput: React.ForwardRefExoticComponent<TextInputProps & React.RefAttributes<TextInput>>;
150
+
151
+ type ClintplayMaskImageProps = ImageProps;
152
+ declare const ClintplayMaskImage: React.ForwardRefExoticComponent<ImageProps & React.RefAttributes<Image>>;
153
+
154
+ interface ClintplayCaptureProviderProps extends ViewProps {
155
+ children?: React.ReactNode;
156
+ style?: StyleProp<ViewStyle>;
157
+ enabled?: boolean;
158
+ }
159
+ declare function ClintplayCaptureProvider({ children, style, enabled, onTouchStart, onTouchEnd, onTouchCancel, ...rest }: ClintplayCaptureProviderProps): react_jsx_runtime.JSX.Element;
160
+
161
+ interface NavigationRouteLike {
162
+ key?: string;
163
+ name?: string;
164
+ params?: Record<string, unknown>;
165
+ state?: NavigationStateLike | unknown;
166
+ }
167
+ interface NavigationStateLike {
168
+ key?: string;
169
+ index?: number;
170
+ routes?: NavigationRouteLike[];
171
+ routeNames?: string[];
172
+ [key: string]: unknown;
173
+ }
174
+ type NavigationStateListenerCallback = (to: string, from?: string) => void;
175
+ interface NavigationStateListenerOptions {
176
+ /**
177
+ * Initial previous route name if known.
178
+ */
179
+ initialRouteName?: string;
180
+ /**
181
+ * Optional custom callback invoked when the route changes.
182
+ */
183
+ onRouteChanged?: NavigationStateListenerCallback;
184
+ }
185
+ /**
186
+ * Sanitizes a route name or pathname by stripping query parameters (?token=...)
187
+ * and fragments (#section...).
188
+ */
189
+ declare function sanitizeRoute(route?: string): string | undefined;
190
+ /**
191
+ * Traverses a nested React Navigation state tree to extract the active leaf route name.
192
+ */
193
+ declare function getActiveRouteName(state: unknown, depth?: number): string | undefined;
194
+ /**
195
+ * Creates an `onStateChange` listener for React Navigation's `<NavigationContainer>`.
196
+ * Automatically extracts the active leaf screen name and emits a `navigation` event
197
+ * while preventing duplicate consecutive emissions.
198
+ */
199
+ declare function createClintplayNavigationStateListener(options?: NavigationStateListenerOptions | NavigationStateListenerCallback): (state: unknown) => void;
200
+ interface ClintplayNavigationTrackerProps {
201
+ children?: React.ReactNode | ((props: {
202
+ onStateChange: (state: unknown) => void;
203
+ }) => React.ReactNode);
204
+ pathname?: string;
205
+ onStateChange?: (state: unknown) => void;
206
+ initialRouteName?: string;
207
+ onRouteChanged?: NavigationStateListenerCallback;
208
+ }
209
+ /**
210
+ * Navigation tracker component for React Navigation and Expo Router.
211
+ * Can be used as a wrapper, helper, or render-prop provider around `<NavigationContainer>`,
212
+ * or as a standalone tracker component `<ClintplayNavigationTracker pathname={pathname} />`.
213
+ */
214
+ declare function ClintplayNavigationTracker({ children, pathname, onStateChange, initialRouteName, onRouteChanged, }: ClintplayNavigationTrackerProps): react_jsx_runtime.JSX.Element;
215
+
216
+ interface UseClintplayNavigationOptions {
217
+ /**
218
+ * Initial previous route name if known.
219
+ */
220
+ from?: string;
221
+ /**
222
+ * Optional custom callback triggered on screen change.
223
+ */
224
+ onRouteChanged?: (to: string, from?: string) => void;
225
+ }
226
+ interface UseClintplayNavigationResult {
227
+ (state: unknown): void;
228
+ onStateChange: (state: unknown) => void;
229
+ trackScreen: (to: string, from?: string) => void;
230
+ }
231
+ /**
232
+ * Resets the shared last tracked route. Used primarily for test isolation.
233
+ */
234
+ declare function _resetLastTrackedRoute(): void;
235
+ /**
236
+ * Hook for automatic or manual screen tracking in React Native and Expo Router.
237
+ *
238
+ * Usage:
239
+ *
240
+ * 1. Screen-level tracking (Expo Router or per-screen):
241
+ * ```tsx
242
+ * const pathname = usePathname();
243
+ * useClintplayNavigationTracking(pathname);
244
+ * ```
245
+ *
246
+ * 2. NavigationContainer onStateChange helper:
247
+ * ```tsx
248
+ * const { onStateChange } = useClintplayNavigationTracking();
249
+ * <NavigationContainer onStateChange={onStateChange} />
250
+ * ```
251
+ */
252
+ declare function useClintplayNavigationTracking(routeNameOrPath?: string, options?: UseClintplayNavigationOptions): UseClintplayNavigationResult;
253
+
254
+ declare const SDK_VERSION: string;
255
+ declare function formatEventForBatch(event: ReplayEvent | BackendEvent, defaultSessionId: string): BackendEvent;
256
+ declare function init(rawConfig: ClintplayReactNativeConfig): void;
257
+ declare function identify(userId: string | null, traits?: Record<string, unknown>): void;
258
+ declare function reset(options?: {
259
+ clearOfflineQueue?: boolean;
260
+ }): void;
261
+ declare function trackScreen(path: string, from?: string): void;
262
+ declare function reportError(err: unknown): void;
263
+ declare function flush(): Promise<void>;
264
+ declare function stop(): Promise<void>;
265
+ declare function current(): {
266
+ sessionId: string;
267
+ userId: string | null;
268
+ } | null;
269
+ declare const Clintplay: {
270
+ init: typeof init;
271
+ identify: typeof identify;
272
+ reset: typeof reset;
273
+ trackScreen: typeof trackScreen;
274
+ reportError: typeof reportError;
275
+ flush: typeof flush;
276
+ stop: typeof stop;
277
+ current: typeof current;
278
+ };
279
+
280
+ export { type BackendEvent, CLINTPLAY_MASK_ID, Clintplay, ClintplayCaptureProvider, type ClintplayCaptureProviderProps, ClintplayMaskImage, type ClintplayMaskImageProps, ClintplayMaskTextInput, type ClintplayMaskTextInputProps, ClintplayMaskView, type ClintplayMaskViewProps, ClintplayNavigationTracker, type ClintplayNavigationTrackerProps, type ClintplayReactNativeConfig, type DeviceInfo, type NavigationRouteLike, type NavigationStateLike, type NavigationStateListenerCallback, type NavigationStateListenerOptions, type ReplayBatch, type ReplayEvent, SDK_VERSION, type UseClintplayNavigationOptions, type UseClintplayNavigationResult, type WireframeEvent, type WireframeNode, _resetLastTrackedRoute, createClintplayNavigationStateListener, formatEventForBatch, getActiveRouteName, sanitizeRoute, useClintplayNavigationTracking };
@@ -0,0 +1,280 @@
1
+ import React from 'react';
2
+ import { ViewProps, View, TextInputProps, TextInput, ImageProps, Image, StyleProp, ViewStyle } from 'react-native';
3
+ import * as react_jsx_runtime from 'react/jsx-runtime';
4
+
5
+ type EventType = 'meta' | 'screen' | 'lifecycle' | 'navigation' | 'touch' | 'error' | 'log' | 'identify' | 'network' | 'wireframe';
6
+ interface DeviceInfo {
7
+ platform: 'ios' | 'android' | 'web';
8
+ osVersion?: string;
9
+ }
10
+ interface MetaEvent {
11
+ type: 'meta';
12
+ ts: number;
13
+ sessionId: string;
14
+ sdkVersion: string;
15
+ device: DeviceInfo;
16
+ }
17
+ interface ScreenEvent {
18
+ type: 'screen';
19
+ ts: number;
20
+ width: number;
21
+ height: number;
22
+ scale: number;
23
+ orientation: 'portrait' | 'landscape';
24
+ }
25
+ interface LifecycleEvent {
26
+ type: 'lifecycle';
27
+ ts: number;
28
+ state: 'active' | 'background' | 'inactive';
29
+ }
30
+ interface NavigationEvent {
31
+ type: 'navigation';
32
+ ts: number;
33
+ from?: string;
34
+ to: string;
35
+ }
36
+ interface TouchEvent {
37
+ type: 'touch';
38
+ ts: number;
39
+ x: number;
40
+ y: number;
41
+ screenX?: number;
42
+ screenY?: number;
43
+ kind: 'start' | 'move' | 'end' | 'tap' | 'long-press';
44
+ }
45
+ interface ErrorEvent {
46
+ type: 'error';
47
+ ts: number;
48
+ message: string;
49
+ stack?: string;
50
+ name?: string;
51
+ fatal: boolean;
52
+ }
53
+ interface LogEvent {
54
+ type: 'log';
55
+ ts: number;
56
+ level: 'info' | 'warn' | 'error';
57
+ message: string;
58
+ }
59
+ interface IdentifyEvent {
60
+ type: 'identify';
61
+ ts: number;
62
+ userId: string | null;
63
+ traits?: Record<string, unknown>;
64
+ }
65
+ interface NetworkEvent {
66
+ type: 'network';
67
+ ts: number;
68
+ method: string;
69
+ url: string;
70
+ status?: number;
71
+ durationMs?: number;
72
+ error?: string;
73
+ }
74
+ interface WireframeNode {
75
+ id: number;
76
+ type: string;
77
+ className?: string;
78
+ x: number;
79
+ y: number;
80
+ w: number;
81
+ h: number;
82
+ width?: number;
83
+ height?: number;
84
+ bg?: string;
85
+ backgroundColor?: string;
86
+ text?: string;
87
+ masked?: boolean;
88
+ tag?: number;
89
+ accessibilityIdentifier?: string;
90
+ accessibilityLabel?: string;
91
+ children?: WireframeNode[];
92
+ }
93
+ interface WireframeEvent {
94
+ type: 'wireframe';
95
+ ts: number;
96
+ version: number;
97
+ nodes: WireframeNode[];
98
+ }
99
+ type ReplayEvent = MetaEvent | ScreenEvent | LifecycleEvent | NavigationEvent | TouchEvent | ErrorEvent | LogEvent | IdentifyEvent | NetworkEvent | WireframeEvent;
100
+ interface BackendEvent {
101
+ type: string;
102
+ timestamp: number;
103
+ sessionId: string;
104
+ data: unknown;
105
+ }
106
+ interface ReplayBatch {
107
+ projectId: string;
108
+ sessionId: string;
109
+ events: BackendEvent[];
110
+ sentAt: number;
111
+ anonId?: string;
112
+ sdkVersion?: string;
113
+ }
114
+ interface ClintplayReactNativeConfig {
115
+ apiUrl: string;
116
+ apiKey?: string;
117
+ projectId?: string;
118
+ anonId?: string;
119
+ flushIntervalMs?: number;
120
+ flushSize?: number;
121
+ maxBufferSize?: number;
122
+ enabled?: boolean;
123
+ debug?: boolean;
124
+ sampleRate?: number;
125
+ captureNetwork?: boolean;
126
+ captureConsole?: boolean;
127
+ captureConsoleLog?: boolean;
128
+ captureWireframe?: boolean;
129
+ wireframeIntervalMs?: number;
130
+ sanitizeUrl?: (url: string) => string;
131
+ excludeEventTypes?: ReadonlyArray<EventType>;
132
+ asyncStorage?: AsyncStorageLike;
133
+ }
134
+ interface AsyncStorageLike {
135
+ setItem(key: string, value: string): Promise<void>;
136
+ getItem(key: string): Promise<string | null>;
137
+ removeItem(key: string): Promise<void>;
138
+ getAllKeys(): Promise<readonly string[]>;
139
+ multiRemove(keys: readonly string[]): Promise<void>;
140
+ }
141
+
142
+ declare const CLINTPLAY_MASK_ID = "clintplay-mask";
143
+ interface ClintplayMaskViewProps extends ViewProps {
144
+ children?: React.ReactNode;
145
+ }
146
+ declare const ClintplayMaskView: React.ForwardRefExoticComponent<ClintplayMaskViewProps & React.RefAttributes<View>>;
147
+
148
+ type ClintplayMaskTextInputProps = TextInputProps;
149
+ declare const ClintplayMaskTextInput: React.ForwardRefExoticComponent<TextInputProps & React.RefAttributes<TextInput>>;
150
+
151
+ type ClintplayMaskImageProps = ImageProps;
152
+ declare const ClintplayMaskImage: React.ForwardRefExoticComponent<ImageProps & React.RefAttributes<Image>>;
153
+
154
+ interface ClintplayCaptureProviderProps extends ViewProps {
155
+ children?: React.ReactNode;
156
+ style?: StyleProp<ViewStyle>;
157
+ enabled?: boolean;
158
+ }
159
+ declare function ClintplayCaptureProvider({ children, style, enabled, onTouchStart, onTouchEnd, onTouchCancel, ...rest }: ClintplayCaptureProviderProps): react_jsx_runtime.JSX.Element;
160
+
161
+ interface NavigationRouteLike {
162
+ key?: string;
163
+ name?: string;
164
+ params?: Record<string, unknown>;
165
+ state?: NavigationStateLike | unknown;
166
+ }
167
+ interface NavigationStateLike {
168
+ key?: string;
169
+ index?: number;
170
+ routes?: NavigationRouteLike[];
171
+ routeNames?: string[];
172
+ [key: string]: unknown;
173
+ }
174
+ type NavigationStateListenerCallback = (to: string, from?: string) => void;
175
+ interface NavigationStateListenerOptions {
176
+ /**
177
+ * Initial previous route name if known.
178
+ */
179
+ initialRouteName?: string;
180
+ /**
181
+ * Optional custom callback invoked when the route changes.
182
+ */
183
+ onRouteChanged?: NavigationStateListenerCallback;
184
+ }
185
+ /**
186
+ * Sanitizes a route name or pathname by stripping query parameters (?token=...)
187
+ * and fragments (#section...).
188
+ */
189
+ declare function sanitizeRoute(route?: string): string | undefined;
190
+ /**
191
+ * Traverses a nested React Navigation state tree to extract the active leaf route name.
192
+ */
193
+ declare function getActiveRouteName(state: unknown, depth?: number): string | undefined;
194
+ /**
195
+ * Creates an `onStateChange` listener for React Navigation's `<NavigationContainer>`.
196
+ * Automatically extracts the active leaf screen name and emits a `navigation` event
197
+ * while preventing duplicate consecutive emissions.
198
+ */
199
+ declare function createClintplayNavigationStateListener(options?: NavigationStateListenerOptions | NavigationStateListenerCallback): (state: unknown) => void;
200
+ interface ClintplayNavigationTrackerProps {
201
+ children?: React.ReactNode | ((props: {
202
+ onStateChange: (state: unknown) => void;
203
+ }) => React.ReactNode);
204
+ pathname?: string;
205
+ onStateChange?: (state: unknown) => void;
206
+ initialRouteName?: string;
207
+ onRouteChanged?: NavigationStateListenerCallback;
208
+ }
209
+ /**
210
+ * Navigation tracker component for React Navigation and Expo Router.
211
+ * Can be used as a wrapper, helper, or render-prop provider around `<NavigationContainer>`,
212
+ * or as a standalone tracker component `<ClintplayNavigationTracker pathname={pathname} />`.
213
+ */
214
+ declare function ClintplayNavigationTracker({ children, pathname, onStateChange, initialRouteName, onRouteChanged, }: ClintplayNavigationTrackerProps): react_jsx_runtime.JSX.Element;
215
+
216
+ interface UseClintplayNavigationOptions {
217
+ /**
218
+ * Initial previous route name if known.
219
+ */
220
+ from?: string;
221
+ /**
222
+ * Optional custom callback triggered on screen change.
223
+ */
224
+ onRouteChanged?: (to: string, from?: string) => void;
225
+ }
226
+ interface UseClintplayNavigationResult {
227
+ (state: unknown): void;
228
+ onStateChange: (state: unknown) => void;
229
+ trackScreen: (to: string, from?: string) => void;
230
+ }
231
+ /**
232
+ * Resets the shared last tracked route. Used primarily for test isolation.
233
+ */
234
+ declare function _resetLastTrackedRoute(): void;
235
+ /**
236
+ * Hook for automatic or manual screen tracking in React Native and Expo Router.
237
+ *
238
+ * Usage:
239
+ *
240
+ * 1. Screen-level tracking (Expo Router or per-screen):
241
+ * ```tsx
242
+ * const pathname = usePathname();
243
+ * useClintplayNavigationTracking(pathname);
244
+ * ```
245
+ *
246
+ * 2. NavigationContainer onStateChange helper:
247
+ * ```tsx
248
+ * const { onStateChange } = useClintplayNavigationTracking();
249
+ * <NavigationContainer onStateChange={onStateChange} />
250
+ * ```
251
+ */
252
+ declare function useClintplayNavigationTracking(routeNameOrPath?: string, options?: UseClintplayNavigationOptions): UseClintplayNavigationResult;
253
+
254
+ declare const SDK_VERSION: string;
255
+ declare function formatEventForBatch(event: ReplayEvent | BackendEvent, defaultSessionId: string): BackendEvent;
256
+ declare function init(rawConfig: ClintplayReactNativeConfig): void;
257
+ declare function identify(userId: string | null, traits?: Record<string, unknown>): void;
258
+ declare function reset(options?: {
259
+ clearOfflineQueue?: boolean;
260
+ }): void;
261
+ declare function trackScreen(path: string, from?: string): void;
262
+ declare function reportError(err: unknown): void;
263
+ declare function flush(): Promise<void>;
264
+ declare function stop(): Promise<void>;
265
+ declare function current(): {
266
+ sessionId: string;
267
+ userId: string | null;
268
+ } | null;
269
+ declare const Clintplay: {
270
+ init: typeof init;
271
+ identify: typeof identify;
272
+ reset: typeof reset;
273
+ trackScreen: typeof trackScreen;
274
+ reportError: typeof reportError;
275
+ flush: typeof flush;
276
+ stop: typeof stop;
277
+ current: typeof current;
278
+ };
279
+
280
+ export { type BackendEvent, CLINTPLAY_MASK_ID, Clintplay, ClintplayCaptureProvider, type ClintplayCaptureProviderProps, ClintplayMaskImage, type ClintplayMaskImageProps, ClintplayMaskTextInput, type ClintplayMaskTextInputProps, ClintplayMaskView, type ClintplayMaskViewProps, ClintplayNavigationTracker, type ClintplayNavigationTrackerProps, type ClintplayReactNativeConfig, type DeviceInfo, type NavigationRouteLike, type NavigationStateLike, type NavigationStateListenerCallback, type NavigationStateListenerOptions, type ReplayBatch, type ReplayEvent, SDK_VERSION, type UseClintplayNavigationOptions, type UseClintplayNavigationResult, type WireframeEvent, type WireframeNode, _resetLastTrackedRoute, createClintplayNavigationStateListener, formatEventForBatch, getActiveRouteName, sanitizeRoute, useClintplayNavigationTracking };