@e-xi/xion 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/dist/bin/icon-generator.d.ts +22 -0
- package/dist/bin/index.d.ts +5 -0
- package/dist/bin/index.js +92 -0
- package/dist/bin/logo-generator.d.ts +22 -0
- package/dist/chunk-files/chunk-34OODP7M.js +147 -0
- package/dist/chunk-files/chunk-3KBZWBNP.js +51 -0
- package/dist/chunk-files/chunk-3R6EJDYR.js +10 -0
- package/dist/chunk-files/chunk-3RVKOFMP.js +68 -0
- package/dist/chunk-files/chunk-3S5OTD47.js +35 -0
- package/dist/chunk-files/chunk-3XB4IEWO.js +195 -0
- package/dist/chunk-files/chunk-3XOVD6UX.js +8 -0
- package/dist/chunk-files/chunk-4HEDNQUP.js +426 -0
- package/dist/chunk-files/chunk-4SSGMLEE.js +934 -0
- package/dist/chunk-files/chunk-5PKWVAQP.js +92 -0
- package/dist/chunk-files/chunk-6BOPFOZD.js +19 -0
- package/dist/chunk-files/chunk-6FDO72PN.js +25 -0
- package/dist/chunk-files/chunk-6X74EPRM.js +0 -0
- package/dist/chunk-files/chunk-B2FI5WI5.js +67 -0
- package/dist/chunk-files/chunk-B7DTBTWQ.js +74 -0
- package/dist/chunk-files/chunk-BFD2LHLK.js +60 -0
- package/dist/chunk-files/chunk-BJOPQNB2.js +319 -0
- package/dist/chunk-files/chunk-BMOLIJ3W.js +89 -0
- package/dist/chunk-files/chunk-BPTFUGTP.js +97 -0
- package/dist/chunk-files/chunk-CSUNGWAE.js +405 -0
- package/dist/chunk-files/chunk-D5ZV4VMI.js +627 -0
- package/dist/chunk-files/chunk-DD6WZ4NY.js +841 -0
- package/dist/chunk-files/chunk-DEODEAKM.js +19 -0
- package/dist/chunk-files/chunk-DRMV3M5V.js +1970 -0
- package/dist/chunk-files/chunk-EQTU45UO.js +21 -0
- package/dist/chunk-files/chunk-F7YTK2MY.js +154 -0
- package/dist/chunk-files/chunk-FMQTZ3QV.js +17 -0
- package/dist/chunk-files/chunk-FPN7JYR4.js +67 -0
- package/dist/chunk-files/chunk-FULHNQ4O.js +1243 -0
- package/dist/chunk-files/chunk-GN2FNR3Z.js +259 -0
- package/dist/chunk-files/chunk-GROGDGEL.js +177 -0
- package/dist/chunk-files/chunk-GUOSVDXA.js +34 -0
- package/dist/chunk-files/chunk-HT5V5A7S.js +6 -0
- package/dist/chunk-files/chunk-ID3YDA2K.js +19 -0
- package/dist/chunk-files/chunk-IH3R2NDR.js +230 -0
- package/dist/chunk-files/chunk-IMGYTSWY.js +261 -0
- package/dist/chunk-files/chunk-J34MOWJP.js +26 -0
- package/dist/chunk-files/chunk-KFK47PDH.js +77 -0
- package/dist/chunk-files/chunk-KFV4GXVE.js +11 -0
- package/dist/chunk-files/chunk-LFHJJQW3.js +723 -0
- package/dist/chunk-files/chunk-LQ67F6EY.js +32 -0
- package/dist/chunk-files/chunk-MJ6Q3TIX.js +703 -0
- package/dist/chunk-files/chunk-OUFO3LM4.js +135 -0
- package/dist/chunk-files/chunk-P4CX6I4J.js +14 -0
- package/dist/chunk-files/chunk-PL5KNBCY.js +78 -0
- package/dist/chunk-files/chunk-PVWRRUOK.js +11 -0
- package/dist/chunk-files/chunk-Q7LCZIQP.js +15 -0
- package/dist/chunk-files/chunk-Q7YMMN7J.js +220 -0
- package/dist/chunk-files/chunk-RAVPJRBA.js +118 -0
- package/dist/chunk-files/chunk-RN7AI33H.js +26 -0
- package/dist/chunk-files/chunk-RODB64YF.js +148 -0
- package/dist/chunk-files/chunk-SVTZ4T6S.js +10 -0
- package/dist/chunk-files/chunk-T3QCAOCO.js +20 -0
- package/dist/chunk-files/chunk-U4XEWVBH.js +19 -0
- package/dist/chunk-files/chunk-UCMR6V67.js +746 -0
- package/dist/chunk-files/chunk-UFYEZIUE.js +1269 -0
- package/dist/chunk-files/chunk-UIJUY7QZ.js +18 -0
- package/dist/chunk-files/chunk-VGDNICVG.js +67 -0
- package/dist/chunk-files/chunk-W2I3I7U7.js +35 -0
- package/dist/chunk-files/chunk-WGYOMA43.js +33 -0
- package/dist/chunk-files/chunk-WKVLVI6N.js +44 -0
- package/dist/chunk-files/chunk-WOJ2UKI7.js +11 -0
- package/dist/chunk-files/chunk-Y3OEXVQ2.js +59 -0
- package/dist/chunk-files/chunk-YLZRRUY7.js +6 -0
- package/dist/chunk-files/chunk-YTHS2ZV7.js +51 -0
- package/dist/chunk-files/chunk-YXAEUJKJ.js +331 -0
- package/dist/chunk-files/chunk-YZOJOLFL.js +121 -0
- package/dist/main/app/app-lifecycle-abstract.d.ts +190 -0
- package/dist/main/app/app-lifecycle.d.ts +7 -0
- package/dist/main/app/icons/icon.ico +0 -0
- package/dist/main/app/index.d.ts +8 -0
- package/dist/main/app/index.js +1226 -0
- package/dist/main/app/types/app.d.ts +74 -0
- package/dist/main/app/xo-app-abstract.d.ts +464 -0
- package/dist/main/app/xo-app.d.ts +23 -0
- package/dist/main/auth/index.d.ts +8 -0
- package/dist/main/auth/index.js +109 -0
- package/dist/main/auth/jwt-auth-manager.d.ts +302 -0
- package/dist/main/auth/jwt-auth-provider-abstract.d.ts +100 -0
- package/dist/main/auth/jwt-auth-refresh-rejected-error.d.ts +12 -0
- package/dist/main/auth/jwt-auth-session-changed-error.d.ts +12 -0
- package/dist/main/auth/types/jwt-auth-manager.d.ts +13 -0
- package/dist/main/banner/banner-abstract.d.ts +38 -0
- package/dist/main/banner/banner-manager.d.ts +20 -0
- package/dist/main/banner/index.d.ts +6 -0
- package/dist/main/banner/index.js +10 -0
- package/dist/main/banner/types/banner.d.ts +17 -0
- package/dist/main/config/app-config.d.ts +6 -0
- package/dist/main/config/index.d.ts +13 -0
- package/dist/main/config/index.js +33 -0
- package/dist/main/config/logger-config.d.ts +6 -0
- package/dist/main/config/remote-service-config.d.ts +6 -0
- package/dist/main/config/tray-config.d.ts +6 -0
- package/dist/main/config/types/app.d.ts +38 -0
- package/dist/main/config/types/logger.d.ts +82 -0
- package/dist/main/config/types/window.d.ts +35 -0
- package/dist/main/config/updater-config.d.ts +6 -0
- package/dist/main/config/window/main-window-config.d.ts +6 -0
- package/dist/main/config/window/setting-window-config.d.ts +6 -0
- package/dist/main/file-association/file-association-handlers-abstract.d.ts +23 -0
- package/dist/main/file-association/file-association-manager-abstract.d.ts +87 -0
- package/dist/main/file-association/file-association-manager.d.ts +13 -0
- package/dist/main/file-association/handlers/app-file-association-handlers.d.ts +12 -0
- package/dist/main/file-association/index.d.ts +8 -0
- package/dist/main/file-association/index.js +13 -0
- package/dist/main/file-association/types/file-association.d.ts +31 -0
- package/dist/main/ipc/handlers/app-handlers.d.ts +13 -0
- package/dist/main/ipc/handlers/auth-handlers.d.ts +12 -0
- package/dist/main/ipc/handlers/clipboard-handlers.d.ts +13 -0
- package/dist/main/ipc/handlers/contex-menu-handlers.d.ts +13 -0
- package/dist/main/ipc/handlers/dialog-handlers.d.ts +13 -0
- package/dist/main/ipc/handlers/file-handlers.d.ts +13 -0
- package/dist/main/ipc/handlers/log-handlers.d.ts +45 -0
- package/dist/main/ipc/handlers/remote-service-handlers.d.ts +13 -0
- package/dist/main/ipc/handlers/shell-handlers.d.ts +13 -0
- package/dist/main/ipc/handlers/theme-handlers.d.ts +13 -0
- package/dist/main/ipc/handlers/updater-handlers.d.ts +13 -0
- package/dist/main/ipc/handlers/window-handlers.d.ts +13 -0
- package/dist/main/ipc/index.d.ts +20 -0
- package/dist/main/ipc/index.js +60 -0
- package/dist/main/ipc/ipc-handlers-abstract.d.ts +23 -0
- package/dist/main/ipc/ipc-manager-abstract.d.ts +46 -0
- package/dist/main/ipc/ipc-manager.d.ts +13 -0
- package/dist/main/ipc/types/ipc-handler.d.ts +22 -0
- package/dist/main/ipc/utils/ipc-handler-util.d.ts +24 -0
- package/dist/main/logger/index.d.ts +4 -0
- package/dist/main/logger/index.js +13 -0
- package/dist/main/logger/xo-logger.d.ts +113 -0
- package/dist/main/menu/consts/menu-type.d.ts +1 -0
- package/dist/main/menu/index.d.ts +8 -0
- package/dist/main/menu/index.js +28 -0
- package/dist/main/menu/menu-items.d.ts +192 -0
- package/dist/main/menu/menu-manager-abstract.d.ts +273 -0
- package/dist/main/menu/menu-manager.d.ts +12 -0
- package/dist/main/menu/types/menu.d.ts +101 -0
- package/dist/main/mode/app-mode.d.ts +32 -0
- package/dist/main/mode/index.d.ts +5 -0
- package/dist/main/mode/index.js +9 -0
- package/dist/main/mode/types/mode.d.ts +25 -0
- package/dist/main/protocol/consts/protocol-keys.d.ts +10 -0
- package/dist/main/protocol/handlers/app-protocol-handlers.d.ts +12 -0
- package/dist/main/protocol/index.d.ts +9 -0
- package/dist/main/protocol/index.js +15 -0
- package/dist/main/protocol/protocol-handlers-abstract.d.ts +23 -0
- package/dist/main/protocol/protocol-manager-abstract.d.ts +85 -0
- package/dist/main/protocol/protocol-manager.d.ts +13 -0
- package/dist/main/protocol/types/protocol.d.ts +33 -0
- package/dist/main/remote-service/consts/remote-service-methods.d.ts +5 -0
- package/dist/main/remote-service/index.d.ts +7 -0
- package/dist/main/remote-service/index.js +17 -0
- package/dist/main/remote-service/remote-service-manager-abstract.d.ts +303 -0
- package/dist/main/remote-service/remote-service-manager.d.ts +7 -0
- package/dist/main/remote-service/types/remote-service.d.ts +9 -0
- package/dist/main/renderer-protocol/handlers/renderer-remote-service-protocol-handlers.d.ts +130 -0
- package/dist/main/renderer-protocol/handlers/renderer-root-protocol-handlers.d.ts +65 -0
- package/dist/main/renderer-protocol/index.d.ts +9 -0
- package/dist/main/renderer-protocol/index.js +18 -0
- package/dist/main/renderer-protocol/renderer-protocol-handlers-abstract.d.ts +23 -0
- package/dist/main/renderer-protocol/renderer-protocol-manager-abstract.d.ts +78 -0
- package/dist/main/renderer-protocol/renderer-protocol-manager.d.ts +13 -0
- package/dist/main/renderer-protocol/types/renderer-protocol.d.ts +34 -0
- package/dist/main/shortcut/handlers/app-shortcut-handlers.d.ts +11 -0
- package/dist/main/shortcut/handlers/window-shortcut-handlers.d.ts +11 -0
- package/dist/main/shortcut/index.d.ts +9 -0
- package/dist/main/shortcut/index.js +17 -0
- package/dist/main/shortcut/shortcut-handlers-abstract.d.ts +18 -0
- package/dist/main/shortcut/shortcut-manager-abstract.d.ts +121 -0
- package/dist/main/shortcut/shortcut-manager.d.ts +12 -0
- package/dist/main/shortcut/types/shortcut.d.ts +50 -0
- package/dist/main/store/app-store.d.ts +179 -0
- package/dist/main/store/index.d.ts +7 -0
- package/dist/main/store/index.js +13 -0
- package/dist/main/store/jwt-auth-store.d.ts +36 -0
- package/dist/main/store/types/app-store.d.ts +46 -0
- package/dist/main/store/types/jwt-auth-store.d.ts +14 -0
- package/dist/main/theme/consts/theme-sources.d.ts +10 -0
- package/dist/main/theme/index.d.ts +7 -0
- package/dist/main/theme/index.js +16 -0
- package/dist/main/theme/theme-manager-abstract.d.ts +93 -0
- package/dist/main/theme/theme-manager.d.ts +7 -0
- package/dist/main/theme/types/theme.d.ts +38 -0
- package/dist/main/tray/consts/tray-animation-name.d.ts +1 -0
- package/dist/main/tray/consts/tray-icon-name.d.ts +1 -0
- package/dist/main/tray/icons/blur.ico +0 -0
- package/dist/main/tray/icons/error.ico +0 -0
- package/dist/main/tray/icons/focus.ico +0 -0
- package/dist/main/tray/icons/none.ico +0 -0
- package/dist/main/tray/icons/offline.ico +0 -0
- package/dist/main/tray/icons/online.ico +0 -0
- package/dist/main/tray/icons/success.ico +0 -0
- package/dist/main/tray/index.d.ts +11 -0
- package/dist/main/tray/index.js +27 -0
- package/dist/main/tray/tray-animation.d.ts +48 -0
- package/dist/main/tray/tray-icon.d.ts +51 -0
- package/dist/main/tray/tray-lifecycle-abstract.d.ts +154 -0
- package/dist/main/tray/tray-lifecycle.d.ts +7 -0
- package/dist/main/tray/tray-manager.d.ts +173 -0
- package/dist/main/tray/types/tray.d.ts +81 -0
- package/dist/main/updater/dev-app-update.yml +5 -0
- package/dist/main/updater/index.d.ts +6 -0
- package/dist/main/updater/index.js +20 -0
- package/dist/main/updater/types/updater.d.ts +167 -0
- package/dist/main/updater/updater-manager-abstract.d.ts +237 -0
- package/dist/main/updater/updater-manager.d.ts +7 -0
- package/dist/main/utils/file-association-util.d.ts +43 -0
- package/dist/main/utils/index.d.ts +14 -0
- package/dist/main/utils/index.js +105 -0
- package/dist/main/utils/menu-util.d.ts +12 -0
- package/dist/main/utils/protocol-util.d.ts +49 -0
- package/dist/main/utils/runtime-config-util.d.ts +75 -0
- package/dist/main/utils/shortcut-util.d.ts +38 -0
- package/dist/main/utils/tray-util.d.ts +18 -0
- package/dist/main/utils/window-util.d.ts +55 -0
- package/dist/main/utils/xo-app-root-util.d.ts +30 -0
- package/dist/main/utils/xo-app-util.d.ts +24 -0
- package/dist/main/utils/xo-path-util.d.ts +59 -0
- package/dist/main/utils/xo-util.d.ts +17 -0
- package/dist/main/window/index.d.ts +10 -0
- package/dist/main/window/index.js +36 -0
- package/dist/main/window/main/main-window-lifecycle.d.ts +7 -0
- package/dist/main/window/main/main-window-type.d.ts +5 -0
- package/dist/main/window/setting/setting-window-lifecycle.d.ts +7 -0
- package/dist/main/window/setting/setting-window-type.d.ts +5 -0
- package/dist/main/window/types/window.d.ts +86 -0
- package/dist/main/window/window-lifecycle-abstract.d.ts +514 -0
- package/dist/main/window/window-manager.d.ts +422 -0
- package/dist/preload/bridge/bridge-abstract.d.ts +11 -0
- package/dist/preload/bridge/bridge.d.ts +35 -0
- package/dist/preload/bridge/index.d.ts +6 -0
- package/dist/preload/bridge/index.js +117 -0
- package/dist/preload/bridge/preload.cjs +1706 -0
- package/dist/preload/bridge/preload.internal.d.ts +1 -0
- package/dist/preload/bridge/types/bridge.d.ts +19 -0
- package/dist/preload/bridges/app/app-bridge.d.ts +142 -0
- package/dist/preload/bridges/app/types/app.d.ts +65 -0
- package/dist/preload/bridges/auth/auth-bridge.d.ts +36 -0
- package/dist/preload/bridges/auth/types/auth.d.ts +23 -0
- package/dist/preload/bridges/clipboard/clipboard-bridge.d.ts +37 -0
- package/dist/preload/bridges/clipboard/types/clipboard.d.ts +23 -0
- package/dist/preload/bridges/context-menu/context-menu-bridge.d.ts +27 -0
- package/dist/preload/bridges/context-menu/types/context-menu.d.ts +19 -0
- package/dist/preload/bridges/dialog/dialog-bridge.d.ts +30 -0
- package/dist/preload/bridges/dialog/types/dialog.d.ts +41 -0
- package/dist/preload/bridges/file/file-bridge.d.ts +34 -0
- package/dist/preload/bridges/file/types/file.d.ts +21 -0
- package/dist/preload/bridges/index.d.ts +29 -0
- package/dist/preload/bridges/index.js +40 -0
- package/dist/preload/bridges/ipc/ipc-bridge.d.ts +43 -0
- package/dist/preload/bridges/ipc/types/ipc.d.ts +23 -0
- package/dist/preload/bridges/log/log-bridge.d.ts +52 -0
- package/dist/preload/bridges/log/types/log.d.ts +20 -0
- package/dist/preload/bridges/remote-service/remote-service-bridge.d.ts +55 -0
- package/dist/preload/bridges/remote-service/types/remote-service.d.ts +29 -0
- package/dist/preload/bridges/shell/shell-bridge.d.ts +27 -0
- package/dist/preload/bridges/shell/types/shell.d.ts +19 -0
- package/dist/preload/bridges/theme/theme-bridge.d.ts +32 -0
- package/dist/preload/bridges/theme/types/theme.d.ts +21 -0
- package/dist/preload/bridges/updater/types/updater.d.ts +35 -0
- package/dist/preload/bridges/updater/updater-bridge.d.ts +66 -0
- package/dist/preload/bridges/window/internal/route-redirect-buffer.d.ts +36 -0
- package/dist/preload/bridges/window/types/window.d.ts +53 -0
- package/dist/preload/bridges/window/window-bridge.d.ts +118 -0
- package/dist/preload/utils/bridge-util.d.ts +43 -0
- package/dist/preload/utils/index.d.ts +4 -0
- package/dist/preload/utils/index.js +7 -0
- package/dist/renderer/app/bootstrap-renderer.d.ts +6 -0
- package/dist/renderer/app/index.d.ts +5 -0
- package/dist/renderer/app/index.js +164 -0
- package/dist/renderer/app/styles-element-plus.internal.d.ts +2 -0
- package/dist/renderer/app/styles-xion.internal.d.ts +2 -0
- package/dist/renderer/app/types/app.d.ts +51 -0
- package/dist/renderer/components/captcha/internal/captcha-controller.d.ts +280 -0
- package/dist/renderer/components/captcha/internal/captcha-css-property.d.ts +25 -0
- package/dist/renderer/components/captcha/internal/captcha-defaults.d.ts +33 -0
- package/dist/renderer/components/captcha/internal/captcha-errors.d.ts +21 -0
- package/dist/renderer/components/captcha/internal/captcha-helper.d.ts +72 -0
- package/dist/renderer/components/captcha/internal/captcha-injector.d.ts +16 -0
- package/dist/renderer/components/captcha/internal/captcha-runtime-types.d.ts +153 -0
- package/dist/renderer/components/captcha/internal/captcha-service.d.ts +22 -0
- package/dist/renderer/components/captcha/internal/captcha-slide-types.d.ts +62 -0
- package/dist/renderer/components/captcha/internal/captcha-ui-patch.d.ts +43 -0
- package/dist/renderer/components/captcha/internal/captcha-wasm-loader.d.ts +36 -0
- package/dist/renderer/components/captcha/style/index.less +132 -0
- package/dist/renderer/components/captcha/types/captcha.d.ts +132 -0
- package/dist/renderer/components/captcha/xo-captcha-host.vue +151 -0
- package/dist/renderer/components/captcha/xo-captcha.vue +83 -0
- package/dist/renderer/components/captcha.d.ts +40 -0
- package/dist/renderer/components/context-menu/types/context-menu.d.ts +55 -0
- package/dist/renderer/components/context-menu/xo-context-menu-items.vue +112 -0
- package/dist/renderer/components/context-menu/xo-context-menu.vue +356 -0
- package/dist/renderer/components/context-menu.d.ts +32 -0
- package/dist/renderer/components/divider/types/divider.d.ts +31 -0
- package/dist/renderer/components/divider/xo-divider.vue +176 -0
- package/dist/renderer/components/form/types/form-flex-row.d.ts +21 -0
- package/dist/renderer/components/form/types/form-flex.d.ts +49 -0
- package/dist/renderer/components/form/xo-form-flex-row.vue +122 -0
- package/dist/renderer/components/form/xo-form-flex.vue +115 -0
- package/dist/renderer/components/index.d.ts +70 -0
- package/dist/renderer/components/index.js +1282 -0
- package/dist/renderer/components/layouts/types/app-layout.d.ts +29 -0
- package/dist/renderer/components/layouts/types/mini-layout.d.ts +23 -0
- package/dist/renderer/components/layouts/types/simple-layout.d.ts +17 -0
- package/dist/renderer/components/layouts/xo-app-layout.vue +350 -0
- package/dist/renderer/components/layouts/xo-mini-layout.vue +207 -0
- package/dist/renderer/components/layouts/xo-simple-layout.vue +43 -0
- package/dist/renderer/components/pages/types/app-page.d.ts +25 -0
- package/dist/renderer/components/pages/types/bootstrap-page.d.ts +35 -0
- package/dist/renderer/components/pages/types/dynamic-page.d.ts +20 -0
- package/dist/renderer/components/pages/types/settings-page.d.ts +23 -0
- package/dist/renderer/components/pages/xo-app-page.vue +230 -0
- package/dist/renderer/components/pages/xo-bootstrap-page.vue +93 -0
- package/dist/renderer/components/pages/xo-dynamic-page.vue +28 -0
- package/dist/renderer/components/pages/xo-settings-page.vue +143 -0
- package/dist/renderer/components/radio-group/types/radio-group.d.ts +30 -0
- package/dist/renderer/components/radio-group/xo-radio-group.vue +38 -0
- package/dist/renderer/components/service-status-bar/types/service-status-bar.d.ts +65 -0
- package/dist/renderer/components/service-status-bar/xo-service-status-bar.vue +193 -0
- package/dist/renderer/components/settings-components/types/setting-app-opacity.d.ts +19 -0
- package/dist/renderer/components/settings-components/types/setting-log-level.d.ts +23 -0
- package/dist/renderer/components/settings-components/types/setting-shortcut-keys-record-for-form-flex-rows.d.ts +47 -0
- package/dist/renderer/components/settings-components/types/setting-shortcut-keys-record.d.ts +23 -0
- package/dist/renderer/components/settings-components/types/setting-window-material.d.ts +23 -0
- package/dist/renderer/components/settings-components/xo-setting-app-opacity.vue +105 -0
- package/dist/renderer/components/settings-components/xo-setting-log-level.vue +84 -0
- package/dist/renderer/components/settings-components/xo-setting-shortcut-keys-record-for-form-flex-rows.vue +37 -0
- package/dist/renderer/components/settings-components/xo-setting-shortcut-keys-record.vue +74 -0
- package/dist/renderer/components/settings-components/xo-setting-window-material.vue +83 -0
- package/dist/renderer/components/settings-pages/types/setting-page-folder.d.ts +41 -0
- package/dist/renderer/components/settings-pages/types/setting-page-general.d.ts +23 -0
- package/dist/renderer/components/settings-pages/types/setting-page-remote-service.d.ts +19 -0
- package/dist/renderer/components/settings-pages/types/setting-page-updater.d.ts +27 -0
- package/dist/renderer/components/settings-pages/xo-setting-page-folder.vue +137 -0
- package/dist/renderer/components/settings-pages/xo-setting-page-general.vue +255 -0
- package/dist/renderer/components/settings-pages/xo-setting-page-remote-service.vue +183 -0
- package/dist/renderer/components/settings-pages/xo-setting-page-updater.vue +350 -0
- package/dist/renderer/components/shortcut-keys-record/types/shortcut-keys-record.d.ts +25 -0
- package/dist/renderer/components/shortcut-keys-record/xo-shortcut-keys-record.vue +161 -0
- package/dist/renderer/components/side-bar/types/sidebar-logo.d.ts +39 -0
- package/dist/renderer/components/side-bar/xo-sidebar-logo.vue +133 -0
- package/dist/renderer/components/spacing-line/types/spacing-line.d.ts +17 -0
- package/dist/renderer/components/spacing-line/xo-spacing-line.vue +53 -0
- package/dist/renderer/components/theme-switch/types/theme-switch-mini.d.ts +21 -0
- package/dist/renderer/components/theme-switch/types/theme-switch.d.ts +45 -0
- package/dist/renderer/components/theme-switch/xo-theme-switch-mini.vue +93 -0
- package/dist/renderer/components/theme-switch/xo-theme-switch.vue +200 -0
- package/dist/renderer/components/title-bar/types/title-bar.d.ts +58 -0
- package/dist/renderer/components/title-bar/xo-title-bar.vue +364 -0
- package/dist/renderer/components/types/sidebar-menu.d.ts +37 -0
- package/dist/renderer/components/types/vue.d.ts +9 -0
- package/dist/renderer/components/updater/types/updater.d.ts +97 -0
- package/dist/renderer/components/updater/xo-updater.vue +1190 -0
- package/dist/renderer/components/window-control/types/window-control.d.ts +17 -0
- package/dist/renderer/components/window-control/xo-window-control.vue +193 -0
- package/dist/renderer/composables/index.d.ts +7 -0
- package/dist/renderer/composables/index.js +570 -0
- package/dist/renderer/composables/use-xo-boolean.d.ts +14 -0
- package/dist/renderer/composables/use-xo-data-loader.d.ts +73 -0
- package/dist/renderer/composables/use-xo-form-control.d.ts +84 -0
- package/dist/renderer/composables/use-xo-updater-action.d.ts +25 -0
- package/dist/renderer/global/index.d.ts +4 -0
- package/dist/renderer/global/index.js +0 -0
- package/dist/renderer/global/types/window.d.ts +21 -0
- package/dist/renderer/icons/demo.css +539 -0
- package/dist/renderer/icons/iconfont.css +490 -0
- package/dist/renderer/services/index.d.ts +6 -0
- package/dist/renderer/services/index.js +444 -0
- package/dist/renderer/services/orval-axios-mutator.d.ts +9 -0
- package/dist/renderer/services/types/xo-api.d.ts +92 -0
- package/dist/renderer/services/xo-api-requester.d.ts +129 -0
- package/dist/renderer/store/app/app-store.d.ts +68 -0
- package/dist/renderer/store/auth/auth-store.d.ts +43 -0
- package/dist/renderer/store/index.d.ts +9 -0
- package/dist/renderer/store/index.js +595 -0
- package/dist/renderer/store/remote-service/remote-service-store.d.ts +52 -0
- package/dist/renderer/store/theme/theme-store.d.ts +52 -0
- package/dist/renderer/store/updater/updater-store.d.ts +88 -0
- package/dist/renderer/store/window/window-store.d.ts +58 -0
- package/dist/renderer/styles/css/element-plus.less +280 -0
- package/dist/renderer/styles/css/iconfont-patch.less +6 -0
- package/dist/renderer/styles/css/reset.less +83 -0
- package/dist/renderer/styles/css/scrollbar.less +56 -0
- package/dist/renderer/styles/index.less +35 -0
- package/dist/renderer/styles/mixin.less +144 -0
- package/dist/renderer/styles/var/element-plus/dark.less +32 -0
- package/dist/renderer/styles/var/element-plus/root.less +88 -0
- package/dist/renderer/styles/var/global/dark.less +10 -0
- package/dist/renderer/styles/var/global/root.less +46 -0
- package/dist/renderer/styles/var/layout/dark.less +7 -0
- package/dist/renderer/styles/var/layout/root.less +9 -0
- package/dist/renderer/styles/var/scrollbar/dark.less +13 -0
- package/dist/renderer/styles/var/scrollbar/root.less +35 -0
- package/dist/renderer/utils/auth-route-util.d.ts +117 -0
- package/dist/renderer/utils/context-util.d.ts +13 -0
- package/dist/renderer/utils/error-util.d.ts +12 -0
- package/dist/renderer/utils/index.d.ts +14 -0
- package/dist/renderer/utils/index.js +1522 -0
- package/dist/renderer/utils/keyboard-util.d.ts +86 -0
- package/dist/renderer/utils/message-util.d.ts +161 -0
- package/dist/renderer/utils/renderer-log-util.d.ts +44 -0
- package/dist/renderer/utils/renderer-util.d.ts +37 -0
- package/dist/renderer/utils/router-util.d.ts +186 -0
- package/dist/renderer/utils/shortcut-util.d.ts +20 -0
- package/dist/renderer/utils/storage-util.d.ts +85 -0
- package/dist/renderer/utils/types/vue-router.d.ts +17 -0
- package/dist/shared/app/consts/app-launch-mode.d.ts +9 -0
- package/dist/shared/app/consts/update-mode.d.ts +8 -0
- package/dist/shared/app/consts/window-close-behavior.d.ts +8 -0
- package/dist/shared/app/consts/window-material.d.ts +8 -0
- package/dist/shared/app/consts/xion-name.d.ts +5 -0
- package/dist/shared/app/electron-app-config.d.ts +5 -0
- package/dist/shared/app/index.d.ts +16 -0
- package/dist/shared/app/index.js +30 -0
- package/dist/shared/app/types/app-info.d.ts +32 -0
- package/dist/shared/app/types/app-launch-mode.d.ts +13 -0
- package/dist/shared/app/types/app-paths.d.ts +27 -0
- package/dist/shared/app/types/general-settings.d.ts +27 -0
- package/dist/shared/app/types/on-window-close.d.ts +13 -0
- package/dist/shared/app/types/update-mode.d.ts +13 -0
- package/dist/shared/app/types/window-material.d.ts +2 -0
- package/dist/shared/auth/const/auth-status.d.ts +2 -0
- package/dist/shared/auth/index.d.ts +5 -0
- package/dist/shared/auth/index.js +5 -0
- package/dist/shared/auth/types/auth.d.ts +78 -0
- package/dist/shared/color/consts/color.d.ts +5 -0
- package/dist/shared/color/index.d.ts +5 -0
- package/dist/shared/color/index.js +6 -0
- package/dist/shared/color/types/color.d.ts +26 -0
- package/dist/shared/electron-builder/index.d.ts +4 -0
- package/dist/shared/electron-builder/index.js +0 -0
- package/dist/shared/electron-builder/types/electron-builder-options.d.ts +34 -0
- package/dist/shared/errors/index.d.ts +4 -0
- package/dist/shared/errors/index.js +10 -0
- package/dist/shared/errors/ipc-invoke-error.d.ts +32 -0
- package/dist/shared/ipc/channels/app-channels.d.ts +56 -0
- package/dist/shared/ipc/channels/auth-channels.d.ts +14 -0
- package/dist/shared/ipc/channels/clipboard-channels.d.ts +14 -0
- package/dist/shared/ipc/channels/context-menu-channels.d.ts +10 -0
- package/dist/shared/ipc/channels/dialog-channels.d.ts +12 -0
- package/dist/shared/ipc/channels/file-channels.d.ts +12 -0
- package/dist/shared/ipc/channels/log-channels.d.ts +14 -0
- package/dist/shared/ipc/channels/remote-service-channels.d.ts +20 -0
- package/dist/shared/ipc/channels/shell-channels.d.ts +10 -0
- package/dist/shared/ipc/channels/theme-channels.d.ts +12 -0
- package/dist/shared/ipc/channels/updater-channels.d.ts +26 -0
- package/dist/shared/ipc/channels/window-channels.d.ts +44 -0
- package/dist/shared/ipc/consts/ipc-channel.d.ts +1 -0
- package/dist/shared/ipc/index.d.ts +19 -0
- package/dist/shared/ipc/index.js +46 -0
- package/dist/shared/ipc/ipc-result.d.ts +20 -0
- package/dist/shared/ipc/types/ipc-logger.d.ts +27 -0
- package/dist/shared/ipc/types/ipc.d.ts +61 -0
- package/dist/shared/logger/consts/log-levels.d.ts +14 -0
- package/dist/shared/logger/index.d.ts +4 -0
- package/dist/shared/logger/index.js +10 -0
- package/dist/shared/menu/consts/menu-command.d.ts +1 -0
- package/dist/shared/menu/index.d.ts +6 -0
- package/dist/shared/menu/index.js +10 -0
- package/dist/shared/menu/menu-command.d.ts +24 -0
- package/dist/shared/menu/types/menu.d.ts +72 -0
- package/dist/shared/mode/consts/command.d.ts +10 -0
- package/dist/shared/mode/consts/mode.d.ts +22 -0
- package/dist/shared/mode/index.d.ts +5 -0
- package/dist/shared/mode/index.js +18 -0
- package/dist/shared/remote-service/const/remote-service.d.ts +8 -0
- package/dist/shared/remote-service/index.d.ts +5 -0
- package/dist/shared/remote-service/index.js +38 -0
- package/dist/shared/remote-service/types/remote-service.d.ts +146 -0
- package/dist/shared/renderer/index.d.ts +7 -0
- package/dist/shared/renderer/index.js +0 -0
- package/dist/shared/renderer/types/element-plus.d.ts +20 -0
- package/dist/shared/renderer/types/input.d.ts +11 -0
- package/dist/shared/renderer/types/options.d.ts +22 -0
- package/dist/shared/renderer/types/switch.d.ts +11 -0
- package/dist/shared/renderer-protocol/consts/renderer-protocol-keys.d.ts +10 -0
- package/dist/shared/renderer-protocol/index.d.ts +5 -0
- package/dist/shared/renderer-protocol/index.js +6 -0
- package/dist/shared/renderer-protocol/types/renderer-protocol.d.ts +7 -0
- package/dist/shared/runtime/index.d.ts +4 -0
- package/dist/shared/runtime/index.js +0 -0
- package/dist/shared/runtime/types/runtime.d.ts +20 -0
- package/dist/shared/shortcut/consts/shortcut-handler-ids.d.ts +9 -0
- package/dist/shared/shortcut/consts/shortcut-id.d.ts +1 -0
- package/dist/shared/shortcut/index.d.ts +6 -0
- package/dist/shared/shortcut/index.js +10 -0
- package/dist/shared/shortcut/types/shortcut.d.ts +13 -0
- package/dist/shared/utils/bytes-util.d.ts +16 -0
- package/dist/shared/utils/index.d.ts +15 -0
- package/dist/shared/utils/index.js +42 -0
- package/dist/shared/utils/ipc-util.d.ts +12 -0
- package/dist/shared/utils/log-util.d.ts +33 -0
- package/dist/shared/utils/menu-util.d.ts +12 -0
- package/dist/shared/utils/number-util.d.ts +12 -0
- package/dist/shared/utils/object-util.d.ts +88 -0
- package/dist/shared/utils/regexp-util.d.ts +22 -0
- package/dist/shared/utils/shortcut-util.d.ts +12 -0
- package/dist/shared/utils/string-util.d.ts +14 -0
- package/dist/shared/utils/time-util.d.ts +32 -0
- package/dist/shared/utils/validator-util.d.ts +12 -0
- package/dist/shared/utils/window-shared-util.d.ts +26 -0
- package/dist/shared/window/consts/window-record-id.d.ts +2 -0
- package/dist/shared/window/consts/window-type-name.d.ts +1 -0
- package/dist/shared/window/identity/main-window-identity.d.ts +5 -0
- package/dist/shared/window/identity/setting-window-identity.d.ts +5 -0
- package/dist/shared/window/index.d.ts +8 -0
- package/dist/shared/window/index.js +23 -0
- package/dist/shared/window/types/window.d.ts +84 -0
- package/dist/types/index.d.ts +102 -0
- package/dist/types/index.js +0 -0
- package/dist/vite/build/build-chunk.d.ts +53 -0
- package/dist/vite/build/build-csp-update.d.ts +80 -0
- package/dist/vite/build/build-obfuscation.d.ts +33 -0
- package/dist/vite/build/component-map.d.ts +38 -0
- package/dist/vite/build/component-resolver.d.ts +6 -0
- package/dist/vite/build/index.d.ts +9 -0
- package/dist/vite/build/index.js +18 -0
- package/dist/vite/build/types/build.d.ts +13 -0
- package/dist/vite/config/electron-app-config.d.ts +6 -0
- package/dist/vite/config/electron-builder-config.d.ts +8 -0
- package/dist/vite/config/electron-vite-config.d.ts +9 -0
- package/dist/vite/config/index.d.ts +11 -0
- package/dist/vite/config/index.js +2259 -0
- package/dist/vite/config/types/electron-app-options.d.ts +22 -0
- package/dist/vite/config/types/electron-builder-options.d.ts +16 -0
- package/dist/vite/config/types/electron-vite-options.d.ts +43 -0
- package/dist/vite/config/types/vite-obfuscation.d.ts +36 -0
- package/dist/vite/config/vite-obfuscation-config.d.ts +6 -0
- package/dist/vite/mode/index.d.ts +4 -0
- package/dist/vite/mode/index.js +8 -0
- package/dist/vite/mode/vite-mode.d.ts +37 -0
- package/dist/vite/orval/index.d.ts +4 -0
- package/dist/vite/orval/index.js +75 -0
- package/dist/vite/orval/orval-global-types.d.ts +23 -0
- package/dist/vite/utils/file-write-vite-util.d.ts +30 -0
- package/dist/vite/utils/index.d.ts +5 -0
- package/dist/vite/utils/index.js +10 -0
- package/dist/vite/utils/runtime-config-vite-util.d.ts +39 -0
- package/package.json +287 -0
|
@@ -0,0 +1,1243 @@
|
|
|
1
|
+
import {
|
|
2
|
+
BridgeUtil
|
|
3
|
+
} from "./chunk-PL5KNBCY.js";
|
|
4
|
+
import {
|
|
5
|
+
AppChannels,
|
|
6
|
+
ClipboardChannels,
|
|
7
|
+
DialogChannels,
|
|
8
|
+
FileChannels,
|
|
9
|
+
LogChannels,
|
|
10
|
+
ShellChannels
|
|
11
|
+
} from "./chunk-RAVPJRBA.js";
|
|
12
|
+
import {
|
|
13
|
+
UpdaterChannels
|
|
14
|
+
} from "./chunk-LQ67F6EY.js";
|
|
15
|
+
import {
|
|
16
|
+
ContextMenuChannels,
|
|
17
|
+
WindowChannels
|
|
18
|
+
} from "./chunk-BFD2LHLK.js";
|
|
19
|
+
import {
|
|
20
|
+
LogUtil
|
|
21
|
+
} from "./chunk-BMOLIJ3W.js";
|
|
22
|
+
import {
|
|
23
|
+
RemoteServiceChannels
|
|
24
|
+
} from "./chunk-RN7AI33H.js";
|
|
25
|
+
import {
|
|
26
|
+
ThemeChannels
|
|
27
|
+
} from "./chunk-UIJUY7QZ.js";
|
|
28
|
+
import {
|
|
29
|
+
AuthChannels
|
|
30
|
+
} from "./chunk-T3QCAOCO.js";
|
|
31
|
+
|
|
32
|
+
// src/preload/bridge/bridge-abstract.ts
|
|
33
|
+
var BridgeAbstract = class {
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
// src/preload/bridges/app/app-bridge.ts
|
|
37
|
+
var AppBridge = class extends BridgeAbstract {
|
|
38
|
+
/**
|
|
39
|
+
* 接口映射
|
|
40
|
+
* <p>渲染进程声明文件 {@link XoBridgeApi.Map.app}</p>
|
|
41
|
+
* @returns {XoBridge.ApiMap}
|
|
42
|
+
*/
|
|
43
|
+
apiMap() {
|
|
44
|
+
return {
|
|
45
|
+
app: {
|
|
46
|
+
// 获取应用信息
|
|
47
|
+
getInfo: this.getInfo.bind(this),
|
|
48
|
+
// 获取应用目录
|
|
49
|
+
getPaths: this.getPaths.bind(this),
|
|
50
|
+
// 获取通用设置
|
|
51
|
+
getGeneralSettings: this.getGeneralSettings.bind(this),
|
|
52
|
+
// 获取 APP 透明度
|
|
53
|
+
getOpacity: this.getOpacity.bind(this),
|
|
54
|
+
// 设置 APP 透明度
|
|
55
|
+
setOpacity: this.setOpacity.bind(this),
|
|
56
|
+
// 获取快捷窗口材质
|
|
57
|
+
getWindowMaterial: this.getWindowMaterial.bind(this),
|
|
58
|
+
// 设置快捷窗口材质
|
|
59
|
+
setWindowMaterial: this.setWindowMaterial.bind(this),
|
|
60
|
+
// 获取应用启动模式
|
|
61
|
+
getAppLaunchMode: this.getAppLaunchMode.bind(this),
|
|
62
|
+
// 设置应用启动模式
|
|
63
|
+
setAppLaunchMode: this.setAppLaunchMode.bind(this),
|
|
64
|
+
// 获取是否开机启动
|
|
65
|
+
getLaunchOnStartup: this.getLaunchOnStartup.bind(this),
|
|
66
|
+
// 设置是否开机启动
|
|
67
|
+
setLaunchOnStartup: this.setLaunchOnStartup.bind(this),
|
|
68
|
+
// 获取关闭窗口行为
|
|
69
|
+
getWindowCloseBehavior: this.getWindowCloseBehavior.bind(this),
|
|
70
|
+
// 设置关闭窗口行为
|
|
71
|
+
setWindowCloseBehavior: this.setWindowCloseBehavior.bind(this),
|
|
72
|
+
// 获取日志等级
|
|
73
|
+
getLogLevel: this.getLogLevel.bind(this),
|
|
74
|
+
// 设置日志等级
|
|
75
|
+
setLogLevel: this.setLogLevel.bind(this),
|
|
76
|
+
// 获取快捷键配置
|
|
77
|
+
getShortcuts: this.getShortcuts.bind(this),
|
|
78
|
+
// 设置快捷键配置
|
|
79
|
+
setShortcuts: this.setShortcuts.bind(this),
|
|
80
|
+
// 设置单个快捷键配置
|
|
81
|
+
setShortcut: this.setShortcut.bind(this),
|
|
82
|
+
// 删除快捷键配置
|
|
83
|
+
deleteShortcut: this.deleteShortcut.bind(this),
|
|
84
|
+
// 重定向指定窗口路由
|
|
85
|
+
redirectWindowRoute: this.redirectWindowRoute.bind(this),
|
|
86
|
+
// 重定向主窗口路由
|
|
87
|
+
redirectMainWindowRoute: this.redirectMainWindowRoute.bind(this),
|
|
88
|
+
// 重定向设置窗口路由
|
|
89
|
+
redirectSettingWindowRoute: this.redirectSettingWindowRoute.bind(this),
|
|
90
|
+
// 显示主窗口
|
|
91
|
+
showMainWindow: this.showMainWindow.bind(this),
|
|
92
|
+
// 显示设置窗口
|
|
93
|
+
showSettingWindow: this.showSettingWindow.bind(this),
|
|
94
|
+
// 重启应用
|
|
95
|
+
restart: this.restart.bind(this)
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* 获取应用信息
|
|
101
|
+
* @returns {Promise<XoApp.Info>}
|
|
102
|
+
*/
|
|
103
|
+
getInfo = async () => {
|
|
104
|
+
const data = await BridgeUtil.invoke(AppChannels.getInfo);
|
|
105
|
+
return data ?? {};
|
|
106
|
+
};
|
|
107
|
+
/**
|
|
108
|
+
* 获取应用目录
|
|
109
|
+
* @returns {Promise<XoApp.Paths>}
|
|
110
|
+
*/
|
|
111
|
+
getPaths = async () => {
|
|
112
|
+
const data = await BridgeUtil.invoke(AppChannels.getPaths);
|
|
113
|
+
return data ?? {
|
|
114
|
+
userData: "",
|
|
115
|
+
sessionData: "",
|
|
116
|
+
logs: "",
|
|
117
|
+
crashDumps: "",
|
|
118
|
+
temp: "",
|
|
119
|
+
updaterCacheDir: ""
|
|
120
|
+
};
|
|
121
|
+
};
|
|
122
|
+
/**
|
|
123
|
+
* 获取通用设置
|
|
124
|
+
* @returns {Promise<XoApp.GeneralSettings>}
|
|
125
|
+
*/
|
|
126
|
+
getGeneralSettings = async () => {
|
|
127
|
+
const settings = await BridgeUtil.invoke(AppChannels.getGeneralSettings);
|
|
128
|
+
return settings ?? {
|
|
129
|
+
opacity: 1,
|
|
130
|
+
windowMaterial: "none",
|
|
131
|
+
shortcuts: {},
|
|
132
|
+
logLevel: "info",
|
|
133
|
+
launchOnStartup: false,
|
|
134
|
+
appLaunchMode: "window",
|
|
135
|
+
windowCloseBehavior: "minimize"
|
|
136
|
+
};
|
|
137
|
+
};
|
|
138
|
+
/**
|
|
139
|
+
* 获取 APP 透明度
|
|
140
|
+
* @returns {Promise<number>}
|
|
141
|
+
*/
|
|
142
|
+
getOpacity = async () => {
|
|
143
|
+
const opacity = await BridgeUtil.invoke(AppChannels.getOpacity);
|
|
144
|
+
return opacity ?? 1;
|
|
145
|
+
};
|
|
146
|
+
/**
|
|
147
|
+
* 设置 APP 透明度
|
|
148
|
+
* @param {number} opacity APP 透明度
|
|
149
|
+
* @returns {Promise<void>}
|
|
150
|
+
*/
|
|
151
|
+
setOpacity = async (opacity) => {
|
|
152
|
+
await BridgeUtil.invoke(AppChannels.setOpacity, opacity);
|
|
153
|
+
};
|
|
154
|
+
/**
|
|
155
|
+
* 获取快捷窗口材质
|
|
156
|
+
* @returns {Promise<XoApp.WindowMaterial | undefined>}
|
|
157
|
+
*/
|
|
158
|
+
getWindowMaterial = async () => {
|
|
159
|
+
return await BridgeUtil.invoke(AppChannels.getWindowMaterial);
|
|
160
|
+
};
|
|
161
|
+
/**
|
|
162
|
+
* 设置快捷窗口材质
|
|
163
|
+
* @param {XoApp.WindowMaterial} windowMaterial 窗口材质
|
|
164
|
+
* @returns {Promise<void>}
|
|
165
|
+
*/
|
|
166
|
+
setWindowMaterial = async (windowMaterial) => {
|
|
167
|
+
await BridgeUtil.invoke(AppChannels.setWindowMaterial, windowMaterial);
|
|
168
|
+
};
|
|
169
|
+
/**
|
|
170
|
+
* 获取应用启动模式
|
|
171
|
+
* @returns {Promise<XoApp.AppLaunchMode>}
|
|
172
|
+
*/
|
|
173
|
+
getAppLaunchMode = async () => {
|
|
174
|
+
const appLaunchMode = await BridgeUtil.invoke(AppChannels.getAppLaunchMode);
|
|
175
|
+
return appLaunchMode ?? "window";
|
|
176
|
+
};
|
|
177
|
+
/**
|
|
178
|
+
* 设置应用启动模式
|
|
179
|
+
* @param {XoApp.AppLaunchMode} appLaunchMode 应用启动模式
|
|
180
|
+
* @returns {Promise<void>}
|
|
181
|
+
*/
|
|
182
|
+
setAppLaunchMode = async (appLaunchMode) => {
|
|
183
|
+
await BridgeUtil.invoke(AppChannels.setAppLaunchMode, appLaunchMode);
|
|
184
|
+
};
|
|
185
|
+
/**
|
|
186
|
+
* 获取是否开机启动
|
|
187
|
+
* @returns {Promise<boolean>}
|
|
188
|
+
*/
|
|
189
|
+
getLaunchOnStartup = async () => {
|
|
190
|
+
const launchOnStartup = await BridgeUtil.invoke(AppChannels.getLaunchOnStartup);
|
|
191
|
+
return launchOnStartup ?? false;
|
|
192
|
+
};
|
|
193
|
+
/**
|
|
194
|
+
* 设置是否开机启动
|
|
195
|
+
* @param {boolean} launchOnStartup 是否开机启动
|
|
196
|
+
* @returns {Promise<void>}
|
|
197
|
+
*/
|
|
198
|
+
setLaunchOnStartup = async (launchOnStartup) => {
|
|
199
|
+
await BridgeUtil.invoke(AppChannels.setLaunchOnStartup, launchOnStartup);
|
|
200
|
+
};
|
|
201
|
+
/**
|
|
202
|
+
* 获取关闭窗口行为
|
|
203
|
+
* @returns {Promise<XoApp.WindowCloseBehavior>}
|
|
204
|
+
*/
|
|
205
|
+
getWindowCloseBehavior = async () => {
|
|
206
|
+
const windowCloseBehavior = await BridgeUtil.invoke(AppChannels.getWindowCloseBehavior);
|
|
207
|
+
return windowCloseBehavior ?? "minimize";
|
|
208
|
+
};
|
|
209
|
+
/**
|
|
210
|
+
* 设置关闭窗口行为
|
|
211
|
+
* @param {XoApp.WindowCloseBehavior} windowCloseBehavior 关闭窗口行为
|
|
212
|
+
* @returns {Promise<void>}
|
|
213
|
+
*/
|
|
214
|
+
setWindowCloseBehavior = async (windowCloseBehavior) => {
|
|
215
|
+
await BridgeUtil.invoke(AppChannels.setWindowCloseBehavior, windowCloseBehavior);
|
|
216
|
+
};
|
|
217
|
+
/**
|
|
218
|
+
* 获取日志等级
|
|
219
|
+
* @returns {Promise<XoLogger.Level>}
|
|
220
|
+
*/
|
|
221
|
+
getLogLevel = async () => {
|
|
222
|
+
const logLevel = await BridgeUtil.invoke(AppChannels.getLogLevel);
|
|
223
|
+
return logLevel ?? "info";
|
|
224
|
+
};
|
|
225
|
+
/**
|
|
226
|
+
* 设置日志等级
|
|
227
|
+
* @param {XoLogger.Level} logLevel 日志等级
|
|
228
|
+
* @returns {Promise<void>}
|
|
229
|
+
*/
|
|
230
|
+
setLogLevel = async (logLevel) => {
|
|
231
|
+
await BridgeUtil.invoke(AppChannels.setLogLevel, logLevel ?? "info");
|
|
232
|
+
};
|
|
233
|
+
/**
|
|
234
|
+
* 获取快捷键配置
|
|
235
|
+
* @returns {Promise<XoShortcut.KeyMap>}
|
|
236
|
+
*/
|
|
237
|
+
getShortcuts = async () => {
|
|
238
|
+
const shortcuts = await BridgeUtil.invoke(AppChannels.getShortcuts);
|
|
239
|
+
return shortcuts ?? {};
|
|
240
|
+
};
|
|
241
|
+
/**
|
|
242
|
+
* 设置快捷键配置
|
|
243
|
+
* @param {XoShortcut.KeyMap} shortcuts 快捷键配置
|
|
244
|
+
* @returns {Promise<void>}
|
|
245
|
+
*/
|
|
246
|
+
setShortcuts = async (shortcuts) => {
|
|
247
|
+
await BridgeUtil.invoke(AppChannels.setShortcuts, shortcuts);
|
|
248
|
+
};
|
|
249
|
+
/**
|
|
250
|
+
* 设置单个快捷键配置
|
|
251
|
+
* @param {XoShortcut.Key} shortcut 快捷键配置
|
|
252
|
+
* @returns {Promise<void>}
|
|
253
|
+
*/
|
|
254
|
+
setShortcut = async (shortcut) => {
|
|
255
|
+
await BridgeUtil.invoke(AppChannels.setShortcut, shortcut);
|
|
256
|
+
};
|
|
257
|
+
/**
|
|
258
|
+
* 删除快捷键配置
|
|
259
|
+
* @param {XoShortcut.ID} id 快捷键 ID
|
|
260
|
+
* @returns {Promise<void>}
|
|
261
|
+
*/
|
|
262
|
+
deleteShortcut = async (id) => {
|
|
263
|
+
await BridgeUtil.invoke(AppChannels.deleteShortcut, id);
|
|
264
|
+
};
|
|
265
|
+
/** 重定向指定窗口路由 */
|
|
266
|
+
redirectWindowRoute = async (request) => {
|
|
267
|
+
const result = await BridgeUtil.invoke(AppChannels.redirectWindowRoute, request);
|
|
268
|
+
return result ?? false;
|
|
269
|
+
};
|
|
270
|
+
/** 重定向主窗口路由 */
|
|
271
|
+
redirectMainWindowRoute = async (request) => {
|
|
272
|
+
const result = await BridgeUtil.invoke(AppChannels.redirectMainWindowRoute, request);
|
|
273
|
+
return result ?? false;
|
|
274
|
+
};
|
|
275
|
+
/** 重定向设置窗口路由 */
|
|
276
|
+
redirectSettingWindowRoute = async (request) => {
|
|
277
|
+
const result = await BridgeUtil.invoke(AppChannels.redirectSettingWindowRoute, request);
|
|
278
|
+
return result ?? false;
|
|
279
|
+
};
|
|
280
|
+
/**
|
|
281
|
+
* 显示主窗口
|
|
282
|
+
* @param {XoWindow.RouteRedirectRequestWithoutWindow} request 路由重定向请求
|
|
283
|
+
* @returns {Promise<void>}
|
|
284
|
+
*/
|
|
285
|
+
showMainWindow = async (request) => {
|
|
286
|
+
await BridgeUtil.invoke(AppChannels.showMainWindow, request);
|
|
287
|
+
};
|
|
288
|
+
/**
|
|
289
|
+
* 显示设置窗口
|
|
290
|
+
* @param {XoWindow.RouteRedirectRequestWithoutWindow} request 路由重定向请求
|
|
291
|
+
* @returns {Promise<void>}
|
|
292
|
+
*/
|
|
293
|
+
showSettingWindow = async (request) => {
|
|
294
|
+
await BridgeUtil.invoke(AppChannels.showSettingWindow, request);
|
|
295
|
+
};
|
|
296
|
+
/**
|
|
297
|
+
* 重启应用
|
|
298
|
+
* @returns {Promise<void>}
|
|
299
|
+
*/
|
|
300
|
+
restart = async () => {
|
|
301
|
+
await BridgeUtil.invoke(AppChannels.restart);
|
|
302
|
+
};
|
|
303
|
+
};
|
|
304
|
+
|
|
305
|
+
// src/preload/bridges/auth/auth-bridge.ts
|
|
306
|
+
var AuthBridge = class extends BridgeAbstract {
|
|
307
|
+
/**
|
|
308
|
+
* 接口映射
|
|
309
|
+
* @returns {{auth: XoBridgeApi.Map['auth']}}
|
|
310
|
+
*/
|
|
311
|
+
apiMap() {
|
|
312
|
+
return {
|
|
313
|
+
auth: {
|
|
314
|
+
// 获取认证状态
|
|
315
|
+
getState: this.getState.bind(this),
|
|
316
|
+
// 登录
|
|
317
|
+
login: this.login.bind(this),
|
|
318
|
+
// 退出登录
|
|
319
|
+
logout: this.logout.bind(this),
|
|
320
|
+
// 监听认证状态
|
|
321
|
+
onState: this.onState.bind(this)
|
|
322
|
+
}
|
|
323
|
+
};
|
|
324
|
+
}
|
|
325
|
+
/**
|
|
326
|
+
* 获取认证状态
|
|
327
|
+
* @returns {Promise<XoAuth.State>}
|
|
328
|
+
*/
|
|
329
|
+
getState = async () => {
|
|
330
|
+
return await BridgeUtil.invoke(AuthChannels.getState) ?? { status: "unauthenticated" };
|
|
331
|
+
};
|
|
332
|
+
/**
|
|
333
|
+
* 登录
|
|
334
|
+
* @param {XoAuth.LoginRequest} request 登录请求
|
|
335
|
+
* @returns {Promise<XoAuth.State>}
|
|
336
|
+
*/
|
|
337
|
+
login = async (request) => {
|
|
338
|
+
return await BridgeUtil.invoke(AuthChannels.login, request) ?? { status: "unauthenticated" };
|
|
339
|
+
};
|
|
340
|
+
/**
|
|
341
|
+
* 退出登录
|
|
342
|
+
* @returns {Promise<XoAuth.State>}
|
|
343
|
+
*/
|
|
344
|
+
logout = async () => {
|
|
345
|
+
return await BridgeUtil.invoke(AuthChannels.logout) ?? { status: "unauthenticated" };
|
|
346
|
+
};
|
|
347
|
+
/**
|
|
348
|
+
* 监听认证状态
|
|
349
|
+
* @param {XoAuth.StateListener} listener 状态监听器
|
|
350
|
+
* @returns {() => void}
|
|
351
|
+
*/
|
|
352
|
+
onState = (listener) => {
|
|
353
|
+
return BridgeUtil.on(AuthChannels.onState, listener);
|
|
354
|
+
};
|
|
355
|
+
};
|
|
356
|
+
|
|
357
|
+
// src/preload/bridges/clipboard/clipboard-bridge.ts
|
|
358
|
+
var ClipboardBridge = class extends BridgeAbstract {
|
|
359
|
+
/**
|
|
360
|
+
* 接口映射
|
|
361
|
+
* <p>渲染进程声明文件 {@link XoBridgeApi.Map.clipboard}</p>
|
|
362
|
+
* @returns {XoBridge.ApiMap}
|
|
363
|
+
*/
|
|
364
|
+
apiMap() {
|
|
365
|
+
return {
|
|
366
|
+
clipboard: {
|
|
367
|
+
// 读取文本
|
|
368
|
+
readText: this.readText.bind(this),
|
|
369
|
+
// 写入文本
|
|
370
|
+
writeText: this.writeText.bind(this),
|
|
371
|
+
// 写入图片
|
|
372
|
+
writeImage: this.writeImage.bind(this),
|
|
373
|
+
// 清空剪切板
|
|
374
|
+
clear: this.clear.bind(this)
|
|
375
|
+
}
|
|
376
|
+
};
|
|
377
|
+
}
|
|
378
|
+
/**
|
|
379
|
+
* 读取文本
|
|
380
|
+
* @returns {Promise<string>}
|
|
381
|
+
*/
|
|
382
|
+
readText = async () => {
|
|
383
|
+
const text = await BridgeUtil.invoke(ClipboardChannels.readText);
|
|
384
|
+
return text ?? "";
|
|
385
|
+
};
|
|
386
|
+
/**
|
|
387
|
+
* 写入文本
|
|
388
|
+
* @param {string} text 文本
|
|
389
|
+
* @returns {Promise<void>}
|
|
390
|
+
*/
|
|
391
|
+
writeText = async (text) => {
|
|
392
|
+
await BridgeUtil.invoke(ClipboardChannels.writeText, text);
|
|
393
|
+
};
|
|
394
|
+
/**
|
|
395
|
+
* 写入图片
|
|
396
|
+
* @param {string} dataURL 图片 DataURL
|
|
397
|
+
* @returns {Promise<void>}
|
|
398
|
+
*/
|
|
399
|
+
writeImage = async (dataURL) => {
|
|
400
|
+
await BridgeUtil.invoke(ClipboardChannels.writeImage, dataURL);
|
|
401
|
+
};
|
|
402
|
+
/**
|
|
403
|
+
* 清空剪切板
|
|
404
|
+
* @returns {Promise<void>}
|
|
405
|
+
*/
|
|
406
|
+
clear = async () => {
|
|
407
|
+
await BridgeUtil.invoke(ClipboardChannels.clear);
|
|
408
|
+
};
|
|
409
|
+
};
|
|
410
|
+
|
|
411
|
+
// src/preload/bridges/context-menu/context-menu-bridge.ts
|
|
412
|
+
var ContextMenuBridge = class extends BridgeAbstract {
|
|
413
|
+
/**
|
|
414
|
+
* 接口映射
|
|
415
|
+
* <p>渲染进程声明文件 {@link XoBridgeApi.Map.contextMenu}</p>
|
|
416
|
+
* @returns {XoBridge.ApiMap}
|
|
417
|
+
*/
|
|
418
|
+
apiMap() {
|
|
419
|
+
return {
|
|
420
|
+
contextMenu: {
|
|
421
|
+
// 监听上下文菜单请求
|
|
422
|
+
onRequested: this.onRequested.bind(this),
|
|
423
|
+
// 执行菜单命令
|
|
424
|
+
executeCommand: this.executeCommand.bind(this)
|
|
425
|
+
}
|
|
426
|
+
};
|
|
427
|
+
}
|
|
428
|
+
/**
|
|
429
|
+
* 监听上下文菜单请求
|
|
430
|
+
* @param {XoMenu.ContextMenuRequestedListener} listener 监听器
|
|
431
|
+
* @returns {() => void}
|
|
432
|
+
*/
|
|
433
|
+
onRequested(listener) {
|
|
434
|
+
return BridgeUtil.on(ContextMenuChannels.onRequested, listener);
|
|
435
|
+
}
|
|
436
|
+
/**
|
|
437
|
+
* 执行菜单命令
|
|
438
|
+
* @param {XoMenu.ExecuteCommandRequest} request 请求
|
|
439
|
+
* @returns {Promise<boolean>}
|
|
440
|
+
*/
|
|
441
|
+
executeCommand = async (request) => {
|
|
442
|
+
const success = await BridgeUtil.invoke(ContextMenuChannels.executeCommand, request);
|
|
443
|
+
return success ?? false;
|
|
444
|
+
};
|
|
445
|
+
};
|
|
446
|
+
|
|
447
|
+
// src/preload/bridges/dialog/dialog-bridge.ts
|
|
448
|
+
var DialogBridge = class extends BridgeAbstract {
|
|
449
|
+
/**
|
|
450
|
+
* 接口映射
|
|
451
|
+
* <p>渲染进程声明文件 {@link XoBridgeApi.Map.dialog}</p>
|
|
452
|
+
* @returns {XoBridge.ApiMap}
|
|
453
|
+
*/
|
|
454
|
+
apiMap() {
|
|
455
|
+
return {
|
|
456
|
+
dialog: {
|
|
457
|
+
// 打开文件选择框
|
|
458
|
+
openFile: this.openFile.bind(this),
|
|
459
|
+
// 打开目录选择框
|
|
460
|
+
openDir: this.openDir.bind(this),
|
|
461
|
+
// 打开文件保存框
|
|
462
|
+
saveFile: this.saveFile.bind(this)
|
|
463
|
+
}
|
|
464
|
+
};
|
|
465
|
+
}
|
|
466
|
+
/**
|
|
467
|
+
* 打开文件选择框
|
|
468
|
+
* @returns {Promise<XoDialog.OpenResult>}
|
|
469
|
+
*/
|
|
470
|
+
openFile = async () => {
|
|
471
|
+
const openResult = await BridgeUtil.invoke(DialogChannels.openFile);
|
|
472
|
+
return openResult ?? { canceled: true, filePaths: [] };
|
|
473
|
+
};
|
|
474
|
+
/**
|
|
475
|
+
* 打开目录选择框
|
|
476
|
+
* @returns {Promise<XoDialog.OpenResult>}
|
|
477
|
+
*/
|
|
478
|
+
openDir = async () => {
|
|
479
|
+
const openResult = await BridgeUtil.invoke(DialogChannels.openDir);
|
|
480
|
+
return openResult ?? { canceled: true, filePaths: [] };
|
|
481
|
+
};
|
|
482
|
+
/**
|
|
483
|
+
* 打开文件保存框
|
|
484
|
+
* @returns {Promise<XoDialog.SaveResult>}
|
|
485
|
+
*/
|
|
486
|
+
saveFile = async () => {
|
|
487
|
+
const saveResult = await BridgeUtil.invoke(DialogChannels.saveFile);
|
|
488
|
+
return saveResult ?? { canceled: true, filePath: null };
|
|
489
|
+
};
|
|
490
|
+
};
|
|
491
|
+
|
|
492
|
+
// src/preload/bridges/file/file-bridge.ts
|
|
493
|
+
var FileBridge = class extends BridgeAbstract {
|
|
494
|
+
/**
|
|
495
|
+
* 接口映射
|
|
496
|
+
* <p>渲染进程声明文件 {@link XoBridgeApi.Map.file}</p>
|
|
497
|
+
* @returns {XoBridge.ApiMap}
|
|
498
|
+
*/
|
|
499
|
+
apiMap() {
|
|
500
|
+
return {
|
|
501
|
+
file: {
|
|
502
|
+
// 读取文本文件
|
|
503
|
+
readText: this.readText.bind(this),
|
|
504
|
+
// 写入文本文件
|
|
505
|
+
writeText: this.writeText.bind(this),
|
|
506
|
+
// 文件是否存在
|
|
507
|
+
exists: this.exists.bind(this)
|
|
508
|
+
}
|
|
509
|
+
};
|
|
510
|
+
}
|
|
511
|
+
/**
|
|
512
|
+
* 读取文本文件
|
|
513
|
+
* @param {string} path 文件路径
|
|
514
|
+
* @returns {Promise<string>}
|
|
515
|
+
*/
|
|
516
|
+
readText = async (path) => {
|
|
517
|
+
const text = await BridgeUtil.invoke(FileChannels.readText, path);
|
|
518
|
+
return text ?? "";
|
|
519
|
+
};
|
|
520
|
+
/**
|
|
521
|
+
* 写入文本文件
|
|
522
|
+
* @param {string} path 文件路径
|
|
523
|
+
* @param {string} content 内容
|
|
524
|
+
* @returns {Promise<boolean>}
|
|
525
|
+
*/
|
|
526
|
+
writeText = async (path, content) => {
|
|
527
|
+
const request = { path, content };
|
|
528
|
+
const success = await BridgeUtil.invoke(FileChannels.writeText, request);
|
|
529
|
+
return success ?? false;
|
|
530
|
+
};
|
|
531
|
+
/**
|
|
532
|
+
* 文件是否存在
|
|
533
|
+
* @param {string} path 文件路径
|
|
534
|
+
* @returns {Promise<boolean>}
|
|
535
|
+
*/
|
|
536
|
+
exists = async (path) => {
|
|
537
|
+
const exists = await BridgeUtil.invoke(FileChannels.exists, path);
|
|
538
|
+
return exists ?? false;
|
|
539
|
+
};
|
|
540
|
+
};
|
|
541
|
+
|
|
542
|
+
// src/preload/bridges/ipc/ipc-bridge.ts
|
|
543
|
+
var IpcBridge = class extends BridgeAbstract {
|
|
544
|
+
/**
|
|
545
|
+
* 接口映射
|
|
546
|
+
* <p>渲染进程声明文件 {@link XoBridgeApi.Map.ipc}</p>
|
|
547
|
+
* @returns {XoBridge.ApiMap}
|
|
548
|
+
*/
|
|
549
|
+
apiMap() {
|
|
550
|
+
return {
|
|
551
|
+
ipc: {
|
|
552
|
+
// 调用主进程方法
|
|
553
|
+
invoke: this.invoke.bind(this),
|
|
554
|
+
// 给主进程发送消息
|
|
555
|
+
send: this.send.bind(this),
|
|
556
|
+
// 监听主进程消息
|
|
557
|
+
on: this.on.bind(this),
|
|
558
|
+
// 单次监听主进程消息
|
|
559
|
+
once: this.once.bind(this)
|
|
560
|
+
}
|
|
561
|
+
};
|
|
562
|
+
}
|
|
563
|
+
/**
|
|
564
|
+
* 调用主进程方法(内置)
|
|
565
|
+
* @param {XoIpc.Channel} channel 通道
|
|
566
|
+
* @param {any} request 参数
|
|
567
|
+
* @returns {Promise<XoIpc.Result>}
|
|
568
|
+
*/
|
|
569
|
+
invoke = async (channel, request) => {
|
|
570
|
+
return await BridgeUtil.invokeResult(channel, request);
|
|
571
|
+
};
|
|
572
|
+
/**
|
|
573
|
+
* 给主进程发送消息(内置)
|
|
574
|
+
* @param {XoIpc.Channel} channel 通道
|
|
575
|
+
* @param {any} request 参数
|
|
576
|
+
*/
|
|
577
|
+
send = (channel, request) => {
|
|
578
|
+
BridgeUtil.send(channel, request);
|
|
579
|
+
};
|
|
580
|
+
/**
|
|
581
|
+
* 监听主进程消息(内置)
|
|
582
|
+
* <p>支持主动解除监听</p>
|
|
583
|
+
* <p>const off = window.xion.ipc.on(channel, listener); off()</p>
|
|
584
|
+
* @param {XoIpc.Channel} channel 通道
|
|
585
|
+
* @param {XoIpc.Listener} listener 监听器
|
|
586
|
+
* @returns {() => void}
|
|
587
|
+
*/
|
|
588
|
+
on = (channel, listener) => {
|
|
589
|
+
return BridgeUtil.on(channel, listener);
|
|
590
|
+
};
|
|
591
|
+
/**
|
|
592
|
+
* 单次监听主进程消息(内置)
|
|
593
|
+
* @param {XoIpc.Channel} channel 通道
|
|
594
|
+
* @param {XoIpc.Listener} listener 监听器
|
|
595
|
+
*/
|
|
596
|
+
once = (channel, listener) => {
|
|
597
|
+
BridgeUtil.once(channel, listener);
|
|
598
|
+
};
|
|
599
|
+
};
|
|
600
|
+
|
|
601
|
+
// src/preload/bridges/log/log-bridge.ts
|
|
602
|
+
var LogBridge = class extends BridgeAbstract {
|
|
603
|
+
/**
|
|
604
|
+
* 接口映射
|
|
605
|
+
* <p>渲染进程声明文件 {@link XoBridgeApi.Map.log}</p>
|
|
606
|
+
* @returns {XoBridge.ApiMap}
|
|
607
|
+
*/
|
|
608
|
+
apiMap() {
|
|
609
|
+
return {
|
|
610
|
+
log: {
|
|
611
|
+
debug: this.debug.bind(this),
|
|
612
|
+
info: this.info.bind(this),
|
|
613
|
+
warn: this.warn.bind(this),
|
|
614
|
+
error: this.error.bind(this)
|
|
615
|
+
}
|
|
616
|
+
};
|
|
617
|
+
}
|
|
618
|
+
/**
|
|
619
|
+
* 写入 debug 日志
|
|
620
|
+
* @param message 日志消息
|
|
621
|
+
* @param data 附加数据
|
|
622
|
+
* @returns {Promise<void>}
|
|
623
|
+
*/
|
|
624
|
+
debug = async (message, ...data) => {
|
|
625
|
+
await this.write(LogChannels.debug, message, data);
|
|
626
|
+
};
|
|
627
|
+
/**
|
|
628
|
+
* 写入 info 日志
|
|
629
|
+
* @param message 日志消息
|
|
630
|
+
* @param data 附加数据
|
|
631
|
+
* @returns {Promise<void>}
|
|
632
|
+
*/
|
|
633
|
+
info = async (message, ...data) => {
|
|
634
|
+
await this.write(LogChannels.info, message, data);
|
|
635
|
+
};
|
|
636
|
+
/**
|
|
637
|
+
* 写入 warn 日志
|
|
638
|
+
* @param message 日志消息
|
|
639
|
+
* @param data 附加数据
|
|
640
|
+
* @returns {Promise<void>}
|
|
641
|
+
*/
|
|
642
|
+
warn = async (message, ...data) => {
|
|
643
|
+
await this.write(LogChannels.warn, message, data);
|
|
644
|
+
};
|
|
645
|
+
/**
|
|
646
|
+
* 写入 error 日志
|
|
647
|
+
* @param message 日志消息
|
|
648
|
+
* @param data 附加数据
|
|
649
|
+
* @returns {Promise<void>}
|
|
650
|
+
*/
|
|
651
|
+
error = async (message, ...data) => {
|
|
652
|
+
await this.write(LogChannels.error, message, data);
|
|
653
|
+
};
|
|
654
|
+
/**
|
|
655
|
+
* 写入日志
|
|
656
|
+
* @param {XoIpc.Channel} channel 日志通道
|
|
657
|
+
* @param {string} message 日志消息
|
|
658
|
+
* @param {unknown[]} data 附加数据
|
|
659
|
+
* @returns {Promise<void>}
|
|
660
|
+
* @private
|
|
661
|
+
*/
|
|
662
|
+
async write(channel, message, data) {
|
|
663
|
+
try {
|
|
664
|
+
const request = LogUtil.normalizeRequest(message, data);
|
|
665
|
+
await BridgeUtil.invoke(channel, request);
|
|
666
|
+
} catch {
|
|
667
|
+
}
|
|
668
|
+
}
|
|
669
|
+
};
|
|
670
|
+
|
|
671
|
+
// src/preload/bridges/remote-service/remote-service-bridge.ts
|
|
672
|
+
var RemoteServiceBridge = class extends BridgeAbstract {
|
|
673
|
+
/**
|
|
674
|
+
* 接口映射
|
|
675
|
+
* <p>渲染进程声明文件 {@link XoBridgeApi.Map.remoteService}</p>
|
|
676
|
+
* @returns {XoBridge.ApiMap}
|
|
677
|
+
*/
|
|
678
|
+
apiMap() {
|
|
679
|
+
return {
|
|
680
|
+
remoteService: {
|
|
681
|
+
// 获取远程服务状态
|
|
682
|
+
getState: this.getState.bind(this),
|
|
683
|
+
// 获取远程服务设置
|
|
684
|
+
getSettings: this.getSettings.bind(this),
|
|
685
|
+
// 设置远程服务用户设置
|
|
686
|
+
setSettings: this.setSettings.bind(this),
|
|
687
|
+
// 重置远程服务用户设置
|
|
688
|
+
resetSettings: this.resetSettings.bind(this),
|
|
689
|
+
// 请求远程服务 API
|
|
690
|
+
request: this.request.bind(this),
|
|
691
|
+
// 监听远程服务状态
|
|
692
|
+
onState: this.onState.bind(this),
|
|
693
|
+
// 监听远程服务设置
|
|
694
|
+
onSettings: this.onSettings.bind(this)
|
|
695
|
+
}
|
|
696
|
+
};
|
|
697
|
+
}
|
|
698
|
+
/**
|
|
699
|
+
* 获取远程服务状态
|
|
700
|
+
* @returns {Promise<XoRemoteService.State>}
|
|
701
|
+
*/
|
|
702
|
+
getState = async () => {
|
|
703
|
+
const state = await BridgeUtil.invoke(RemoteServiceChannels.getState);
|
|
704
|
+
return state ?? {
|
|
705
|
+
status: "idle",
|
|
706
|
+
reconnectCount: 0
|
|
707
|
+
};
|
|
708
|
+
};
|
|
709
|
+
/**
|
|
710
|
+
* 获取远程服务设置
|
|
711
|
+
* @returns {Promise<XoRemoteService.EffectiveSettings>}
|
|
712
|
+
*/
|
|
713
|
+
getSettings = async () => {
|
|
714
|
+
const settings = await BridgeUtil.invoke(RemoteServiceChannels.getSettings);
|
|
715
|
+
return settings;
|
|
716
|
+
};
|
|
717
|
+
/**
|
|
718
|
+
* 设置远程服务用户设置
|
|
719
|
+
* @param {XoRemoteService.UserSettings} settings 远程服务用户设置
|
|
720
|
+
* @returns {Promise<void>}
|
|
721
|
+
*/
|
|
722
|
+
setSettings = async (settings) => {
|
|
723
|
+
await BridgeUtil.invoke(RemoteServiceChannels.setSettings, settings);
|
|
724
|
+
};
|
|
725
|
+
/**
|
|
726
|
+
* 重置远程服务用户设置
|
|
727
|
+
* @returns {Promise<void>}
|
|
728
|
+
*/
|
|
729
|
+
resetSettings = async () => {
|
|
730
|
+
await BridgeUtil.invoke(RemoteServiceChannels.resetSettings);
|
|
731
|
+
};
|
|
732
|
+
/**
|
|
733
|
+
* 请求远程服务 API
|
|
734
|
+
* @template T 响应数据类型
|
|
735
|
+
* @param {XoRemoteService.Request} request 请求参数
|
|
736
|
+
* @returns {Promise<XoRemoteService.Response<T>>}
|
|
737
|
+
*/
|
|
738
|
+
request = async (request) => {
|
|
739
|
+
const response = await BridgeUtil.invoke(RemoteServiceChannels.request, request);
|
|
740
|
+
return response;
|
|
741
|
+
};
|
|
742
|
+
/**
|
|
743
|
+
* 监听远程服务状态
|
|
744
|
+
* @param {XoRemoteService.StateListener} listener 监听器
|
|
745
|
+
* @returns {() => void}
|
|
746
|
+
*/
|
|
747
|
+
onState = (listener) => {
|
|
748
|
+
return BridgeUtil.on(RemoteServiceChannels.onState, listener);
|
|
749
|
+
};
|
|
750
|
+
/**
|
|
751
|
+
* 监听远程服务设置
|
|
752
|
+
* @param {XoRemoteService.SettingsListener} listener 监听器
|
|
753
|
+
* @returns {() => void}
|
|
754
|
+
*/
|
|
755
|
+
onSettings = (listener) => {
|
|
756
|
+
return BridgeUtil.on(RemoteServiceChannels.onSettings, listener);
|
|
757
|
+
};
|
|
758
|
+
};
|
|
759
|
+
|
|
760
|
+
// src/preload/bridges/shell/shell-bridge.ts
|
|
761
|
+
var ShellBridge = class extends BridgeAbstract {
|
|
762
|
+
/**
|
|
763
|
+
* 接口映射
|
|
764
|
+
* <p>渲染进程声明文件 {@link XoBridgeApi.Map.shell}</p>
|
|
765
|
+
* @returns {XoBridge.ApiMap}
|
|
766
|
+
*/
|
|
767
|
+
apiMap() {
|
|
768
|
+
return {
|
|
769
|
+
shell: {
|
|
770
|
+
// 使用系统默认程序打开路径
|
|
771
|
+
openPath: this.openPath.bind(this),
|
|
772
|
+
// 在文件管理器中显示路径
|
|
773
|
+
showItemInFolder: this.showItemInFolder.bind(this)
|
|
774
|
+
}
|
|
775
|
+
};
|
|
776
|
+
}
|
|
777
|
+
/**
|
|
778
|
+
* 使用系统默认程序打开路径
|
|
779
|
+
* @param {string} path 路径
|
|
780
|
+
* @returns {Promise<void>}
|
|
781
|
+
*/
|
|
782
|
+
openPath = async (path) => {
|
|
783
|
+
await BridgeUtil.invoke(ShellChannels.openPath, path);
|
|
784
|
+
};
|
|
785
|
+
/**
|
|
786
|
+
* 在文件管理器中显示路径
|
|
787
|
+
* @param {string} path 路径
|
|
788
|
+
* @returns {Promise<void>}
|
|
789
|
+
*/
|
|
790
|
+
showItemInFolder = async (path) => {
|
|
791
|
+
await BridgeUtil.invoke(ShellChannels.showItemInFolder, path);
|
|
792
|
+
};
|
|
793
|
+
};
|
|
794
|
+
|
|
795
|
+
// src/preload/bridges/theme/theme-bridge.ts
|
|
796
|
+
var ThemeBridge = class extends BridgeAbstract {
|
|
797
|
+
/**
|
|
798
|
+
* 接口映射
|
|
799
|
+
* <p>渲染进程声明文件 {@link XoBridgeApi.Map.theme}</p>
|
|
800
|
+
* @returns {XoBridge.ApiMap}
|
|
801
|
+
*/
|
|
802
|
+
apiMap() {
|
|
803
|
+
return {
|
|
804
|
+
theme: {
|
|
805
|
+
// 获取主题状态
|
|
806
|
+
getState: this.getState.bind(this),
|
|
807
|
+
// 设置主题来源
|
|
808
|
+
setSource: this.setSource.bind(this),
|
|
809
|
+
// 监听主题更新
|
|
810
|
+
onUpdated: this.onUpdated.bind(this)
|
|
811
|
+
}
|
|
812
|
+
};
|
|
813
|
+
}
|
|
814
|
+
/**
|
|
815
|
+
* 获取主题状态
|
|
816
|
+
* @returns {Promise<XoTheme.State>}
|
|
817
|
+
*/
|
|
818
|
+
getState = async () => {
|
|
819
|
+
const state = await BridgeUtil.invoke(ThemeChannels.getState);
|
|
820
|
+
return state ?? {
|
|
821
|
+
themeSource: "system",
|
|
822
|
+
shouldUseDarkColors: false,
|
|
823
|
+
titleBarOverlayEnabled: false,
|
|
824
|
+
titleBarOverlay: {},
|
|
825
|
+
titleBarOverlayBackground: void 0
|
|
826
|
+
};
|
|
827
|
+
};
|
|
828
|
+
/**
|
|
829
|
+
* 设置主题来源
|
|
830
|
+
* @param {XoTheme.Source} themeSource 主题来源
|
|
831
|
+
* @returns {Promise<void>}
|
|
832
|
+
*/
|
|
833
|
+
setSource = async (themeSource) => {
|
|
834
|
+
await BridgeUtil.invoke(ThemeChannels.setSource, themeSource);
|
|
835
|
+
};
|
|
836
|
+
/**
|
|
837
|
+
* 监听主题更新
|
|
838
|
+
* @param {XoTheme.UpdatedListener} listener 监听器
|
|
839
|
+
* @returns {() => void}
|
|
840
|
+
*/
|
|
841
|
+
onUpdated = (listener) => {
|
|
842
|
+
return BridgeUtil.on(ThemeChannels.onUpdate, listener);
|
|
843
|
+
};
|
|
844
|
+
};
|
|
845
|
+
|
|
846
|
+
// src/preload/bridges/updater/updater-bridge.ts
|
|
847
|
+
var UpdaterBridge = class extends BridgeAbstract {
|
|
848
|
+
/**
|
|
849
|
+
* 接口映射
|
|
850
|
+
* <p>渲染进程声明文件 {@link XoBridgeApi.Map.updater}</p>
|
|
851
|
+
* @returns {XoBridge.ApiMap}
|
|
852
|
+
*/
|
|
853
|
+
apiMap() {
|
|
854
|
+
return {
|
|
855
|
+
updater: {
|
|
856
|
+
// 检查更新
|
|
857
|
+
checkForUpdates: this.checkForUpdates.bind(this),
|
|
858
|
+
// 下载更新
|
|
859
|
+
downloadUpdate: this.downloadUpdate.bind(this),
|
|
860
|
+
// 取消下载
|
|
861
|
+
cancelDownload: this.cancelDownload.bind(this),
|
|
862
|
+
// 退出并安装更新
|
|
863
|
+
quitAndInstall: this.quitAndInstall.bind(this),
|
|
864
|
+
// 获取更新器状态
|
|
865
|
+
getState: this.getState.bind(this),
|
|
866
|
+
// 获取更新器设置
|
|
867
|
+
getSettings: this.getSettings.bind(this),
|
|
868
|
+
// 设置更新器用户设置
|
|
869
|
+
setSettings: this.setSettings.bind(this),
|
|
870
|
+
// 重置更新器用户设置
|
|
871
|
+
resetSettings: this.resetSettings.bind(this),
|
|
872
|
+
// 监听更新器状态
|
|
873
|
+
onState: this.onState.bind(this),
|
|
874
|
+
// 监听更新器设置
|
|
875
|
+
onSettings: this.onSettings.bind(this)
|
|
876
|
+
}
|
|
877
|
+
};
|
|
878
|
+
}
|
|
879
|
+
/**
|
|
880
|
+
* 检查更新
|
|
881
|
+
* @returns {Promise<void>}
|
|
882
|
+
*/
|
|
883
|
+
checkForUpdates = async () => {
|
|
884
|
+
await BridgeUtil.invoke(UpdaterChannels.checkForUpdates);
|
|
885
|
+
};
|
|
886
|
+
/**
|
|
887
|
+
* 下载更新
|
|
888
|
+
* @returns {Promise<void>}
|
|
889
|
+
*/
|
|
890
|
+
downloadUpdate = async () => {
|
|
891
|
+
await BridgeUtil.invoke(UpdaterChannels.downloadUpdate);
|
|
892
|
+
};
|
|
893
|
+
/**
|
|
894
|
+
* 取消下载
|
|
895
|
+
* @returns {Promise<boolean>}
|
|
896
|
+
*/
|
|
897
|
+
cancelDownload = async () => {
|
|
898
|
+
const cancelled = await BridgeUtil.invoke(UpdaterChannels.cancelDownload);
|
|
899
|
+
return cancelled ?? false;
|
|
900
|
+
};
|
|
901
|
+
/**
|
|
902
|
+
* 退出并安装更新
|
|
903
|
+
* @returns {Promise<void>}
|
|
904
|
+
*/
|
|
905
|
+
quitAndInstall = async () => {
|
|
906
|
+
await BridgeUtil.invoke(UpdaterChannels.quitAndInstall);
|
|
907
|
+
};
|
|
908
|
+
/**
|
|
909
|
+
* 获取更新器状态
|
|
910
|
+
* @returns {Promise<XoUpdater.State>}
|
|
911
|
+
*/
|
|
912
|
+
getState = async () => {
|
|
913
|
+
const state = await BridgeUtil.invoke(UpdaterChannels.getState);
|
|
914
|
+
return state ?? {
|
|
915
|
+
status: "idle",
|
|
916
|
+
downloadCancellationCount: 0,
|
|
917
|
+
disabledUntilRestart: false
|
|
918
|
+
};
|
|
919
|
+
};
|
|
920
|
+
/**
|
|
921
|
+
* 获取更新器设置
|
|
922
|
+
* @returns {Promise<XoUpdater.EffectiveSettings>}
|
|
923
|
+
*/
|
|
924
|
+
getSettings = async () => {
|
|
925
|
+
const settings = await BridgeUtil.invoke(UpdaterChannels.getSettings);
|
|
926
|
+
return settings;
|
|
927
|
+
};
|
|
928
|
+
/**
|
|
929
|
+
* 设置更新器用户设置
|
|
930
|
+
* @param {XoUpdater.UserSettings} settings 更新器用户设置
|
|
931
|
+
*/
|
|
932
|
+
setSettings = async (settings) => {
|
|
933
|
+
await BridgeUtil.invoke(UpdaterChannels.setSettings, settings);
|
|
934
|
+
};
|
|
935
|
+
/**
|
|
936
|
+
* 重置更新器用户设置
|
|
937
|
+
*/
|
|
938
|
+
resetSettings = async () => {
|
|
939
|
+
await BridgeUtil.invoke(UpdaterChannels.resetSettings);
|
|
940
|
+
};
|
|
941
|
+
/**
|
|
942
|
+
* 监听更新器状态
|
|
943
|
+
* @param {XoUpdater.UpdatedListener} listener 监听器
|
|
944
|
+
* @returns {() => void}
|
|
945
|
+
*/
|
|
946
|
+
onState = (listener) => {
|
|
947
|
+
return BridgeUtil.on(UpdaterChannels.onState, listener);
|
|
948
|
+
};
|
|
949
|
+
/**
|
|
950
|
+
* 监听更新器设置
|
|
951
|
+
* @param {XoUpdater.SettingsUpdatedListener} listener 监听器
|
|
952
|
+
* @returns {() => void}
|
|
953
|
+
*/
|
|
954
|
+
onSettings = (listener) => {
|
|
955
|
+
return BridgeUtil.on(UpdaterChannels.onSettings, listener);
|
|
956
|
+
};
|
|
957
|
+
};
|
|
958
|
+
|
|
959
|
+
// src/preload/bridges/window/internal/route-redirect-buffer.ts
|
|
960
|
+
var RouteRedirectBuffer = class {
|
|
961
|
+
/** Renderer 是否已完成初始化 */
|
|
962
|
+
rendererReady = false;
|
|
963
|
+
/** Renderer 路由重定向监听器 */
|
|
964
|
+
listener;
|
|
965
|
+
/** 等待分发的路由重定向请求 */
|
|
966
|
+
pendingRequests = [];
|
|
967
|
+
/**
|
|
968
|
+
* 接收路由重定向请求
|
|
969
|
+
* @param {XoWindow.RouteRedirectRequest} request 路由重定向请求
|
|
970
|
+
* @returns {void}
|
|
971
|
+
*/
|
|
972
|
+
receive(request) {
|
|
973
|
+
if (!this.rendererReady || !this.listener) {
|
|
974
|
+
this.pendingRequests.push(request);
|
|
975
|
+
return;
|
|
976
|
+
}
|
|
977
|
+
this.listener(request);
|
|
978
|
+
}
|
|
979
|
+
/**
|
|
980
|
+
* 设置 Renderer 路由重定向监听器
|
|
981
|
+
* @param {XoWindow.RouteRedirectListener} listener 路由重定向监听器
|
|
982
|
+
* @returns {() => void}
|
|
983
|
+
*/
|
|
984
|
+
setListener(listener) {
|
|
985
|
+
this.listener = listener;
|
|
986
|
+
this.flush();
|
|
987
|
+
return () => {
|
|
988
|
+
if (this.listener === listener) {
|
|
989
|
+
this.listener = void 0;
|
|
990
|
+
}
|
|
991
|
+
};
|
|
992
|
+
}
|
|
993
|
+
/**
|
|
994
|
+
* 标记 Renderer 已完成初始化
|
|
995
|
+
* @returns {void}
|
|
996
|
+
*/
|
|
997
|
+
setReady() {
|
|
998
|
+
this.rendererReady = true;
|
|
999
|
+
this.flush();
|
|
1000
|
+
}
|
|
1001
|
+
/**
|
|
1002
|
+
* 分发等待中的路由重定向请求
|
|
1003
|
+
* @returns {void}
|
|
1004
|
+
* @private
|
|
1005
|
+
*/
|
|
1006
|
+
flush() {
|
|
1007
|
+
const listener = this.listener;
|
|
1008
|
+
if (!this.rendererReady || !listener) {
|
|
1009
|
+
return;
|
|
1010
|
+
}
|
|
1011
|
+
for (const request of this.pendingRequests.splice(0)) {
|
|
1012
|
+
listener(request);
|
|
1013
|
+
}
|
|
1014
|
+
}
|
|
1015
|
+
};
|
|
1016
|
+
|
|
1017
|
+
// src/preload/bridges/window/window-bridge.ts
|
|
1018
|
+
var WindowBridge = class extends BridgeAbstract {
|
|
1019
|
+
/** 路由重定向请求缓冲器 */
|
|
1020
|
+
routeRedirectBuffer = new RouteRedirectBuffer();
|
|
1021
|
+
/**
|
|
1022
|
+
* 构造函数
|
|
1023
|
+
*/
|
|
1024
|
+
constructor() {
|
|
1025
|
+
super();
|
|
1026
|
+
BridgeUtil.on(WindowChannels.onRouteRedirect, (request) => this.routeRedirectBuffer.receive(request));
|
|
1027
|
+
}
|
|
1028
|
+
/**
|
|
1029
|
+
* 接口映射
|
|
1030
|
+
* <p>渲染进程声明文件 {@link XoBridgeApi.Map.window}</p>
|
|
1031
|
+
* @returns {XoBridge.ApiMap}
|
|
1032
|
+
*/
|
|
1033
|
+
apiMap() {
|
|
1034
|
+
return {
|
|
1035
|
+
window: {
|
|
1036
|
+
// 通知主进程渲染进程首屏渲染完成
|
|
1037
|
+
ready: this.ready.bind(this),
|
|
1038
|
+
// 是否等待 Renderer 渲染完成后再显示窗口
|
|
1039
|
+
shouldShowAfterRendererReady: this.shouldShowAfterRendererReady.bind(this),
|
|
1040
|
+
// 获取窗口状态
|
|
1041
|
+
getState: this.getState.bind(this),
|
|
1042
|
+
// 获取当前已打开窗口标识
|
|
1043
|
+
getOpenedWindowIdentities: this.getOpenedWindowIdentities.bind(this),
|
|
1044
|
+
// 最小化窗口
|
|
1045
|
+
minimize: this.minimize.bind(this),
|
|
1046
|
+
// 最大化窗口
|
|
1047
|
+
maximize: this.maximize.bind(this),
|
|
1048
|
+
// 是否已最大化
|
|
1049
|
+
isMaximized: this.isMaximized.bind(this),
|
|
1050
|
+
// 取消最大化窗口
|
|
1051
|
+
unmaximize: this.unmaximize.bind(this),
|
|
1052
|
+
// 全屏窗口
|
|
1053
|
+
fullScreen: this.fullScreen.bind(this),
|
|
1054
|
+
// 退出全屏窗口
|
|
1055
|
+
exitFullScreen: this.exitFullScreen.bind(this),
|
|
1056
|
+
// 重新加载窗口
|
|
1057
|
+
reload: this.reload.bind(this),
|
|
1058
|
+
// 居中窗口
|
|
1059
|
+
center: this.center.bind(this),
|
|
1060
|
+
// 隐藏窗口
|
|
1061
|
+
hide: this.hide.bind(this),
|
|
1062
|
+
// 还原窗口
|
|
1063
|
+
restore: this.restore.bind(this),
|
|
1064
|
+
// 切换窗口置顶
|
|
1065
|
+
toggleAlwaysOnTop: this.toggleAlwaysOnTop.bind(this),
|
|
1066
|
+
// 切换侧边栏折叠
|
|
1067
|
+
toggleSidebarFold: this.toggleSidebarFold.bind(this),
|
|
1068
|
+
// 关闭窗口
|
|
1069
|
+
close: this.close.bind(this),
|
|
1070
|
+
// 监听窗口状态
|
|
1071
|
+
onState: this.onState.bind(this),
|
|
1072
|
+
// 监听路由重定向
|
|
1073
|
+
onRouteRedirect: this.onRouteRedirect.bind(this)
|
|
1074
|
+
}
|
|
1075
|
+
};
|
|
1076
|
+
}
|
|
1077
|
+
/**
|
|
1078
|
+
* 通知主进程渲染进程首屏渲染完成
|
|
1079
|
+
* @returns {Promise<void>}
|
|
1080
|
+
*/
|
|
1081
|
+
ready = async () => {
|
|
1082
|
+
this.routeRedirectBuffer.setReady();
|
|
1083
|
+
await BridgeUtil.invoke(WindowChannels.ready);
|
|
1084
|
+
};
|
|
1085
|
+
/**
|
|
1086
|
+
* 是否等待 Renderer 渲染完成后再显示窗口
|
|
1087
|
+
* @returns {Promise<boolean>}
|
|
1088
|
+
*/
|
|
1089
|
+
shouldShowAfterRendererReady = async () => {
|
|
1090
|
+
const enabled = await BridgeUtil.invoke(WindowChannels.shouldShowAfterRendererReady);
|
|
1091
|
+
return enabled ?? true;
|
|
1092
|
+
};
|
|
1093
|
+
/**
|
|
1094
|
+
* 获取窗口状态
|
|
1095
|
+
* @returns {Promise<XoWindow.State>}
|
|
1096
|
+
*/
|
|
1097
|
+
getState = async () => {
|
|
1098
|
+
const state = await BridgeUtil.invoke(WindowChannels.getState);
|
|
1099
|
+
return state ?? {
|
|
1100
|
+
isSidebarFolded: false,
|
|
1101
|
+
isAlwaysOnTop: false,
|
|
1102
|
+
isMaximized: false,
|
|
1103
|
+
isFullScreen: false,
|
|
1104
|
+
isMinimized: false,
|
|
1105
|
+
isFullScreenable: false,
|
|
1106
|
+
isMinimizable: false,
|
|
1107
|
+
isMaximizable: false,
|
|
1108
|
+
isClosable: false
|
|
1109
|
+
};
|
|
1110
|
+
};
|
|
1111
|
+
/**
|
|
1112
|
+
* 获取当前已打开窗口标识
|
|
1113
|
+
* @returns {Promise<XoWindow.Identity[]>}
|
|
1114
|
+
*/
|
|
1115
|
+
getOpenedWindowIdentities = async () => {
|
|
1116
|
+
return await BridgeUtil.invoke(WindowChannels.getOpenedWindowIdentities) ?? [];
|
|
1117
|
+
};
|
|
1118
|
+
/**
|
|
1119
|
+
* 最小化窗口
|
|
1120
|
+
* @returns {Promise<void>}
|
|
1121
|
+
*/
|
|
1122
|
+
minimize = async () => {
|
|
1123
|
+
await BridgeUtil.invoke(WindowChannels.minimize);
|
|
1124
|
+
};
|
|
1125
|
+
/**
|
|
1126
|
+
* 最大化窗口
|
|
1127
|
+
* @returns {Promise<void>}
|
|
1128
|
+
*/
|
|
1129
|
+
maximize = async () => {
|
|
1130
|
+
await BridgeUtil.invoke(WindowChannels.maximize);
|
|
1131
|
+
};
|
|
1132
|
+
/**
|
|
1133
|
+
* 是否已最大化
|
|
1134
|
+
* @returns {Promise<boolean>}
|
|
1135
|
+
*/
|
|
1136
|
+
isMaximized = async () => {
|
|
1137
|
+
const maximized = await BridgeUtil.invoke(WindowChannels.isMaximized);
|
|
1138
|
+
return maximized ?? false;
|
|
1139
|
+
};
|
|
1140
|
+
/**
|
|
1141
|
+
* 取消最大化窗口
|
|
1142
|
+
* @returns {Promise<void>}
|
|
1143
|
+
*/
|
|
1144
|
+
unmaximize = async () => {
|
|
1145
|
+
await BridgeUtil.invoke(WindowChannels.unmaximize);
|
|
1146
|
+
};
|
|
1147
|
+
/**
|
|
1148
|
+
* 全屏窗口
|
|
1149
|
+
* @returns {Promise<void>}
|
|
1150
|
+
*/
|
|
1151
|
+
fullScreen = async () => {
|
|
1152
|
+
await BridgeUtil.invoke(WindowChannels.fullScreen);
|
|
1153
|
+
};
|
|
1154
|
+
/**
|
|
1155
|
+
* 退出全屏窗口
|
|
1156
|
+
* @returns {Promise<void>}
|
|
1157
|
+
*/
|
|
1158
|
+
exitFullScreen = async () => {
|
|
1159
|
+
await BridgeUtil.invoke(WindowChannels.exitFullScreen);
|
|
1160
|
+
};
|
|
1161
|
+
/**
|
|
1162
|
+
* 重新加载窗口
|
|
1163
|
+
* @returns {Promise<void>}
|
|
1164
|
+
*/
|
|
1165
|
+
reload = async () => {
|
|
1166
|
+
await BridgeUtil.invoke(WindowChannels.reload);
|
|
1167
|
+
};
|
|
1168
|
+
/**
|
|
1169
|
+
* 居中窗口
|
|
1170
|
+
* @returns {Promise<void>}
|
|
1171
|
+
*/
|
|
1172
|
+
center = async () => {
|
|
1173
|
+
await BridgeUtil.invoke(WindowChannels.center);
|
|
1174
|
+
};
|
|
1175
|
+
/**
|
|
1176
|
+
* 隐藏窗口
|
|
1177
|
+
* @returns {Promise<void>}
|
|
1178
|
+
*/
|
|
1179
|
+
hide = async () => {
|
|
1180
|
+
await BridgeUtil.invoke(WindowChannels.hide);
|
|
1181
|
+
};
|
|
1182
|
+
/**
|
|
1183
|
+
* 还原窗口
|
|
1184
|
+
* @returns {Promise<void>}
|
|
1185
|
+
*/
|
|
1186
|
+
restore = async () => {
|
|
1187
|
+
await BridgeUtil.invoke(WindowChannels.restore);
|
|
1188
|
+
};
|
|
1189
|
+
/**
|
|
1190
|
+
* 切换窗口置顶
|
|
1191
|
+
* @returns {Promise<void>}
|
|
1192
|
+
*/
|
|
1193
|
+
toggleAlwaysOnTop = async () => {
|
|
1194
|
+
await BridgeUtil.invoke(WindowChannels.toggleAlwaysOnTop);
|
|
1195
|
+
};
|
|
1196
|
+
/**
|
|
1197
|
+
* 切换侧边栏折叠
|
|
1198
|
+
* @returns {Promise<void>}
|
|
1199
|
+
*/
|
|
1200
|
+
toggleSidebarFold = async () => {
|
|
1201
|
+
await BridgeUtil.invoke(WindowChannels.toggleSidebarFold);
|
|
1202
|
+
};
|
|
1203
|
+
/**
|
|
1204
|
+
* 关闭窗口
|
|
1205
|
+
* @returns {Promise<void>}
|
|
1206
|
+
*/
|
|
1207
|
+
close = async () => {
|
|
1208
|
+
await BridgeUtil.invoke(WindowChannels.close);
|
|
1209
|
+
};
|
|
1210
|
+
/**
|
|
1211
|
+
* 监听窗口状态
|
|
1212
|
+
* @param {XoWindow.StateListener} listener 监听器
|
|
1213
|
+
* @returns {() => void}
|
|
1214
|
+
*/
|
|
1215
|
+
onState = (listener) => {
|
|
1216
|
+
return BridgeUtil.on(WindowChannels.onState, listener);
|
|
1217
|
+
};
|
|
1218
|
+
/**
|
|
1219
|
+
* 监听路由重定向
|
|
1220
|
+
* @param {XoWindow.RouteRedirectListener} listener 监听器
|
|
1221
|
+
* @returns {() => void}
|
|
1222
|
+
*/
|
|
1223
|
+
onRouteRedirect = (listener) => {
|
|
1224
|
+
return this.routeRedirectBuffer.setListener(listener);
|
|
1225
|
+
};
|
|
1226
|
+
};
|
|
1227
|
+
|
|
1228
|
+
export {
|
|
1229
|
+
BridgeAbstract,
|
|
1230
|
+
AppBridge,
|
|
1231
|
+
AuthBridge,
|
|
1232
|
+
ClipboardBridge,
|
|
1233
|
+
ContextMenuBridge,
|
|
1234
|
+
DialogBridge,
|
|
1235
|
+
FileBridge,
|
|
1236
|
+
IpcBridge,
|
|
1237
|
+
LogBridge,
|
|
1238
|
+
RemoteServiceBridge,
|
|
1239
|
+
ShellBridge,
|
|
1240
|
+
ThemeBridge,
|
|
1241
|
+
UpdaterBridge,
|
|
1242
|
+
WindowBridge
|
|
1243
|
+
};
|