@arkts/image-manager 0.5.6 → 0.5.8

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 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.6";
35
+ var version = "0.5.8";
36
36
 
37
37
  //#endregion
38
38
  //#region src/common/serializable-content.ts
@@ -276,11 +276,10 @@ var EmulatorFileImpl = class extends SerializableFileImpl {
276
276
  }
277
277
  }).filter(Boolean);
278
278
  }
279
- getDeviceItems(items = []) {
280
- for (const item of this.getItems()) if (EmulatorBasicItem.is(item)) items.push(item);
281
- else if (EmulatorFoldItem.is(item)) items.push(item);
282
- else if (EmulatorTripleFoldItem.is(item)) items.push(item);
283
- else this.getDeviceItems(item.getChildren());
279
+ getDeviceItems() {
280
+ const items = [];
281
+ for (const item of this.getItems()) if (EmulatorGroupItem.is(item)) for (const child of item.getChildren()) items.push(child);
282
+ else items.push(item);
284
283
  return items;
285
284
  }
286
285
  findRemoteImageByDeviceItem(deviceItem, remoteImages) {
@@ -357,10 +356,7 @@ var ListsFileItemImpl = class extends SerializableContentImpl {
357
356
  return this.content;
358
357
  }
359
358
  toJSON() {
360
- return {
361
- content: this.getContent(),
362
- listsFile: this.getListsFile().toJSON()
363
- };
359
+ return { content: this.getContent() };
364
360
  }
365
361
  };
366
362
 
package/dist/index.d.cts CHANGED
@@ -318,7 +318,8 @@ interface ListsFileItem<ProductDeviceType extends ProductConfigFile.DeviceType =
318
318
  getListsFile(): ListsFile;
319
319
  }
320
320
  declare namespace ListsFileItem {
321
- interface Serializable extends Omit<BaseSerializable<ListsFileItem>, 'imageManager'> {}
321
+ /** Excludes `listsFile` to avoid circular reference: ListsFile contains ListsFileItems, each of which would reference back to ListsFile. */
322
+ interface Serializable extends Omit<BaseSerializable<ListsFileItem>, 'imageManager' | 'listsFile'> {}
322
323
  type DeviceType = 'phone' | 'tablet' | '2in1' | 'foldable' | 'widefold' | 'triplefold' | '2in1_foldable' | 'tv' | 'wearable';
323
324
  type DeviceTypeWithString = DeviceType | (string & {});
324
325
  interface Content<ProductDeviceType extends ProductConfigFile.DeviceType = ProductConfigFile.DeviceType, ProductName extends ProductConfigFile.GenericContent<ProductDeviceType>['name'] = ProductConfigFile.GenericContent<ProductDeviceType>['name']> {
package/dist/index.d.mts CHANGED
@@ -318,7 +318,8 @@ interface ListsFileItem<ProductDeviceType extends ProductConfigFile.DeviceType =
318
318
  getListsFile(): ListsFile;
319
319
  }
320
320
  declare namespace ListsFileItem {
321
- interface Serializable extends Omit<BaseSerializable<ListsFileItem>, 'imageManager'> {}
321
+ /** Excludes `listsFile` to avoid circular reference: ListsFile contains ListsFileItems, each of which would reference back to ListsFile. */
322
+ interface Serializable extends Omit<BaseSerializable<ListsFileItem>, 'imageManager' | 'listsFile'> {}
322
323
  type DeviceType = 'phone' | 'tablet' | '2in1' | 'foldable' | 'widefold' | 'triplefold' | '2in1_foldable' | 'tv' | 'wearable';
323
324
  type DeviceTypeWithString = DeviceType | (string & {});
324
325
  interface Content<ProductDeviceType extends ProductConfigFile.DeviceType = ProductConfigFile.DeviceType, ProductName extends ProductConfigFile.GenericContent<ProductDeviceType>['name'] = ProductConfigFile.GenericContent<ProductDeviceType>['name']> {
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";
6
+ var version = "0.5.8";
7
7
 
8
8
  //#endregion
9
9
  //#region src/common/serializable-content.ts
@@ -247,11 +247,10 @@ var EmulatorFileImpl = class extends SerializableFileImpl {
247
247
  }
248
248
  }).filter(Boolean);
249
249
  }
250
- getDeviceItems(items = []) {
251
- for (const item of this.getItems()) if (EmulatorBasicItem.is(item)) items.push(item);
252
- else if (EmulatorFoldItem.is(item)) items.push(item);
253
- else if (EmulatorTripleFoldItem.is(item)) items.push(item);
254
- else this.getDeviceItems(item.getChildren());
250
+ getDeviceItems() {
251
+ const items = [];
252
+ for (const item of this.getItems()) if (EmulatorGroupItem.is(item)) for (const child of item.getChildren()) items.push(child);
253
+ else items.push(item);
255
254
  return items;
256
255
  }
257
256
  findRemoteImageByDeviceItem(deviceItem, remoteImages) {
@@ -328,10 +327,7 @@ var ListsFileItemImpl = class extends SerializableContentImpl {
328
327
  return this.content;
329
328
  }
330
329
  toJSON() {
331
- return {
332
- content: this.getContent(),
333
- listsFile: this.getListsFile().toJSON()
334
- };
330
+ return { content: this.getContent() };
335
331
  }
336
332
  };
337
333
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@arkts/image-manager",
3
3
  "type": "module",
4
- "version": "0.5.6",
4
+ "version": "0.5.8",
5
5
  "description": "OpenHarmony/HarmonyOS qemu image manager.",
6
6
  "author": "Naily Zero <zero@naily.cc> (https://naily.cc)",
7
7
  "license": "MIT",