otter-bridge
Advanced tools
Comparing version 0.0.3-alpha.17 to 0.0.3-alpha.18
@@ -29,3 +29,3 @@ declare enum GameType { | ||
constructor(gameType?: GameType, gameName?: string); | ||
init(): Promise<void>; | ||
init(): Promise<IInitRes>; | ||
env(): Promise<envResult>; | ||
@@ -99,3 +99,6 @@ reportFirebase(params: IFirebaseLogParams): Promise<any>; | ||
} | ||
interface IInitRes { | ||
clientAvailable: boolean; | ||
} | ||
export { GameType, BridgeHandler as default }; |
@@ -105,3 +105,9 @@ "use strict"; | ||
this._sid = sidRes; | ||
return { | ||
clientAvailable: true | ||
}; | ||
} catch (e) { | ||
return { | ||
clientAvailable: false | ||
}; | ||
} | ||
@@ -108,0 +114,0 @@ }); |
{ | ||
"name": "otter-bridge", | ||
"version": "0.0.3-alpha.17", | ||
"version": "0.0.3-alpha.18", | ||
"description": "Otter game web jsbridge", | ||
@@ -5,0 +5,0 @@ "files": [ |
@@ -65,3 +65,3 @@ import URI from "urijs"; | ||
async init() { | ||
async init(): Promise<IInitRes> { | ||
try { | ||
@@ -72,3 +72,10 @@ const sidRes = await OtterBridge.instance.callHandler( | ||
this._sid = sidRes; | ||
} catch {} | ||
return { | ||
clientAvailable: true, | ||
} | ||
} catch(e) { | ||
return { | ||
clientAvailable: false, | ||
} | ||
} | ||
} | ||
@@ -244,1 +251,5 @@ | ||
} | ||
interface IInitRes { | ||
clientAvailable: boolean; | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
43021
812