Skip to content

Commit

Permalink
refactor: move types to separate module
Browse files Browse the repository at this point in the history
  • Loading branch information
trevormunoz committed Aug 16, 2024
1 parent 9fe638f commit 2a4ae02
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 13 deletions.
14 changes: 1 addition & 13 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,8 @@ import { parse } from "std/flags";
import { sleep } from "sleep";
import { join } from "std/path";
import { ensureDirSync } from "std/fs";
import { FetchOptions, AirtableResponse } from "./types.ts";

interface FetchOptions {
baseId: string;
tableName: string;
apiKey: string;
httpReadTimeout?: number;
userAgent?: string | null;
delay?: number;
}

interface AirtableResponse {
records: Record<string, unknown>[];
offset?: string;
}
export async function getAirtableData(
baseId: string,
tables: string[],
Expand Down
19 changes: 19 additions & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
export interface FetchOptions {
baseId: string;
tableName: string;
apiKey: string;
httpReadTimeout?: number;
userAgent?: string | null;
delay?: number;
}

export interface AirtableRecord {
id: string;
createdTime: string;
fields: Record<string, unknown>;
}

export interface AirtableResponse {
records: Record<string, AirtableRecord>[];
offset?: string;
}

0 comments on commit 2a4ae02

Please sign in to comment.