From 9cf629e17365a221db9dc63b3b054296dbc2cecd Mon Sep 17 00:00:00 2001 From: Katie Rischpater <98350084+the-bay-kay@users.noreply.github.com> Date: Thu, 2 Nov 2023 13:59:36 -0700 Subject: [PATCH] Updated type appearances with prettier --- www/js/types/diaryTypes.ts | 124 ++++++++++++++++----------------- www/js/types/fileShareTypes.ts | 12 ++-- www/js/types/serverData.ts | 45 ++++++------ 3 files changed, 90 insertions(+), 91 deletions(-) diff --git a/www/js/types/diaryTypes.ts b/www/js/types/diaryTypes.ts index b51725977..14d8acc07 100644 --- a/www/js/types/diaryTypes.ts +++ b/www/js/types/diaryTypes.ts @@ -1,75 +1,75 @@ -import { LocalDt, ServerData } from './serverData' +import { LocalDt, ServerData } from './serverData'; -export type UserInput = ServerData +export type UserInput = ServerData; export type UserInputData = { - end_ts: number, - start_ts: number - label: string, - start_local_dt?: LocalDt - end_local_dt?: LocalDt - status?: string, - match_id?: string, -} + end_ts: number; + start_ts: number; + label: string; + start_local_dt?: LocalDt; + end_local_dt?: LocalDt; + status?: string; + match_id?: string; +}; type ConfirmedPlace = any; // TODO export type CompositeTrip = { - _id: {$oid: string}, - additions: any[], // TODO - cleaned_section_summary: any, // TODO - cleaned_trip: {$oid: string}, - confidence_threshold: number, - confirmed_trip: {$oid: string}, - distance: number, - duration: number, - end_confirmed_place: ConfirmedPlace, - end_fmt_time: string, - end_loc: {type: string, coordinates: number[]}, - end_local_dt: LocalDt, - end_place: {$oid: string}, - end_ts: number, - expectation: any, // TODO "{to_label: boolean}" - expected_trip: {$oid: string}, - inferred_labels: any[], // TODO - inferred_section_summary: any, // TODO - inferred_trip: {$oid: string}, - key: string, - locations: any[], // TODO - origin_key: string, - raw_trip: {$oid: string}, - sections: any[], // TODO - source: string, - start_confirmed_place: ConfirmedPlace, - start_fmt_time: string, - start_loc: {type: string, coordinates: number[]}, - start_local_dt: LocalDt, - start_place: {$oid: string}, - start_ts: number, - user_input: UserInput, -} + _id: { $oid: string }; + additions: any[]; // TODO + cleaned_section_summary: any; // TODO + cleaned_trip: { $oid: string }; + confidence_threshold: number; + confirmed_trip: { $oid: string }; + distance: number; + duration: number; + end_confirmed_place: ConfirmedPlace; + end_fmt_time: string; + end_loc: { type: string; coordinates: number[] }; + end_local_dt: LocalDt; + end_place: { $oid: string }; + end_ts: number; + expectation: any; // TODO "{to_label: boolean}" + expected_trip: { $oid: string }; + inferred_labels: any[]; // TODO + inferred_section_summary: any; // TODO + inferred_trip: { $oid: string }; + key: string; + locations: any[]; // TODO + origin_key: string; + raw_trip: { $oid: string }; + sections: any[]; // TODO + source: string; + start_confirmed_place: ConfirmedPlace; + start_fmt_time: string; + start_loc: { type: string; coordinates: number[] }; + start_local_dt: LocalDt; + start_place: { $oid: string }; + start_ts: number; + user_input: UserInput; +}; export type PopulatedTrip = CompositeTrip & { - additionsList?: any[], // TODO - finalInference?: any, // TODO - geojson?: any, // TODO - getNextEntry?: () => PopulatedTrip | ConfirmedPlace, - userInput?: UserInput, - verifiability?: string, -} + additionsList?: any[]; // TODO + finalInference?: any; // TODO + geojson?: any; // TODO + getNextEntry?: () => PopulatedTrip | ConfirmedPlace; + userInput?: UserInput; + verifiability?: string; +}; export type Trip = { - end_ts: number, - start_ts: number, -} + end_ts: number; + start_ts: number; +}; export type TlEntry = { - key: string, - origin_key: string, - start_ts: number, - end_ts: number, - enter_ts: number, - exit_ts: number, - duration: number, -getNextEntry?: () => PopulatedTrip | ConfirmedPlace, -} \ No newline at end of file + key: string; + origin_key: string; + start_ts: number; + end_ts: number; + enter_ts: number; + exit_ts: number; + duration: number; + getNextEntry?: () => PopulatedTrip | ConfirmedPlace; +}; diff --git a/www/js/types/fileShareTypes.ts b/www/js/types/fileShareTypes.ts index 89481624d..03b41a161 100644 --- a/www/js/types/fileShareTypes.ts +++ b/www/js/types/fileShareTypes.ts @@ -1,11 +1,11 @@ -import { ServerData } from './serverData'; +import { ServerData } from './serverData'; export type TimeStampData = ServerData; export type RawTimelineData = { - name: string, - ts: number, - reading: number, + name: string; + ts: number; + reading: number; }; export interface FsWindow extends Window { @@ -13,10 +13,10 @@ export interface FsWindow extends Window { type: number, size: number, successCallback: (fs: any) => void, - errorCallback?: (error: any) => void + errorCallback?: (error: any) => void, ) => void; LocalFileSystem: { TEMPORARY: number; PERSISTENT: number; }; -}; +} diff --git a/www/js/types/serverData.ts b/www/js/types/serverData.ts index 35bd283bb..76142b603 100644 --- a/www/js/types/serverData.ts +++ b/www/js/types/serverData.ts @@ -1,32 +1,31 @@ export type ServerResponse = { - phone_data: Array>, -} + phone_data: Array>; +}; export type ServerData = { - data: Type, - metadata: MetaData, - key?: string, - user_id?: { $uuid: string, }, - _id?: { $oid: string, }, + data: Type; + metadata: MetaData; + key?: string; + user_id?: { $uuid: string }; + _id?: { $oid: string }; }; export type MetaData = { - key: string, - platform: string, - write_ts: number, - time_zone: string, - write_fmt_time: string, - write_local_dt: LocalDt, + key: string; + platform: string; + write_ts: number; + time_zone: string; + write_fmt_time: string; + write_local_dt: LocalDt; }; - + export type LocalDt = { - minute: number, - hour: number, - second: number, - day: number, - weekday: number, - month: number, - year: number, - timezone: string, + minute: number; + hour: number; + second: number; + day: number; + weekday: number; + month: number; + year: number; + timezone: string; }; - \ No newline at end of file