Skip to content

Commit

Permalink
improve type exports
Browse files Browse the repository at this point in the history
  • Loading branch information
adamchal committed Mar 3, 2020
1 parent 137dcbb commit 7fa65d6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"devDependencies": {
"@types/node": "*",
"del-cli": "*",
"gaxios": "*",
"np": "*",
"ts-node": "*",
"tslib": "*",
Expand Down
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -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';

Expand Down Expand Up @@ -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;
Expand Down
4 changes: 4 additions & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -24,3 +26,5 @@ export interface GSheetOptions {
keyTransform?: typeof noChange;
sanitize?: typeof trim;
}

export type GoogleSheetsAppendResponse = Promise<GaxiosResponse<sheets_v4.Schema$AppendValuesResponse>>;

0 comments on commit 7fa65d6

Please sign in to comment.