fix: getWithRenderProcess with optional params

This commit is contained in:
Bloomingg
2024-05-28 17:30:05 +08:00
parent da9b1a056c
commit 4bfbce6727
2 changed files with 4 additions and 5 deletions

View File

@@ -1,6 +1,6 @@
{ {
"name": "@openim/electron-client-sdk", "name": "@openim/electron-client-sdk",
"version": "1.0.1", "version": "1.0.2",
"description": "open im sdk for node", "description": "open im sdk for node",
"source": "src/index.ts", "source": "src/index.ts",
"main": "lib/index.js", "main": "lib/index.js",

View File

@@ -106,10 +106,9 @@ async function createWasmSDK(wasmConfig?: WasmPathConfig): Promise<void> {
} }
} }
export function getWithRenderProcess({ export function getWithRenderProcess(
wasmConfig, { wasmConfig, invoke } = {} as CreateElectronOptions
invoke, ) {
}: CreateElectronOptions) {
const interalInvoke = invoke ?? window.openIMRenderApi?.imMethodsInvoke; const interalInvoke = invoke ?? window.openIMRenderApi?.imMethodsInvoke;
const subscribeCallback = (event: keyof EmitterEvents, data: any) => const subscribeCallback = (event: keyof EmitterEvents, data: any) =>
sdkEmitter.emit(event, data); sdkEmitter.emit(event, data);