mirror of
https://github.com/samuelthomas2774/nxapi.git
synced 2026-03-21 18:04:10 -05:00
Coral 3.0.1 web service JS APIs
This commit is contained in:
parent
8492db43d9
commit
00ab5fc623
|
|
@ -152,6 +152,21 @@ interface WebServiceJsApi {
|
|||
* Opens a URL in the default browser.
|
||||
*/
|
||||
openExternalBrowser(url: string): void;
|
||||
|
||||
/**
|
||||
* Plays a preset vibration pattern.
|
||||
*
|
||||
* Used by ZELDA NOTES.
|
||||
*/
|
||||
func_2644(data: string): void;
|
||||
|
||||
/**
|
||||
* Requests a web service token from the Coral API.
|
||||
* `window.znca._private.func_1d5e` is called with the returned token.
|
||||
*
|
||||
* Used by ZELDA NOTES.
|
||||
*/
|
||||
func_272e(): void;
|
||||
}
|
||||
|
||||
//
|
||||
|
|
@ -195,6 +210,17 @@ function requestGameWebToken() {
|
|||
});
|
||||
}
|
||||
|
||||
function func_272e() {
|
||||
debug('func_272e called');
|
||||
|
||||
ipc.requestGameWebToken().then(token => {
|
||||
// @ts-expect-error
|
||||
window.znca?._private?.func_1d5e?.call(null, token);
|
||||
}).catch(async err => {
|
||||
debug('Error requesting web service token', err);
|
||||
});
|
||||
}
|
||||
|
||||
//
|
||||
// Persistent data
|
||||
//
|
||||
|
|
@ -359,6 +385,21 @@ function openExternalBrowser(url: string) {
|
|||
window.open(url);
|
||||
}
|
||||
|
||||
export interface VibrateOptions {
|
||||
pattern: VibratePattern;
|
||||
}
|
||||
export enum VibratePattern {
|
||||
TAP = '0',
|
||||
SUCCESS = '1',
|
||||
ERROR = '2',
|
||||
}
|
||||
|
||||
function func_2644(/** JSON.stringify(data: VibrateOptions) */ data: string) {
|
||||
const options: VibrateOptions = JSON.parse(data);
|
||||
|
||||
debug('func_2644 called', options);
|
||||
}
|
||||
|
||||
const api: WebServiceJsApi = {
|
||||
invokeNativeShare,
|
||||
invokeNativeShareUrl,
|
||||
|
|
@ -378,6 +419,8 @@ const api: WebServiceJsApi = {
|
|||
reloadExtension,
|
||||
clearUnreadFlag,
|
||||
openExternalBrowser,
|
||||
func_2644,
|
||||
func_272e,
|
||||
};
|
||||
|
||||
window.jsBridge = api;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user