-
-
Notifications
You must be signed in to change notification settings - Fork 197
/
Copy pathpreview-app-livesync.d.ts
43 lines (36 loc) · 1.45 KB
/
preview-app-livesync.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import { FilePayload, Device, FilesPayload } from "nativescript-preview-sdk";
import { EventEmitter } from "events";
declare global {
interface IPreviewAppLiveSyncService {
initialize(data: IPreviewAppLiveSyncData): void;
syncFiles(data: IPreviewAppLiveSyncData, filesToSync: string[], filesToRemove: string[]): Promise<void>;
stopLiveSync(): Promise<void>;
}
interface IPreviewAppLiveSyncData extends IProjectDir, IAppFilesUpdaterOptionsComposition, IEnvOptions { }
interface IPreviewSdkService extends EventEmitter {
getQrCodeUrl(options: IHasUseHotModuleReloadOption): string;
initialize(getInitialFiles: (device: Device) => Promise<FilesPayload>): void;
applyChanges(filesPayload: FilesPayload): Promise<void>;
stop(): void;
}
interface IPreviewAppPluginsService {
comparePluginsOnDevice(data: IPreviewAppLiveSyncData, device: Device): Promise<void>;
getExternalPlugins(device: Device): string[];
}
interface IPlaygroundQrCodeGenerator {
generateQrCode(options: IGenerateQrCodeOptions): Promise<void>;
}
interface IGenerateQrCodeOptions extends IHasUseHotModuleReloadOption {
/**
* If set to true, a link will be shown on console instead of QR code
* Default value is false.
*/
link: boolean;
}
interface IPreviewDevicesService extends EventEmitter {
getConnectedDevices(): Device[];
updateConnectedDevices(devices: Device[]): void;
getDeviceById(id: string): Device;
getDevicesForPlatform(platform: string): Device[];
}
}