2019-09-19 10:40:16 +09:00
|
|
|
import { Observable } from 'rxjs';
|
|
|
|
|
2019-10-24 15:37:33 +09:00
|
|
|
import { WindowState } from '../types/window-state.type';
|
2019-11-07 16:56:14 +09:00
|
|
|
import { WindowIdle } from '../types/window-idle.type';
|
2019-11-09 17:29:02 +09:00
|
|
|
import { NotificationRequest } from '../models/notification';
|
2019-11-11 18:09:47 +09:00
|
|
|
import { TranslateLoader } from '@ngx-translate/core';
|
2019-11-19 16:44:50 +09:00
|
|
|
import { StatusCode } from '@ucap-webmessenger/core';
|
2019-12-12 17:15:09 +09:00
|
|
|
import { UpdateInfo, UpdateCheckConfig } from '../models/update-info';
|
2019-12-24 11:41:50 +09:00
|
|
|
import { NativeType } from '../types/native.type';
|
|
|
|
|
|
|
|
export type NativePathName =
|
|
|
|
| 'home'
|
|
|
|
| 'documents'
|
|
|
|
| 'downloads'
|
|
|
|
| 'music'
|
|
|
|
| 'pictures'
|
|
|
|
| 'videos';
|
2019-10-24 15:37:33 +09:00
|
|
|
|
2019-11-12 18:54:21 +09:00
|
|
|
export abstract class NativeService {
|
2019-12-24 11:41:50 +09:00
|
|
|
abstract type(): NativeType;
|
2019-11-12 18:54:21 +09:00
|
|
|
abstract postAppInit(): void;
|
2019-11-11 18:09:47 +09:00
|
|
|
|
2019-11-19 16:44:50 +09:00
|
|
|
abstract logout(): Observable<void>;
|
|
|
|
abstract changeStatus(): Observable<StatusCode>;
|
|
|
|
abstract showSetting(): Observable<void>;
|
|
|
|
|
2019-12-24 17:31:03 +09:00
|
|
|
abstract getNetworkInfo(): Promise<any>;
|
|
|
|
|
2019-12-17 17:27:08 +09:00
|
|
|
abstract changeAutoLaunch(autoLaunch: boolean): Promise<boolean>;
|
2019-12-18 17:11:58 +09:00
|
|
|
abstract changeStartupHideWindow(
|
|
|
|
startupHideWindow: boolean
|
|
|
|
): Promise<boolean>;
|
2020-01-03 10:29:40 +09:00
|
|
|
abstract changeDownloadPath(downloadPath: string): Promise<string>;
|
2019-12-17 17:27:08 +09:00
|
|
|
|
2019-11-12 18:54:21 +09:00
|
|
|
abstract notify(noti: NotificationRequest): void;
|
|
|
|
abstract closeAllNotify(): void;
|
2019-09-18 15:02:21 +09:00
|
|
|
|
2019-12-16 02:33:40 +09:00
|
|
|
abstract checkForUpdates(currentVersion: string): Promise<boolean>;
|
2019-12-12 17:15:09 +09:00
|
|
|
abstract checkForInstantUpdates(
|
|
|
|
config: UpdateCheckConfig
|
|
|
|
): Observable<UpdateInfo>;
|
|
|
|
abstract applyInstantUpdates(): void;
|
2019-09-18 15:02:21 +09:00
|
|
|
|
2019-11-12 18:54:21 +09:00
|
|
|
abstract showImageViewer(): void;
|
2019-09-18 15:02:21 +09:00
|
|
|
|
2019-11-12 18:54:21 +09:00
|
|
|
abstract saveFile(
|
|
|
|
buffer: Buffer,
|
|
|
|
fileName: string,
|
2019-11-13 15:28:33 +09:00
|
|
|
mimeType: string,
|
2019-11-12 18:54:21 +09:00
|
|
|
path?: string
|
2019-11-13 15:28:33 +09:00
|
|
|
): Promise<string>;
|
|
|
|
abstract readFile(path: string): Promise<Buffer>;
|
2019-12-04 16:37:19 +09:00
|
|
|
abstract openDefaultDownloadFolder(): Promise<boolean>;
|
|
|
|
abstract openTargetFolder(
|
|
|
|
folderPath?: string,
|
|
|
|
make?: boolean
|
|
|
|
): Promise<boolean>;
|
|
|
|
abstract openTargetItem(filePath?: string): Promise<boolean>;
|
2019-12-24 11:41:50 +09:00
|
|
|
abstract getPath(name: NativePathName): Promise<string>;
|
2019-12-24 16:16:13 +09:00
|
|
|
abstract selectDirectory(): Promise<string>;
|
2020-01-03 15:52:19 +09:00
|
|
|
abstract selectSaveFilePath(defaultPath?: string): Promise<string>;
|
2019-10-24 15:37:33 +09:00
|
|
|
|
2020-01-09 18:52:08 +09:00
|
|
|
abstract executeProcess(executableName: string): Promise<number>;
|
|
|
|
|
2019-11-12 18:54:21 +09:00
|
|
|
abstract windowStateChanged(): Observable<WindowState>;
|
|
|
|
abstract windowClose(): void;
|
|
|
|
abstract windowMinimize(): void;
|
|
|
|
abstract windowMaximize(): void;
|
2019-11-07 16:56:14 +09:00
|
|
|
|
2019-11-12 18:54:21 +09:00
|
|
|
abstract idleStateChanged(): Observable<WindowIdle>;
|
2020-01-10 16:49:53 +09:00
|
|
|
abstract changeLimitOfIdleState(limitTime: number): void;
|
2019-11-11 18:09:47 +09:00
|
|
|
|
2019-11-12 18:54:21 +09:00
|
|
|
abstract chatOpenRoom(): Observable<string>;
|
2019-12-17 16:39:02 +09:00
|
|
|
abstract msgOpenMessage(): Observable<string>;
|
2019-11-12 10:38:51 +09:00
|
|
|
|
2019-11-12 18:54:21 +09:00
|
|
|
abstract getTranslateLoader(
|
|
|
|
prefix?: string,
|
|
|
|
suffix?: string
|
|
|
|
): TranslateLoader;
|
2019-11-19 19:34:53 +09:00
|
|
|
|
|
|
|
abstract openDefaultBrowser(url: string): void;
|
2019-09-18 15:02:21 +09:00
|
|
|
}
|