How to use the electron-rpc-api.createIpcMainApiService function in electron-rpc-api

To help you get started, we’ve selected a few electron-rpc-api examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github vladimiry / ElectronMail / src / shared / api / main.ts View on Github external
toggleControls: ActionType.Promise, "hideControls"> | void, void>(),

    toggleLocalDbMailsListViewMode: ActionType.Promise(),

    notification: ActionType.Observable>(),
};

export interface InitResponse {
    electronLocations: ElectronContextLocations;
    hasSavedPassword?: boolean;
    snapPasswordManagerServiceHint?: boolean;
    keytarSupport: boolean;
    checkUpdateAndNotify: boolean;
}

export const IPC_MAIN_API = createIpcMainApiService({
    channel: `${PACKAGE_NAME}:ipcMain-api`,
    apiDefinition: ENDPOINTS_DEFINITION,
});

export const IPC_MAIN_API_DB_INDEXER_ON_ACTIONS = unionize({
        Bootstrapped: ofType<{}>(),
        ProgressState: ofType<{
            key: DbModel.DbAccountPk;
            status: {
                indexing?: boolean;
                searching?: boolean;
            };
        } | {
            status: {
                indexing?: boolean;
            };

electron-rpc-api

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

MIT
Latest version published 5 months ago

Package Health Score

62 / 100
Full package analysis