import type * as Vital from "../index.js"; export interface ClientFacingSleep { id: string; /** User id returned by vital create user request. This id should be stored in your database against the user and used for all interactions with the vital api. */ userId: string; /** Date of the specified record, formatted as ISO8601 datetime string in UTC 00:00. Deprecated in favour of calendar_date. */ date: Date; /** Date of the sleep summary in the YYYY-mm-dd format. This generally matches the sleep end date. */ calendarDate: string; /** UTC Time when the sleep period started */ bedtimeStart: Date; /** UTC Time when the sleep period ended */ bedtimeStop: Date; /** * `long_sleep`: >=3 hours of sleep; * `short_sleep`: <3 hours of sleep; * `acknowledged_nap`: User-acknowledged naps, typically under 3 hours of sleep; * `unknown`: The sleep session recording is ongoing. */ type: Vital.SleepType; /** Timezone offset from UTC as seconds. For example, EEST (Eastern European Summer Time, +3h) is 10800. PST (Pacific Standard Time, -8h) is -28800::seconds */ timezoneOffset?: number; /** Total duration of the sleep period (sleep.duration = sleep.bedtime_end - sleep.bedtime_start)::seconds */ duration: number; /** Total amount of sleep registered during the sleep period (sleep.total = sleep.rem + sleep.light + sleep.deep)::seconds */ total: number; /** Total amount of awake time registered during the sleep period::seconds */ awake: number; /** Total amount of light sleep registered during the sleep period::seconds */ light: number; /** Total amount of REM sleep registered during the sleep period, minutes::seconds */ rem: number; /** Total amount of deep (N3) sleep registered during the sleep period::seconds */ deep: number; /** A value between 1 and 100 representing how well the user slept. Currently only available for Withings, Oura, Whoop and Garmin::scalar */ score?: number; /** The lowest heart rate (5 minutes sliding average) registered during the sleep period::beats per minute */ hrLowest?: number; /** The average heart rate registered during the sleep period::beats per minute */ hrAverage?: number; /** Resting heart rate recorded during a sleep session::bpm */ hrResting?: number; /** Sleep efficiency is the percentage of the sleep period spent asleep (100% * sleep.total / sleep.duration)::perc */ efficiency?: number; /** Detected latency from bedtime_start to the beginning of the first five minutes of persistent sleep::seconds */ latency?: number; /** Skin temperature deviation from the long-term temperature average::celcius */ temperatureDelta?: number; /** The skin temperature::celcius */ skinTemperature?: number; /** Sleeping Heart Rate Dip is the percentage difference between your average waking heart rate and your average sleeping heart rate. In health studies, a greater "dip" is typically seen as a positive indicator of overall health. Currently only available for Garmin::perc */ hrDip?: number; /** Some providers can provide updates to the sleep summary hours after the sleep period has ended. This field indicates the state of the sleep summary. For example, TENTATIVE means the summary is an intial prediction from the provider and can be subject to change. Currently only available for Garmin and EightSleep::str */ state?: Vital.SleepSummaryState; /** The average heart rate variability registered during the sleep period::rmssd */ averageHrv?: number; /** Average respiratory rate::breaths per minute */ respiratoryRate?: number; /** Source the data has come from. */ source: Vital.ClientFacingSource; sleepStream?: Vital.ClientFacingSleepStream; createdAt: Date; updatedAt: Date; }