declare module "@sentiance-react-native/crash-detection" { import { EmitterSubscription } from "react-native"; export interface Location { timestamp: number; latitude: number; longitude: number; accuracy?: number; altitude?: number; provider?: string; // Android only } export interface CrashEvent { time: number; location: Location; precedingLocations: Location[]; magnitude: number; speedAtImpact: number; deltaV: number; confidence: number; severity: CrashSeverity; readonly detectorMode: CrashDetectorMode; } export type VehicleCrashDetectionState = "CANDIDATE_DETECTED" | "CANDIDATE_DISCARDED_WEAK_IMPACT" | "CANDIDATE_DISCARDED_NON_VEHICLE_TRANSPORT_MODE" | "CANDIDATE_DISCARDED_PRE_IMPACT_NOISE" | "CANDIDATE_DISCARDED_LOW_SPEED_BEFORE_IMPACT" | "CANDIDATE_DISCARDED_POST_IMPACT_NOISE" | "CANDIDATE_DISCARDED_HIGH_SPEED_AFTER_IMPACT" | "CANDIDATE_DISCARDED_BAD_LOCATION_ACCURACY_BEFORE_IMPACT" | "CANDIDATE_NOT_DETECTED"; export type CrashSeverity = "UNAVAILABLE" | "LOW" | "MEDIUM" | "HIGH"; export type CrashDetectorMode = "UNKNOWN" | "TWO_WHEELER" | "CAR"; export interface VehicleCrashDiagnostic { crashDetectionState: VehicleCrashDetectionState; crashDetectionStateDescription: string; } export interface SentianceCrashDetection { /** * @deprecated Use `addVehicleCrashEventListener` instead */ listenVehicleCrashEvents(): Promise; /** *

Invokes a dummy vehicle crash event. Use this method to test your vehicle crash detection integration.

* *

Calling this method will invoke the listener you previously set via * {@link addVehicleCrashEventListener} (if any). *

* *
*

Note that this method is intended only for testing your integration. It will not generate a real vehicle crash. *

*/ invokeDummyVehicleCrash(): Promise; /** *

Returns whether vehicle crash detection is supported on the device.

* *
*

The result depends on multiple criteria, such as if vehicle crash detection is enabled for the user, and if * the necessary sensors are present on the device. As such, make sure a Sentiance user has been created before * calling this function. Otherwise, the result will always be false. *

* * @return true if vehicle crash detection is supported. */ isVehicleCrashDetectionSupported(): Promise; /** *

Registers a listener that is invoked when a vehicle crash is detected.

* @param onVehicleCrash - the callback to be invoked when a vehicle crash is detected. * @returns a subscription object that you can use to unregister the listener you previously set. */ addVehicleCrashEventListener(onVehicleCrash: (crashEvent: CrashEvent) => void): Promise; /** *

Registers a listener that is invoked when vehicle crash diagnostic data becomes available.

* Use this function to receive diagnostic data while vehicle crash detection is running. * @param onVehicleCrashDiagnostic - the callback to be invoked with the received diagnostic data. * @returns a subscription object that you can use to unregister the listener you previously set. */ addVehicleCrashDiagnosticListener(onVehicleCrashDiagnostic: (diagnostic: VehicleCrashDiagnostic) => void): Promise; } const SentianceCrashDetection: SentianceCrashDetection; export default SentianceCrashDetection; }