mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-06-28 22:30:01 +00:00
airtable: update SelectOptions to match airtable docs (#37364)
This commit is contained in:
committed by
Nathan Shively-Sanders
parent
39c9df962a
commit
573ceaf1de
@@ -12,7 +12,27 @@ const base = airtable.base('app id');
|
||||
const table = base('table name') as Airtable.Table<Row>;
|
||||
|
||||
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) {
|
||||
|
||||
13
types/airtable/index.d.ts
vendored
13
types/airtable/index.d.ts
vendored
@@ -45,8 +45,21 @@ declare global {
|
||||
destroy(...args: any[]): Promise<any>;
|
||||
}
|
||||
|
||||
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<TFields extends object> {
|
||||
|
||||
Reference in New Issue
Block a user