/*! * Copyright 2026 - Vexo Inc * * Public entry point. The implementation lives in plain-JS modules under * ./vexo; this file pins the public API's types so `react-native-builder-bob` * can generate real declaration files from the build instead of a * hand-maintained ambient d.ts (see issue #66). */ import type { ComponentType, ReactNode } from 'react'; export interface VexoMaskProps { children?: ReactNode; /** Forwarded to the underlying view (layout only; does not affect masking). */ style?: unknown; [prop: string]: unknown; } export interface VexoOptions { /** * Set to `false` to keep session replay (the native screen recorder and * privacy blur) off on this device. The choice is made client-side before * any native recorder call — server-side settings can further restrict * recording but never re-enable it. All other tracking keeps working. * Omitted or `true` keeps the default behavior. In-memory only: calling * `vexo()` again overwrites it. */ sessionReplay?: boolean; /** * Fraction of sessions (0 to 1) to record session replay for — a client-side * cost lever. `0.1` records ~10% of sessions; the decision is made once per * session on-device (no server round-trip) and applies only to replay, event * capture stays at 100%. Omitted (or an out-of-range value) records every * session. Server-side config and `sessionReplay: false` still take * precedence and can further restrict — sampling never re-enables recording * they turned off. In-memory only: calling `vexo()` again overwrites it. */ sessionReplaySampleRate?: number; /** * Set to `false` to disable mobile performance capture (app-start latency, * per-screen render timing, and JS-thread slow/frozen frame counts) on this * device. Omitted or `true` keeps the default behavior. In-memory only: * calling `vexo()` again overwrites it. All other tracking keeps working. */ performance?: boolean; /** * Coarse session-replay masking defaults, applied natively on-device before * each frame leaves the app. For per-view control wrap sensitive subtrees in * `` (and `` to opt back out). Secure/password text * inputs are always masked regardless of these flags. */ masking?: { /** Mask every `` node. Default `false`. */ maskAllText?: boolean; /** Mask every ``. Default `true`. */ maskAllTextInputs?: boolean; /** Mask every ``. Default `false`. */ maskAllImages?: boolean; }; } /** * Initializes Vexo. * * @param apiKey - The app's API key * @param options - Optional settings, e.g. `{ sessionReplay: false }` to * disable session replay in code. * * Check out {@link https://docs.vexo.co} for more information. */ export declare const vexo: (apiKey: string, options?: VexoOptions) => void; /** * Assigns a custom unique identifier to the device. * * @param id - Identifier * * Check out {@link https://docs.vexo.co/features} for more information. */ export declare const identifyDevice: (id: string | null) => Promise; /** * Enables tracking of user events. * * Check out {@link https://docs.vexo.co/features} for more information. */ export declare const enableTracking: () => Promise; /** * Disables tracking of user events. * * Check out {@link https://docs.vexo.co/features} for more information. */ export declare const disableTracking: () => Promise; /** * Creates a custom event. * * @param name - Name of the event * @param args - Additional arguments * * Check out {@link https://docs.vexo.co/features} for more information. */ export declare const customEvent: (name: string, args: object) => void; /** * Registers global "super" properties merged into every subsequent event's * args (Mixpanel `register()` style). Call it once (e.g. after login) to attach * fields like `plan`, `ab_bucket`, or `tenant_id` to all events without * threading them through every `customEvent` call. Repeated calls merge; * a matching per-event `customEvent` key wins over the global. In-memory per * session. * * @param props - Object of scalar properties to attach to every event. * * Check out {@link https://docs.vexo.co/features} for more information. */ export declare const registerProperties: (props: Record) => void; /** * Reports a caught exception without crashing the app. * * @param error - The error (or any value) to report * @param options - Pass `{ handled: false }` to count the error against the * crash-free rate; defaults to a handled (non-crash) error. * * Check out {@link https://docs.vexo.co/features} for more information. */ export declare const trackError: (error: unknown, options?: { handled?: boolean; }) => void; /** * Tags subsequent taps and heatmap screenshots with a segment label. * * @param value - Segment name (1 to 64 characters). Pass null, undefined or '' * to clear it. * * Check out {@link https://docs.vexo.co/features} for more information. */ export declare const setHeatmapSegment: (value: string | null | undefined) => void; /** * Manually record a screen change for navigators the `vexo()` render * auto-patch does not cover — react-native-navigation (Wix) and custom / * in-house navigation. Emits the same screen event and drives the same route * pipeline (heatmaps, per-screen render timing, crash `route`) as the * react-navigation / Expo Router auto-attach. * * Composes with auto-attach: repeating the current route is a no-op, so an * overlap does not double-count. Use `trackScreen` OR auto-attach for a given * navigator, not both. This is the escape hatch alongside {@link VexoProvider}. * * @param name - The screen / route name (non-empty string) * @param properties - Optional extra properties to attach to the screen event * * Check out {@link https://docs.vexo.co/features} for more information. */ export declare const trackScreen: (name: string, properties?: object) => void; export interface VexoProviderProps { /** The app's API key. */ apiKey: string; /** The navigation container component to wrap, e.g. NavigationContainer. */ container: ComponentType; onReady?: () => void; onStateChange?: (state: unknown) => void; children?: ReactNode; /** Remaining props are forwarded to the wrapped container. */ [prop: string]: unknown; } /** * Explicit alternative to the render auto-patch performed by `vexo()`: * wrap your navigation container yourself. Use this when auto-attach warns * that it could not patch your navigation library. * * ```jsx * * * * ``` */ export declare const VexoProvider: ComponentType; /** * Marks a subtree as sensitive: the native session-replay recorder redacts its * on-screen rect (a solid block) before the frame leaves the device. Independent * of the global `isBlurred` blur. * * ```jsx * * ``` */ export declare const VexoMask: ComponentType; /** * Opts a subtree back out of masking — an escape hatch inside a `` or * against the `masking` defaults (e.g. `maskAllText`). */ export declare const VexoUnmask: ComponentType; //# sourceMappingURL=index.d.ts.map