зеркало из
1
0
Форкнуть 0
This commit is contained in:
Elsie Ju 2022-09-12 19:23:16 -07:00
Родитель 8024aba4b4
Коммит 41f19ce659
2 изменённых файлов: 0 добавлений и 17 удалений

Просмотреть файл

@ -6,12 +6,10 @@ import { contextBridge } from 'electron';
import { generateSettingsInterface } from './factories/settingsInterfaceFactory';
import { generateDirectoryInterface } from './factories/directoryInterfaceFactory';
import { generateModelRepositoryInterface } from './factories/modelRepositoryInterfaceFactory';
import { generateDeviceInterface } from './factories/deviceInterfaceFactory';
import { generateEventHubInterface } from './factories/eventHubInterfaceFactory';
import { generateAuthenticationInterface } from './factories/authenticationInterfaceFactory';
import { API_INTERFACES } from './constants';
contextBridge.exposeInMainWorld(API_INTERFACES.DEVICE, generateDeviceInterface());
contextBridge.exposeInMainWorld(API_INTERFACES.DIRECTORY, generateDirectoryInterface());
contextBridge.exposeInMainWorld(API_INTERFACES.EVENTHUB, generateEventHubInterface());
contextBridge.exposeInMainWorld(API_INTERFACES.MODEL_DEFINITION, generateModelRepositoryInterface());

Просмотреть файл

@ -1,15 +0,0 @@
/***********************************************************
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License
**********************************************************/
import { MESSAGE_CHANNELS } from '../constants';
import { DeviceInterface, SendMessageToDeviceParameters } from '../interfaces/deviceInterface';
import { invokeInMainWorld } from '../utils/invokeHelper';
export const generateDeviceInterface = (): DeviceInterface => {
return {
sendMessageToDevice: async (params: SendMessageToDeviceParameters): Promise<void> => {
return invokeInMainWorld<void>(MESSAGE_CHANNELS.DEVICE_SEND_MESSAGE, params);
},
};
};