declare module "@sentiance-react-native/user-context" { import { EmitterSubscription } from "react-native"; export type SegmentCategory = "LEISURE" | "MOBILITY" | "WORK_LIFE"; export type SegmentSubcategory = | "COMMUTE" | "DRIVING" | "ENTERTAINMENT" | "FAMILY" | "HOME" | "SHOPPING" | "SOCIAL" | "TRANSPORT" | "TRAVEL" | "WELLBEING" | "WINING_AND_DINING" | "WORK"; export type SegmentType = | "AGGRESSIVE_DRIVER" | "ANTICIPATIVE_DRIVER" | "BAR_GOER" | "CITY_DRIVER" | "CITY_HOME" | "CITY_WORKER" | "CULTURE_BUFF" | "DIE_HARD_DRIVER" | "DISTRACTED_DRIVER" | "DOG_WALKER" | "EARLY_BIRD" | "EASY_COMMUTER" | "EFFICIENT_DRIVER" | "FOODIE" | "FREQUENT_FLYER" | "FULLTIME_WORKER" | "GREEN_COMMUTER" | "HEALTHY_BIKER" | "HEALTHY_WALKER" | "HEAVY_COMMUTER" | "HOME_BOUND" | "HOMEBODY" | "HOMEWORKER" | "ILLEGAL_DRIVER" | "LATE_WORKER" | "LEGAL_DRIVER" | "LONG_COMMUTER" | "MOBILITY" | "MOBILITY__HIGH" | "MOBILITY__LIMITED" | "MOBILITY__MODERATE" | "MOTORWAY_DRIVER" | "MUSIC_LOVER" | "NATURE_LOVER" | "NIGHT_OWL" | "NIGHTWORKER" | "NORMAL_COMMUTER" | "PARTTIME_WORKER" | "PET_OWNER" | "PHYSICAL_ACTIVITY__HIGH" | "PHYSICAL_ACTIVITY__LIMITED" | "PHYSICAL_ACTIVITY__MODERATE" | "PUBLIC_TRANSPORTS_COMMUTER" | "PUBLIC_TRANSPORTS_USER" | "RECENTLY_CHANGED_JOB" | "RECENTLY_MOVED_HOME" | "RESTO_LOVER" | "RURAL_HOME" | "RURAL_WORKER" | "SHOPAHOLIC" | "SHORT_COMMUTER" | "SLEEP_DEPRIVED" | "SOCIAL_ACTIVITY" | "SOCIAL_ACTIVITY__HIGH" | "SOCIAL_ACTIVITY__LIMITED" | "SOCIAL_ACTIVITY__MODERATE" | "SPORTIVE" | "STUDENT" | "TOWN_HOME" | "TOWN_WORKER" | "UBER_PARENT" | "WORK_LIFE_BALANCE" | "WORK_TRAVELLER" | "WORKAHOLIC"; export type TransportMode = | "UNKNOWN" | "BICYCLE" | "WALKING" | "RUNNING" | "TRAM" | "TRAIN" | "CAR" | "BUS" | "MOTORCYCLE"; export type VenueSignificance = | "UNKNOWN" | "HOME" | "WORK" | "POINT_OF_INTEREST" /** * The list of venue types that are currently supported by the venue-type mapping model: * *
A provisional event is identified based on real-time detections, but may change in the near future * as more data is collected and processed, to filter out unwanted artifacts. * For example, a provisional car transport may get identified, followed by a provisional bus transport. * After the full trip is complete, these provisional events may get merged into a single final car event.
* *Final events are generated independently of the provisional events, and have unique event IDs. They are * not linked to the provisional events they may resemble, replace, or overlap with.
* *Currently, provisional events apply only to 'transport' types, as the SDK tries to determine the mode of * transport in (near) real time. When the full trip is complete (e.g. the user becomes stationary), * the collected data is reprocessed to produce a more accurate and cleaned up list of transport events.
*/ isProvisional: boolean; // stationary event fields location: GeoLocation | null; venue: Venue | null; // transport event fields transportMode: TransportMode | null; waypoints: Waypoint[]; distance?: number; // in meters transportTags: TransportTags; occupantRole: OccupantRole; } export interface GeoLocation { latitude: number; longitude: number; accuracy: number; } export interface Waypoint { latitude: number; longitude: number; accuracy: number; // in meters timestamp: number; // UTC epoch time in milliseconds speedInMps?: number; // in meters per second /** * - If {@link isSpeedLimitInfoSet} is `false`, then this value will be `undefined`. * - If {@link hasUnlimitedSpeedLimit} is `true`, then this value will be `Number.MAX_VALUE`. */ speedLimitInMps?: number; // in meters per second hasUnlimitedSpeedLimit: boolean; isSpeedLimitInfoSet: boolean; isSynthetic: boolean; } export interface Venue { location: GeoLocation | null; significance: VenueSignificance; type: VenueType; } export interface Segment { category: SegmentCategory; subcategory: SegmentSubcategory; type: SegmentType; id: number; startTime: string; startTimeEpoch: number; // in milliseconds endTime: string | null; endTimeEpoch: number | null; // in milliseconds attributes: SegmentAttribute[]; } export interface SegmentAttribute { name: string; value: number; } export interface UserContext { events: Event[]; activeSegments: Segment[]; lastKnownLocation: GeoLocation | null; home: Venue | null; work: Venue | null; semanticTime: SemanticTime; } export interface UserContextUpdate { readonly criteria: UserContextUpdateCriteria[]; readonly userContext: UserContext; } export interface SentianceUserContext { requestUserContext(includeProvisionalEvents?: boolean): Promise