@@ -39,15 +39,10 @@ interface IPlatformService extends NodeJS.EventEmitter {
3939 * When there are changes to be prepared, it prepares the native project for the specified platform.
4040 * When finishes, prepare saves the .nsprepareinfo file in platform folder.
4141 * This file contains information about current project configuration and allows skipping unnecessary build, deploy and livesync steps.
42- * @param {string } platform The platform to be prepared.
43- * @param {IAppFilesUpdaterOptions } appFilesUpdaterOptions Options needed to instantiate AppFilesUpdater class.
44- * @param {string } platformTemplate The name of the platform template.
45- * @param {IProjectData } projectData DTO with information about the project.
46- * @param {IAddPlatformCoreOptions } config Options required for project preparation/creation.
47- * @param {Array } filesToSync Files about to be synced to device.
42+ * @param {IPreparePlatformInfo } platformInfo Options to control the preparation.
4843 * @returns {boolean } true indicates that the platform was prepared.
4944 */
50- preparePlatform ( platform : string , appFilesUpdaterOptions : IAppFilesUpdaterOptions , platformTemplate : string , projectData : IProjectData , config : IPlatformOptions , filesToSync ?: Array < String > , nativePrepare ?: INativePrepare ) : Promise < boolean > ;
45+ preparePlatform ( platformInfo : IPreparePlatformInfo ) : Promise < boolean > ;
5146
5247 /**
5348 * Determines whether a build is necessary. A build is necessary when one of the following is true:
@@ -106,14 +101,10 @@ interface IPlatformService extends NodeJS.EventEmitter {
106101 /**
107102 * Executes prepare, build and installOnPlatform when necessary to ensure that the latest version of the app is installed on specified platform.
108103 * - When --clean option is specified it builds the app on every change. If not, build is executed only when there are native changes.
109- * @param {string } platform The platform to deploy.
110- * @param {IAppFilesUpdaterOptions } appFilesUpdaterOptions Options needed to instantiate AppFilesUpdater class.
111- * @param {IDeployPlatformOptions } deployOptions Various options that can manage the deploy operation.
112- * @param {IProjectData } projectData DTO with information about the project.
113- * @param {IAddPlatformCoreOptions } config Options required for project preparation/creation.
104+ * @param {IDeployPlatformInfo } deployInfo Options required for project preparation and deployment.
114105 * @returns {void }
115106 */
116- deployPlatform ( platform : string , appFilesUpdaterOptions : IAppFilesUpdaterOptions , deployOptions : IDeployPlatformOptions , projectData : IProjectData , config : IPlatformOptions ) : Promise < void > ;
107+ deployPlatform ( deployInfo : IDeployPlatformInfo ) : Promise < void > ;
117108
118109 /**
119110 * Runs the application on specified platform. Assumes that the application is already build and installed. Fails if this is not true.
@@ -276,9 +267,19 @@ interface IPlatformsData {
276267 getPlatformData ( platform : string , projectData : IProjectData ) : IPlatformData ;
277268}
278269
270+ interface IAppFilesUpdaterOptionsComposition {
271+ appFilesUpdaterOptions : IAppFilesUpdaterOptions ;
272+ }
273+
274+ interface IJsNodeModulesData extends IPlatform , IProjectDataComposition , IAppFilesUpdaterOptionsComposition {
275+ absoluteOutputPath : string ;
276+ lastModifiedTime : Date ;
277+ projectFilesConfig : IProjectFilesConfig ;
278+ }
279+
279280interface INodeModulesBuilder {
280281 prepareNodeModules ( absoluteOutputPath : string , platform : string , lastModifiedTime : Date , projectData : IProjectData , projectFilesConfig : IProjectFilesConfig ) : Promise < void > ;
281- prepareJSNodeModules ( absoluteOutputPath : string , platform : string , lastModifiedTime : Date , projectData : IProjectData , projectFilesConfig : IProjectFilesConfig ) : Promise < void > ;
282+ prepareJSNodeModules ( jsNodeModulesData : IJsNodeModulesData ) : Promise < void > ;
282283 cleanNodeModules ( absoluteOutputPath : string , platform : string ) : void ;
283284}
284285
@@ -290,3 +291,45 @@ interface IBuildInfo {
290291 prepareTime : string ;
291292 buildTime : string ;
292293}
294+
295+ interface IPlatformDataComposition {
296+ platformData : IPlatformData ;
297+ }
298+
299+ interface ICopyAppFilesData extends IProjectDataComposition , IAppFilesUpdaterOptionsComposition , IPlatformDataComposition { }
300+
301+ interface IPreparePlatformService {
302+ addPlatform ( info : IAddPlatformInfo ) : Promise < void > ;
303+ preparePlatform ( config : IPreparePlatformJSInfo ) : Promise < void > ;
304+ }
305+
306+ interface IAddPlatformInfo extends IProjectDataComposition , IPlatformDataComposition {
307+ frameworkDir : string ;
308+ installedVersion : string ;
309+ config : IPlatformOptions ;
310+ platformTemplate ?: string ;
311+ }
312+
313+ interface IPreparePlatformJSInfo extends IPreparePlatformCoreInfo , ICopyAppFilesData {
314+ projectFilesConfig ?: IProjectFilesConfig ;
315+ }
316+
317+ interface IPreparePlatformCoreInfo extends IPreparePlatformInfoBase {
318+ platformSpecificData : IPlatformSpecificData
319+ changesInfo ?: IProjectChangesInfo ;
320+ }
321+
322+ interface IPreparePlatformInfo extends IPreparePlatformInfoBase , IPlatformConfig , IPlatformTemplate { }
323+
324+ interface IPlatformConfig {
325+ config : IPlatformOptions ;
326+ }
327+
328+ interface IPreparePlatformInfoBase extends IPlatform , IAppFilesUpdaterOptionsComposition , IProjectDataComposition , IEnvOptions {
329+ filesToSync ?: string [ ] ;
330+ nativePrepare ?: INativePrepare ;
331+ }
332+
333+ interface IDeployPlatformInfo extends IPlatform , IAppFilesUpdaterOptionsComposition , IProjectDataComposition , IPlatformConfig , IEnvOptions {
334+ deployOptions : IDeployPlatformOptions
335+ }
0 commit comments