1212
1313// https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/gapi.auth2
1414
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+ // * non_constant_identifier_names required to be able to use the same parameter
17+ // names as the underlying library.
1618
1719@JS ()
1820library gapiauth2;
@@ -122,6 +124,15 @@ abstract class CurrentUser {
122124@anonymous
123125@JS ()
124126abstract class SigninOptions {
127+ external factory SigninOptions (
128+ {String app_package_name,
129+ bool fetch_basic_profile,
130+ String prompt,
131+ String scope,
132+ String /*'popup'|'redirect'*/ ux_mode,
133+ String redirect_uri,
134+ String login_hint});
135+
125136 /// The package name of the Android app to install over the air.
126137 /// See Android app installs from your web site:
127138 /// https://developers.google.com/identity/sign-in/web/android-app-installs
@@ -162,15 +173,6 @@ abstract class SigninOptions {
162173 // https://developers.google.com/identity/protocols/OpenIDConnect?hl=en#authenticationuriparameters
163174 external String ? get login_hint;
164175 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});
174176}
175177
176178/// Definitions by: John <https://github.com/jhcao23>
@@ -179,23 +181,35 @@ abstract class SigninOptions {
179181@anonymous
180182@JS ()
181183abstract class OfflineAccessOptions {
184+ external factory OfflineAccessOptions (
185+ {String scope,
186+ String /*'select_account'|'consent'*/ prompt,
187+ String app_package_name});
182188 external String ? get scope;
183189 external set scope (String ? v);
184190 external String ? /*'select_account'|'consent'*/ get prompt;
185191 external set prompt (String ? /*'select_account'|'consent'*/ v);
186192 external String ? get app_package_name;
187193 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});
192194}
193195
194196/// Interface that represents the different configuration parameters for the gapi.auth2.init method.
195197/// Reference: https://developers.google.com/api-client-library/javascript/reference/referencedocs#gapiauth2clientconfig
196198@anonymous
197199@JS ()
198200abstract class ClientConfig {
201+ external factory ClientConfig ({
202+ String client_id,
203+ String cookie_policy,
204+ String scope,
205+ bool fetch_basic_profile,
206+ String ? hosted_domain,
207+ String openid_realm,
208+ String /*'popup'|'redirect'*/ ux_mode,
209+ String redirect_uri,
210+ String plugin_name,
211+ });
212+
199213 /// The app's client ID, found and created in the Google Developers Console.
200214 external String ? get client_id;
201215 external set client_id (String ? v);
@@ -238,18 +252,6 @@ abstract class ClientConfig {
238252 /// See: https://github.com/flutter/flutter/issues/88084
239253 external String ? get plugin_name;
240254 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- });
253255}
254256
255257@JS ('gapi.auth2.SigninOptionsBuilder' )
@@ -276,6 +278,7 @@ abstract class BasicProfile {
276278@anonymous
277279@JS ()
278280abstract class AuthResponse {
281+
279282 external String ? get access_token;
280283 external set access_token (String ? v);
281284 external String ? get id_token;
@@ -290,20 +293,23 @@ abstract class AuthResponse {
290293 external set first_issued_at (num ? v);
291294 external num ? get expires_at;
292295 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});
301296}
302297
303298/// Reference: https://developers.google.com/api-client-library/javascript/reference/referencedocs#gapiauth2authorizeconfig
304299@anonymous
305300@JS ()
306301abstract class AuthorizeConfig {
302+ external factory AuthorizeConfig (
303+ {String client_id,
304+ String scope,
305+ String response_type,
306+ String prompt,
307+ String cookie_policy,
308+ String hosted_domain,
309+ String login_hint,
310+ String app_package_name,
311+ String openid_realm,
312+ bool include_granted_scopes});
307313 external String get client_id;
308314 external set client_id (String v);
309315 external String get scope;
@@ -324,23 +330,22 @@ abstract class AuthorizeConfig {
324330 external set openid_realm (String ? v);
325331 external bool ? get include_granted_scopes;
326332 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});
338333}
339334
340335/// Reference: https://developers.google.com/api-client-library/javascript/reference/referencedocs#gapiauth2authorizeresponse
341336@anonymous
342337@JS ()
343338abstract class AuthorizeResponse {
339+ external factory AuthorizeResponse (
340+ {String access_token,
341+ String id_token,
342+ String code,
343+ String scope,
344+ num expires_in,
345+ num first_issued_at,
346+ num expires_at,
347+ String error,
348+ String error_subtype});
344349 external String get access_token;
345350 external set access_token (String v);
346351 external String get id_token;
@@ -359,16 +364,6 @@ abstract class AuthorizeResponse {
359364 external set error (String v);
360365 external String get error_subtype;
361366 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});
372367}
373368
374369/// A GoogleUser object represents one user account.
@@ -498,6 +493,4 @@ external void render(
498493abstract class Promise <T > {
499494 external factory Promise (
500495 void Function (void Function (T result) resolve, Function reject) executor);
501- external Promise then (void Function (T result) onFulfilled,
502- [Function onRejected]);
503496}
0 commit comments