fix(core): update
This commit is contained in:
parent
ab5c3fc8f2
commit
dcff23e71d
@ -3,6 +3,6 @@
|
|||||||
*/
|
*/
|
||||||
export const commitinfo = {
|
export const commitinfo = {
|
||||||
name: '@api.global/typedelectron',
|
name: '@api.global/typedelectron',
|
||||||
version: '1.0.7',
|
version: '1.0.8',
|
||||||
description: 'a package made for ipc communication in electron'
|
description: 'a package made for ipc communication in electron'
|
||||||
}
|
}
|
||||||
|
@ -11,20 +11,23 @@ export class TypedElectronBackend {
|
|||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
plugins.electron.ipcMain.on('typedrequest', (eventArg, payloadArg) => {
|
plugins.electron.ipcMain.on('typedrequest', (eventArg, payloadArg) => {
|
||||||
this.typedrouter.routeAndAddResponse(payloadArg);
|
this.typedrouter.routeAndAddResponse({ ...payloadArg }); // TODO: check how to pass on eventArg
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
createTypedRequest<T extends plugins.typedrequestInterfaces.ITypedRequest>(
|
createTypedRequest<T extends plugins.typedrequestInterfaces.ITypedRequest>(
|
||||||
methodName: T['method'],
|
methodName: T['method'],
|
||||||
windowArg: plugins.electron.BrowserWindow,
|
windowArg: plugins.electron.BrowserWindow
|
||||||
) {
|
) {
|
||||||
const typedrequest = new plugins.typedrequest.TypedRequest<T>(new plugins.typedrequest.TypedTarget({
|
const typedrequest = new plugins.typedrequest.TypedRequest<T>(
|
||||||
|
new plugins.typedrequest.TypedTarget({
|
||||||
typedRouterRef: this.typedrouter,
|
typedRouterRef: this.typedrouter,
|
||||||
postMethodWithTypedRouter: async (payloadArg: T) => {
|
postMethodWithTypedRouter: async (payloadArg: T) => {
|
||||||
windowArg.webContents.send('typedrequest', payloadArg);
|
windowArg.webContents.send('typedrequest', payloadArg);
|
||||||
}
|
},
|
||||||
}), methodName);
|
}),
|
||||||
|
methodName
|
||||||
|
);
|
||||||
return typedrequest;
|
return typedrequest;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,6 @@
|
|||||||
*/
|
*/
|
||||||
export const commitinfo = {
|
export const commitinfo = {
|
||||||
name: '@api.global/typedelectron',
|
name: '@api.global/typedelectron',
|
||||||
version: '1.0.7',
|
version: '1.0.8',
|
||||||
description: 'a package made for ipc communication in electron'
|
description: 'a package made for ipc communication in electron'
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1 @@
|
|||||||
|
export * from './classes.typedelectronfrontend.js';
|
Loading…
Reference in New Issue
Block a user