Skip to content

Commit 046d6e9

Browse files
committed
fix: remove unneeded interfaces
1 parent e85daf7 commit 046d6e9

File tree

3 files changed

+7
-170
lines changed

3 files changed

+7
-170
lines changed

lib/declarations.d.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -912,18 +912,6 @@ interface IXcconfigService {
912912
mergeFiles(sourceFile: string, destinationFile: string): Promise<void>;
913913
}
914914

915-
/**
916-
* Describes helper used during execution of deploy commands.
917-
*/
918-
interface IDeployCommandHelper {
919-
/**
920-
* Retrieves data needed to execute deploy command.
921-
* @param {string} platform platform to which to deploy - could be android or ios.
922-
* @return {IDeployPlatformInfo} data needed to execute deploy command.
923-
*/
924-
getDeployPlatformInfo(platform: string): IDeployPlatformInfo;
925-
}
926-
927915
/**
928916
* Describes helper for validating bundling.
929917
*/

lib/definitions/livesync.d.ts

Lines changed: 7 additions & 99 deletions
Original file line numberDiff line numberDiff line change
@@ -1,70 +1,8 @@
11
import { EventEmitter } from "events";
22

33
declare global {
4-
// This interface is a mashup of NodeJS' along with Chokidar's event watchers
5-
interface IFSWatcher extends NodeJS.EventEmitter {
6-
// from fs.FSWatcher
7-
close(): void;
8-
9-
/**
10-
* events.EventEmitter
11-
* 1. change
12-
* 2. error
13-
*/
14-
addListener(event: string, listener: Function): this;
15-
addListener(event: "change", listener: (eventType: string, filename: string | Buffer) => void): this;
16-
addListener(event: "error", listener: (code: number, signal: string) => void): this;
17-
18-
on(event: string, listener: Function): this;
19-
on(event: "change", listener: (eventType: string, filename: string | Buffer) => void): this;
20-
on(event: "error", listener: (code: number, signal: string) => void): this;
21-
22-
once(event: string, listener: Function): this;
23-
once(event: "change", listener: (eventType: string, filename: string | Buffer) => void): this;
24-
once(event: "error", listener: (code: number, signal: string) => void): this;
25-
26-
prependListener(event: string, listener: Function): this;
27-
prependListener(event: "change", listener: (eventType: string, filename: string | Buffer) => void): this;
28-
prependListener(event: "error", listener: (code: number, signal: string) => void): this;
29-
30-
prependOnceListener(event: string, listener: Function): this;
31-
prependOnceListener(event: "change", listener: (eventType: string, filename: string | Buffer) => void): this;
32-
prependOnceListener(event: "error", listener: (code: number, signal: string) => void): this;
33-
34-
// From chokidar FSWatcher
35-
36-
/**
37-
* Add files, directories, or glob patterns for tracking. Takes an array of strings or just one
38-
* string.
39-
*/
40-
add(paths: string | string[]): void;
41-
42-
/**
43-
* Stop watching files, directories, or glob patterns. Takes an array of strings or just one
44-
* string.
45-
*/
46-
unwatch(paths: string | string[]): void;
47-
48-
/**
49-
* Returns an object representing all the paths on the file system being watched by this
50-
* `FSWatcher` instance. The object's keys are all the directories (using absolute paths unless
51-
* the `cwd` option was used), and the values are arrays of the names of the items contained in
52-
* each directory.
53-
*/
54-
getWatched(): IDictionary<string[]>;
55-
56-
/**
57-
* Removes all listeners from watched files.
58-
*/
59-
close(): void;
60-
}
61-
624
interface ILiveSyncProcessInfo {
635
timer: NodeJS.Timer;
64-
watcherInfo: {
65-
watcher: IFSWatcher,
66-
patterns: string[]
67-
};
686
actionsChain: Promise<any>;
697
isStopped: boolean;
708
deviceDescriptors: ILiveSyncDeviceInfo[];
@@ -131,18 +69,16 @@ declare global {
13169
debugggingEnabled?: boolean;
13270
}
13371

134-
interface IOptionalSkipWatcher {
135-
/**
136-
* Defines if the watcher should be skipped. If not passed, fs.Watcher will be started.
137-
*/
138-
skipWatcher?: boolean;
139-
}
140-
14172
/**
14273
* Describes a LiveSync operation.
14374
*/
144-
interface ILiveSyncInfo extends IProjectDir, IEnvOptions, IRelease, IOptionalSkipWatcher, IHasUseHotModuleReloadOption, IHasSyncToPreviewAppOption {
75+
interface ILiveSyncInfo extends IProjectDir, IEnvOptions, IRelease, IHasUseHotModuleReloadOption, IHasSyncToPreviewAppOption {
14576
emulator?: boolean;
77+
78+
/**
79+
* Defines if the watcher should be skipped. If not passed, fs.Watcher will be started.
80+
*/
81+
skipWatcher?: boolean;
14682

14783
/**
14884
* Forces a build before the initial livesync.
@@ -189,43 +125,14 @@ declare global {
189125
isFullSync?: boolean
190126
}
191127

192-
interface ILatestAppPackageInstalledSettings extends IDictionary<IDictionary<boolean>> { /* empty */ }
193-
194128
interface IIsEmulator {
195129
isEmulator: boolean;
196130
}
197131

198-
interface ILiveSyncBuildInfo extends IIsEmulator, IPlatform {
199-
pathToBuildItem: string;
200-
}
201-
202132
interface IProjectDataComposition {
203133
projectData: IProjectData;
204134
}
205135

206-
/**
207-
* Desribes object that can be passed to ensureLatestAppPackageIsInstalledOnDevice method.
208-
*/
209-
interface IEnsureLatestAppPackageIsInstalledOnDeviceOptions extends IProjectDataComposition, IEnvOptions, IBundle, IRelease, IOptionalFilesToRemove, IOptionalFilesToSync {
210-
device: Mobile.IDevice;
211-
preparedPlatforms: string[];
212-
rebuiltInformation: ILiveSyncBuildInfo[];
213-
deviceBuildInfoDescriptor: ILiveSyncDeviceInfo;
214-
settings: ILatestAppPackageInstalledSettings;
215-
liveSyncData?: ILiveSyncInfo;
216-
modifiedFiles?: string[];
217-
}
218-
219-
/**
220-
* Describes the action that has been executed during ensureLatestAppPackageIsInstalledOnDevice execution.
221-
*/
222-
interface IAppInstalledOnDeviceResult {
223-
/**
224-
* Defines if the app has been installed on device from the ensureLatestAppPackageIsInstalledOnDevice method.
225-
*/
226-
appInstalled: boolean;
227-
}
228-
229136
/**
230137
* Describes LiveSync operations.
231138
*/
@@ -401,6 +308,7 @@ declare global {
401308
shouldRestart(projectData: IProjectData, liveSyncInfo: ILiveSyncResultInfo): Promise<boolean>;
402309
getDeviceLiveSyncService(device: Mobile.IDevice, projectData: IProjectData): INativeScriptDeviceLiveSyncService;
403310
}
311+
404312
interface IRestartApplicationInfo {
405313
didRestart: boolean;
406314
}

lib/definitions/platform.d.ts

Lines changed: 0 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ interface IBuildPlatformAction {
1414
buildPlatform(platform: string, buildConfig: IBuildConfig, projectData: IProjectData): Promise<string>;
1515
}
1616

17-
interface IPlatformOptions extends IPlatformSpecificData, ICreateProjectOptions { }
18-
1917
/**
2018
* Platform specific data required for project preparation.
2119
*/
@@ -63,16 +61,6 @@ interface IPlatformsData {
6361
getPlatformData(platform: string, projectData: IProjectData): IPlatformData;
6462
}
6563

66-
interface IAppFilesUpdaterOptionsComposition {
67-
appFilesUpdaterOptions: IAppFilesUpdaterOptions;
68-
}
69-
70-
interface INodeModulesData extends IPlatform, IProjectDataComposition, IAppFilesUpdaterOptionsComposition {
71-
absoluteOutputPath: string;
72-
lastModifiedTime: Date;
73-
projectFilesConfig: IProjectFilesConfig;
74-
}
75-
7664
interface INodeModulesBuilder {
7765
prepareNodeModules(platformData: IPlatformData, projectData: IProjectData): Promise<void>;
7866
}
@@ -93,53 +81,6 @@ interface IBuildInfo {
9381
deploymentTarget?: string;
9482
}
9583

96-
interface IPlatformDataComposition {
97-
platformData: IPlatformData;
98-
}
99-
100-
interface ICopyAppFilesData extends IProjectDataComposition, IAppFilesUpdaterOptionsComposition, IPlatformDataComposition, IOptionalFilesToSync, IOptionalFilesToRemove { }
101-
102-
interface IPreparePlatformJSInfo extends IPreparePlatformCoreInfo, ICopyAppFilesData {
103-
projectFilesConfig?: IProjectFilesConfig;
104-
}
105-
106-
interface IPlatformOptions extends IRelease, IHasUseHotModuleReloadOption {
107-
}
108-
109-
interface IOptionalProjectChangesInfoComposition {
110-
changesInfo?: IProjectChangesInfo;
111-
}
112-
113-
interface IPreparePlatformCoreInfo extends IPreparePlatformInfoBase, IOptionalProjectChangesInfoComposition {
114-
platformSpecificData: IPlatformSpecificData;
115-
}
116-
117-
interface IPlatformConfig {
118-
config: IPlatformOptions;
119-
}
120-
121-
interface IOptionalFilesToSync {
122-
filesToSync?: string[];
123-
}
124-
125-
interface IOptionalFilesToRemove {
126-
filesToRemove?: string[];
127-
}
128-
129-
interface IPreparePlatformInfoBase extends IPlatform, IAppFilesUpdaterOptionsComposition, IProjectDataComposition, IEnvOptions, IOptionalFilesToSync, IOptionalFilesToRemove, IOptionalNativePrepareComposition { }
130-
131-
interface IOptionalNativePrepareComposition {
132-
nativePrepare?: INativePrepare;
133-
}
134-
135-
interface IDeployPlatformInfo extends IPlatform, IAppFilesUpdaterOptionsComposition, IProjectDataComposition, IPlatformConfig, IEnvOptions, IOptionalNativePrepareComposition, IOptionalOutputPath, IBuildPlatformAction {
136-
deployOptions: IDeployPlatformOptions
137-
}
138-
139-
interface IUpdateAppOptions extends IOptionalFilesToSync, IOptionalFilesToRemove {
140-
beforeCopyAction: (sourceFiles: string[]) => void;
141-
}
142-
14384
interface IPlatformEnvironmentRequirements {
14485
checkEnvironmentRequirements(input: ICheckEnvironmentRequirementsInput): Promise<ICheckEnvironmentRequirementsOutput>;
14586
}

0 commit comments

Comments
 (0)