export type DrawerRowData = {
    id: string,
    name: string,
    source: string,
    status: string,
    size: number,
    lastUpdated: string
    nbColumns: number,
    nbRows: number,
  }


// From firebase auth response
// {
//   "user": {
//       "uid": "TTjIzzfDwsgPxP2OjbAhZAmOduv2",
//       "email": "leocances@gmail.com",
//       "emailVerified": false,
//       "isAnonymous": false,
//       "providerData": [
//           {
//               "providerId": "password",
//               "uid": "leocances@gmail.com",
//               "displayName": null,
//               "email": "leocances@gmail.com",
//               "phoneNumber": null,
//               "photoURL": null
//           }
//       ],
//       "stsTokenManager": {
//           "refreshToken": "APJWN8fnMNg03KoIfPQYUXFBIb87nSxKU1YjOnbU78nnNIcpCXfBuJVtr111wQtCahJ9l1FEljp2kccU-ivGsu1WJWjPex0nV8s97awqG6YXG67V0f-v30A4jtABMDpyCuzaJPbfVw_co1oeH6U2fhc5FtxGCaKnyv_wX9mAtemt_xdD_kMAeSSy4FJjloESMHxpol0r_kdgEGgUT1CsQk7OqE26ckLCIw",
//           "accessToken": "eyJhbGciOiJSUzI1NiIsImtpZCI6IjFlOTczZWUwZTE2ZjdlZWY0ZjkyMWQ1MGRjNjFkNzBiMmVmZWZjMTkiLCJ0eXAiOiJKV1QifQ.eyJpc3MiOiJodHRwczovL3NlY3VyZXRva2VuLmdvb2dsZS5jb20vcmVmaWxlLWMzMjVjIiwiYXVkIjoicmVmaWxlLWMzMjVjIiwiYXV0aF90aW1lIjoxNjc4NzQ0OTEzLCJ1c2VyX2lkIjoiVFRqSXp6ZkR3c2dQeFAyT2piQWhaQW1PZHV2MiIsInN1YiI6IlRUakl6emZEd3NnUHhQMk9qYkFoWkFtT2R1djIiLCJpYXQiOjE2Nzg3NDQ5MTMsImV4cCI6MTY3ODc0ODUxMywiZW1haWwiOiJsZW9jYW5jZXNAZ21haWwuY29tIiwiZW1haWxfdmVyaWZpZWQiOmZhbHNlLCJmaXJlYmFzZSI6eyJpZGVudGl0aWVzIjp7ImVtYWlsIjpbImxlb2NhbmNlc0BnbWFpbC5jb20iXX0sInNpZ25faW5fcHJvdmlkZXIiOiJwYXNzd29yZCJ9fQ.REEP4Af34Lun1EkAFUWVkNGR6cRrZRj26nhQmyJD3yxvH60w6Vn60GLzE1K6L8jmTWNkWAQZ69SdG-bPfkrGIB3L1OWrIK1GTXBA1eoHDLl2u4Uu1x25ndJV3a8frIRiMGf80BFcN-mlesBGurO50oUCv8OeVs_HmHWXh0z8MZKo_tlJqW1CLWXm6Lxg5rIHbJpHfuQn3UuWXaAKBfWqkjqcT93L_zzYItZWAbxZgjP8X8lwraKg-UX7NSccJ2YT0cU1u4IkStEV6AemuzM4sUimszb0YQ8vDB49SVnOuNvZl4MbxKUDfQQoRSlaxCEcafsigz0IqsxWWsVyLuU9Rg",
//           "expirationTime": 1678748513943
//       },
//       "createdAt": "1678744913665",
//       "lastLoginAt": "1678744913665",
//       "apiKey": "AIzaSyCrSgNa7Hcqt1ILDJSIWJyoerlroSujCD8",
//       "appName": "[DEFAULT]"
//   },
//   "providerId": null,
//   "_tokenResponse": {
//       "kind": "identitytoolkit#SignupNewUserResponse",
//       "idToken": "eyJhbGciOiJSUzI1NiIsImtpZCI6IjFlOTczZWUwZTE2ZjdlZWY0ZjkyMWQ1MGRjNjFkNzBiMmVmZWZjMTkiLCJ0eXAiOiJKV1QifQ.eyJpc3MiOiJodHRwczovL3NlY3VyZXRva2VuLmdvb2dsZS5jb20vcmVmaWxlLWMzMjVjIiwiYXVkIjoicmVmaWxlLWMzMjVjIiwiYXV0aF90aW1lIjoxNjc4NzQ0OTEzLCJ1c2VyX2lkIjoiVFRqSXp6ZkR3c2dQeFAyT2piQWhaQW1PZHV2MiIsInN1YiI6IlRUakl6emZEd3NnUHhQMk9qYkFoWkFtT2R1djIiLCJpYXQiOjE2Nzg3NDQ5MTMsImV4cCI6MTY3ODc0ODUxMywiZW1haWwiOiJsZW9jYW5jZXNAZ21haWwuY29tIiwiZW1haWxfdmVyaWZpZWQiOmZhbHNlLCJmaXJlYmFzZSI6eyJpZGVudGl0aWVzIjp7ImVtYWlsIjpbImxlb2NhbmNlc0BnbWFpbC5jb20iXX0sInNpZ25faW5fcHJvdmlkZXIiOiJwYXNzd29yZCJ9fQ.REEP4Af34Lun1EkAFUWVkNGR6cRrZRj26nhQmyJD3yxvH60w6Vn60GLzE1K6L8jmTWNkWAQZ69SdG-bPfkrGIB3L1OWrIK1GTXBA1eoHDLl2u4Uu1x25ndJV3a8frIRiMGf80BFcN-mlesBGurO50oUCv8OeVs_HmHWXh0z8MZKo_tlJqW1CLWXm6Lxg5rIHbJpHfuQn3UuWXaAKBfWqkjqcT93L_zzYItZWAbxZgjP8X8lwraKg-UX7NSccJ2YT0cU1u4IkStEV6AemuzM4sUimszb0YQ8vDB49SVnOuNvZl4MbxKUDfQQoRSlaxCEcafsigz0IqsxWWsVyLuU9Rg",
//       "email": "leocances@gmail.com",
//       "refreshToken": "APJWN8fnMNg03KoIfPQYUXFBIb87nSxKU1YjOnbU78nnNIcpCXfBuJVtr111wQtCahJ9l1FEljp2kccU-ivGsu1WJWjPex0nV8s97awqG6YXG67V0f-v30A4jtABMDpyCuzaJPbfVw_co1oeH6U2fhc5FtxGCaKnyv_wX9mAtemt_xdD_kMAeSSy4FJjloESMHxpol0r_kdgEGgUT1CsQk7OqE26ckLCIw",
//       "expiresIn": "3600",
//       "localId": "TTjIzzfDwsgPxP2OjbAhZAmOduv2"
//   },
//   "operationType": "signIn"
// }
export type UserAuthInfo = {
  // From firebase information
  uid: string;
  email: string;
  emailVerified: boolean;
  displayName: string;
  phoneNumber: string;
  photoURL: string;
}


// ALl the information about the user that will be stored into Firestore
// There is no need to store information such as emailVerified, phoneNumber, photoURL
// because they are already stored in the UserAuthInfo
export type UserInfo = {
  uid: string;  // This is the same as UserAuthInfo.uid (the user's unique ID)
  plan: string;  // to store the user's plan (free, premium, etc.)
  documents: DocumentInfo[];  // to store the list of documents that the user has uploaded
  apiKey: string;  // to store the API key that the user has generated
}


// The user can upload multiple documents, or provide an URL to a document
// We will store the information about the document in Firestore
export type DocumentInfo = {
  id: string;
  name: string;
  source: string;
  status?: string;
  size: number;
  lastUpdated: string;
  nbColumns: number;
  nbRows: number;

  // Important for code snippets
  headers: string[];
  firstCell: string;
}


export enum ECollection {
  USERS = 'users',
}


export enum SupportedFileExtension {
  CSV = "csv",
  JSON = "json",
}

export type ParsedDocument = {
  data: object[],
  columns: number,
  rows: number,
  size: number,
}
