Source: validic-cordova-session/www/Constants.js

/**
 * @interface Peripheral
 * @property {number} ID - A unique identifer for a particular peripheral model.
 * @property {number} Type - The type of the peripheral, used to identify its function. {@link PeripheralType}
 * @property {string} Model - Model number of the peripheral.
 * @property {string} Manufacturer - Manufacturer name of the peripheral.
 * @property {string} PeripheralImageURL - URL for an image of the peripheral.
 */

/**
 * @interface Record
 * @property {string} activity_id - Unique ID generated by the orginal source.
 * @property {string} recordType - Type of record. This field not present on server. Added for use by Cordova plugin. Possible values
       are "biometrics", "diabetes", "weight", "routine", "nutrition", "fitness", "sleep".
 * @property {string} timestamp - Timestamp for the measurement set.
 * @property {string} source - The short name of the Validic integration that created the record (validicmobile).
 * @property {string} source_name - The display name of the Validic integration that created the record (ValidicMobile).
 * @property {string} original_source - The name of the peripheral manufacturer, for records sourced from HealthKit this will be 
 *     the name of the application that originally wrote the data to HealthKit.
 * @property {string} intermediary_source - The name of the library technology used to create the record 
 *     (eg "ValidicMobile Bluetooth", "ValidicMobile Apple Health").
 * @property {string} device - The model number of the peripheral, for records sourced from HealthKit this will be
 *     the bundle ID of the application that originally wrote the data to HealthKit.
 * @property {string} last_updated - Date and time when the measurement set was last updated.
 * @property {boolean} validated - Indicates the data you are receiving was generated using a device,
 *     opposed to being manually entered by a end user.
 * @property {string} _id - Record ID. Assigned after being upload to the server.
 * @property {Object} extras - Map of additional extra information.
 * @property {Object} media - Object containing URL to image associated with this record if any.
 */
/**
 * @interface BiometricsRecord - Subtype of {@link Record}. Adds the following additional properties
 * @property {number} blood_calcium - The value of the measured quantity in mg/dL.
 * @property {number} blood_chromium - The value of the measured quantity in µg/L.
 * @property {number} blood_folic_acid - The value of the measured quantity in ng/mL.
 * @property {number} blood_magnesium - The value of the measured quantity mg/dL.
 * @property {number} blood_potassium - The value of the measured quantity in mEq/L.
 * @property {number} blood_sodium - The value of the measured quantity in mEq/L.
 * @property {number} blood_vitamin_b12 - The value of the measured quantity in pg/mL.
 * @property {number} blood_zinc - The value of the measured quantity in µg/dL.
 * @property {string} creatine_kinase - The value of the measured quantity in U/L.
 * @property {string} crp - The value of the measured quantity in mg/L.
 * @property {string} diastolic - The value of the measured quantity in mmHg.
 * @property {string} ferritin - The value of the measured quantity in ng/mL.
 * @property {string} hdl - The value of the measured quantity in mg/dL.
 * @property {string} hscrp - The value of the measured quantity in mg/L .
 * @property {string} il6 - The value of the measured quantity in pg/mL.
 * @property {string} ldl - The value of the measured quantity in mg/dL.
 * @property {string} resting_heartrate - The value of the measured quantity in bpm.
 * @property {string} systolic - The value of the measured quantity in mmHg.
 * @property {string} testosterone - The value of the measured quantity in ng/dL.
 * @property {string} total_cholesterol - The value of the measured quantity in mg/dL.
 * @property {string} tsh - The value of the measured quantity in mIU/L.
 * @property {string} uric_acid - The value of the measured quantity in mg/dL.
 * @property {string} vitamin_d - The value of the measured quantity in ng/mL.
 * @property {string} white_cell_count - The value of the measured quantity in cells/µL.
 * @property {string} spo2 - The value of the measured quantity in %.
 * @property {string} temperature - The value of the measured quantity in Celsius.
 */
/**
 * @interface DiabetesRecord - Subtype of {@link Record}. Adds the following additional properties
 * @property {number} c_peptide - The value of the measured quantity in ng/mL.
 * @property {number} fasting_plasma_glucose_test - The value of the measured quantity in mg/dL.
 * @property {number} hba1c - The value of the measured quantity in %.
 * @property {number} insulin - The value of the measured quantity U.
 * @property {number} oral_glucose_tolerance_test - The value of the measured quantity in mg/dL.
 * @property {number} random_plasma_glucose_test - The value of the measured quantity in mg/dL.
 * @property {number} triglyceride - The value of the measured quantity in mg/dL.
 * @property {number} blood_glucose - The value of the measured quantity mg/dL.
 * @property {string} relationship_to_meal - The value of the measured quantity.
 */
/**
 * @interface WeightRecord - Subtype of {@link Record}. Adds the following additional properties
 * @property {number} weight - The value of the measured quantity in kg.
 * @property {number} height - The value of the measured quantity in cm.
 * @property {number} free_mass - The value of the measured quantity in kg.
 * @property {number} fat_percent - The value of the measured quantity.
 * @property {number} mass_weight - The value of the measured quantity.
 * @property {number} bmi - The value of the measured quantity.
 */
/**
 * @interface NutritionRecord - Subtype of {@link Record}. Adds the following additional properties
 * @property {number} calories - Calories consumed per food intake.
 * @property {number} carbohydrates - Grams of carbohydrates consumed.
 * @property {number} fat - Grams of fat consumed.
 * @property {number} fiber - Grams of fiber consumed.
 * @property {number} protein - Grams of protein consumed.
 * @property {number} sodium - Grams of sodium consumed.
 * @property {number} water - Grams of water consumed.
 * @property {number} meal - Meal consumed: Breakfast, Lunch, or Dinner.
 */
/**
 * @interface RoutineRecord - Subtype of {@link Record}. Adds the following additional properties
 * @property {number} steps - Number of steps taken during routine.
 * @property {number} distance - The value of the measured quantity in meters.
 * @property {number} floors - The value of the measured quantity.
 * @property {number} elevation - Elevation climbed in meters.
 * @property {number} calories_burned - Calories burned during fitness activity.
 */
/**
 * @interface FitnessRecord - Subtype of {@link Record}. Adds the following additional properties
 * @property {string} type - Type of fitness activity: Walking, Running, Swimming, etc.
 * @property {string} intensity - Subjective intensity with which an activity was performed. 
 *     Examples are: low, medium, high. Returned as provided by source.
 * @property {string} start_time - Timestamp of when fitness activity started in ISO08601 format.
 * @property {number} distance - Distance in meters.
 * @property {number} duration - Duration of fitness activity in seconds.
 * @property {number} calories - Calories burned during fitness activity.
 */
// Callback definitions and returned properties
// Covers both success and fail callbacks from BLE wrapped as events
/**
 * @callback EventCallback
 * @property {string} event - Name of event to fire in the window.
 * @property {Object} payload - The payload of the event.
 * @property {number} payload.peripheralID - Id of the peripheral the event came from.
 * @property {Record} [payload.record] - Record returned by event.
 * @property {Record[]}  [payload.records] - Array of records returned by the event.
 * @property {string} [payload.error] - Error message returned by the event.
 */
/**
 * @interface NotificationOptions - Notifications options to be displayed on android. These have no affect on iOS 
 * @property {Number} id - identifier for the notification to be posted to
 * @property {string} title - Title to be displayed in the Notification
 * @property {string} message - Message to be displayed in the Notification
 * @property {string} icon - Icon to be displayed by the Notification. Can be in the form or a uri. Default looks for 'res://ic_launcher.png'
 * @property {string} clearText - Text to be displayed as a notification action. If set, the action will stop the associated foreground service.
 */
/**
 * @callback InvalidIDCallback
 * @property {string} error - The String representation of the error that occured.
 * @property {number} [peripheralID] - The peripheral that the error occured with.
 */
/**
 * @callback InvalidTypeCallback
 * @property {string} error - The String representation of the error that occured.
 * @property {number} type - The peripheral type that the error is related to.
 */

/**
 * Fail callback
 * @callback FailCallback
 * @property {string} error - Message describing the error.
 */
/**
 * Success Callback
 * @callback Callback
 * @property {any?} data
 */
/**
 * Callback response from availability checks
 * @callback AvailableCallback
 * @property {boolean} isAvailable - Indicates if the requested service is available.
 */
/**
 * Callback for data type requests
 * @callback DataTypeCallback
 * @property {string[]} dataTypes - Array of strings representing SHealth data types associated with a subscription set
 */
/**
 * Callback response to obtain version information.
 * @callback VersionCallback
 * @property {string} version - Version number of the native Validic Mobile library the plugin is using.
 */
/**
 * Callback response checking if service is active.
 * @callback IsActiveCallback
 * @property {boolean} isActive - Indicates if the requested service is active.
 */
/**
 * Records returned from read operations include a record type value. Records submitted to the session
 * requires the record type property to be set to one of these values.
 * @enum {string}
 */
exports.RecordTypeString = {
    BIOMETRICS: "biometrics",
    DIABETES: "diabetes",
    WEIGHT: "weight",
    ROUTINE: "routine",
    NUTRITION: "nutrition",
    FITNESS: "fitness",
    SLEEP: "sleep"
};

/**
 * For use with HealthKit.getSampleTypesForRecordType
 * @enum {number}
 */
exports.RecordType = {
    NONE: 0,
    BIOMETRICS: 1,
    DIABETES: 2,
    WEIGHT: 3,
    ROUTINE: 4,
    NUTRITION: 5,
    FITNESS: 6,
    SLEEP: 7
};
/**
 *  @enum {number}
 */
exports.PeripheralType = {
    NONE: 0,
    THERMOMETER: 1,
    BLOOD_PRESSURE: 2,
    HEART_RATE: 3,
    GLUCOSE: 4,
    WEIGHT_SCALE: 5,
    PULSE_OXIMETER: 6
};

/**
* Used for setting units for ocr.
* @enum {string}
*/
exports.GlucoseUnits = {
    MGDL: "mg/dL",
    MMOLL: "mmol/L"
};