12
12
13
13
// https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/gapi.auth2
14
14
15
- // ignore_for_file: public_member_api_docs, unused_element, non_constant_identifier_names, sort_constructors_first, always_specify_types, strict_raw_type
15
+ // ignore_for_file: public_member_api_docs, non_constant_identifier_names,
16
+ // * public_member_api_docs originally undocumented because the file was
17
+ // autogenerated.
18
+ // * non_constant_identifier_names required to be able to use the same parameter
19
+ // names as the underlying library.
16
20
17
21
@JS ()
18
22
library gapiauth2;
@@ -122,6 +126,15 @@ abstract class CurrentUser {
122
126
@anonymous
123
127
@JS ()
124
128
abstract class SigninOptions {
129
+ external factory SigninOptions (
130
+ {String app_package_name,
131
+ bool fetch_basic_profile,
132
+ String prompt,
133
+ String scope,
134
+ String /*'popup'|'redirect'*/ ux_mode,
135
+ String redirect_uri,
136
+ String login_hint});
137
+
125
138
/// The package name of the Android app to install over the air.
126
139
/// See Android app installs from your web site:
127
140
/// https://developers.google.com/identity/sign-in/web/android-app-installs
@@ -162,15 +175,6 @@ abstract class SigninOptions {
162
175
// https://developers.google.com/identity/protocols/OpenIDConnect?hl=en#authenticationuriparameters
163
176
external String ? get login_hint;
164
177
external set login_hint (String ? v);
165
-
166
- external factory SigninOptions (
167
- {String app_package_name,
168
- bool fetch_basic_profile,
169
- String prompt,
170
- String scope,
171
- String /*'popup'|'redirect'*/ ux_mode,
172
- String redirect_uri,
173
- String login_hint});
174
178
}
175
179
176
180
/// Definitions by: John <https://github.com/jhcao23>
@@ -179,23 +183,35 @@ abstract class SigninOptions {
179
183
@anonymous
180
184
@JS ()
181
185
abstract class OfflineAccessOptions {
186
+ external factory OfflineAccessOptions (
187
+ {String scope,
188
+ String /*'select_account'|'consent'*/ prompt,
189
+ String app_package_name});
182
190
external String ? get scope;
183
191
external set scope (String ? v);
184
192
external String ? /*'select_account'|'consent'*/ get prompt;
185
193
external set prompt (String ? /*'select_account'|'consent'*/ v);
186
194
external String ? get app_package_name;
187
195
external set app_package_name (String ? v);
188
- external factory OfflineAccessOptions (
189
- {String scope,
190
- String /*'select_account'|'consent'*/ prompt,
191
- String app_package_name});
192
196
}
193
197
194
198
/// Interface that represents the different configuration parameters for the gapi.auth2.init method.
195
199
/// Reference: https://developers.google.com/api-client-library/javascript/reference/referencedocs#gapiauth2clientconfig
196
200
@anonymous
197
201
@JS ()
198
202
abstract class ClientConfig {
203
+ external factory ClientConfig ({
204
+ String client_id,
205
+ String cookie_policy,
206
+ String scope,
207
+ bool fetch_basic_profile,
208
+ String ? hosted_domain,
209
+ String openid_realm,
210
+ String /*'popup'|'redirect'*/ ux_mode,
211
+ String redirect_uri,
212
+ String plugin_name,
213
+ });
214
+
199
215
/// The app's client ID, found and created in the Google Developers Console.
200
216
external String ? get client_id;
201
217
external set client_id (String ? v);
@@ -238,18 +254,6 @@ abstract class ClientConfig {
238
254
/// See: https://github.com/flutter/flutter/issues/88084
239
255
external String ? get plugin_name;
240
256
external set plugin_name (String ? v);
241
-
242
- external factory ClientConfig ({
243
- String client_id,
244
- String cookie_policy,
245
- String scope,
246
- bool fetch_basic_profile,
247
- String ? hosted_domain,
248
- String openid_realm,
249
- String /*'popup'|'redirect'*/ ux_mode,
250
- String redirect_uri,
251
- String plugin_name,
252
- });
253
257
}
254
258
255
259
@JS ('gapi.auth2.SigninOptionsBuilder' )
@@ -290,20 +294,23 @@ abstract class AuthResponse {
290
294
external set first_issued_at (num ? v);
291
295
external num ? get expires_at;
292
296
external set expires_at (num ? v);
293
- external factory AuthResponse (
294
- {String ? access_token,
295
- String ? id_token,
296
- String ? login_hint,
297
- String ? scope,
298
- num ? expires_in,
299
- num ? first_issued_at,
300
- num ? expires_at});
301
297
}
302
298
303
299
/// Reference: https://developers.google.com/api-client-library/javascript/reference/referencedocs#gapiauth2authorizeconfig
304
300
@anonymous
305
301
@JS ()
306
302
abstract class AuthorizeConfig {
303
+ external factory AuthorizeConfig (
304
+ {String client_id,
305
+ String scope,
306
+ String response_type,
307
+ String prompt,
308
+ String cookie_policy,
309
+ String hosted_domain,
310
+ String login_hint,
311
+ String app_package_name,
312
+ String openid_realm,
313
+ bool include_granted_scopes});
307
314
external String get client_id;
308
315
external set client_id (String v);
309
316
external String get scope;
@@ -324,23 +331,22 @@ abstract class AuthorizeConfig {
324
331
external set openid_realm (String ? v);
325
332
external bool ? get include_granted_scopes;
326
333
external set include_granted_scopes (bool ? v);
327
- external factory AuthorizeConfig (
328
- {String client_id,
329
- String scope,
330
- String response_type,
331
- String prompt,
332
- String cookie_policy,
333
- String hosted_domain,
334
- String login_hint,
335
- String app_package_name,
336
- String openid_realm,
337
- bool include_granted_scopes});
338
334
}
339
335
340
336
/// Reference: https://developers.google.com/api-client-library/javascript/reference/referencedocs#gapiauth2authorizeresponse
341
337
@anonymous
342
338
@JS ()
343
339
abstract class AuthorizeResponse {
340
+ external factory AuthorizeResponse (
341
+ {String access_token,
342
+ String id_token,
343
+ String code,
344
+ String scope,
345
+ num expires_in,
346
+ num first_issued_at,
347
+ num expires_at,
348
+ String error,
349
+ String error_subtype});
344
350
external String get access_token;
345
351
external set access_token (String v);
346
352
external String get id_token;
@@ -359,16 +365,6 @@ abstract class AuthorizeResponse {
359
365
external set error (String v);
360
366
external String get error_subtype;
361
367
external set error_subtype (String v);
362
- external factory AuthorizeResponse (
363
- {String access_token,
364
- String id_token,
365
- String code,
366
- String scope,
367
- num expires_in,
368
- num first_issued_at,
369
- num expires_at,
370
- String error,
371
- String error_subtype});
372
368
}
373
369
374
370
/// A GoogleUser object represents one user account.
@@ -498,6 +494,4 @@ external void render(
498
494
abstract class Promise <T > {
499
495
external factory Promise (
500
496
void Function (void Function (T result) resolve, Function reject) executor);
501
- external Promise then (void Function (T result) onFulfilled,
502
- [Function onRejected]);
503
497
}
0 commit comments