Skip to content

Commit 3c1cb0c

Browse files
author
Dimitar Kerezov
committed
Separate NS specific interfaces from common ones
1 parent 5c1460a commit 3c1cb0c

File tree

5 files changed

+16
-4
lines changed

5 files changed

+16
-4
lines changed

lib/declarations.ts

+12
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,18 @@ interface ILiveSyncService {
5454
liveSync(platform: string, projectData: IProjectData, applicationReloadAction?: (deviceAppData: Mobile.IDeviceAppData) => Promise<void>): Promise<void>;
5555
}
5656

57+
interface INativeScriptDeviceLiveSyncService extends IDeviceLiveSyncServiceBase {
58+
/**
59+
* Refreshes the application's content on a device
60+
*/
61+
refreshApplication(deviceAppData: Mobile.IDeviceAppData, localToDevicePaths: Mobile.ILocalToDevicePathData[], forceExecuteFullSync: boolean, projectId: string): Promise<void>;
62+
/**
63+
* Removes specified files from a connected device
64+
*/
65+
removeFiles(appIdentifier: string, localToDevicePaths: Mobile.ILocalToDevicePathData[], projectId: string): Promise<void>;
66+
afterInstallApplicationAction?(deviceAppData: Mobile.IDeviceAppData, localToDevicePaths: Mobile.ILocalToDevicePathData[], projectId: string): Promise<boolean>;
67+
}
68+
5769
interface IPlatformLiveSyncService {
5870
fullSync(projectData: IProjectData, postAction?: (deviceAppData: Mobile.IDeviceAppData, localToDevicePaths: Mobile.ILocalToDevicePathData[]) => Promise<void>): Promise<void>;
5971
partialSync(event: string, filePath: string, dispatcher: IFutureDispatcher, afterFileSyncAction: (deviceAppData: Mobile.IDeviceAppData, localToDevicePaths: Mobile.ILocalToDevicePathData[]) => Promise<void>, projectData: IProjectData): Promise<void>;

lib/services/livesync/android-device-livesync-service.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import * as helpers from "../../common/helpers";
44
import * as path from "path";
55
import * as net from "net";
66

7-
class AndroidLiveSyncService implements IDeviceLiveSyncService {
7+
class AndroidLiveSyncService implements INativeScriptDeviceLiveSyncService {
88
private static BACKEND_PORT = 18182;
99
private device: Mobile.IAndroidDevice;
1010

lib/services/livesync/ios-device-livesync-service.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import * as net from "net";
55

66
let currentPageReloadId = 0;
77

8-
class IOSLiveSyncService implements IDeviceLiveSyncService {
8+
class IOSLiveSyncService implements INativeScriptDeviceLiveSyncService {
99
private static BACKEND_PORT = 18181;
1010
private socket: net.Socket;
1111
private device: Mobile.IiOSDevice;

lib/services/livesync/platform-livesync-service.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ export abstract class PlatformLiveSyncServiceBase implements IPlatformLiveSyncSe
9797
this.logFilesSyncInformation(localToDevicePaths, "Successfully transferred %s.", this.$logger.info);
9898
}
9999

100-
protected resolveDeviceSpecificLiveSyncService(platform: string, device: Mobile.IDevice): IDeviceLiveSyncService {
100+
protected resolveDeviceSpecificLiveSyncService(platform: string, device: Mobile.IDevice): INativeScriptDeviceLiveSyncService {
101101
return this.$injector.resolve(this.$liveSyncProvider.deviceSpecificLiveSyncServices[platform.toLowerCase()], { _device: device });
102102
}
103103

0 commit comments

Comments
 (0)