-
-
Notifications
You must be signed in to change notification settings - Fork 197
/
Copy pathpreview-app-livesync.d.ts
82 lines (68 loc) · 2.71 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
import { FilePayload, Device, FilesPayload } from "nativescript-preview-sdk";
import { EventEmitter } from "events";
declare global {
interface IPreviewAppFilesService {
getInitialFilesPayload(liveSyncData: IPreviewAppLiveSyncData, platform: string, deviceId?: string): FilesPayload;
getFilesPayload(liveSyncData: IPreviewAppLiveSyncData, filesData: IPreviewAppFilesData, platform: string, deviceId?: string): FilesPayload;
}
interface IPreviewAppFilesData {
filesToSync: string[];
filesToRemove?: string[];
}
interface IPreviewAppLiveSyncData extends IProjectDir, IHasUseHotModuleReloadOption, IEnvOptions { }
interface IPreviewSdkService {
getQrCodeUrl(options: IGetQrCodeUrlOptions): string;
initialize(projectDir: string, getInitialFiles: (device: Device) => Promise<FilesPayload>): void;
applyChanges(filesPayload: FilesPayload): Promise<void>;
stop(): void;
}
interface IGetQrCodeUrlOptions extends IHasUseHotModuleReloadOption, IProjectDir { }
interface IPreviewAppPluginsService {
getPluginsUsageWarnings(data: IPreviewAppLiveSyncData, device: Device): Promise<string[]>;
comparePluginsOnDevice(data: IPreviewAppLiveSyncData, device: Device): Promise<void>;
getExternalPlugins(device: Device): string[];
}
interface IPreviewAppLogProvider extends EventEmitter {
logData(log: string, deviceName: string, deviceId: string): void;
}
interface IPreviewQrCodeService {
getPlaygroundAppQrCode(options?: IPlaygroundAppQrCodeOptions): Promise<IDictionary<IQrCodeImageData>>;
getLiveSyncQrCode(url: string): Promise<IQrCodeImageData>;
printLiveSyncQrCode(options: IPrintLiveSyncOptions): Promise<void>;
}
interface IPlaygroundAppQrCodeOptions extends IProjectDir {
platform?: string;
}
interface IPrintLiveSyncOptions extends IGetQrCodeUrlOptions {
/**
* 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[];
getPluginsUsageWarnings(data: IPreviewAppLiveSyncData, device: Device): Promise<string[]>;
}
interface IPreviewSchemaService {
getSchemaData(projectDir: string): IPreviewSchemaData;
}
interface IPreviewSchemaData {
name: string;
scannerAppId: string;
scannerAppStoreId: string;
previewAppId: string;
previewAppStoreId: string;
msvKey: string;
publishKey: string;
subscribeKey: string;
default?: boolean;
}
interface IPreviewAppController {
startPreview(data: IPreviewAppLiveSyncData): Promise<IQrCodeImageData>;
stopPreview(data: IProjectDir): Promise<void>;
}
}