mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-24 01:03:50 +02:00
rename
This commit is contained in:
42
src/plugins/interopApi.js
Normal file
42
src/plugins/interopApi.js
Normal file
@@ -0,0 +1,42 @@
|
||||
// @ts-nocheck
|
||||
import InteropApi from '../ipc-electron/interopApi.js';
|
||||
import configRepository from '../services/config.js';
|
||||
import vrcxJsonStorage from '../services/jsonStorage.js';
|
||||
|
||||
export async function initInteropApi(isVrOverlay = false) {
|
||||
if (isVrOverlay) {
|
||||
if (WINDOWS) {
|
||||
await CefSharp.BindObjectAsync('AppApiVr');
|
||||
} else {
|
||||
// @ts-ignore
|
||||
window.AppApiVr = InteropApi.AppApiVrElectron;
|
||||
}
|
||||
} else {
|
||||
// #region | Init Cef C# bindings
|
||||
if (WINDOWS) {
|
||||
await CefSharp.BindObjectAsync(
|
||||
'AppApi',
|
||||
'WebApi',
|
||||
'VRCXStorage',
|
||||
'SQLite',
|
||||
'LogWatcher',
|
||||
'Discord',
|
||||
'AssetBundleManager'
|
||||
);
|
||||
} else {
|
||||
window.AppApi = InteropApi.AppApiElectron;
|
||||
window.WebApi = InteropApi.WebApi;
|
||||
window.VRCXStorage = InteropApi.VRCXStorage;
|
||||
window.SQLite = InteropApi.SQLite;
|
||||
window.LogWatcher = InteropApi.LogWatcher;
|
||||
window.Discord = InteropApi.Discord;
|
||||
window.AssetBundleManager = InteropApi.AssetBundleManager;
|
||||
window.AppApiVrElectron = InteropApi.AppApiVrElectron;
|
||||
}
|
||||
|
||||
await configRepository.init();
|
||||
new vrcxJsonStorage(VRCXStorage);
|
||||
|
||||
AppApi.SetUserAgent();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user