mirror of
https://github.com/Kong/insomnia
synced 2024-11-08 06:39:48 +00:00
cb42863868
This reverts commit 80e5161a20
.
22 lines
903 B
TypeScript
22 lines
903 B
TypeScript
import { ipcMain } from 'electron';
|
|
|
|
import { GrpcRequestEventEnum } from '../common/grpc-events';
|
|
import * as grpc from '../network/grpc';
|
|
import { GrpcIpcRequestParams } from '../network/grpc/prepare';
|
|
import { ResponseCallbacks } from '../network/grpc/response-callbacks';
|
|
|
|
export function init() {
|
|
ipcMain.on(GrpcRequestEventEnum.start, (e, params: GrpcIpcRequestParams) =>
|
|
grpc.start(params, new ResponseCallbacks(e)),
|
|
);
|
|
ipcMain.on(GrpcRequestEventEnum.sendMessage, (e, params: GrpcIpcRequestParams) =>
|
|
// @ts-expect-error -- TSCONVERSION
|
|
grpc.sendMessage(params, new ResponseCallbacks(e)),
|
|
);
|
|
ipcMain.on(GrpcRequestEventEnum.commit, (_, requestId) => grpc.commit(requestId));
|
|
ipcMain.on(GrpcRequestEventEnum.cancel, (_, requestId) => grpc.cancel(requestId));
|
|
ipcMain.on(GrpcRequestEventEnum.cancelMultiple, (_, requestIdS) =>
|
|
grpc.cancelMultiple(requestIdS),
|
|
);
|
|
}
|