import type { RadarConfigResponse, RadarTrackResponse, RadarMetadata, RadarResponse } from 'radar-sdk-js'; declare module 'radar-sdk-js' { interface TrackBodyExtension { /** An optional reason, displayed in the dashboard and reports. */ reason?: string; /** An optional transaction ID, displayed in the dashboard and reports. */ transactionId?: string; /** The Radar ID from a previous reveal risk call. */ revealRiskId?: string; } } /** Parameters for {@link RadarFraud.trackVerified} and {@link RadarFraud.getVerifiedLocationToken}. */ export interface RadarTrackVerifiedParams { /** A stable unique ID for the user. If not set, falls back to the value from {@link Radar.setUserId}. */ userId?: string; /** A description for the user. If not set, falls back to the value from {@link Radar.setDescription}. */ description?: string; /** A set of custom key-value pairs for the user. Must have 16 or fewer keys and values of type string, boolean, or number. If not set, falls back to the value from {@link Radar.setMetadata}. */ metadata?: RadarMetadata; /** * Determines whether to skip the Radar Verify app and use the no-download solution instead. * @default false */ skipVerifyApp?: boolean; /** An optional reason, displayed in the dashboard and reports. */ reason?: string; /** An optional transaction ID, displayed in the dashboard and reports. */ transactionId?: string; } /** Parameters for {@link RadarFraud.startTrackingVerified}. */ export interface RadarStartTrackingVerifiedParams { /** * The default interval in seconds between each location update. * @default 300 */ interval?: number; /** * Determines whether to skip the Radar Verify app and use the no-download solution instead. * @default false */ skipVerifyApp?: boolean; /** * Determines whether to listen for IP changes. * @default false */ ipChanges?: boolean; } /** Response from verified tracking. */ export interface RadarTrackVerifiedResponse extends RadarTrackResponse { /** A signed JSON Web Token (JWT) containing the user and array of events. Verify the token server-side using your secret key. */ token: string; /** The datetime when the token expires. */ expiresAt: Date; /** The number of seconds until the token expires. */ expiresIn: number; /** A boolean indicating whether the user passed all jurisdiction and fraud detection checks. */ passed: boolean; /** An array of failure reasons for jurisdiction and fraud detection checks. */ failureReasons: string[]; /** The Radar ID of the location check. */ _id: string; } export interface RadarPingResponse { ip: string; } export interface RadarFraudConfigResponse extends RadarConfigResponse { dk?: string; } export type RadarRevealRiskLevel = 'none' | 'low' | 'medium' | 'high'; export interface RadarRevealRisk { level: RadarRevealRiskLevel; reasons: string[]; } interface GeoJSONPoint { type: 'Point'; coordinates: number[]; } export interface RadarRevealRiskNetworkIpAddress { countryCode?: string; country?: string; countryFlag?: string; state?: string; city?: string; postalCode?: string; latitude?: number; longitude?: number; connectionType?: string; stateCode?: string; stateConfidence?: string; countryConfidence?: string; dma?: string; dmaCode?: string; stateAllowed?: boolean; countryAllowed?: boolean; layer?: string; geometry?: GeoJSONPoint; ip: string; } export interface RadarRevealRiskNetworkPrivacy { hosting?: boolean; proxy?: boolean; relay?: boolean; service?: string; tor?: boolean; vpn?: boolean; residentialProxy?: boolean; } export interface RadarRevealRiskNetworkAsn { asn?: string; country?: string; domain?: string; name?: string; network?: string; type?: string; } export interface RadarRevealRiskNetwork { ipAddress?: RadarRevealRiskNetworkIpAddress; privacy?: RadarRevealRiskNetworkPrivacy; asn?: RadarRevealRiskNetworkAsn; } export interface RadarRevealRiskDevice { deviceId?: string; deviceType?: string; deviceMake?: string; deviceModel?: string; deviceOSName?: string; deviceOSVersion?: string; sdkVersion?: string; xPlatformType?: string; installId?: string; appId?: string; appName?: string; appVersion?: string; appBuild?: string; userAgent?: string; browserName?: string; browserVersion?: string; browserEngine?: string; browserEngineVersion?: string; } export interface RadarRevealRiskResponse extends RadarResponse { _id: string; risk: RadarRevealRisk; network: RadarRevealRiskNetwork; device: RadarRevealRiskDevice; token?: string; expiresAt?: Date; expiresIn?: number; } export {};