|
| 1 | +declare module NativeScriptDoctor { |
| 2 | + /** |
| 3 | + * Describes methods which helps collecting system information. |
| 4 | + */ |
| 5 | + interface ISysInfo { |
| 6 | + /** |
| 7 | + * Returns the currently installed Java version. |
| 8 | + * @return {Promise<string>} The currently installed Java version. |
| 9 | + */ |
| 10 | + getJavaVersion(): Promise<string>; |
| 11 | + |
| 12 | + /** |
| 13 | + * Returns the currently installed Java compiler version. |
| 14 | + * @return {Promise<string>} The currently installed Java compiler version. |
| 15 | + */ |
| 16 | + getJavaCompilerVersion(): Promise<string>; |
| 17 | + |
| 18 | + /** |
| 19 | + * Returns the currently installed version of Xcode. |
| 20 | + * @return {Promise<string>} Returns the currently installed version of Xcode or null if Xcode is not installed or executed on Linux or Windows. |
| 21 | + */ |
| 22 | + getXcodeVersion(): Promise<string>; |
| 23 | + |
| 24 | + /** |
| 25 | + * Returns the currently installed Node.js version. |
| 26 | + * @return {Promise<string>} Returns the currently installed Node.js version. |
| 27 | + */ |
| 28 | + getNodeVersion(): Promise<string>; |
| 29 | + |
| 30 | + /** |
| 31 | + * Returns the currently installed node-gyp version. |
| 32 | + * @return {Promise<string>} Returns the currently installed node-gyp version. If node-gyp is not installed it will return null. |
| 33 | + */ |
| 34 | + getNodeGypVersion(): Promise<string>; |
| 35 | + |
| 36 | + /** |
| 37 | + * Returns the xcodeproj gem location. |
| 38 | + * @return {Promise<string>} Returns the xcodeproj gem location. If the the xcodeproj gem is not installed it will return null. |
| 39 | + */ |
| 40 | + getXcodeprojGemLocation(): Promise<string>; |
| 41 | + |
| 42 | + /** |
| 43 | + * Checks if iTunes is installed. |
| 44 | + * @return {Promise<string>} Returns true if iTunes is installed. |
| 45 | + */ |
| 46 | + isITunesInstalled(): Promise<boolean>; |
| 47 | + |
| 48 | + /** |
| 49 | + * Returns the currently installed Cocoapods version. |
| 50 | + * @return {Promise<string>} Returns the currently installed Cocoapods version. It will return null if Cocoapods is not installed. |
| 51 | + */ |
| 52 | + getCocoaPodsVersion(): Promise<string>; |
| 53 | + |
| 54 | + /** |
| 55 | + * Returns the os name. |
| 56 | + * @return {Promise<string>} Returns the os name. |
| 57 | + */ |
| 58 | + getOs(): Promise<string>; |
| 59 | + |
| 60 | + /** |
| 61 | + * Returns the currently installed ADB version. |
| 62 | + * @return {Promise<string>} Returns the currently installed ADB version. It will return null if ADB is not installed. |
| 63 | + */ |
| 64 | + getAdbVersion(): Promise<string>; |
| 65 | + |
| 66 | + /** |
| 67 | + * Checks if Android is installed. |
| 68 | + * @return {Promise<boolean>} Returns true if Android is installed. |
| 69 | + */ |
| 70 | + isAndroidInstalled(): Promise<boolean>; |
| 71 | + |
| 72 | + /** |
| 73 | + * Returns the currently installed Mono version. |
| 74 | + * @return {Promise<string>} Returns the currently installed Mono version. It will return null if Mono is not installed. |
| 75 | + */ |
| 76 | + getMonoVersion(): Promise<string>; |
| 77 | + |
| 78 | + /** |
| 79 | + * Returns the currently installed Git version. |
| 80 | + * @return {Promise<string>} Returns the currently installed Git version. It will return null if Git is not installed. |
| 81 | + */ |
| 82 | + getGitVersion(): Promise<string>; |
| 83 | + |
| 84 | + /** |
| 85 | + * Returns the currently installed Gradle version. |
| 86 | + * @return {Promise<string>} Returns the currently installed Gradle version. It will return null if Gradle is not installed. |
| 87 | + */ |
| 88 | + getGradleVersion(): Promise<string>; |
| 89 | + |
| 90 | + /** |
| 91 | + * Checks if CocoaPods is working correctly by trying to install one pod. |
| 92 | + * @return {Promise<boolean>} Returns true if CocoaPods is working correctly. |
| 93 | + */ |
| 94 | + isCocoaPodsWorkingCorrectly(): Promise<boolean>; |
| 95 | + |
| 96 | + /** |
| 97 | + * Returns the version of the globally installed NativeScript CLI. |
| 98 | + * @return {Promise<string>} Returns the version of the globally installed NativeScript CLI. |
| 99 | + */ |
| 100 | + getNativeScriptCliVersion(): Promise<string>; |
| 101 | + |
| 102 | + /** |
| 103 | + * Returns the whole system information. |
| 104 | + * @return {Promise<ISysInfoData>} The system information. |
| 105 | + */ |
| 106 | + getSysInfo(): Promise<ISysInfoData>; |
| 107 | + } |
| 108 | + |
| 109 | + /** |
| 110 | + * Describes methods which help identifying if the environment can be used for development of {N} apps. |
| 111 | + */ |
| 112 | + interface IDoctor { |
| 113 | + /** |
| 114 | + * Checks if a local build can be executed on the current machine. |
| 115 | + * @param {string} platform The platform for which to check if local build is possible. |
| 116 | + * @return {Promise<boolean>} true if local build can be executed for the provided platform. |
| 117 | + */ |
| 118 | + canExecuteLocalBuild(platform: string): Promise<boolean>; |
| 119 | + |
| 120 | + /** |
| 121 | + * Executes all checks for the current environment and returns the warnings from each check. |
| 122 | + * @return {Promise<IWarning[]>} Array of all the warnings from all checks. If there are no warnings will return empty array. |
| 123 | + */ |
| 124 | + getWarnings(): Promise<IWarning[]>; |
| 125 | + } |
| 126 | + |
| 127 | + interface ISysInfoData { |
| 128 | + // os stuff |
| 129 | + /** |
| 130 | + * Os platform flavour, reported by os.platform. |
| 131 | + * @type {string} |
| 132 | + */ |
| 133 | + platform: string; |
| 134 | + |
| 135 | + /** |
| 136 | + * Full os name, like `uname -a` on unix, registry query on win. |
| 137 | + * @type {string} |
| 138 | + */ |
| 139 | + os: string; |
| 140 | + |
| 141 | + /** |
| 142 | + * .net version, applicable to windows only. |
| 143 | + * @type {string} |
| 144 | + */ |
| 145 | + dotNetVer: string; |
| 146 | + |
| 147 | + /** |
| 148 | + * The command shell in use, usually bash or cmd. |
| 149 | + * @type {string} |
| 150 | + */ |
| 151 | + shell: string; |
| 152 | + |
| 153 | + // node stuff |
| 154 | + /** |
| 155 | + * node.js version, returned by `process.version`. |
| 156 | + * @type {string} |
| 157 | + */ |
| 158 | + nodeVer: string; |
| 159 | + |
| 160 | + /** |
| 161 | + * npm version, returned by `npm -v`. |
| 162 | + * @type {string} |
| 163 | + */ |
| 164 | + npmVer: string; |
| 165 | + |
| 166 | + /** |
| 167 | + * Process architecture, returned by `process.arch`. |
| 168 | + * @type {string} |
| 169 | + */ |
| 170 | + procArch: string; |
| 171 | + |
| 172 | + /** |
| 173 | + * node-gyp version as returned by `node-gyp -v`. |
| 174 | + * @type {string} |
| 175 | + */ |
| 176 | + nodeGypVer: string; |
| 177 | + |
| 178 | + // dependencies |
| 179 | + /** |
| 180 | + * Version of java, as returned by `java -version`. |
| 181 | + * @type {string} |
| 182 | + */ |
| 183 | + javaVer: string; |
| 184 | + |
| 185 | + /** |
| 186 | + * Xcode version string as returned by `xcodebuild -version`. Valid only on Mac. |
| 187 | + * @type {string} |
| 188 | + */ |
| 189 | + xcodeVer: string; |
| 190 | + |
| 191 | + /** |
| 192 | + * Version string of adb, as returned by `adb version`. |
| 193 | + * @type {string} |
| 194 | + */ |
| 195 | + adbVer: string; |
| 196 | + |
| 197 | + /** |
| 198 | + * Whether iTunes is installed on the machine. |
| 199 | + * @type {boolean} |
| 200 | + */ |
| 201 | + itunesInstalled: boolean; |
| 202 | + |
| 203 | + /** |
| 204 | + * Whether `android` executable can be run. |
| 205 | + * @type {boolean} |
| 206 | + */ |
| 207 | + androidInstalled: boolean; |
| 208 | + |
| 209 | + /** |
| 210 | + * mono version, relevant on Mac only. |
| 211 | + * @type {string} |
| 212 | + */ |
| 213 | + monoVer: string; |
| 214 | + |
| 215 | + /** |
| 216 | + * git version string, as returned by `git --version`. |
| 217 | + * @type {string} |
| 218 | + */ |
| 219 | + gitVer: string; |
| 220 | + |
| 221 | + /** |
| 222 | + * gradle version string as returned by `gradle -v`. |
| 223 | + * @type {string} |
| 224 | + */ |
| 225 | + gradleVer: string; |
| 226 | + |
| 227 | + /** |
| 228 | + * javac version string as returned by `javac -version`. |
| 229 | + * @type {string} |
| 230 | + */ |
| 231 | + javacVersion: string; |
| 232 | + |
| 233 | + /** |
| 234 | + * pod version string, as returned by `pod --version`. |
| 235 | + * @type {string} |
| 236 | + */ |
| 237 | + cocoaPodsVer: string; |
| 238 | + |
| 239 | + /** |
| 240 | + * xcodeproj gem location, as returned by `which gem xcodeproj`. |
| 241 | + * @type {string} |
| 242 | + */ |
| 243 | + xcodeprojGemLocation: string; |
| 244 | + |
| 245 | + /** |
| 246 | + * true id CocoaPods can successfully execute pod install. |
| 247 | + * @type {boolean} |
| 248 | + */ |
| 249 | + isCocoaPodsWorkingCorrectly: boolean; |
| 250 | + |
| 251 | + /** |
| 252 | + * NativeScript CLI version string, as returned by `tns --version`. |
| 253 | + * @type {string} |
| 254 | + */ |
| 255 | + nativeScriptCliVersion: string; |
| 256 | + } |
| 257 | + |
| 258 | + /** |
| 259 | + * Describes warning returned from nativescript-doctor check. |
| 260 | + */ |
| 261 | + interface IWarning { |
| 262 | + /** The warning. */ |
| 263 | + warning: string; |
| 264 | + /** Additional information for the warning. */ |
| 265 | + additionalInformation: string; |
| 266 | + } |
| 267 | +} |
0 commit comments