sitepong 0.2.7 → 0.2.9

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.
@@ -1,4 +1,5 @@
1
1
  import React, { ReactNode, ReactElement } from 'react';
2
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
3
 
3
4
  /**
4
5
  * Platform-agnostic storage interface.
@@ -771,6 +772,78 @@ interface WatchtowerProviderProps {
771
772
  */
772
773
  declare function WatchtowerProvider(props: WatchtowerProviderProps): React.ReactElement;
773
774
 
775
+ interface StructuralCaptureConfig {
776
+ /** Ingest base URL, e.g. https://ingest.sitepong.com */
777
+ endpoint: string;
778
+ /** Project API key (sent as X-API-Key). */
779
+ apiKey: string;
780
+ /** Project id (sent as X-Project-ID for the ingest cross-check). */
781
+ projectId?: string;
782
+ /** Stable session id (defaults to a generated one). */
783
+ sessionId?: string;
784
+ /** Wire platform label, e.g. react-native-ios. */
785
+ platform?: string;
786
+ sampleIntervalMs?: number;
787
+ flushIntervalMs?: number;
788
+ debug?: boolean;
789
+ }
790
+ declare class StructuralCapture {
791
+ private readonly recorder;
792
+ private currentIndex;
793
+ private started;
794
+ private sampleTimer;
795
+ private flushTimer;
796
+ private screen;
797
+ private prevScreen;
798
+ private cfg;
799
+ private sessionId;
800
+ private running;
801
+ private sentCount;
802
+ private flushing;
803
+ private readonly scrollOffsets;
804
+ private overloadSkip;
805
+ private appStateSub;
806
+ private readonly teardowns;
807
+ private now;
808
+ isRunning(): boolean;
809
+ getSessionId(): string;
810
+ start(cfg: StructuralCaptureConfig): void;
811
+ /** Best-effort flush the pre-crash tail before the app tears down. */
812
+ private installCrashFlush;
813
+ /** Flush on background/inactive so timer suspension doesn't strand the tail. */
814
+ private installBackgroundFlush;
815
+ private sample;
816
+ setScreen(name: string): void;
817
+ /** Resolve a native touch to a node + emit a tap. `target` is the RN
818
+ * nativeTag from `nativeEvent.target`. */
819
+ handleTap(target: number, pageX: number, pageY: number): void;
820
+ /** Feed a scroll/drag delta from a touch onto the nearest scrollable ancestor
821
+ * of the touched node. `target` is the RN nativeTag under the finger; `dx`/`dy`
822
+ * are content-offset deltas (px, sign = content motion). Native-driven scroll
823
+ * never reaches the fiber walk, so this is the only way the replay can ride the
824
+ * scroll instead of freezing on a stale frame. */
825
+ handleScroll(target: number, dx: number, dy: number): void;
826
+ /** Public best-effort flush — used by the shared RN error handler to push the
827
+ * pre-crash tail (the in-class ErrorUtils hook covers apps that don't call
828
+ * setupRNErrorHandler; both are idempotent via the `flushing` guard). */
829
+ flushNow(): Promise<void>;
830
+ private flush;
831
+ stop(): Promise<void>;
832
+ }
833
+ /** Process-wide singleton (one capture per app session). */
834
+ declare const structuralCapture: StructuralCapture;
835
+
836
+ interface StructuralCaptureProviderProps extends Omit<StructuralCaptureConfig, 'sessionId'> {
837
+ sessionId?: string;
838
+ children: React.ReactNode;
839
+ }
840
+ declare function StructuralCaptureProvider({ children, ...cfg }: StructuralCaptureProviderProps): react_jsx_runtime.JSX.Element;
841
+ /** Mark the active screen (drives screen_view + navigation outcome detection). */
842
+ declare function useStructuralScreen(name: string): void;
843
+
844
+ /** Install the commit hook once. Safe to call repeatedly. */
845
+ declare function installStructuralHook(): void;
846
+
774
847
  /**
775
848
  * React Native Network Interception
776
849
  *
@@ -1164,4 +1237,4 @@ declare function reportConversion(props?: Record<string, unknown>): Promise<bool
1164
1237
  */
1165
1238
  declare function setRNStorage(storage: StorageAdapter | null): void;
1166
1239
 
1167
- export { type AsyncStorageLike, type DeferredDeepLinkHandler, type ErrorContext, type GroupTraits, type IconSpec, type LiveActivityAttributes, type LiveActivityContentState, type NavigationRef, type NavigationTrackerOptions, type NetworkInterceptionOptions, type ProgressSpec, RNAutocaptureModule, type RNAutocaptureOptions, type RNDeviceInfo, type RNErrorHandlerOptions, RNPerformanceManager, type RemoteConfig, type ScreenRecordingConfig, SensitiveView, type SitePongConfig, type SitePongInitConfig, SitePongRNProvider, type SitePongRNProviderProps, type StartLiveActivityOptions, type StartedLiveActivity, type SuperLinkConfig, type SuperLinkDeepLink, type SuperLinkEventType, type SuperLinkFingerprint, type SuperLinkIdentityMetadata, type SuperLinkMatchType, type SuperLinkPlatform, type SymbolWeight, type TextStyle, type TextWeight, type TrackProperties, type TrackedDatabaseOptions, type UserTraits, type WatchtowerConfig, WatchtowerProvider, type WatchtowerProviderProps, type WidgetSyncOptions, addBreadcrumb, addSensitiveView, areFlagsReady, areLiveActivitiesEnabled, captureError, captureMessage, clearAnonymousId, clearUser, collectDeviceInfo, completeFromScan, createAsyncStorageAdapter, createNavigationTracker, createSuperLinkListener, createTrackedDatabase, endLiveActivity, fetchNativeDeviceSignals, fetchPersistentDeviceId, flush, flushScreenRecording, flushScreenRecordingOnError, getAllFlags, getAnonymousId, getFlag, getMatchedDeepLink, getRemoteConfig, getVariant, getVariantPayload, getWatchtowerSessionId, group, handleUniversalLink, identify$1 as identify, initRN, initSuperLinkRN, isInitialized, isRemoteConfigFeatureEnabled, isScreenRecording, markColdStart, onDeferredDeepLink, onPushTokenUpdate, onRemoteConfigChange, parseUniversalLink, refreshFlags, registerDeviceToken, registerLiveActivityToken, registerPushToStartToken, registerPushToken, removeSensitiveView, reportConversion, resetAnalytics, setAnonymousId, setContext, setCurrentScreen, setRNStorage, setTags, setUser, setWatchtowerUser, setupNetworkInterception, setupRNErrorHandler, startLiveActivity, startScreenRecording, startWatchtower, stopScreenRecording, stopWatchtower, stopWidgetSync, subscribeNavigationToWatchtower, identify as superlinkIdentify, syncWidgets, track, triggerWidgetRefresh, updateLiveActivity, updateWidgetData, useAppState, useRNPerformance, useRemoteConfig, useScreenTrack, useSitePongRNContext, waitForFlags };
1240
+ export { type AsyncStorageLike, type DeferredDeepLinkHandler, type ErrorContext, type GroupTraits, type IconSpec, type LiveActivityAttributes, type LiveActivityContentState, type NavigationRef, type NavigationTrackerOptions, type NetworkInterceptionOptions, type ProgressSpec, RNAutocaptureModule, type RNAutocaptureOptions, type RNDeviceInfo, type RNErrorHandlerOptions, RNPerformanceManager, type RemoteConfig, type ScreenRecordingConfig, SensitiveView, type SitePongConfig, type SitePongInitConfig, SitePongRNProvider, type SitePongRNProviderProps, type StartLiveActivityOptions, type StartedLiveActivity, StructuralCapture, type StructuralCaptureConfig, StructuralCaptureProvider, type StructuralCaptureProviderProps, type SuperLinkConfig, type SuperLinkDeepLink, type SuperLinkEventType, type SuperLinkFingerprint, type SuperLinkIdentityMetadata, type SuperLinkMatchType, type SuperLinkPlatform, type SymbolWeight, type TextStyle, type TextWeight, type TrackProperties, type TrackedDatabaseOptions, type UserTraits, type WatchtowerConfig, WatchtowerProvider, type WatchtowerProviderProps, type WidgetSyncOptions, addBreadcrumb, addSensitiveView, areFlagsReady, areLiveActivitiesEnabled, captureError, captureMessage, clearAnonymousId, clearUser, collectDeviceInfo, completeFromScan, createAsyncStorageAdapter, createNavigationTracker, createSuperLinkListener, createTrackedDatabase, endLiveActivity, fetchNativeDeviceSignals, fetchPersistentDeviceId, flush, flushScreenRecording, flushScreenRecordingOnError, getAllFlags, getAnonymousId, getFlag, getMatchedDeepLink, getRemoteConfig, getVariant, getVariantPayload, getWatchtowerSessionId, group, handleUniversalLink, identify$1 as identify, initRN, initSuperLinkRN, installStructuralHook, isInitialized, isRemoteConfigFeatureEnabled, isScreenRecording, markColdStart, onDeferredDeepLink, onPushTokenUpdate, onRemoteConfigChange, parseUniversalLink, refreshFlags, registerDeviceToken, registerLiveActivityToken, registerPushToStartToken, registerPushToken, removeSensitiveView, reportConversion, resetAnalytics, setAnonymousId, setContext, setCurrentScreen, setRNStorage, setTags, setUser, setWatchtowerUser, setupNetworkInterception, setupRNErrorHandler, startLiveActivity, startScreenRecording, startWatchtower, stopScreenRecording, stopWatchtower, stopWidgetSync, structuralCapture, subscribeNavigationToWatchtower, identify as superlinkIdentify, syncWidgets, track, triggerWidgetRefresh, updateLiveActivity, updateWidgetData, useAppState, useRNPerformance, useRemoteConfig, useScreenTrack, useSitePongRNContext, useStructuralScreen, waitForFlags };