@arkts/image-manager 0.5.10 → 0.5.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/default-product-config.cjs +32 -64
- package/dist/default-product-config.d.cts +0 -33
- package/dist/default-product-config.d.mts +0 -33
- package/dist/default-product-config.mjs +32 -64
- package/dist/index.cjs +78 -21
- package/dist/index.d.cts +18 -21
- package/dist/index.d.mts +18 -21
- package/dist/index.mjs +78 -21
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -32,7 +32,7 @@ let base64_js = require("base64-js");
|
|
|
32
32
|
let vscode_fs = require("vscode-fs");
|
|
33
33
|
|
|
34
34
|
//#region package.json
|
|
35
|
-
var version = "0.5.
|
|
35
|
+
var version = "0.5.11";
|
|
36
36
|
|
|
37
37
|
//#endregion
|
|
38
38
|
//#region src/common/serializable-content.ts
|
|
@@ -413,6 +413,54 @@ var ListsFileImpl = class extends SerializableFileImpl {
|
|
|
413
413
|
//#region src/configs/product/item.ts
|
|
414
414
|
let ProductConfigItem;
|
|
415
415
|
(function(_ProductConfigItem) {
|
|
416
|
+
function isBaseContent(content) {
|
|
417
|
+
return typeof content === "object" && content !== null && "name" in content && "screenWidth" in content && "screenHeight" in content && "screenDiagonal" in content && "screenDensity" in content && "visible" in content;
|
|
418
|
+
}
|
|
419
|
+
_ProductConfigItem.isBaseContent = isBaseContent;
|
|
420
|
+
function isBaseFoldContent(content) {
|
|
421
|
+
return isBaseContent(content) && "outerScreenWidth" in content && "outerScreenHeight" in content && "outerScreenDiagonal" in content;
|
|
422
|
+
}
|
|
423
|
+
_ProductConfigItem.isBaseFoldContent = isBaseFoldContent;
|
|
424
|
+
function isPhoneContent(content) {
|
|
425
|
+
return isBaseContent(content);
|
|
426
|
+
}
|
|
427
|
+
_ProductConfigItem.isPhoneContent = isPhoneContent;
|
|
428
|
+
function isTabletContent(content) {
|
|
429
|
+
return isBaseContent(content);
|
|
430
|
+
}
|
|
431
|
+
_ProductConfigItem.isTabletContent = isTabletContent;
|
|
432
|
+
function isTwoInOneContent(content) {
|
|
433
|
+
return isBaseContent(content);
|
|
434
|
+
}
|
|
435
|
+
_ProductConfigItem.isTwoInOneContent = isTwoInOneContent;
|
|
436
|
+
function isFoldableContent(content) {
|
|
437
|
+
return isBaseFoldContent(content);
|
|
438
|
+
}
|
|
439
|
+
_ProductConfigItem.isFoldableContent = isFoldableContent;
|
|
440
|
+
function isWideFoldContent(content) {
|
|
441
|
+
return isBaseFoldContent(content);
|
|
442
|
+
}
|
|
443
|
+
_ProductConfigItem.isWideFoldContent = isWideFoldContent;
|
|
444
|
+
function isTripleFoldContent(content) {
|
|
445
|
+
return isBaseFoldContent(content) && "outerDoubleScreenWidth" in content && "outerDoubleScreenHeight" in content && "outerDoubleScreenDiagonal" in content;
|
|
446
|
+
}
|
|
447
|
+
_ProductConfigItem.isTripleFoldContent = isTripleFoldContent;
|
|
448
|
+
function isTwoInOneFoldableContent(content) {
|
|
449
|
+
return isBaseFoldContent(content);
|
|
450
|
+
}
|
|
451
|
+
_ProductConfigItem.isTwoInOneFoldableContent = isTwoInOneFoldableContent;
|
|
452
|
+
function isTVContent(content) {
|
|
453
|
+
return isBaseContent(content);
|
|
454
|
+
}
|
|
455
|
+
_ProductConfigItem.isTVContent = isTVContent;
|
|
456
|
+
function isWearableContent(content) {
|
|
457
|
+
return isBaseContent(content);
|
|
458
|
+
}
|
|
459
|
+
_ProductConfigItem.isWearableContent = isWearableContent;
|
|
460
|
+
function isWearableKidContent(content) {
|
|
461
|
+
return isBaseContent(content);
|
|
462
|
+
}
|
|
463
|
+
_ProductConfigItem.isWearableKidContent = isWearableKidContent;
|
|
416
464
|
function is(value) {
|
|
417
465
|
return value instanceof ProductConfigItemImpl;
|
|
418
466
|
}
|
|
@@ -783,8 +831,8 @@ var ScreenPresetImpl = class {
|
|
|
783
831
|
_customizeScreen;
|
|
784
832
|
getCustomizeScreenConfig() {
|
|
785
833
|
if (this._customizeScreen) return this._customizeScreen;
|
|
786
|
-
if (this.getEmulatorDeviceItem().getContent().deviceType === "foldable" && this.options.productConfigItem.getContent().name === "Customize" && "customizeScreen" in this.options && "customizeFoldableScreen" in this.options) this._customizeScreen = new CustomizeFoldableScreenImpl(this, this.options.customizeScreen, this.options.customizeFoldableScreen);
|
|
787
|
-
else if (this.options.productConfigItem.getContent().name === "Customize" && "customizeScreen" in this.options) this._customizeScreen = new CustomizeScreenImpl(this, this.options.customizeScreen);
|
|
834
|
+
if (this.getEmulatorDeviceItem().getContent().deviceType === "foldable" && this.options.productConfigItem.getContent().name === "Customize" && "customizeScreen" in this.options && this.options.customizeScreen !== void 0 && this.options.customizeScreen !== null && "customizeFoldableScreen" in this.options && this.options.customizeFoldableScreen !== void 0 && this.options.customizeFoldableScreen !== null) this._customizeScreen = new CustomizeFoldableScreenImpl(this, this.options.customizeScreen, this.options.customizeFoldableScreen);
|
|
835
|
+
else if (this.options.productConfigItem.getContent().name === "Customize" && "customizeScreen" in this.options && this.options.customizeScreen !== void 0 && this.options.customizeScreen !== null) this._customizeScreen = new CustomizeScreenImpl(this, this.options.customizeScreen);
|
|
788
836
|
return this._customizeScreen;
|
|
789
837
|
}
|
|
790
838
|
toJSON() {
|
|
@@ -869,7 +917,7 @@ var LocalImageImpl = class extends BaseImageImpl {
|
|
|
869
917
|
return name?.[name.length - 1];
|
|
870
918
|
}
|
|
871
919
|
async createDevice(options) {
|
|
872
|
-
const { deployedPath,
|
|
920
|
+
const { deployedPath, configPath, logPath, sdkPath, defaultSdkPath, adapter: { join } } = this.getImageManager().getOptions();
|
|
873
921
|
const screen = new ScreenPresetImpl(options.screen);
|
|
874
922
|
const emulatorDeviceItem = screen.getEmulatorDeviceItem();
|
|
875
923
|
const productConfigItem = screen.getProductConfigItem();
|
|
@@ -885,9 +933,9 @@ var LocalImageImpl = class extends BaseImageImpl {
|
|
|
885
933
|
"memoryRamSize": options.memoryRamSize?.toString(),
|
|
886
934
|
"dataDiskSize": options.dataDiskSize?.toString(),
|
|
887
935
|
"version": this.getSdkPkgFile().data?.version ?? "",
|
|
888
|
-
"imageDir": this.getRelativePath()
|
|
889
|
-
"showVersion": this.getSdkPkgFile().data?.guestVersion
|
|
890
|
-
"harmonyos.sdk.path":
|
|
936
|
+
"imageDir": this.getRelativePath().endsWith("/") ? this.getRelativePath() : `${this.getRelativePath()}/`,
|
|
937
|
+
"showVersion": `${this.getSdkPkgFile().data?.guestVersion?.split(" ")[0]} ${this.getSdkPkgFile().data?.platformVersion}(${this.getSdkPkgFile().data?.apiVersion})`,
|
|
938
|
+
"harmonyos.sdk.path": defaultSdkPath?.fsPath ?? sdkPath.fsPath,
|
|
891
939
|
"harmonyos.config.path": configPath.fsPath,
|
|
892
940
|
"harmonyos.log.path": logPath.fsPath,
|
|
893
941
|
"hw.apiName": this.getSdkPkgFile().data?.platformVersion ?? "",
|
|
@@ -915,13 +963,13 @@ var LocalImageImpl = class extends BaseImageImpl {
|
|
|
915
963
|
"name": listFileItem.getContent()?.name,
|
|
916
964
|
"deviceType": listFileItem.getContent()?.type,
|
|
917
965
|
"deviceModel": listFileItem.getContent()?.devModel,
|
|
918
|
-
"productModel": listFileItem.getContent()?.model,
|
|
966
|
+
"productModel": EmulatorTripleFoldItem.is(emulatorDeviceItem) ? void 0 : listFileItem.getContent()?.model,
|
|
919
967
|
"vendorCountry": options.vendorCountry ?? "CN",
|
|
920
968
|
"uuid": listFileItem.getContent()?.uuid,
|
|
921
969
|
"configPath": listFileItem.getContent()["harmonyos.config.path"],
|
|
922
970
|
"logPath": listFileItem.getContent()["harmonyos.log.path"],
|
|
923
971
|
"sdkPath": listFileItem.getContent()["harmonyos.sdk.path"],
|
|
924
|
-
"imageSubPath": listFileItem.getContent()?.imageDir
|
|
972
|
+
"imageSubPath": listFileItem.getContent()?.imageDir.endsWith("/") ? listFileItem.getContent()?.imageDir : `${listFileItem.getContent()?.imageDir}/`,
|
|
925
973
|
"instancePath": listFileItem.getContent()?.path,
|
|
926
974
|
"os.osVersion": `${this.getSdkPkgFile().data?.guestVersion?.split(" ")[0]} ${this.getSdkPkgFile().data?.platformVersion}(${this.getApiVersion()})`,
|
|
927
975
|
"os.apiVersion": this.getApiVersion().toString(),
|
|
@@ -936,6 +984,9 @@ var LocalImageImpl = class extends BaseImageImpl {
|
|
|
936
984
|
"hw.lcd.double.diagonalSize": EmulatorTripleFoldItem.is(emulatorDeviceItem) ? emulatorDeviceItem.getContent()?.doubleDiagonalSize?.toString() : void 0,
|
|
937
985
|
"hw.lcd.double.height": EmulatorTripleFoldItem.is(emulatorDeviceItem) ? emulatorDeviceItem.getContent()?.doubleResolutionHeight?.toString() : void 0,
|
|
938
986
|
"hw.lcd.double.width": EmulatorTripleFoldItem.is(emulatorDeviceItem) ? emulatorDeviceItem.getContent()?.doubleResolutionWidth?.toString() : void 0,
|
|
987
|
+
"hw.lcd.triple.diagonalSize": EmulatorTripleFoldItem.is(emulatorDeviceItem) ? emulatorDeviceItem.getContent().diagonalSize.toString() : void 0,
|
|
988
|
+
"hw.lcd.triple.height": EmulatorTripleFoldItem.is(emulatorDeviceItem) ? emulatorDeviceItem.getContent().resolutionHeight.toString() : void 0,
|
|
989
|
+
"hw.lcd.triple.width": EmulatorTripleFoldItem.is(emulatorDeviceItem) ? emulatorDeviceItem.getContent().resolutionWidth.toString() : void 0,
|
|
939
990
|
"hw.lcd.phy.height": emulatorDeviceItem.getContent()?.physicalHeight?.toString(),
|
|
940
991
|
"hw.lcd.phy.width": emulatorDeviceItem.getContent()?.physicalWidth?.toString(),
|
|
941
992
|
"hw.lcd.number": EmulatorTripleFoldItem.is(emulatorDeviceItem) || EmulatorFoldItem.is(emulatorDeviceItem) ? "2" : "1",
|
|
@@ -1297,58 +1348,64 @@ let OptionsResolver;
|
|
|
1297
1348
|
_OptionsResolver.resolveAdapter = resolveAdapter;
|
|
1298
1349
|
async function resolveImageManagerOptions(options) {
|
|
1299
1350
|
const adapter = await resolveAdapter(options.adapter);
|
|
1300
|
-
const { os, join, process, URI } = adapter;
|
|
1351
|
+
const { os, join, process, URI, fs } = adapter;
|
|
1301
1352
|
function resolveDefaultImageBasePath() {
|
|
1302
1353
|
switch (process.platform) {
|
|
1303
1354
|
case "win32": return typeof process.env.APPDATA === "string" && process.env.APPDATA.length > 0 ? join(URI.file(process.env.APPDATA), "Local", "Huawei", "Sdk") : join(URI.file(os.homedir()), "AppData", "Local", "Huawei", "Sdk");
|
|
1304
1355
|
case "darwin": return join(URI.file(os.homedir()), "Library", "Huawei", "Sdk");
|
|
1305
|
-
default: return join(URI.file(os.homedir()), ".
|
|
1356
|
+
default: return join(URI.file(os.homedir()), ".Huawei", "Sdk");
|
|
1306
1357
|
}
|
|
1307
1358
|
}
|
|
1308
1359
|
function resolveDefaultDeployedPath() {
|
|
1309
1360
|
switch (process.platform) {
|
|
1310
1361
|
case "win32": return typeof process.env.APPDATA === "string" && process.env.APPDATA.length > 0 ? join(URI.file(process.env.APPDATA), "Local", "Huawei", "Emulator", "deployed") : join(URI.file(os.homedir()), "AppData", "Local", "Huawei", "Emulator", "deployed");
|
|
1311
|
-
default: return join(URI.file(os.homedir()), ".
|
|
1362
|
+
default: return join(URI.file(os.homedir()), ".Huawei", "Emulator", "deployed");
|
|
1312
1363
|
}
|
|
1313
1364
|
}
|
|
1314
1365
|
function resolveDefaultSdkPath() {
|
|
1315
1366
|
switch (process.platform) {
|
|
1316
1367
|
case "darwin": return URI.file("/Applications/DevEco-Studio.app/Contents/sdk/default/openharmony");
|
|
1317
1368
|
case "win32": return URI.file("C:\\Program Files\\Huawei\\DevEco Studio\\sdk\\default\\openharmony");
|
|
1318
|
-
default: return join(URI.file(os.homedir()), ".
|
|
1369
|
+
default: return join(URI.file(os.homedir()), ".Huawei", "Sdk", "default", "openharmony");
|
|
1319
1370
|
}
|
|
1320
1371
|
}
|
|
1321
1372
|
function resolveDefaultConfigPath() {
|
|
1322
1373
|
switch (process.platform) {
|
|
1323
1374
|
case "darwin": return join(URI.file(os.homedir()), "Library", "Application Support", "Huawei", "DevEcoStudio6.0");
|
|
1324
1375
|
case "win32": return join(URI.file(process.env.APPDATA ?? os.homedir()), "Roaming", "Huawei", "DevEcoStudio6.0");
|
|
1325
|
-
default: return join(URI.file(os.homedir()), ".
|
|
1376
|
+
default: return join(URI.file(os.homedir()), ".Huawei", "DevEcoStudio6.0");
|
|
1326
1377
|
}
|
|
1327
1378
|
}
|
|
1328
1379
|
function resolveDefaultLogPath() {
|
|
1329
1380
|
switch (process.platform) {
|
|
1330
1381
|
case "darwin": return join(URI.file(os.homedir()), "Library", "Logs", "Huawei", "DevEcoStudio6.0");
|
|
1331
1382
|
case "win32": return join(URI.file(process.env.APPDATA ?? os.homedir()), "Local", "Huawei", "DevEcoStudio6.0", "log");
|
|
1332
|
-
default: return join(URI.file(os.homedir()), ".
|
|
1383
|
+
default: return join(URI.file(os.homedir()), ".Huawei", "DevEcoStudio6.0", "log");
|
|
1333
1384
|
}
|
|
1334
1385
|
}
|
|
1335
1386
|
function resolveDefaultEmulatorPath() {
|
|
1336
1387
|
switch (process.platform) {
|
|
1337
1388
|
case "darwin": return URI.file("/Applications/DevEco-Studio.app/Contents/tools/emulator");
|
|
1338
1389
|
case "win32": return URI.file("C:\\Program Files\\Huawei\\DevEco Studio\\tools\\emulator");
|
|
1339
|
-
default: return join(URI.file(os.homedir()), ".
|
|
1390
|
+
default: return join(URI.file(os.homedir()), ".Huawei", "Emulator");
|
|
1340
1391
|
}
|
|
1341
1392
|
}
|
|
1342
1393
|
const imageBasePath = typeof options.imageBasePath === "string" ? options.imageBasePath ? URI.file(options.imageBasePath) : resolveDefaultImageBasePath() : options.imageBasePath ? options.imageBasePath : resolveDefaultImageBasePath();
|
|
1343
1394
|
const cachePath = typeof options.cachePath === "string" ? options.cachePath ? URI.file(options.cachePath) : join(imageBasePath, "cache") : options.cachePath ? options.cachePath : join(imageBasePath, "cache");
|
|
1395
|
+
const deployedPath = typeof options.deployedPath === "string" ? options.deployedPath ? URI.file(options.deployedPath) : resolveDefaultDeployedPath() : options.deployedPath ? options.deployedPath : resolveDefaultDeployedPath();
|
|
1396
|
+
const sdkPath = typeof options.sdkPath === "string" ? options.sdkPath ? URI.file(options.sdkPath) : resolveDefaultSdkPath() : options.sdkPath ? options.sdkPath : resolveDefaultSdkPath();
|
|
1397
|
+
const configPath = typeof options.configPath === "string" ? options.configPath ? URI.file(options.configPath) : resolveDefaultConfigPath() : options.configPath ? options.configPath : resolveDefaultConfigPath();
|
|
1398
|
+
const logPath = typeof options.logPath === "string" ? options.logPath ? URI.file(options.logPath) : resolveDefaultLogPath() : options.logPath ? options.logPath : resolveDefaultLogPath();
|
|
1399
|
+
const emulatorPath = typeof options.emulatorPath === "string" ? options.emulatorPath ? URI.file(options.emulatorPath) : resolveDefaultEmulatorPath() : options.emulatorPath ? options.emulatorPath : resolveDefaultEmulatorPath();
|
|
1344
1400
|
return {
|
|
1345
1401
|
imageBasePath,
|
|
1346
|
-
deployedPath
|
|
1402
|
+
deployedPath,
|
|
1347
1403
|
cachePath,
|
|
1348
|
-
sdkPath
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1404
|
+
sdkPath,
|
|
1405
|
+
defaultSdkPath: await fs.isDirectory(resolveDefaultSdkPath()).then((isDirectory) => isDirectory ? resolveDefaultSdkPath() : void 0, () => void 0),
|
|
1406
|
+
configPath,
|
|
1407
|
+
logPath,
|
|
1408
|
+
emulatorPath,
|
|
1352
1409
|
adapter
|
|
1353
1410
|
};
|
|
1354
1411
|
}
|
package/dist/index.d.cts
CHANGED
|
@@ -183,11 +183,8 @@ declare namespace ProductConfigItem {
|
|
|
183
183
|
* Whether the product is visible.
|
|
184
184
|
*/
|
|
185
185
|
readonly visible: boolean;
|
|
186
|
-
/**
|
|
187
|
-
* The dev model of the product.
|
|
188
|
-
*/
|
|
189
|
-
readonly devModel?: string;
|
|
190
186
|
}
|
|
187
|
+
function isBaseContent(content: unknown): content is BaseContent;
|
|
191
188
|
interface BaseFoldContent extends BaseContent {
|
|
192
189
|
/**
|
|
193
190
|
* The name of the product.
|
|
@@ -206,6 +203,7 @@ declare namespace ProductConfigItem {
|
|
|
206
203
|
*/
|
|
207
204
|
readonly outerScreenDiagonal: string;
|
|
208
205
|
}
|
|
206
|
+
function isBaseFoldContent(content: unknown): content is BaseFoldContent;
|
|
209
207
|
interface PhoneContent extends BaseContent {
|
|
210
208
|
/**
|
|
211
209
|
* The name of the product.
|
|
@@ -216,42 +214,35 @@ declare namespace ProductConfigItem {
|
|
|
216
214
|
*/
|
|
217
215
|
readonly oneCutoutPath?: string;
|
|
218
216
|
}
|
|
217
|
+
function isPhoneContent(content: unknown): content is PhoneContent;
|
|
219
218
|
interface TabletContent extends BaseContent {
|
|
220
219
|
/**
|
|
221
220
|
* The name of the product.
|
|
222
221
|
*/
|
|
223
222
|
readonly name: TabletName | Customize;
|
|
224
223
|
}
|
|
224
|
+
function isTabletContent(content: unknown): content is TabletContent;
|
|
225
225
|
interface TwoInOneContent extends BaseContent {
|
|
226
226
|
/**
|
|
227
227
|
* The name of the product.
|
|
228
228
|
*/
|
|
229
229
|
readonly name: TwoInOneName | Customize;
|
|
230
230
|
}
|
|
231
|
+
function isTwoInOneContent(content: unknown): content is TwoInOneContent;
|
|
231
232
|
interface FoldableContent extends BaseFoldContent {
|
|
232
233
|
/**
|
|
233
234
|
* The name of the product.
|
|
234
235
|
*/
|
|
235
236
|
readonly name: FoldableName | Customize;
|
|
236
237
|
}
|
|
238
|
+
function isFoldableContent(content: unknown): content is FoldableContent;
|
|
237
239
|
interface WideFoldContent extends BaseFoldContent {
|
|
238
240
|
/**
|
|
239
241
|
* The name of the product.
|
|
240
242
|
*/
|
|
241
243
|
readonly name: WideFoldName;
|
|
242
|
-
/**
|
|
243
|
-
* The outer screen width of the product.
|
|
244
|
-
*/
|
|
245
|
-
readonly outerScreenWidth: string;
|
|
246
|
-
/**
|
|
247
|
-
* The outer screen height of the product.
|
|
248
|
-
*/
|
|
249
|
-
readonly outerScreenHeight: string;
|
|
250
|
-
/**
|
|
251
|
-
* The outer screen diagonal of the product.
|
|
252
|
-
*/
|
|
253
|
-
readonly outerScreenDiagonal: string;
|
|
254
244
|
}
|
|
245
|
+
function isWideFoldContent(content: unknown): content is WideFoldContent;
|
|
255
246
|
interface TripleFoldContent extends BaseFoldContent {
|
|
256
247
|
/**
|
|
257
248
|
* The name of the product.
|
|
@@ -270,30 +261,35 @@ declare namespace ProductConfigItem {
|
|
|
270
261
|
*/
|
|
271
262
|
readonly outerDoubleScreenDiagonal: string;
|
|
272
263
|
}
|
|
264
|
+
function isTripleFoldContent(content: BaseFoldContent): content is TripleFoldContent;
|
|
273
265
|
interface TwoInOneFoldableContent extends BaseFoldContent {
|
|
274
266
|
/**
|
|
275
267
|
* The name of the product.
|
|
276
268
|
*/
|
|
277
269
|
readonly name: TwoInOneFoldableName;
|
|
278
270
|
}
|
|
271
|
+
function isTwoInOneFoldableContent(content: unknown): content is TwoInOneFoldableContent;
|
|
279
272
|
interface TVContent extends BaseContent {
|
|
280
273
|
/**
|
|
281
274
|
* The name of the product.
|
|
282
275
|
*/
|
|
283
276
|
readonly name: TVName;
|
|
284
277
|
}
|
|
278
|
+
function isTVContent(content: unknown): content is TVContent;
|
|
285
279
|
interface WearableContent extends BaseContent {
|
|
286
280
|
/**
|
|
287
281
|
* The name of the product.
|
|
288
282
|
*/
|
|
289
283
|
readonly name: WearableName;
|
|
290
284
|
}
|
|
285
|
+
function isWearableContent(content: unknown): content is WearableContent;
|
|
291
286
|
interface WearableKidContent extends BaseContent {
|
|
292
287
|
/**
|
|
293
288
|
* The name of the product.
|
|
294
289
|
*/
|
|
295
290
|
readonly name: WearableKidName;
|
|
296
291
|
}
|
|
292
|
+
function isWearableKidContent(content: unknown): content is WearableKidContent;
|
|
297
293
|
type Content = PhoneContent | TabletContent | TwoInOneContent | FoldableContent | WideFoldContent | TripleFoldContent | TwoInOneFoldableContent | TVContent | WearableContent | WearableKidContent;
|
|
298
294
|
interface Serializable extends Omit<BaseSerializable<ProductConfigItem>, 'imageManager'> {}
|
|
299
295
|
type DevModel = 'MCHEMU-AL00CN' | 'PHEMU-FD00' | 'PHEMU-FD01' | 'PHEMU-FD02' | 'PCEMU-FD05' | 'PHEMU-FD06';
|
|
@@ -1082,6 +1078,7 @@ type ResolvedImageManagerOptions = Omit<Required<ImageManager.Options>, 'imageBa
|
|
|
1082
1078
|
deployedPath: vscode_uri0.URI;
|
|
1083
1079
|
cachePath: vscode_uri0.URI;
|
|
1084
1080
|
sdkPath: vscode_uri0.URI;
|
|
1081
|
+
defaultSdkPath: vscode_uri0.URI | undefined;
|
|
1085
1082
|
configPath: vscode_uri0.URI;
|
|
1086
1083
|
logPath: vscode_uri0.URI;
|
|
1087
1084
|
emulatorPath: vscode_uri0.URI;
|
|
@@ -1125,7 +1122,7 @@ declare namespace ImageManager {
|
|
|
1125
1122
|
*
|
|
1126
1123
|
* - In macOS, it will be `/Applications/DevEco-Studio.app/Contents/sdk/default/openharmony` by default;
|
|
1127
1124
|
* - In Windows, it will be `C:\Program Files\Huawei\DevEco Studio\sdk\default\openharmony` by default;
|
|
1128
|
-
* - In other platforms, it will be `~/.
|
|
1125
|
+
* - In other platforms, it will be `~/.Huawei/Sdk/default/openharmony` by default.
|
|
1129
1126
|
*/
|
|
1130
1127
|
sdkPath?: string | vscode_uri0.URI;
|
|
1131
1128
|
/**
|
|
@@ -1133,7 +1130,7 @@ declare namespace ImageManager {
|
|
|
1133
1130
|
*
|
|
1134
1131
|
* - In macOS, it will be `~/Library/Application Support/Huawei/DevEcoStudio6.0` by default;
|
|
1135
1132
|
* - In Windows, it will be `%APPDATA%\Roaming\Huawei\DevEcoStudio6.0` by default;
|
|
1136
|
-
* - In other platforms, it will be `~/.
|
|
1133
|
+
* - In other platforms, it will be `~/.Huawei/DevEcoStudio6.0` by default.
|
|
1137
1134
|
*/
|
|
1138
1135
|
configPath?: string | vscode_uri0.URI;
|
|
1139
1136
|
/**
|
|
@@ -1141,7 +1138,7 @@ declare namespace ImageManager {
|
|
|
1141
1138
|
*
|
|
1142
1139
|
* - In macOS, it will be `~/Library/Logs/Huawei/DevEcoStudio6.0` by default;
|
|
1143
1140
|
* - In Windows, it will be `%APPDATA%\Local\Huawei\DevEcoStudio6.0\log` by default;
|
|
1144
|
-
* - In other platforms, it will be `~/.
|
|
1141
|
+
* - In other platforms, it will be `~/.Huawei/DevEcoStudio6.0/log` by default.
|
|
1145
1142
|
*/
|
|
1146
1143
|
logPath?: string | vscode_uri0.URI;
|
|
1147
1144
|
/**
|
|
@@ -1151,7 +1148,7 @@ declare namespace ImageManager {
|
|
|
1151
1148
|
*
|
|
1152
1149
|
* - In macOS, it will be `/Applications/DevEco-Studio.app/Contents/tools/emulator`;
|
|
1153
1150
|
* - In Windows, it will be `C:\Program Files\Huawei\DevEco Studio\tools\emulator`;
|
|
1154
|
-
* - In other platforms, it will be `~/.
|
|
1151
|
+
* - In other platforms, it will be `~/.Huawei/Emulator`.
|
|
1155
1152
|
*/
|
|
1156
1153
|
emulatorPath?: string | vscode_uri0.URI;
|
|
1157
1154
|
/**
|
|
@@ -1244,7 +1241,7 @@ interface ConfigIniFile<ProductDeviceType extends ProductConfigFile.DeviceType =
|
|
|
1244
1241
|
declare namespace ConfigIniFile {
|
|
1245
1242
|
type Content = Record<string, string | undefined>;
|
|
1246
1243
|
type GenericContent<ProductDeviceType extends ProductConfigFile.DeviceType = ProductConfigFile.DeviceType, ProductName extends ProductConfigFile.GenericContent<ProductDeviceType>['name'] = ProductConfigFile.GenericContent<ProductDeviceType>['name']> = Content & {
|
|
1247
|
-
productModel
|
|
1244
|
+
productModel?: ProductName;
|
|
1248
1245
|
};
|
|
1249
1246
|
interface Serializable<ProductDeviceType extends ProductConfigFile.DeviceType = ProductConfigFile.DeviceType, ProductName extends ProductConfigFile.GenericContent<ProductDeviceType>['name'] = ProductConfigFile.GenericContent<ProductDeviceType>['name']> extends Omit<BaseSerializable<ConfigIniFile<ProductDeviceType, ProductName>>, 'device' | 'imageManager'> {}
|
|
1250
1247
|
function is(value: unknown): value is ConfigIniFile;
|
package/dist/index.d.mts
CHANGED
|
@@ -183,11 +183,8 @@ declare namespace ProductConfigItem {
|
|
|
183
183
|
* Whether the product is visible.
|
|
184
184
|
*/
|
|
185
185
|
readonly visible: boolean;
|
|
186
|
-
/**
|
|
187
|
-
* The dev model of the product.
|
|
188
|
-
*/
|
|
189
|
-
readonly devModel?: string;
|
|
190
186
|
}
|
|
187
|
+
function isBaseContent(content: unknown): content is BaseContent;
|
|
191
188
|
interface BaseFoldContent extends BaseContent {
|
|
192
189
|
/**
|
|
193
190
|
* The name of the product.
|
|
@@ -206,6 +203,7 @@ declare namespace ProductConfigItem {
|
|
|
206
203
|
*/
|
|
207
204
|
readonly outerScreenDiagonal: string;
|
|
208
205
|
}
|
|
206
|
+
function isBaseFoldContent(content: unknown): content is BaseFoldContent;
|
|
209
207
|
interface PhoneContent extends BaseContent {
|
|
210
208
|
/**
|
|
211
209
|
* The name of the product.
|
|
@@ -216,42 +214,35 @@ declare namespace ProductConfigItem {
|
|
|
216
214
|
*/
|
|
217
215
|
readonly oneCutoutPath?: string;
|
|
218
216
|
}
|
|
217
|
+
function isPhoneContent(content: unknown): content is PhoneContent;
|
|
219
218
|
interface TabletContent extends BaseContent {
|
|
220
219
|
/**
|
|
221
220
|
* The name of the product.
|
|
222
221
|
*/
|
|
223
222
|
readonly name: TabletName | Customize;
|
|
224
223
|
}
|
|
224
|
+
function isTabletContent(content: unknown): content is TabletContent;
|
|
225
225
|
interface TwoInOneContent extends BaseContent {
|
|
226
226
|
/**
|
|
227
227
|
* The name of the product.
|
|
228
228
|
*/
|
|
229
229
|
readonly name: TwoInOneName | Customize;
|
|
230
230
|
}
|
|
231
|
+
function isTwoInOneContent(content: unknown): content is TwoInOneContent;
|
|
231
232
|
interface FoldableContent extends BaseFoldContent {
|
|
232
233
|
/**
|
|
233
234
|
* The name of the product.
|
|
234
235
|
*/
|
|
235
236
|
readonly name: FoldableName | Customize;
|
|
236
237
|
}
|
|
238
|
+
function isFoldableContent(content: unknown): content is FoldableContent;
|
|
237
239
|
interface WideFoldContent extends BaseFoldContent {
|
|
238
240
|
/**
|
|
239
241
|
* The name of the product.
|
|
240
242
|
*/
|
|
241
243
|
readonly name: WideFoldName;
|
|
242
|
-
/**
|
|
243
|
-
* The outer screen width of the product.
|
|
244
|
-
*/
|
|
245
|
-
readonly outerScreenWidth: string;
|
|
246
|
-
/**
|
|
247
|
-
* The outer screen height of the product.
|
|
248
|
-
*/
|
|
249
|
-
readonly outerScreenHeight: string;
|
|
250
|
-
/**
|
|
251
|
-
* The outer screen diagonal of the product.
|
|
252
|
-
*/
|
|
253
|
-
readonly outerScreenDiagonal: string;
|
|
254
244
|
}
|
|
245
|
+
function isWideFoldContent(content: unknown): content is WideFoldContent;
|
|
255
246
|
interface TripleFoldContent extends BaseFoldContent {
|
|
256
247
|
/**
|
|
257
248
|
* The name of the product.
|
|
@@ -270,30 +261,35 @@ declare namespace ProductConfigItem {
|
|
|
270
261
|
*/
|
|
271
262
|
readonly outerDoubleScreenDiagonal: string;
|
|
272
263
|
}
|
|
264
|
+
function isTripleFoldContent(content: BaseFoldContent): content is TripleFoldContent;
|
|
273
265
|
interface TwoInOneFoldableContent extends BaseFoldContent {
|
|
274
266
|
/**
|
|
275
267
|
* The name of the product.
|
|
276
268
|
*/
|
|
277
269
|
readonly name: TwoInOneFoldableName;
|
|
278
270
|
}
|
|
271
|
+
function isTwoInOneFoldableContent(content: unknown): content is TwoInOneFoldableContent;
|
|
279
272
|
interface TVContent extends BaseContent {
|
|
280
273
|
/**
|
|
281
274
|
* The name of the product.
|
|
282
275
|
*/
|
|
283
276
|
readonly name: TVName;
|
|
284
277
|
}
|
|
278
|
+
function isTVContent(content: unknown): content is TVContent;
|
|
285
279
|
interface WearableContent extends BaseContent {
|
|
286
280
|
/**
|
|
287
281
|
* The name of the product.
|
|
288
282
|
*/
|
|
289
283
|
readonly name: WearableName;
|
|
290
284
|
}
|
|
285
|
+
function isWearableContent(content: unknown): content is WearableContent;
|
|
291
286
|
interface WearableKidContent extends BaseContent {
|
|
292
287
|
/**
|
|
293
288
|
* The name of the product.
|
|
294
289
|
*/
|
|
295
290
|
readonly name: WearableKidName;
|
|
296
291
|
}
|
|
292
|
+
function isWearableKidContent(content: unknown): content is WearableKidContent;
|
|
297
293
|
type Content = PhoneContent | TabletContent | TwoInOneContent | FoldableContent | WideFoldContent | TripleFoldContent | TwoInOneFoldableContent | TVContent | WearableContent | WearableKidContent;
|
|
298
294
|
interface Serializable extends Omit<BaseSerializable<ProductConfigItem>, 'imageManager'> {}
|
|
299
295
|
type DevModel = 'MCHEMU-AL00CN' | 'PHEMU-FD00' | 'PHEMU-FD01' | 'PHEMU-FD02' | 'PCEMU-FD05' | 'PHEMU-FD06';
|
|
@@ -1082,6 +1078,7 @@ type ResolvedImageManagerOptions = Omit<Required<ImageManager.Options>, 'imageBa
|
|
|
1082
1078
|
deployedPath: vscode_uri0.URI;
|
|
1083
1079
|
cachePath: vscode_uri0.URI;
|
|
1084
1080
|
sdkPath: vscode_uri0.URI;
|
|
1081
|
+
defaultSdkPath: vscode_uri0.URI | undefined;
|
|
1085
1082
|
configPath: vscode_uri0.URI;
|
|
1086
1083
|
logPath: vscode_uri0.URI;
|
|
1087
1084
|
emulatorPath: vscode_uri0.URI;
|
|
@@ -1125,7 +1122,7 @@ declare namespace ImageManager {
|
|
|
1125
1122
|
*
|
|
1126
1123
|
* - In macOS, it will be `/Applications/DevEco-Studio.app/Contents/sdk/default/openharmony` by default;
|
|
1127
1124
|
* - In Windows, it will be `C:\Program Files\Huawei\DevEco Studio\sdk\default\openharmony` by default;
|
|
1128
|
-
* - In other platforms, it will be `~/.
|
|
1125
|
+
* - In other platforms, it will be `~/.Huawei/Sdk/default/openharmony` by default.
|
|
1129
1126
|
*/
|
|
1130
1127
|
sdkPath?: string | vscode_uri0.URI;
|
|
1131
1128
|
/**
|
|
@@ -1133,7 +1130,7 @@ declare namespace ImageManager {
|
|
|
1133
1130
|
*
|
|
1134
1131
|
* - In macOS, it will be `~/Library/Application Support/Huawei/DevEcoStudio6.0` by default;
|
|
1135
1132
|
* - In Windows, it will be `%APPDATA%\Roaming\Huawei\DevEcoStudio6.0` by default;
|
|
1136
|
-
* - In other platforms, it will be `~/.
|
|
1133
|
+
* - In other platforms, it will be `~/.Huawei/DevEcoStudio6.0` by default.
|
|
1137
1134
|
*/
|
|
1138
1135
|
configPath?: string | vscode_uri0.URI;
|
|
1139
1136
|
/**
|
|
@@ -1141,7 +1138,7 @@ declare namespace ImageManager {
|
|
|
1141
1138
|
*
|
|
1142
1139
|
* - In macOS, it will be `~/Library/Logs/Huawei/DevEcoStudio6.0` by default;
|
|
1143
1140
|
* - In Windows, it will be `%APPDATA%\Local\Huawei\DevEcoStudio6.0\log` by default;
|
|
1144
|
-
* - In other platforms, it will be `~/.
|
|
1141
|
+
* - In other platforms, it will be `~/.Huawei/DevEcoStudio6.0/log` by default.
|
|
1145
1142
|
*/
|
|
1146
1143
|
logPath?: string | vscode_uri0.URI;
|
|
1147
1144
|
/**
|
|
@@ -1151,7 +1148,7 @@ declare namespace ImageManager {
|
|
|
1151
1148
|
*
|
|
1152
1149
|
* - In macOS, it will be `/Applications/DevEco-Studio.app/Contents/tools/emulator`;
|
|
1153
1150
|
* - In Windows, it will be `C:\Program Files\Huawei\DevEco Studio\tools\emulator`;
|
|
1154
|
-
* - In other platforms, it will be `~/.
|
|
1151
|
+
* - In other platforms, it will be `~/.Huawei/Emulator`.
|
|
1155
1152
|
*/
|
|
1156
1153
|
emulatorPath?: string | vscode_uri0.URI;
|
|
1157
1154
|
/**
|
|
@@ -1244,7 +1241,7 @@ interface ConfigIniFile<ProductDeviceType extends ProductConfigFile.DeviceType =
|
|
|
1244
1241
|
declare namespace ConfigIniFile {
|
|
1245
1242
|
type Content = Record<string, string | undefined>;
|
|
1246
1243
|
type GenericContent<ProductDeviceType extends ProductConfigFile.DeviceType = ProductConfigFile.DeviceType, ProductName extends ProductConfigFile.GenericContent<ProductDeviceType>['name'] = ProductConfigFile.GenericContent<ProductDeviceType>['name']> = Content & {
|
|
1247
|
-
productModel
|
|
1244
|
+
productModel?: ProductName;
|
|
1248
1245
|
};
|
|
1249
1246
|
interface Serializable<ProductDeviceType extends ProductConfigFile.DeviceType = ProductConfigFile.DeviceType, ProductName extends ProductConfigFile.GenericContent<ProductDeviceType>['name'] = ProductConfigFile.GenericContent<ProductDeviceType>['name']> extends Omit<BaseSerializable<ConfigIniFile<ProductDeviceType, ProductName>>, 'device' | 'imageManager'> {}
|
|
1250
1247
|
function is(value: unknown): value is ConfigIniFile;
|