-
-
Notifications
You must be signed in to change notification settings - Fork 197
/
Copy pathproject.d.ts
202 lines (173 loc) · 6.74 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
interface IProjectService {
createProject(projectName: string, selectedTemplate?: string): IFuture<void>;
}
interface IProjectData {
projectDir: string;
projectName: string;
platformsDir: string;
projectFilePath: string;
projectId?: string;
dependencies: any;
appDirectoryPath: string;
appResourcesDirectoryPath: string;
}
interface IProjectDataService {
initialize(projectDir: string): void;
/**
* Returns a value from `nativescript` key in project's package.json.
* @param {string} propertyName The name of the property to be checked in `nativescript` key.
* @returns {any} The value of the property.
*/
getValue(propertyName: string): any;
/**
* Sets a value in the `nativescript` key in a project's package.json.
* @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}
*/
setValue(key: string, value: any): void;
/**
* Removes a property from `nativescript` key in project's package.json.
* @param {string} propertyName The name of the property to be removed from `nativescript` key.
* @returns {void}
*/
removeProperty(propertyName: string): void;
/**
* Removes dependency from package.json
* @param {string} dependencyName Name of the dependency that has to be removed.
* @returns {void}
*/
removeDependency(dependencyName: string): void;
}
/**
* 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 {string} Path to the directory where extracted template can be found.
*/
prepareTemplate(templateName: string, projectDir: string): IFuture<string>;
}
interface IPlatformProjectServiceBase {
getPluginPlatformsFolderPath(pluginData: IPluginData, platform: string): string;
}
interface IBuildConfig {
buildForDevice?: boolean;
architectures?: string[];
}
/**
* Describes iOS-specific build configuration properties
*/
interface IiOSBuildConfig extends IBuildConfig {
/**
* 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;
/**
* Team identifier.
*/
teamIdentifier?: string;
}
interface IPlatformProjectService {
platformData: IPlatformData;
validate(): IFuture<void>;
createProject(frameworkDir: string, frameworkVersion: string, pathToTemplate?: string): IFuture<void>;
interpolateData(): IFuture<void>;
interpolateConfigurationFile(configurationFilePath?: string): IFuture<void>;
/**
* Executes additional actions after native project is created.
* @param {string} projectRoot Path to the real NativeScript project.
* @returns {void}
*/
afterCreateProject(projectRoot: string): void;
/**
* Gets first chance to validate the options provided as command line arguments.
*/
validateOptions(): IFuture<boolean>;
buildProject(projectRoot: string, buildConfig?: IBuildConfig): IFuture<void>;
/**
* Prepares images in Native project (for iOS).
* @returns {void}
*/
prepareProject(): void;
/**
* Prepares App_Resources in the native project by clearing data from other platform and applying platform specific rules.
* @param {string} appResourcesDirectoryPath The place in the native project where the App_Resources are copied first.
* @returns {void}
*/
prepareAppResources(appResourcesDirectoryPath: string): void;
/**
* Defines if current platform is prepared (i.e. if <project dir>/platforms/<platform> dir exists).
* @param {string} projectRoot The project directory (path where root's package.json is located).
* @returns {boolean} True in case platform is prepare (i.e. if <project dir>/platforms/<platform> dir exists), false otherwise.
*/
isPlatformPrepared(projectRoot: string): boolean;
/**
* Checks if current platform can be updated to a newer versions.
* @param {string} newInstalledModuleDir Path to the native project.
* @return {boolean} True if platform can be updated. false otherwise.
*/
canUpdatePlatform(newInstalledModuleDir: string): boolean;
preparePluginNativeCode(pluginData: IPluginData, options?: any): IFuture<void>;
/**
* Removes native code of a plugin (CocoaPods, jars, libs, src).
* @param {IPluginData} Plugins data describing the plugin which should be cleaned.
* @returns {void}
*/
removePluginNativeCode(pluginData: IPluginData): void;
afterPrepareAllPlugins(): IFuture<void>;
beforePrepareAllPlugins(dependencies?: IDictionary<IDependencyData>): IFuture<void>;
/**
* Gets the path wheren App_Resources should be copied.
* @returns {string} Path to native project, where App_Resources should be copied.
*/
getAppResourcesDestinationDirectoryPath(): string;
deploy(deviceIdentifier: string): IFuture<void>;
processConfigurationFilesFromAppResources(): IFuture<void>;
/**
* Ensures there is configuration file (AndroidManifest.xml, Info.plist) in app/App_Resources.
* @returns {void}
*/
ensureConfigurationFileInAppResources(): void;
}
interface IAndroidProjectPropertiesManager {
getProjectReferences(): IFuture<ILibRef[]>;
addProjectReference(referencePath: string): IFuture<void>;
removeProjectReference(referencePath: string): IFuture<void>;
}
interface ITestExecutionService {
startTestRunner(platform: string): IFuture<void>;
startKarmaServer(platform: string): IFuture<void>;
}
/**
* 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 content of hooks with the provided name if there are more than one hooks with this name in the Podfile.
* @param {string} hookName The name of the hook.
* @param {string} pathToPodfile The path to the Podfile.
* @return {void}
*/
mergePodfileHookContent(sectionName: string, pathToPodfile: string): void
}