mirror of
https://github.com/wailsapp/wails.git
synced 2025-05-16 17:09:28 +08:00
30 lines
597 B
JavaScript
30 lines
597 B
JavaScript
/*
|
|
_ __ _ __
|
|
| | / /___ _(_) /____
|
|
| | /| / / __ `/ / / ___/
|
|
| |/ |/ / /_/ / / (__ )
|
|
|__/|__/\__,_/_/_/____/
|
|
The lightweight framework for web-like apps
|
|
(c) Lea Anthony 2019-present
|
|
*/
|
|
/* jshint esversion: 6 */
|
|
|
|
function Invoke(message) {
|
|
if (window && window.external && window.external.invoke) {
|
|
window.external.invoke(message);
|
|
} else {
|
|
//eslint-disable-line
|
|
console.log(`[No external.invoke] ${message}`);
|
|
}
|
|
}
|
|
|
|
export function SendMessage(type, payload, callbackID) {
|
|
const message = {
|
|
type,
|
|
callbackID,
|
|
payload
|
|
};
|
|
|
|
Invoke(JSON.stringify(message));
|
|
}
|