-
Notifications
You must be signed in to change notification settings - Fork 11
Closed
Labels
priority: p3Desirable enhancement or fix. May not be included in next release.Desirable enhancement or fix. May not be included in next release.type: questionRequest for information or clarification. Not an issue.Request for information or clarification. Not an issue.
Description
I am trying to find the proper type for auth.getClient() in the code below:
let authClient: import('google-auth-library/build/src/auth/googleauth').JSONClient
const sheets = async (): Promise<sheets_v4.Sheets> => {
try {
if (!authClient) {
// create a new JWT client using the key file downloaded from the Google Developer Console
const auth = new google.auth.GoogleAuth({
keyFile: ...,
scopes: ...,
})
authClient = await auth.getClient()
}
return google.sheets({ version: 'v4', auth: authClient })
} catch (err) {
error(err)
throw new Error(err)
}It seems it should be JSONClient but having to access the type through an import seems odd and then I get the following error:
Type 'JSONClient | Compute' is not assignable to type 'JSONClient'Some advice/guidance would be appreciated.
Metadata
Metadata
Assignees
Labels
priority: p3Desirable enhancement or fix. May not be included in next release.Desirable enhancement or fix. May not be included in next release.type: questionRequest for information or clarification. Not an issue.Request for information or clarification. Not an issue.