-
-
Notifications
You must be signed in to change notification settings - Fork 197
/
Copy pathproject.d.ts
876 lines (764 loc) · 24.5 KB
/
project.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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
import type { SupportedPlatform } from "../constants";
import {
IAndroidBuildOptionsSettings,
IProvision,
ITeamIdentifier,
IPlatformBuildData,
} from "../declarations";
import { ICheckEnvironmentRequirementsOutput, IPlatformData } from "./platform";
import { IPluginData, IBasePluginData } from "./plugins";
import {
IStringDictionary,
IProjectDir,
IDeviceIdentifier,
IRelease,
IPlatform,
IDependencyInformation,
ISpawnResult,
} from "../common/declarations";
import { SupportedConfigValues } from "../tools/config-manipulation/config-transformer";
import * as constants from "../constants";
interface IProjectName {
/**
* Name of the newly created application.
*/
projectName: string;
}
interface IProjectSettingsBase extends IProjectName {
/**
* Defines whether the `npm install` command should be executed with `--ignore-scripts` option.
* When it is passed, all scripts (postinstall for example) will not be executed.
*/
ignoreScripts?: boolean;
/**
* Selected template from which to create the project. If not specified, defaults to hello-world template.
* Template can be any npm package, local dir, github url, .tgz file.
* If it is set to `angular` or `ng`, default NativeScript Angular Hello World template will be used.
* If it is set to `typescript` or `tsc`, default NativeScript TypeScript Hello World template will be used.
*/
template?: string;
/**
* Application identifier for the newly created application. If not specified, defaults to org.nativescript.<projectName>.
*/
appId?: string;
}
/**
* Describes information passed to project creation hook (createProject).
*/
interface IProjectCreationSettings extends IProjectSettingsBase, IProjectDir {}
/**
* Describes available settings when creating new NativeScript application.
*/
interface IProjectSettings extends IProjectSettingsBase {
/**
* Path where the project will be created. If not specified, defaults to current working dir.
*/
pathToProject?: string;
/**
* Defines if invalid application name can be used for project creation.
*/
force?: boolean;
}
interface ICreateProjectData extends IProjectDir, IProjectName {}
interface IProjectService {
validateProjectName(opts: {
projectName: string;
force: boolean;
pathToProject: string;
}): Promise<string>;
/**
* Creates new NativeScript application.
* @param {any} projectSettings Options describing new project - its name, appId, path and template from which to be created.
* @returns {Promise<void>}
*/
createProject(projectSettings: IProjectSettings): Promise<ICreateProjectData>;
/**
* Checks if the specified project is valid NativeScript project.
* @param {string} pathToProject Directory to check.
* @returns {boolean} returns true if the project is valid NativeScript project.
*/
isValidNativeScriptProject(pathToProject?: string): boolean;
/**
* Checks if App_Resources exists, or pulls down a fresh set
* from the default template otherwise.
* @param {string} projectDir
*/
ensureAppResourcesExist(projectDir: string): Promise<void>;
}
interface INsConfigPlaform {
id?: string;
}
interface IOSSPMPackageBase {
name: string;
libs: string[];
/**
* Optional: If you have more targets (like widgets for example)
* you can list their names here to include the Swift Package with them
*/
targets?: string[];
}
export interface IOSRemoteSPMPackage extends IOSSPMPackageBase {
repositoryURL: string;
version: string;
}
export interface IOSLocalSPMPackage extends IOSSPMPackageBase {
path: string;
}
export type IOSSPMPackage = IOSRemoteSPMPackage | IOSLocalSPMPackage;
interface INsConfigIOS extends INsConfigPlaform {
discardUncaughtJsExceptions?: boolean;
/**
* Swift Package Manager
* List packages to be included in the iOS build.
*/
SPMPackages?: Array<IOSSPMPackage>;
}
interface INSConfigVisionOS extends INsConfigIOS {}
interface INsConfigAndroid extends INsConfigPlaform {
v8Flags?: string;
codeCache?: boolean;
heapSnapshotScript?: string;
"snapshot.blob"?: string;
profilerOutputDir?: string;
gcThrottleTime?: number;
profiling?: string;
markingMode?: string;
handleTimeZoneChanges?: boolean;
maxLogcatObjectSize?: number;
forceLog?: boolean;
memoryCheckInterval?: number;
freeMemoryRatio?: number;
suppressCallJSMethodExceptions?: boolean;
discardUncaughtJsExceptions?: boolean;
enableLineBreakpoints?: boolean;
enableMultithreadedJavascript?: boolean;
}
interface INsConfigHooks {
type?: string;
script: string;
}
interface INsConfig {
id?: string;
main?: string;
appPath?: string;
appResourcesPath?: string;
shared?: boolean;
overridePods?: string;
webpackConfigPath?: string;
ios?: INsConfigIOS;
android?: INsConfigAndroid;
visionos?: INSConfigVisionOS;
ignoredNativeDependencies?: string[];
hooks?: INsConfigHooks[];
projectName?: string;
}
interface IProjectData extends ICreateProjectData {
platformsDir: string;
projectFilePath: string;
projectId: string;
projectIdentifiers?: Mobile.IProjectIdentifier;
dependencies: any;
ignoredDependencies?: string[];
devDependencies: IStringDictionary;
appDirectoryPath: string;
appResourcesDirectoryPath: string;
projectType: string;
packageJsonData: any;
nsConfig: INsConfig;
androidManifestPath: string;
appGradlePath: string;
gradleFilesDirectoryPath: string;
infoPlistPath: string;
buildXcconfigPath: string;
podfilePath: string;
initialized?: boolean;
/**
* Defines if the project is a code sharing one.
* Value is true when project has nativescript.config and it has `shared: true` in it.
*/
isShared: boolean;
/**
* Defines the path to the configuration file passed to webpack process.
* By default this is the webpack.config.js at the root of the application.
* The value can be changed by setting `webpackConfigPath` in nativescript.config.
*/
webpackConfigPath: string;
projectName: string;
/**
* Initializes project data with the given project directory. If none supplied defaults to --path option or cwd.
* @param {string} projectDir Project root directory.
* @returns {void}
*/
initializeProjectData(projectDir?: string): void;
initializeProjectDataFromContent(
packageJsonContent: string,
projectDir?: string,
): void;
getAppDirectoryPath(projectDir?: string): string;
getAppDirectoryRelativePath(): string;
getAppResourcesDirectoryPath(projectDir?: string): string;
getAppResourcesRelativeDirectoryPath(): string;
}
interface IProjectDataService {
/**
* Returns a value from `nativescript` key in project's package.json.
* @param {string} projectDir The project directory - the place where the root package.json is located.
* @param {string} propertyName The name of the property to be checked in `nativescript` key.
* @returns {any} The value of the property.
*/
getNSValue(projectDir: string, propertyName: string): any;
/**
* Sets a value in the `nativescript` key in a project's package.json.
* @param {string} projectDir The project directory - the place where the root package.json is located.
* @param {string} key Key to be added to `nativescript` key in project's package.json.
* @param {any} value Value of the key to be added to `nativescript` key in project's package.json.
* @returns {void}
*/
setNSValue(projectDir: string, key: string, value: any): void;
/**
* Removes a property from `nativescript` key in project's package.json.
* @param {string} projectDir The project directory - the place where the root package.json is located.
* @param {string} propertyName The name of the property to be removed from `nativescript` key.
* @returns {void}
*/
removeNSProperty(projectDir: string, propertyName: string): void;
/**
* Removes a property from `nativescript.config`.
* @param {string} projectDir The project directory - the place where the `nativescript.config` is located.
* @param {string} propertyName The name of the property to be removed.
* @returns {void}
*/
removeNSConfigProperty(projectDir: string, propertyName: string): void;
/**
* Removes dependency from package.json
* @param {string} projectDir The project directory - the place where the root package.json is located.
* @param {string} dependencyName Name of the dependency that has to be removed.
* @returns {void}
*/
removeDependency(projectDir: string, dependencyName: string): void;
getProjectData(projectDir?: string): IProjectData;
/**
* Gives information about the whole assets structure for both iOS and Android.
* For each of the platforms, the returned object will contain icons, splashBackgrounds, splashCenterImages and splashImages (only for iOS).
* @param {IProjectDir} opts Object with a single property - projectDir. This is the root directory where NativeScript project is located.
* @returns {Promise<IAssetsStructure>} An object describing the current asset structure.
*/
getAssetsStructure(opts: IProjectDir): Promise<IAssetsStructure>;
/**
* Gives information about the whole assets structure for iOS.
* The returned object will contain icons, splashBackgrounds, splashCenterImages and splashImages.
* @param {IProjectDir} opts Object with a single property - projectDir. This is the root directory where NativeScript project is located.
* @returns {Promise<IAssetGroup>} An object describing the current asset structure for iOS.
*/
getIOSAssetsStructure(opts: IProjectDir): Promise<IAssetGroup>;
/**
* Gives information about the whole assets structure for Android.
* The returned object will contain icons, splashBackgrounds and splashCenterImages.
* @param {IProjectDir} opts Object with a single property - projectDir. This is the root directory where NativeScript project is located.
* @returns {Promise<IAssetGroup>} An object describing the current asset structure for Android.
*/
getAndroidAssetsStructure(opts: IProjectDir): Promise<IAssetGroup>;
/**
* Returns array with paths to all `.js` or `.ts` files in application's app directory.
* @param {string} projectDir Path to application.
* @returns {string[]} Array of paths to `.js` or `.ts` files.
*/
getAppExecutableFiles(projectDir: string): string[];
/**
* Returns package details for runtime, respecting the nativescript key for legacy projects
* @param {string} projectDir Path to application.
* @param {string} platform Platform key
*/
getRuntimePackage(
projectDir: string,
platform: SupportedPlatform,
): IBasePluginData;
/**
* Returns a value from `nativescript` key in project's package.json.
* @param {string} jsonData The project directory - the place where the root package.json is located.
* @param {string} propertyName The name of the property to be checked in `nativescript` key.
* @returns {any} The value of the property.
* @deprecated no longer used - will be removed in 8.0.
*/
getNSValueFromContent(jsonData: Object, propertyName: string): any;
}
interface IProjectCleanupService {
/**
* Clean multiple paths
* @param {string[]} pathsToClean
*/
clean(
pathsToClean: string[],
options?: IProjectCleanupOptions,
): Promise<IProjectCleanupResult>;
/**
* Clean a single path
* @param {string} pathToClean
*/
cleanPath(
pathToClean: string,
options?: IProjectCleanupOptions,
): Promise<IProjectCleanupResult>;
}
interface IProjectCleanupOptions {
/**
* When set, the cleanup service will calculate the size of the cleaned up files.
*/
stats?: boolean;
/**
* When set, the cleanup service will not delete any files.
*/
dryRun?: boolean;
/**
* When set, the cleanup service will not print any messages to the console.
*/
silent?: boolean;
}
interface IProjectCleanupResult {
ok: boolean;
/**
* When stats is set to true, this will contain a map of the cleaned up paths and their size.
*/
stats?: Map<string, number>;
}
interface IProjectPathCleanupResult {
ok: boolean;
/**
* When stats is set to true, this will contain the size of the cleaned path in bytes.
*/
size?: number;
}
interface IBackup {
create(): IBackup;
restore(): IBackup;
remove(): IBackup;
isUpToDate(): boolean;
addPath(path: string): IBackup;
addPaths(paths: string[]): IBackup;
}
interface IProjectBackupService {
getBackup(name: string): IBackup;
backup(name: string, pathsToBackup: string[]): IBackup;
restore(name: string, pathsToRestore: string[]): IBackup;
}
interface IProjectConfigInformation {
hasTSConfig: boolean;
hasJSConfig: boolean;
hasNSConfig: boolean;
usingNSConfig: boolean;
TSConfigPath: string;
JSConfigPath: string;
NSConfigPath: string;
}
interface IProjectConfigService {
/**
* read the nativescript.config.(js|ts) file
* @returns {INsConfig} the parsed config data
*/
readConfig(projectDir?: string): INsConfig;
/**
* Get value for a given config key path
* @param key the property key path
*/
getValue(key: string, defaultValue?: any): any;
/**
* Set value for a given config key path
* @param key the property key path
* @param value
*/
setValue(key: string, value: SupportedConfigValues): Promise<boolean>;
/**
* Override legacy fallback - and force using the new configs
* Used by the migrate service to force the config service to
* write new values into the new configs.
* @param force
*/
setForceUsingNewConfig(force: boolean): boolean;
/**
* Override legacy fallback - and force using the legacy configs
* Used by the migrate service to force the config service to
* read values from the old configs
* @param force
*/
setForceUsingLegacyConfig(force: boolean): boolean;
detectProjectConfigs(projectDir?: string): IProjectConfigInformation;
getDefaultTSConfig(appId: string, appPath: string): string;
writeDefaultConfig(projectDir?: string, appId?: string): boolean | string;
writeLegacyNSConfigIfNeeded(
projectDir: string,
runtimePackage: IBasePluginData,
): Promise<void>;
}
interface IAssetItem {
path: string;
size: string;
width: number;
height: number;
filename: string;
directory: string;
scale: string;
idiom: string;
resizeOperation?: string;
overlayImageScale?: number;
rgba?: boolean;
// additional operations for special cases
operation?: "delete" | "writeXMLColor";
data?: any;
}
interface IAssetSubGroup {
images: IAssetItem[];
info?: { version: string; author: string };
[imageType: string]: any;
}
interface IAssetGroup {
icons: IAssetSubGroup;
splashBackgrounds: IAssetSubGroup;
splashCenterImages: IAssetSubGroup;
splashImages?: IAssetSubGroup;
[imageType: string]: IAssetSubGroup;
}
interface IAssetsStructure {
ios: IAssetGroup;
android: IAssetGroup;
}
interface IImageDefinitionGroup {
icons: IAssetItem[];
splashBackgrounds: IAssetItem[];
splashCenterImages: IAssetItem[];
splashImages?: IAssetItem[];
}
interface IImageDefinitionsStructure {
ios: IImageDefinitionGroup;
android: IImageDefinitionGroup;
android_legacy: IImageDefinitionGroup;
}
interface ITemplateData {
/**
* The normalized template name
* In case no --template option is provided, use default template name
* In case --template <templateName> option is provided, use <templateName>
* In case --template <templateName>@<version> is provided, use <templateName>
* In case --ng option is provided, use default angular template name
* In case --ts option is provided, use default typescript template name
*/
templateName: string;
/**
* The path to the template.
* In case template is v1, will be {pathToProjectDir}/node_modules/{templateName}.
* In case template is v2, will be null.
*/
// templatePath: string;
/**
* The whole content of package.json file
*/
templatePackageJsonContent: ITemplatePackageJsonContent;
/**
* The version of the package used for creating the application.
*/
version: string;
}
interface ITemplatePackageJsonContent extends IBasePluginData {
dependencies: IStringDictionary;
devDependencies: IStringDictionary;
nativescript?: {
templateVersion?: string;
};
}
/**
* Describes working with templates.
*/
interface IProjectTemplatesService {
/**
* Prepares template for project creation.
* In case templateName is not provided, use defaultTemplatePath.
* In case templateName is a special word, validated from us (for ex. typescript), resolve the real template name and add it to npm cache.
* In any other cases try to `npm install` the specified templateName to temp directory.
* @param {string} templateName The name of the template.
* @return {ITemplateData} Data describing the template - location where it is installed and its NativeScript version.
*/
prepareTemplate(
templateName: string,
projectDir: string,
): Promise<ITemplateData>;
}
interface IPlatformProjectServiceBase {
getPluginPlatformsFolderPath(
pluginData: IPluginData,
platform: string,
): string;
getFrameworkVersion(projectData: IProjectData): string;
}
interface IBuildForDevice {
buildForDevice: boolean;
}
interface IiCloudContainerEnvironment {
iCloudContainerEnvironment: string;
}
interface INativePrepare {
skipNativePrepare: boolean;
forceRebuildNativeApp?: boolean;
restartLiveSync?: boolean;
}
interface IBuildConfig
extends IAndroidBuildOptionsSettings,
IiOSBuildConfig,
IProjectDir {
clean?: boolean;
architectures?: string[];
buildOutputStdio?: string;
platform?: string;
_device?: Mobile.IDevice;
}
/**
* Describes iOS-specific build configuration properties
*/
interface IiOSBuildConfig
extends IBuildForDevice,
IiCloudContainerEnvironment,
IDeviceIdentifier,
IProvision,
ITeamIdentifier,
IRelease {
/**
* Identifier of the mobile provision which will be used for the build. If not set a provision will be selected automatically if possible.
*/
mobileProvisionIdentifier?: string;
/**
* Code sign identity used for build. If not set iPhone Developer is used as a default when building for device.
*/
codeSignIdentity?: string;
}
/**
* Describes service used for building a project locally.
*/
interface ILocalBuildService {
/**
* Builds a project locally.
* @param {string} platform Platform for which to build.
* @param {IPlatformBuildData} platformBuildOptions Additional options for controlling the build.
* @return {Promise<string>} Path to the build output.
*/
build(
platform: string,
platformBuildOptions: IPlatformBuildData,
): Promise<string>;
/**
* Removes build artifacts specific to the platform
* @param {ICleanNativeAppData} data Data describing the clean app process
* @returns {void}
*/
cleanNativeApp(data: ICleanNativeAppData): Promise<void>;
}
interface ICleanNativeAppData extends IProjectDir, IPlatform {}
interface IValidatePlatformOutput {
checkEnvironmentRequirementsOutput: ICheckEnvironmentRequirementsOutput;
}
interface ITestExecutionService {
startKarmaServer(
platform: string,
liveSyncInfo: ILiveSyncInfo,
deviceDescriptors: ILiveSyncDeviceDescriptor[],
): Promise<void>;
canStartKarmaServer(projectData: IProjectData): Promise<boolean>;
}
interface ITestInitializationService {
getDependencies(framework: string): IDependencyInformation[];
getFrameworkNames(): string[];
}
/**
* Describes a service used to facilitate communication with CocoaPods
*/
interface ICocoaPodsService {
/**
* Get the header needed for the beginning of every Podfile
* @param {string} targetName The name of the target (usually the same as the project's name).
* @return {string} The header which needs to be placed at the beginning of a Podfile.
*/
getPodfileHeader(targetName: string): string;
/**
* Get the footer needed for the end of every Podfile
* @return {string} The footer which needs to be placed at the end of a Podfile.
*/
getPodfileFooter(): string;
/**
* Merges the Podfile's content from App_Resources in the project's Podfile.
* @param projectData Information about the project.
* @param platformData Information about the platform.
* @returns {Promise<void>}
*/
applyPodfileFromAppResources(
projectData: IProjectData,
platformData: IPlatformData,
): Promise<void>;
applyPodfileArchExclusions(
projectData: IProjectData,
platformData: IPlatformData,
): Promise<void>;
applyPodfileFromExtensions(
projectData: IProjectData,
platformData: IPlatformData,
): Promise<void>;
/**
* Prepares the Podfile content of a plugin and merges it in the project's Podfile.
* @param {string} moduleName The module which the Podfile is from.
* @param {string} podfilePath The path to the podfile.
* @param {IProjectData} projectData Information about the project.
* @param {IPlatformData} platformData Information about the platform.
* @returns {Promise<void>}
*/
applyPodfileToProject(
moduleName: string,
podfilePath: string,
projectData: IProjectData,
platformData: IPlatformData,
): Promise<void>;
/**
* Gives the path to the plugin's Podfile.
* @param {IPluginData} pluginData Information about the plugin.
* @returns {string} Path to plugin's Podfile
*/
getPluginPodfilePath(pluginData: IPluginData): string;
/**
* Removes plugins Podfile content from the project.
* @param {string} moduleName The name of the module.
* @param {string} podfilePath The path to the module's Podfile.
* @param {string} projectData Information about the project.
* @param {string} nativeProjectPath Path to the native Xcode project.
* @returns {void}
*/
removePodfileFromProject(
moduleName: string,
podfilePath: string,
projectData: IProjectData,
nativeProjectPath: string,
): void;
/**
* Gives the path to project's Podfile.
* @param {string} nativeProjectPath Path to the native Xcode project.
* @returns {string} Path to project's Podfile.
*/
getProjectPodfilePath(nativeProjectPath: string): string;
/**
* Executes `pod install` or `sanboxpod install` in the passed project.
* @param {string} projectRoot The root directory of the native iOS project.
* @param {string} xcodeProjPath The full path to the .xcodeproj file.
* @returns {Promise<ISpawnResult>} Information about the spawned process.
*/
executePodInstall(
projectRoot: string,
xcodeProjPath: string,
): Promise<ISpawnResult>;
/**
* Merges pod's xcconfig file into project's xcconfig file
* @param projectData
* @param platformData
* @param opts
*/
mergePodXcconfigFile(
projectData: IProjectData,
platformData: IPlatformData,
opts: IRelease,
): Promise<void>;
}
interface ICocoaPodsPlatformManager {
addPlatformSection(
projectData: IProjectData,
podfilePlatformData: IPodfilePlatformData,
projectPodfileContent: string,
): string;
removePlatformSection(
moduleName: string,
projectPodFileContent: string,
podfilePath: string,
): string;
replacePlatformRow(
podfileContent: string,
podfilePath: string,
): { replacedContent: string; podfilePlatformData: IPodfilePlatformData };
}
declare const enum BuildNames {
debug = "Debug",
release = "Release",
}
interface IXcodeTargetBuildConfigurationProperty {
name: string;
value: any;
buildNames?: BuildNames[];
}
/**
* Describes a service used to add and remove iOS extension
*/
interface IIOSNativeTargetService {
addTargetToProject(
targetRootPath: string,
targetFolder: string,
targetType: string,
project: IXcode.project,
platformData: IPlatformData,
parentTarget?: string,
): IXcode.target;
prepareSigning(
targetUuids: string[],
projectData: IProjectData,
projectPath: string,
): void;
getTargetDirectories(folderPath: string): string[];
setXcodeTargetBuildConfigurationProperties(
properties: IXcodeTargetBuildConfigurationProperty[],
targetName: string,
project: IXcode.project,
): void;
setConfigurationsFromJsonFile(
jsonPath: string,
targetUuid: string,
targetName: string,
project: IXcode.project,
): void;
}
/**
* Describes a service used to add and remove iOS extension
*/
interface IIOSExtensionsService {
addExtensionsFromPath(
options: IAddExtensionsFromPathOptions,
): Promise<boolean>;
removeExtensions(options: IRemoveExtensionsOptions): void;
}
interface IIOSWatchAppService {
addWatchAppFromPath(options: IAddWatchAppFromPathOptions): Promise<boolean>;
removeWatchApp(options: IRemoveWatchAppOptions): void;
hasWatchApp(platformData: IPlatformData, projectData: IProjectData): boolean;
}
interface IAddTargetFromPathOptions {
projectData: IProjectData;
platformData: IPlatformData;
pbxProjPath: string;
}
interface IAddExtensionsFromPathOptions extends IAddTargetFromPathOptions {
extensionsFolderPath: string;
}
interface IAddWatchAppFromPathOptions extends IAddTargetFromPathOptions {
watchAppFolderPath: string;
}
interface IRemoveExtensionsOptions {
pbxProjPath: string;
}
interface IRemoveWatchAppOptions extends IRemoveExtensionsOptions {}
interface IRubyFunction {
functionName: string;
functionParameters?: string;
}
interface IPodfilePlatformData {
/**
* The content of the whole pod's platform row
*/
content: string;
/**
* The version of the pod's platform
*/
version: string;
/**
* The path to the pod's file
*/
path: string;
}