import { Unzipped } from "fflate/node";

//#region src/download/download.d.ts
interface ScrapeDownloadUrlResult {
  websiteUrl: string;
  url: string;
  dataFormat: 'csv' | 'xlsx';
  version: string;
  notes: string;
}
interface GetCacheKeyFn {
  (country: string): string;
}
interface GetDownloadUrlFn {
  (fetchFn: typeof globalThis.fetch): Promise<ScrapeDownloadUrlResult>;
}
type CSVString = string;
interface DownloadType {
  (url: string, fetchFn: typeof globalThis.fetch): Promise<CSVString>;
}
type BankData = [bankcode: string, bic: string, name: string, address: string, postcode: string, city: string, phone: string, fax: string, email: string, website: string];
interface ParseCSVType {
  (cvs: CSVString | Unzipped, countryCode: string): BankData[];
}
type FieldNameType = 'bankcode' | 'bic' | 'name' | 'address' | 'postcode' | 'city' | 'phone' | 'fax' | 'email' | 'website';
//#endregion
export { DownloadType, FieldNameType, GetCacheKeyFn, GetDownloadUrlFn, ParseCSVType };