vladimiry / electron-rpc-api Goto Github PK
View Code? Open in Web Editor NEWWrapper around the Electron's IPC for building type-safe API based RPC-like and reactive interactions
License: MIT License
Wrapper around the Electron's IPC for building type-safe API based RPC-like and reactive interactions
License: MIT License
It will require preserving the Promise / Observable return type in runtime so the API structure will need to be defined as a lightweight value rather than a type/interface.
Currently looking API definition:
export interface IpcMainApi {
ping: ApiMethod<{ domain: string, times: number }, { domain: string, value: number }>;
quitApp: ApiMethodNoArgument<never>;
}
Is going to look similar to this form:
const apiDefinition = {
ping: ActionType.Observable<[{ domain: string, times: number }], { domain: string, value: number }>();
quitApp: ActionType.Promise();
}
The default generics arguments/output parameters of the ActionType.Observable
/ ActionType.Promise
functions is going to look like IN extends any[] = []
and OUT extends any = void
. So ActionType.Promise<[], void>()
is the same as ActionType.Promise()
.
The change is going to be released with v5. Work is in progress.
Hey Vladimir,
I'm Richard from Proton Mail, we already discussed in the past. I would like to have a chat with you regarding ElectronMail project. Can you send me a message to [email protected] please?
Thanks.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.