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+ // * 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.
1620
1721@JS ()
1822library gapiauth2;
@@ -122,6 +126,15 @@ abstract class CurrentUser {
122126@anonymous
123127@JS ()
124128abstract 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+
125138 /// The package name of the Android app to install over the air.
126139 /// See Android app installs from your web site:
127140 /// https://developers.google.com/identity/sign-in/web/android-app-installs
@@ -162,15 +175,6 @@ abstract class SigninOptions {
162175 // https://developers.google.com/identity/protocols/OpenIDConnect?hl=en#authenticationuriparameters
163176 external String ? get login_hint;
164177 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});
174178}
175179
176180/// Definitions by: John <https://github.com/jhcao23>
@@ -179,23 +183,35 @@ abstract class SigninOptions {
179183@anonymous
180184@JS ()
181185abstract class OfflineAccessOptions {
186+ external factory OfflineAccessOptions (
187+ {String scope,
188+ String /*'select_account'|'consent'*/ prompt,
189+ String app_package_name});
182190 external String ? get scope;
183191 external set scope (String ? v);
184192 external String ? /*'select_account'|'consent'*/ get prompt;
185193 external set prompt (String ? /*'select_account'|'consent'*/ v);
186194 external String ? get app_package_name;
187195 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});
192196}
193197
194198/// Interface that represents the different configuration parameters for the gapi.auth2.init method.
195199/// Reference: https://developers.google.com/api-client-library/javascript/reference/referencedocs#gapiauth2clientconfig
196200@anonymous
197201@JS ()
198202abstract 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+
199215 /// The app's client ID, found and created in the Google Developers Console.
200216 external String ? get client_id;
201217 external set client_id (String ? v);
@@ -238,18 +254,6 @@ abstract class ClientConfig {
238254 /// See: https://github.com/flutter/flutter/issues/88084
239255 external String ? get plugin_name;
240256 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- });
253257}
254258
255259@JS ('gapi.auth2.SigninOptionsBuilder' )
@@ -290,20 +294,23 @@ abstract class AuthResponse {
290294 external set first_issued_at (num ? v);
291295 external num ? get expires_at;
292296 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});
301297}
302298
303299/// Reference: https://developers.google.com/api-client-library/javascript/reference/referencedocs#gapiauth2authorizeconfig
304300@anonymous
305301@JS ()
306302abstract 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});
307314 external String get client_id;
308315 external set client_id (String v);
309316 external String get scope;
@@ -324,23 +331,22 @@ abstract class AuthorizeConfig {
324331 external set openid_realm (String ? v);
325332 external bool ? get include_granted_scopes;
326333 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});
338334}
339335
340336/// Reference: https://developers.google.com/api-client-library/javascript/reference/referencedocs#gapiauth2authorizeresponse
341337@anonymous
342338@JS ()
343339abstract 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});
344350 external String get access_token;
345351 external set access_token (String v);
346352 external String get id_token;
@@ -359,16 +365,6 @@ abstract class AuthorizeResponse {
359365 external set error (String v);
360366 external String get error_subtype;
361367 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});
372368}
373369
374370/// A GoogleUser object represents one user account.
@@ -498,6 +494,4 @@ external void render(
498494abstract class Promise <T > {
499495 external factory Promise (
500496 void Function (void Function (T result) resolve, Function reject) executor);
501- external Promise then (void Function (T result) onFulfilled,
502- [Function onRejected]);
503497}
0 commit comments