-
Notifications
You must be signed in to change notification settings - Fork 62
Closed
Labels
api: bigtableIssues related to the googleapis/nodejs-bigtable API.Issues related to the googleapis/nodejs-bigtable API.priority: p2Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.typescript
Description
Environment details
- OS: macOS 10.14
- Node.js version: v12.12.0
- npm version: 6.11.3
@google-cloud/bigtableversion: 2.2.1
Steps to reproduce
I have code that calls getInstances without defining a callback:
const [instances] = await bigtable.getInstances();getInstances behaves according to its docstring:
If the callback is omitted, we'll return a Promise.
...but this behavior is not reflected in its generated type, which has return type void and no overloads:
getInstances(gaxOptions?: any, callback?: any): void;This mismatch causes eslint to complain because void is a non-Promise.
Proposal
Declare an overload type:
getInstances(gaxOptions?: any, callback: any): void;
getInstances(gaxOptions?: any): Promise<Instance[]>;Thanks!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
api: bigtableIssues related to the googleapis/nodejs-bigtable API.Issues related to the googleapis/nodejs-bigtable API.priority: p2Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.typescript
