import type { AccidentDetectionSensitivity, ApiLanguage, DeviceIdRegistrationState, Tag, TrackingState } from './types'; import { TrackingMode } from './types'; /** * High-level React Native API for interacting with the native Telematics SDK. * * This module is a thin wrapper around the platform-native SDK exposed through React Native. * Most methods forward directly to the underlying native implementation. * * Typical usage: * 1. Create an instance via {@link createTelematicsSdk}. * 2. Initialize on the native side via {@link TelematicsSdk.initializeSdk}. * 3. Configure the virtual device id/token via {@link TelematicsSdk.setDeviceId}. * 4. Start tracking via {@link TelematicsSdk.startManualTracking} or {@link TelematicsSdk.startTrackAsPersistent}. */ export interface TelematicsSdk { /** * Initializes the native SDK. * * This is typically the first call you make before using any other API. */ initializeSdk(): Promise; /** Returns whether the native SDK is initialized. */ isInitializedSdk(): Promise; /** Returns the current virtual device identifier (token) configured in the native SDK. */ getDeviceId(): Promise; /** Returns the latest known device identifier registration state. */ getDeviceIdRegistrationState(): Promise; /** * Sets the virtual device identifier (token) used by the native SDK. * * Passing a non-empty value typically associates the SDK session with a backend user/device. */ setDeviceId(deviceId: string): Promise; /** * Performs a full logout on the native SDK. * * Typically disables the SDK and clears the stored device token. */ logout(): Promise; /** * Checks whether all required permissions and sensors are granted/available. * * This usually includes Location + Motion (and other platform-specific requirements). */ isAllRequiredPermissionsAndSensorsGranted(): Promise; /** Returns whether the native SDK is currently enabled. */ isSdkEnabled(): Promise; /** Returns whether tracking is currently active on the native side. */ isTracking(): Promise; /** * Enables or disables the native SDK globally. * * Disabling the SDK typically stops tracking and background activity. */ setEnableSdk(enable: boolean): Promise; /** Starts tracking manually. */ startManualTracking(): Promise; /** Starts persistent tracking manually (continues across background/app restarts). */ startTrackAsPersistent(): Promise; /** Stops tracking manually. */ stopManualTracking(): Promise; /** Sets the maximum duration, in minutes, for a single persistent tracking session. */ setMaxPersistentTrackingInterval(minutes: number): Promise; /** Returns the maximum duration, in minutes, for a single persistent tracking session. */ getMaxPersistentTrackingInterval(): Promise; /** Sets whether SDK-started and manually-started tracking runs in standard or persistent mode. */ setTrackingMode(trackingMode: TrackingMode): Promise; /** Returns the current tracking mode. */ getTrackingMode(): Promise; /** Returns the current automatic and manual tracking availability state. */ getTrackingState(): Promise; /** Triggers upload of locally stored, unsent trips if any. */ uploadUnsentTrips(): Promise; /** Returns the number of unsent trips currently stored locally by the native SDK. */ getUnsentTripCount(): Promise; /** * Sends a custom heartbeat to the native SDK with an application-defined reason. * * @param reason A string used for analytics on the backend. */ sendCustomHeartbeats(reason: string): Promise; /** * Shows the native permissions wizard UI. * * @param enableAggressivePermissionsWizard If `true`, the wizard finishes only when all required permissions are granted. * @param enableAggressivePermissionsWizardPage If `true`, the wizard auto-advances when permissions are granted on the current page. * @returns `true` when all required permissions are granted after the wizard, otherwise `false`. */ showPermissionWizard(enableAggressivePermissionsWizard: boolean, enableAggressivePermissionsWizardPage: boolean): Promise; /** Sets accident detection sensitivity in the native SDK. */ setAccidentDetectionSensitivity(accidentDetectionSensitivity: AccidentDetectionSensitivity): Promise; /** Returns whether RTLD (real-time data logging) is enabled in the native SDK. */ isRTLDEnabled(): Promise; /** Enables or disables accident detection in the native SDK. */ enableAccidents(enable: boolean): Promise; /** Returns whether accident detection is enabled in the native SDK. */ isEnabledAccidents(): Promise; /** Requests the current list of Future Track tags from the native SDK. */ getFutureTrackTags(): Promise<{ status: string; tags: Tag[]; }>; /** * Adds a Future Track tag. * * @param tag Tag identifier. * @param source Optional source string (e.g. feature/module name). */ addFutureTrackTag(tag: string, source?: string): Promise<{ status: string; tag: Tag; }>; /** * Removes a Future Track tag. * * @param tag Tag identifier. * @param source Optional source string. Android accepts it for API compatibility and removes by tag. */ removeFutureTrackTag(tag: string, source?: string): Promise<{ status: string; tag: Tag; }>; /** Removes all Future Track tags. */ removeAllFutureTrackTags(): Promise; /** * Enables speed limit monitoring and configures speed violation parameters. */ registerSpeedViolations(params: { speedLimitKmH: number; speedLimitTimeout: number; }): Promise; /** iOS only: returns whether aggressive heartbeat mode is enabled. */ isAggressiveHeartbeats(): Promise; /** iOS only: enables or disables aggressive heartbeat mode. */ setAggressiveHeartbeats(enable: boolean): Promise; /** iOS only: disables or enables user-initiated tracking. */ setDisableTracking(value: boolean): Promise; /** iOS only: returns whether user-initiated tracking is disabled. */ isDisableTracking(): Promise; /** iOS only: returns whether the native SDK considers current location accuracy insufficient. */ isWrongAccuracyState(): Promise; /** iOS only: requests "Always" location permission from the system. */ requestIOSLocationAlwaysPermission(): Promise; /** iOS only: requests Motion/Fitness permission from the system. */ requestIOSMotionPermission(): Promise; /** iOS only: returns the API language configured in the native SDK. */ getApiLanguage(): Promise; /** iOS only: sets the API language used by the native SDK. */ setApiLanguage(language: ApiLanguage): Promise; /** * Android only: enables or disables SDK autostart behavior. * * @param params.enable Whether autostart is enabled. * @param params.permanent Whether the choice should be persisted permanently. */ setAndroidAutoStartEnabled(params: { enable: boolean; permanent: boolean; }): Promise; /** Android only: returns whether SDK autostart is enabled. */ isAndroidAutoStartEnabled(): Promise; } /** Creates a high-level JS wrapper around the native Telematics SDK module. */ export declare function createTelematicsSdk(): TelematicsSdk; //# sourceMappingURL=TelematicsSdk.d.ts.map