electron-reactive-ipc
Version:
rxjs based electron IPC channel wrapper
35 lines • 1.42 kB
TypeScript
import { BrowserWindow, WebContents } from "electron";
import { Channels, DuplexChannel } from "./channel";
import { ChannelState, SignalData } from "./types";
export declare class ElectronIPC {
protected static _instance: ElectronIPC;
protected que: {
[index: number]: string[];
};
protected win: BrowserWindow;
protected isInitialized: boolean;
protected _channels: {
[id: number]: {
[index: string]: IPCChannel<unknown>;
};
};
protected constructor(win?: BrowserWindow);
get channels(): Channels<unknown>;
static get instance(): ElectronIPC;
protected addChanel<T>(name: string, data: T, win?: BrowserWindow): DuplexChannel<unknown>;
private get isMain();
protected resetChannels(id?: number): void;
protected setDataIncoming(sd: SignalData<unknown>, webContents?: WebContents): IPCChannel<unknown>;
protected setDataOutgoing(sd: SignalData<unknown>, webContents?: WebContents): IPCChannel<unknown>;
protected loadQue(id?: number): void;
}
declare class IPCChannel<U> extends DuplexChannel<U> {
readonly name: string;
readonly webContents: WebContents;
constructor(name: string, data: U, webContents?: WebContents, state?: ChannelState);
recieve(data: U): void;
private get isMain();
get localValue(): U;
}
export {};
//# sourceMappingURL=electron-ipc.d.ts.map