5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-02 11:10:47 +08:00
wails/v3/internal/runtime/desktop/main.js
Lea Anthony f951b51c11
Context menu WIP
options refactor
2023-02-09 18:35:26 +11:00

67 lines
1.3 KiB
JavaScript

/*
_ __ _ __
| | / /___ _(_) /____
| | /| / / __ `/ / / ___/
| |/ |/ / /_/ / / (__ )
|__/|__/\__,_/_/_/____/
The electron alternative for Go
(c) Lea Anthony 2019-present
*/
/* jshint esversion: 9 */
import * as Clipboard from './clipboard';
import * as Application from './application';
import * as Log from './log';
import {newWindow} from "./window";
import {dispatchCustomEvent, Emit, Off, OffAll, On, Once, OnMultiple} from "./events";
import {dialogCallback, dialogErrorCallback, Error, Info, OpenFile, Question, SaveFile, Warning,} from "./dialogs";
window.wails = {
...newRuntime(-1),
};
// Internal wails endpoints
window._wails = {
dialogCallback,
dialogErrorCallback,
dispatchCustomEvent,
}
export function newRuntime(id) {
return {
Clipboard: {
...Clipboard
},
Application: {
...Application
},
Log,
Dialog: {
Info,
Warning,
Error,
Question,
OpenFile,
SaveFile,
},
Events: {
Emit,
On,
Once,
OnMultiple,
Off,
OffAll,
},
Window: newWindow(id),
}
}
if (DEBUG) {
console.log("Wails v3.0.0 Debug Mode Enabled");
}