react-web-native-sketch
Version:
[TODO: We need an overview of how this can be used via npm vs as a local package]
100 lines (99 loc) • 3.73 kB
TypeScript
import { CommonTypeKeys, LoginAction, LoginSuccessFailAction, LogoutAction, LogoutSuccessFailAction, SignupAction, SignupSuccessFailAction, SocialLoginAction, SocialLoginSuccessFailAction, Validate2FAAction, Validate2FASuccessFailAction } from './commonActions';
export declare enum TypeKeys {
FB_LOAD_SDK = "react-web-native-sketch/auth/FB_LOAD_SDK",
FB_SDK_LOADED = "react-web-native-sketch/auth/FB_SDK_LOADED",
FB_STATUS_CHANGE = "react-web-native-sketch/auth/FB_STATUS_CHANGE",
GOOGLE_LOAD_SDK = "react-web-native-sketch/auth/GOOGLE_LOAD_SDK",
GOOGLE_SDK_LOADED = "react-web-native-sketch/auth/GOOGLE_SDK_LOADED"
}
export interface FbLoadSdkAction {
type: TypeKeys.FB_LOAD_SDK;
}
export interface FbSdkLoadedAction {
type: TypeKeys.FB_SDK_LOADED;
}
export interface FbStatusChangeAction {
type: TypeKeys.FB_STATUS_CHANGE;
}
export interface GoogleLoadSdkAction {
type: TypeKeys.GOOGLE_LOAD_SDK;
}
export interface GoogleSdkLoadedAction {
type: TypeKeys.GOOGLE_SDK_LOADED;
}
export declare type ActionTypes = FbSdkLoadedAction | FbLoadSdkAction | FbStatusChangeAction | GoogleLoadSdkAction | GoogleSdkLoadedAction | LoginAction | LoginSuccessFailAction | SignupAction | SignupSuccessFailAction | SocialLoginAction | SocialLoginSuccessFailAction | LogoutAction | LogoutSuccessFailAction | Validate2FAAction | Validate2FASuccessFailAction;
export interface AuthState {
forgotSuccess?: boolean;
googleSdkIsLoaded: boolean;
loadedFbSdk: boolean;
loadingFbSdk: boolean;
loadingForgot: boolean;
loadingGoogleSdk: boolean;
loggingIn: boolean;
loggingOut: boolean;
signingUp: boolean;
validateError?: string;
validateSuccess: boolean;
validating: boolean;
}
export declare const auth: (state: AuthState | undefined, action: ActionTypes) => AuthState;
export declare function fbSdkLoaded(): FbSdkLoadedAction;
export declare function fbStatusChangeCallback(inviteCode: string, response: {
status: string;
authResponse: {
userID: string;
accessToken: string;
};
}): any;
export declare const fbLoadSdk: (appId: string, fbSdkLoaded: () => void, fbStatusChangeCallback: any, inviteCode?: string | undefined) => FbLoadSdkAction;
export declare const loadGoogleSdk: () => {
type: TypeKeys;
};
export declare const loadedGoogleSdk: () => {
type: TypeKeys;
};
export declare const login: (body: any, url: string, method: string) => {
types: CommonTypeKeys[];
method: string;
url: string;
body: any;
};
export declare const socialLogin: (url: string, method: string, providerName: string, oauthToken: string | null, providerUserId: string | null, invite_code: string | null, redirect_uri: string | null) => {
types: CommonTypeKeys[];
method: string;
url: string;
body: {
providerName: string;
oauthToken: string | null;
providerUserId: string | null;
invite_code: string | null;
redirect_uri: string | null;
};
};
export declare const signup: (body: any, url: string, method: string) => {
types: CommonTypeKeys[];
method: string;
url: string;
body: any;
};
export declare const validate2FA: (body: any, url: string, method: string, types?: string[] | undefined) => {
types: string[];
method: string;
url: string;
body: any;
};
export declare const logout: (body: any, url: string, method: string) => {
types: CommonTypeKeys[];
url: string;
method: string;
body: any;
};
export interface LogoutProps {
types: Array<string>;
url: string;
method: string;
body: any;
}
export declare const logoutLocal: (props?: LogoutProps | undefined) => LogoutProps | {
type: CommonTypeKeys;
};