Coder Social home page Coder Social logo

vladimiry / electron-rpc-api Goto Github PK

View Code? Open in Web Editor NEW
22.0 22.0 2.0 2.7 MB

Wrapper around the Electron's IPC for building type-safe API based RPC-like and reactive interactions

License: MIT License

TypeScript 97.28% HTML 2.03% SCSS 0.34% Shell 0.35%
api electron ipc rpc rxjs

electron-rpc-api's People

Contributors

dependabot[bot] avatar vladimiry avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

electron-rpc-api's Issues

Support both Promise / Observable return types

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.

Can we have a chat?

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.