export type FunctionPropertyNames < T > = { [ K in keyof T ] : K extends string ? ( T [ K ] extends Function ? K : never ) : never ; } [ keyof T ] ; interface Invokable { invoke : ( channel : string , ... args : any [ ] ) => void ; } ; param ipc param channel param logPrefix param args export function invokerFor < T extends object > ( ipc , channel = "command" , logPrefix , ... const_args ) { return new Proxy ( { ipc } , { get ( target , prop ) { return async ( data ) => { console . log ( `[${ logPrefix }] :: invoke event :: prop=${ prop }, channel=${ channel }, const_args=${ const_args }` ) ; let result = target . ipc . invoke ( channel , ... const_args , prop , data ) ; return result ; } ; } } ) ; } interface Sendable < E extends Electron . Event > { send : ( channel : string , ... args : any [ ] ) => void ; } ; deprecated export function senderFor < T extends object , E extends Electron . Event = Electron . Event > ( ee , channel = "command" , logPrefix ? ) { return new Proxy ( { ee } , { get ( target , prop , receiver ) { return ( data ) => { if ( logPrefix !== undefined ) { console . log ( `${ logPrefix } :: send event :: ${ prop }` ) ; } target . ee . send ( channel , prop , data ) ; let x = prop ; } ; } } ) ; }