mirror of
https://github.com/4gray/iptvnator.git
synced 2026-10-12 20:16:15 -08:00
21 lines
721 B
TypeScript
21 lines
721 B
TypeScript
import { ipcRenderer } from 'electron';
|
|
export abstract class DataService {
|
|
get isElectron(): boolean {
|
|
return !!(window && window.process && (window.process as any).type);
|
|
}
|
|
get remote() {
|
|
return this.isElectron ? window.require('@electron/remote') : null;
|
|
}
|
|
get ipcRenderer(): typeof ipcRenderer {
|
|
return this.isElectron ? window.require('electron').ipcRenderer : null;
|
|
}
|
|
abstract getAppVersion(): string;
|
|
abstract sendIpcEvent(type: string, payload?: unknown);
|
|
abstract removeAllListeners(type: string): void;
|
|
abstract listenOn(
|
|
command: string,
|
|
callback: (...args: any[]) => void
|
|
): void;
|
|
abstract getAppEnvironment(): string;
|
|
}
|