/
githubmirror
/
tabby
Обзор
Документация
Войти
/
githubmirror
/
tabby
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
tabby-core/src/api/hostApp.ts
47 строк
1 KB
Eugene Pankov
avoid unnecessary config writes
30 июл 2022, 01:03
Не верифицирован
30 июл 2022, 01:03
5d383ee
Код
Авторство
О чём код?
import { Observable, Subject } from 'rxjs' import { Injector } from '@angular/core' import { Logger, LogService } from '../services/log.service' export enum Platform { Linux = 'Linux', macOS = 'macOS', Windows = 'Windows', Web = 'Web', } /** * Provides interaction with the main process */ export abstract class HostAppService { abstract get platform (): Platform abstract get configPlatform (): Platform protected settingsUIRequest = new Subject<void>() protected configChangeBroadcast = new Subject<void>() protected logger: Logger /** * Fired when Preferences is selected in the macOS menu */ get settingsUIRequest$ (): Observable<void> { return this.settingsUIRequest } /** * Fired when another window modified the config file */ get configChangeBroadcast$ (): Observable<void> { return this.configChangeBroadcast } constructor ( injector: Injector, ) { this.logger = injector.get(LogService).create('hostApp') } abstract newWindow (): void // eslint-disable-next-line @typescript-eslint/no-empty-function emitReady (): void { } abstract relaunch (): void abstract quit (): void }