Skip to content

Commit

Permalink
feat: Adjust the signature of invokeNative
Browse files Browse the repository at this point in the history
  • Loading branch information
pk5ls20 committed Jul 8, 2024
1 parent f2a22c9 commit ae5e69a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/main/invokeNTQQ/invokeNative.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ class SCListener<CB1, CB2> {

private setupListener(eventName: string) {
this.eventEmitter.on(eventName, (result: any) => {
// log.debug('SCListeners: Received event:', eventName, result);
for (const [uuid, cond] of this.checkMap.entries()) {
if (cond(result)) {
// log.debug('SCListeners: Condition met:', uuid, result);
Expand Down Expand Up @@ -80,8 +81,8 @@ export async function invokeNative<
RTS1 = never extends RTS1B ? never : RTS1B,
RTS2 = never extends RTS2B ? never : RTS2B
>(
eventName: string = 'ns-ntApi-2',
cmdName: string,
eventName: string = 'ns-ntApi-2',
channel: string = 'IPC_UP_2',
args: AGT = [] as unknown as AGT,
timeout: number = IPC_TIMEOUT,
Expand Down
4 changes: 2 additions & 2 deletions src/main/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,8 @@ const getForwardMsgContent = async (msgData: forwardMsgData): Promise<RawMessage
];
// log.debug('await invokeNative in args: ', JSON.stringify(args));
const res = await invokeNative<unknown[], GeneralCallResult, { msgList: RawMessage[] }>(
'ns-ntApi-2',
'nodeIKernelMsgService/getMultiMsg',
'ns-ntApi-2',
'IPC_UP_2',
args
);
Expand Down Expand Up @@ -238,8 +238,8 @@ ipcMain.handle(channel.GET_FORWARD_MSG_CONTENT, async (_, msgData: forwardMsgDat
null
];
return invokeNative<ApiParams, GeneralCallResult, null, any, { notifyInfo: { filePath: string; msgId: string } }>(
'ns-ntApi-2',
'nodeIKernelMsgService/downloadRichMedia',
'ns-ntApi-2',
'IPC_UP_2',
apiParams,
100000,
Expand Down

0 comments on commit ae5e69a

Please sign in to comment.