@arkts/image-manager 0.5.4 → 0.5.6
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/index.cjs +24 -8
- package/dist/index.d.cts +369 -368
- package/dist/index.d.mts +369 -368
- package/dist/index.mjs +24 -8
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import { fromByteArray } from "base64-js";
|
|
|
3
3
|
import { RelativePattern, WriteableFlags, createNodeFileSystem } from "vscode-fs";
|
|
4
4
|
|
|
5
5
|
//#region package.json
|
|
6
|
-
var version = "0.5.
|
|
6
|
+
var version = "0.5.6";
|
|
7
7
|
|
|
8
8
|
//#endregion
|
|
9
9
|
//#region src/common/serializable-content.ts
|
|
@@ -254,6 +254,22 @@ var EmulatorFileImpl = class extends SerializableFileImpl {
|
|
|
254
254
|
else this.getDeviceItems(item.getChildren());
|
|
255
255
|
return items;
|
|
256
256
|
}
|
|
257
|
+
findRemoteImageByDeviceItem(deviceItem, remoteImages) {
|
|
258
|
+
return remoteImages.find((image) => {
|
|
259
|
+
if (image.getApiVersion() !== deviceItem.getContent().api) return false;
|
|
260
|
+
if (image.getFullDeviceType() === deviceItem.getContent().deviceType) return true;
|
|
261
|
+
if (image.getFullDeviceType() === "pc_all") {
|
|
262
|
+
if (deviceItem.getContent().deviceType === "2in1") return true;
|
|
263
|
+
else if (deviceItem.getContent().deviceType === "2in1_foldable") return true;
|
|
264
|
+
} else if (image.getFullDeviceType() === "phone_all") {
|
|
265
|
+
if (deviceItem.getContent().deviceType === "phone") return true;
|
|
266
|
+
else if (deviceItem.getContent().deviceType === "foldable") return true;
|
|
267
|
+
else if (deviceItem.getContent().deviceType === "widefold") return true;
|
|
268
|
+
else if (deviceItem.getContent().deviceType === "triplefold") return true;
|
|
269
|
+
}
|
|
270
|
+
return false;
|
|
271
|
+
});
|
|
272
|
+
}
|
|
257
273
|
findDeviceItems(options = {}) {
|
|
258
274
|
const items = [];
|
|
259
275
|
const pushDeviceItem = (item) => {
|
|
@@ -1298,16 +1314,16 @@ let OptionsResolver;
|
|
|
1298
1314
|
default: return join(URI.file(os.homedir()), ".huawei", "Emulator");
|
|
1299
1315
|
}
|
|
1300
1316
|
}
|
|
1301
|
-
const imageBasePath = typeof options.imageBasePath === "string" ? URI.file(options.imageBasePath) : options.imageBasePath
|
|
1302
|
-
const cachePath = typeof options.cachePath === "string" ? URI.file(options.cachePath) : options.cachePath
|
|
1317
|
+
const imageBasePath = typeof options.imageBasePath === "string" ? options.imageBasePath ? URI.file(options.imageBasePath) : resolveDefaultImageBasePath() : options.imageBasePath ? options.imageBasePath : resolveDefaultImageBasePath();
|
|
1318
|
+
const cachePath = typeof options.cachePath === "string" ? options.cachePath ? URI.file(options.cachePath) : join(imageBasePath, "cache") : options.cachePath ? options.cachePath : join(imageBasePath, "cache");
|
|
1303
1319
|
return {
|
|
1304
1320
|
imageBasePath,
|
|
1305
|
-
deployedPath: typeof options.deployedPath === "string" ? URI.file(options.deployedPath) : options.deployedPath
|
|
1321
|
+
deployedPath: typeof options.deployedPath === "string" ? options.deployedPath ? URI.file(options.deployedPath) : resolveDefaultDeployedPath() : options.deployedPath ? options.deployedPath : resolveDefaultDeployedPath(),
|
|
1306
1322
|
cachePath,
|
|
1307
|
-
sdkPath: typeof options.sdkPath === "string" ? URI.file(options.sdkPath) : options.sdkPath
|
|
1308
|
-
configPath: typeof options.configPath === "string" ? URI.file(options.configPath) : options.configPath
|
|
1309
|
-
logPath: typeof options.logPath === "string" ? URI.file(options.logPath) : options.logPath
|
|
1310
|
-
emulatorPath: typeof options.emulatorPath === "string" ? URI.file(options.emulatorPath) : options.emulatorPath
|
|
1323
|
+
sdkPath: typeof options.sdkPath === "string" ? options.sdkPath ? URI.file(options.sdkPath) : resolveDefaultSdkPath() : options.sdkPath ? options.sdkPath : resolveDefaultSdkPath(),
|
|
1324
|
+
configPath: typeof options.configPath === "string" ? options.configPath ? URI.file(options.configPath) : resolveDefaultConfigPath() : options.configPath ? options.configPath : resolveDefaultConfigPath(),
|
|
1325
|
+
logPath: typeof options.logPath === "string" ? options.logPath ? URI.file(options.logPath) : resolveDefaultLogPath() : options.logPath ? options.logPath : resolveDefaultLogPath(),
|
|
1326
|
+
emulatorPath: typeof options.emulatorPath === "string" ? options.emulatorPath ? URI.file(options.emulatorPath) : resolveDefaultEmulatorPath() : options.emulatorPath ? options.emulatorPath : resolveDefaultEmulatorPath(),
|
|
1311
1327
|
adapter
|
|
1312
1328
|
};
|
|
1313
1329
|
}
|
package/package.json
CHANGED