web3-mq-react
Version:
web3-mq-react-components
40 lines (39 loc) • 1.71 kB
TypeScript
import React, { Dispatch, PropsWithChildren, SetStateAction } from 'react';
import type { WalletType } from 'web3-mq';
import type { LoginEventDataType, LoginResType, RegisterResType } from '../components/LoginModal/hooks/useLogin';
export declare enum StepStringEnum {
HOME = "home",
VIEW_ALL = "view_all_desktop",
LOGIN = "login",
QR_CODE = "qr_code",
SIGN_UP = "sign_up"
}
export declare enum SignAuditTypeEnum {
GET_KEYS_FOR_LOGIN = "get_Keys_For_Login",
GET_KEYS_FOR_REGISTER = "get_keys_For_Register",
REGISTER = "register"
}
export declare type LoginContextValue = {
login: (password: string, walletType?: WalletType) => Promise<LoginResType | null>;
register: (password: string, walletType?: WalletType) => Promise<RegisterResType | null>;
getAccount: (walletType?: WalletType, address?: string) => Promise<any>;
showLoading: boolean;
setShowLoading: Dispatch<SetStateAction<boolean>>;
step: string;
setStep: Dispatch<SetStateAction<StepStringEnum>>;
walletType: WalletType;
setWalletType: Dispatch<SetStateAction<WalletType>>;
styles?: Record<string, any> | null;
handleLoginEvent: (eventData: LoginEventDataType) => void;
handleWeb3mqCallback: any;
qrCodeUrl: any;
userAccount: any;
setMainKeys: any;
loginByQrCode: any;
registerByQrCode: any;
};
export declare const LoginContext: React.Context<LoginContextValue | undefined>;
export declare const LoginProvider: ({ children, value, }: React.PropsWithChildren<{
value: LoginContextValue;
}>) => JSX.Element;
export declare const useLoginContext: (componentName?: string | undefined) => LoginContextValue;