@@ -52,7 +52,7 @@ import {
52
52
ExternalAccountAuthorizedUserClientOptions ,
53
53
} from './externalAccountAuthorizedUserClient' ;
54
54
import { originalOrCamelOptions } from '../util' ;
55
- import { AnyAuthClient } from '..' ;
55
+ import { AnyAuthClient , AnyAuthClientConstructor } from '..' ;
56
56
57
57
/**
58
58
* Defines all types of explicit clients that are determined via ADC JSON
@@ -82,7 +82,7 @@ export interface ADCResponse {
82
82
projectId : string | null ;
83
83
}
84
84
85
- export interface GoogleAuthOptions < T extends AuthClient = JSONClient > {
85
+ export interface GoogleAuthOptions < T extends AuthClient = AnyAuthClient > {
86
86
/**
87
87
* An API key to use, optional. Cannot be used with {@link GoogleAuthOptions.credentials `credentials`}.
88
88
*/
@@ -114,13 +114,12 @@ export interface GoogleAuthOptions<T extends AuthClient = JSONClient> {
114
114
credentials ?: JWTInput | ExternalAccountClientOptions ;
115
115
116
116
/**
117
- * Options object passed to the constructor of the client
117
+ * `AuthClientOptions` object passed to the constructor of the client
118
118
*/
119
- clientOptions ?:
120
- | JWTOptions
121
- | OAuth2ClientOptions
122
- | UserRefreshClientOptions
123
- | ImpersonatedOptions ;
119
+ clientOptions ?: Extract <
120
+ ConstructorParameters < AnyAuthClientConstructor > [ 0 ] ,
121
+ AuthClientOptions
122
+ > ;
124
123
125
124
/**
126
125
* Required scopes for the desired API request
@@ -163,7 +162,7 @@ export const GoogleAuthExceptionMessages = {
163
162
'https://cloud.google.com/compute/docs/metadata/predefined-metadata-keys' ,
164
163
} as const ;
165
164
166
- export class GoogleAuth < T extends AuthClient = JSONClient > {
165
+ export class GoogleAuth < T extends AuthClient = AuthClient > {
167
166
/**
168
167
* Caches a value indicating whether the auth layer is running on Google
169
168
* Compute Engine.
0 commit comments