| 12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- import { Node } from "cc";
- export interface IGoogleLoginRes {
- accessToken: string;
- userId?: string;
- name?: string;
- email?: string;
- isCancel: boolean;
- status?: string;
- reason?: string;
- }
- export interface IGoogleBtnLogin {
- active: boolean,
- setActive: (active: boolean) => void,
- clear: () => void,
- }
- export abstract class GoogleImpl {
- private _isInitialized = false;
- public get isInitialized() { return this._isInitialized; }
- abstract init();
- protected onInited() {
- this._isInitialized = true;
- }
- async login(): Promise<IGoogleLoginRes> {
- const res = await this.onLogin();
- return res;
- }
- protected abstract onLogin(): Promise<IGoogleLoginRes>;
- abstract logOut(): Promise<boolean>;
- createLoginBtn(node: Node, callback: (res: IGoogleLoginRes) => void): IGoogleBtnLogin {
- return null;
- }
- }
|