diff --git a/types/airtable/airtable-tests.ts b/types/airtable/airtable-tests.ts index 7d7dfbdc60..6ae914c0d4 100644 --- a/types/airtable/airtable-tests.ts +++ b/types/airtable/airtable-tests.ts @@ -12,7 +12,27 @@ const base = airtable.base('app id'); const table = base('table name') as Airtable.Table; async () => { - const query = table.select(); + const query = table.select({ + fields: [ + 'field1', + ], + filterByFormula: `NOT({Example Text} = '')`, + maxRecords: 100, + pageSize: 10, + sort: [ + { + field: 'field1', + }, + { + field: 'attachments', + direction: 'asc', + }, + ], + view: 'test-view', + cellFormat: 'json', + timeZone: 'test-tz', + userLocale: 'test-locale', + }); { const rows = await query.all(); for (const row of rows) { diff --git a/types/airtable/index.d.ts b/types/airtable/index.d.ts index bf5e89a786..2026718c46 100644 --- a/types/airtable/index.d.ts +++ b/types/airtable/index.d.ts @@ -45,8 +45,21 @@ declare global { destroy(...args: any[]): Promise; } + interface SortParameter { + field: string; + direction?: 'asc' | 'desc'; + } + interface SelectOptions { + fields?: string[]; + filterByFormula?: string; + maxRecords?: number; + pageSize?: number; + sort?: SortParameter[]; view?: string; + cellFormat?: 'json' | 'string'; + timeZone?: string; + userLocale?: string; } interface Query {