update
This commit is contained in:
Родитель
8024aba4b4
Коммит
41f19ce659
|
@ -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);
|
||||
},
|
||||
};
|
||||
};
|
Загрузка…
Ссылка в новой задаче