Files
esengine/demo/src/Platform.ts

42 lines
787 B
TypeScript
Raw Normal View History

2020-06-08 11:49:45 +08:00
/**
*
*
*
* Promise
*/
declare interface Platform {
getUserInfo(): Promise<any>;
login(): Promise<any>
}
class DebugPlatform implements Platform {
async getUserInfo() {
return { nickName: "username" }
}
async login() {
}
}
if (!window.platform) {
window.platform = new DebugPlatform();
}
declare let platform: Platform;
declare interface Window {
platform: Platform
}