diff --git a/package.json b/package.json index 85263e8..56cbf6f 100644 --- a/package.json +++ b/package.json @@ -36,6 +36,7 @@ "devDependencies": { "@types/node": "*", "del-cli": "*", + "gaxios": "*", "np": "*", "ts-node": "*", "tslib": "*", diff --git a/src/index.ts b/src/index.ts index 5190576..9ab6d81 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,6 +1,6 @@ import { google } from 'googleapis'; -import { GSheetOptions, RowArray, RowObject } from './types'; +import { GSheetOptions, RowArray, RowObject, GoogleSheetsAppendResponse } from './types'; import { noChange, trim, gSheetDate, gSheetDateTime } from './util'; @@ -106,7 +106,7 @@ const gsheet = ({ timer.unref(); } - const append = async (arg: RowArray | RowObject) => { + const append = async (arg: RowArray | RowObject): GoogleSheetsAppendResponse => { let row: RowArray | undefined; if (Array.isArray(arg)) { row = arg; diff --git a/src/types.ts b/src/types.ts index bb3123d..b4f56fd 100644 --- a/src/types.ts +++ b/src/types.ts @@ -1,3 +1,5 @@ +import { sheets_v4 } from 'googleapis'; +import { GaxiosResponse } from 'gaxios'; import { noChange, trim } from "./util"; export type InputTypes = boolean | string | number | null; @@ -24,3 +26,5 @@ export interface GSheetOptions { keyTransform?: typeof noChange; sanitize?: typeof trim; } + +export type GoogleSheetsAppendResponse = Promise>; \ No newline at end of file