@@ -73,6 +73,28 @@ export interface SilentOption {
7373 silent ?: boolean ;
7474}
7575
76+ export interface AnonymousAuthData {
77+ /**
78+ * random UUID with lowercase hexadecimal digits
79+ */
80+ id : string ;
81+ [ extraAttribute : string ] : any ;
82+ }
83+
84+ export interface AuthDataWithUID {
85+ uid : string ;
86+ access_token : string ;
87+ [ extraAttribute : string ] : any ;
88+ }
89+
90+ export interface AuthDataWithOpenID {
91+ openid : string ;
92+ access_token : string ;
93+ [ extraAttribute : string ] : any ;
94+ }
95+
96+ export type AuthData = AnonymousAuthData | AuthDataWithUID | AuthDataWithOpenID ;
97+
7698export interface IBaseObject {
7799 toJSON ( ) : any ;
78100}
@@ -701,23 +723,23 @@ export class User extends Object {
701723 ) : Promise < User > ;
702724 static loginWithEmail ( email : string , password : string ) : Promise < User > ;
703725 static loginWithAuthData (
704- authData : object ,
726+ authData : AuthData ,
705727 platform : string ,
706728 options ?: OAuthLoginOptions
707729 ) : Promise < User > ;
708730 static signUpOrlogInWithAuthData (
709- authData : object ,
731+ authData : AuthData ,
710732 platform : string ,
711733 options ?: OAuthLoginOptions
712734 ) : Promise < User > ;
713735 static loginWithAuthDataAndUnionId (
714- authData : object ,
736+ authData : AuthData ,
715737 platform : string ,
716738 unionId : string ,
717739 unionLoginOptions ?: UnionLoginOptions
718740 ) : Promise < User > ;
719741 static signUpOrlogInWithAuthDataAndUnionId (
720- authData : object ,
742+ authData : AuthData ,
721743 platform : string ,
722744 unionId : string ,
723745 unionLoginOptions ?: UnionLoginOptions
@@ -769,12 +791,12 @@ export class User extends Object {
769791 unionLoginOptions ?: UnionLoginOptions
770792 ) : Promise < User > ;
771793 loginWithAuthData (
772- authData : object ,
794+ authData : AuthData ,
773795 platform : string ,
774796 options ?: OAuthLoginOptions
775797 ) : Promise < User > ;
776798 loginWithAuthDataAndUnionId (
777- authData : object ,
799+ authData : AuthData ,
778800 platform : string ,
779801 unionId : string ,
780802 unionLoginOptions ?: UnionLoginOptions
@@ -798,9 +820,9 @@ export class User extends Object {
798820 unionOptions ?: UnionOptions
799821 ) : Promise < User > ;
800822
801- associateWithAuthData ( authData : object , platform : string ) : Promise < User > ;
823+ associateWithAuthData ( authData : AuthData , platform : string ) : Promise < User > ;
802824 associateWithAuthDataAndUnionId (
803- authData : object ,
825+ authData : AuthData ,
804826 platform : string ,
805827 unionId : string ,
806828 unionOptions ?: UnionOptions
0 commit comments