@arkts/image-manager 0.4.2 → 0.5.0
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/README.md +1 -75
- package/dist/default-emulator-config.d.cts +274 -3
- package/dist/default-emulator-config.d.mts +274 -3
- package/dist/default-product-config.cjs +8 -0
- package/dist/default-product-config.d.cts +379 -3
- package/dist/default-product-config.d.mts +379 -3
- package/dist/default-product-config.mjs +8 -0
- package/dist/index.cjs +1380 -1070
- package/dist/index.d.cts +1113 -540
- package/dist/index.d.mts +1112 -539
- package/dist/index.mjs +1306 -1037
- package/package.json +7 -2
- package/dist/emulator-config-DbI3FRE5.d.mts +0 -64
- package/dist/emulator-config-HeXlMqZ-.d.cts +0 -64
- package/dist/product-config-ByDVg0-5.d.mts +0 -67
- package/dist/product-config-DuzOJEvZ.d.cts +0 -67
- package/dist/types-CayFonNb.d.cts +0 -16
- package/dist/types-DD8_iqBV.d.mts +0 -16
package/dist/index.d.cts
CHANGED
|
@@ -1,685 +1,1258 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { a as GroupPhoneAllEmulatorConfigItem, c as PhoneAllEmulatorConfigItem, i as GroupPCAllEmulatorConfigItem, n as EmulatorConfig, o as PCAllEmulatorConfigItem, r as EmulatorConfigItem, s as ParentEmulatorConfigItem, t as BaseEmulatorConfigItem } from "./emulator-config-HeXlMqZ-.cjs";
|
|
3
|
-
import { n as ProductConfigItem, t as ProductConfig } from "./product-config-DuzOJEvZ.cjs";
|
|
4
|
-
import { AxiosProgressEvent } from "axios";
|
|
5
|
-
import { Emitter } from "mitt";
|
|
6
|
-
import * as node_child_process0 from "node:child_process";
|
|
7
|
-
import progress from "progress-stream";
|
|
1
|
+
import * as vscode_uri0 from "vscode-uri";
|
|
8
2
|
import * as node_os0 from "node:os";
|
|
9
|
-
import * as
|
|
10
|
-
import
|
|
3
|
+
import * as node_stream0 from "node:stream";
|
|
4
|
+
import { Readable } from "node:stream";
|
|
11
5
|
import * as node_process0 from "node:process";
|
|
12
6
|
import * as node_crypto0 from "node:crypto";
|
|
7
|
+
import * as node_child_process0 from "node:child_process";
|
|
8
|
+
import child_process from "node:child_process";
|
|
9
|
+
import * as axios from "axios";
|
|
10
|
+
import * as unzipper from "unzipper";
|
|
11
|
+
import { Disposable, FileSystem, FileSystemWatcher } from "vscode-fs";
|
|
13
12
|
|
|
14
|
-
//#region
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
stop(device: Device): Promise<node_child_process0.ChildProcess>;
|
|
25
|
-
buildStartCommand(device: Device): Promise<string>;
|
|
26
|
-
buildStopCommand(device: Device): Promise<string>;
|
|
27
|
-
getPascalCaseDeviceType(): Promise<PascalCaseDeviceType | undefined>;
|
|
28
|
-
getProductConfig(): Promise<ProductConfigItem[]>;
|
|
29
|
-
}
|
|
30
|
-
declare namespace LocalImage {
|
|
31
|
-
interface Stringifiable extends Omit<BaseImage.Stringifiable, 'imageType'> {
|
|
32
|
-
imageType: 'local';
|
|
33
|
-
executablePath: string;
|
|
34
|
-
}
|
|
13
|
+
//#region src/types/utils.d.ts
|
|
14
|
+
type BaseSerializable<T extends Record<PropertyKey, any>> = { [K in keyof T as K extends `get${infer GetterName}` ? T[K] extends (() => infer R) ? R extends Promise<any> ? never : Uncapitalize<GetterName> : never : never]: K extends `get${string}` ? T[K] extends (() => infer R) ? R extends Promise<any> ? never : R extends Serializable<infer R2> ? R2 : R extends Array<Serializable<infer R2>> ? R2[] : R : never : never };
|
|
15
|
+
/**
|
|
16
|
+
* A serializable object.
|
|
17
|
+
*/
|
|
18
|
+
interface Serializable<T extends BaseSerializable<T>> {
|
|
19
|
+
/**
|
|
20
|
+
* Serialize the object to a JSON object.
|
|
21
|
+
*/
|
|
22
|
+
toJSON(): T;
|
|
35
23
|
}
|
|
24
|
+
type DeepPartial<T extends Record<PropertyKey, any>> = { [K in keyof T]?: T[K] extends Record<PropertyKey, any> ? DeepPartial<T[K]> : T[K] };
|
|
36
25
|
//#endregion
|
|
37
|
-
//#region src/
|
|
38
|
-
interface
|
|
39
|
-
|
|
26
|
+
//#region src/common/serializable-content.d.ts
|
|
27
|
+
interface SerializableContent<T extends SerializableContent.Content = SerializableContent.Content> extends Serializable<SerializableContent.Serializable> {
|
|
28
|
+
getImageManager(): ImageManager;
|
|
29
|
+
getContent(): T;
|
|
40
30
|
}
|
|
41
|
-
declare namespace
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}
|
|
31
|
+
declare namespace SerializableContent {
|
|
32
|
+
type Content = Record<PropertyKey, any> | Content[];
|
|
33
|
+
interface Serializable extends BaseSerializable<SerializableContent> {}
|
|
45
34
|
}
|
|
46
35
|
//#endregion
|
|
47
|
-
//#region src/
|
|
48
|
-
interface
|
|
49
|
-
/**
|
|
50
|
-
* The network speed of the download.
|
|
51
|
-
*/
|
|
52
|
-
network: number;
|
|
53
|
-
/**
|
|
54
|
-
* The unit of the network speed.
|
|
55
|
-
*/
|
|
56
|
-
unit: 'KB' | 'MB';
|
|
36
|
+
//#region src/configs/product/product.d.ts
|
|
37
|
+
interface ProductConfigFile extends Serializable<ProductConfigFile.Serializable>, Omit<SerializableFile, 'toJSON'> {
|
|
57
38
|
/**
|
|
58
|
-
*
|
|
59
|
-
*/
|
|
60
|
-
increment: number;
|
|
61
|
-
}
|
|
62
|
-
interface ExtractProgressEvent extends progress.Progress {}
|
|
63
|
-
type ImageDownloadEventMap = {
|
|
64
|
-
'download-progress': ImageDownloadProgressEvent;
|
|
65
|
-
'extract-progress': ExtractProgressEvent;
|
|
66
|
-
};
|
|
67
|
-
interface ImageDownloader<T extends BaseImage> extends Emitter<ImageDownloadEventMap> {
|
|
68
|
-
/**
|
|
69
|
-
* Start downloading the image.
|
|
39
|
+
* Find the product config items by the options.
|
|
70
40
|
*
|
|
71
|
-
* @param
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
*
|
|
41
|
+
* @param options - The options to find the product config items.
|
|
42
|
+
* @template DeviceType - The device type to find. Example: `Foldable`, `Phone`.
|
|
43
|
+
* @template Name - The name to find. Example: `Mate X7`, `Customize`.
|
|
44
|
+
* @template OtherName - The name to find from other device types. Example: `nova 15 Pro、nova 15 Ultra`, `Customize`.
|
|
45
|
+
* @description The name is strictly matched with the name in the `productConfig.json` file,
|
|
46
|
+
* so if your device type and name are not corresponding, you will get a type error on the `name` property.
|
|
47
|
+
* Sometimes there are some device names that the library hasn't adapted yet, you can still define it in the `name` property,
|
|
48
|
+
* and it will not trigger a type error. Only when your device name and device type do not correspond to the library, will it trigger a type error.
|
|
76
49
|
*
|
|
77
|
-
*
|
|
50
|
+
* It is useful to prevent you from using the wrong name.
|
|
51
|
+
* @returns The product config items.
|
|
78
52
|
*/
|
|
79
|
-
|
|
53
|
+
findProductConfigItems<DeviceType extends ProductConfigFile.DeviceType = ProductConfigFile.DeviceType, Name extends ProductConfigFile.GenericContent<DeviceType>['name'] = ProductConfigFile.GenericContent<DeviceType>['name'], OtherName extends ProductConfigFile.OtherDeviceTypeNames<DeviceType> = ProductConfigFile.OtherDeviceTypeNames<DeviceType>>(options: ProductConfigFile.FindOptions<DeviceType, Name, OtherName>): ProductConfigItem<DeviceType, Name>[];
|
|
80
54
|
/**
|
|
81
|
-
*
|
|
55
|
+
* Find the product config item by the options.
|
|
82
56
|
*
|
|
83
|
-
* @param
|
|
84
|
-
* @
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
*
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
*
|
|
93
|
-
|
|
94
|
-
getImage(): T;
|
|
95
|
-
/**
|
|
96
|
-
* Get the URL of the image.
|
|
57
|
+
* @param options - The options to find the product config item.
|
|
58
|
+
* @template DeviceType - The device type to find. Example: `Foldable`, `Phone`.
|
|
59
|
+
* @template Name - The name to find. Example: `Mate X7`, `Customize`.
|
|
60
|
+
* @template OtherName - The name to find from other device types. Example: `nova 15 Pro、nova 15 Ultra`, `Customize`.
|
|
61
|
+
* @description The name is strictly matched with the name in the `productConfig.json` file,
|
|
62
|
+
* so if your device type and name are not corresponding, you will get a type error on the `name` property.
|
|
63
|
+
* Sometimes there are some device names that the library hasn't adapted yet, you can still define it in the `name` property,
|
|
64
|
+
* and it will not trigger a type error. Only when your device name and device type do not correspond to the library, will it trigger a type error.
|
|
65
|
+
*
|
|
66
|
+
* It is useful to prevent you from using the wrong name.
|
|
67
|
+
* @returns The product config item. If not found will return `undefined`.
|
|
97
68
|
*/
|
|
98
|
-
|
|
69
|
+
findProductConfigItem<DeviceType extends ProductConfigFile.DeviceType = ProductConfigFile.DeviceType, Name extends ProductConfigFile.GenericContent<DeviceType>['name'] = ProductConfigFile.GenericContent<DeviceType>['name'], OtherName extends ProductConfigFile.OtherDeviceTypeNames<DeviceType> = ProductConfigFile.OtherDeviceTypeNames<DeviceType>>(options: ProductConfigFile.FindOptions<DeviceType, Name, OtherName>): ProductConfigItem<DeviceType, Name> | undefined;
|
|
70
|
+
}
|
|
71
|
+
declare namespace ProductConfigFile {
|
|
72
|
+
type DeviceType = 'Phone' | 'Tablet' | '2in1' | 'Foldable' | 'WideFold' | 'TripleFold' | '2in1 Foldable' | 'TV' | 'Wearable';
|
|
73
|
+
type DeviceTypeWithString = DeviceType | (string & {});
|
|
74
|
+
type PhoneContent = Record<'Phone', ProductConfigItem.PhoneContent[]>;
|
|
75
|
+
type TabletContent = Record<'Tablet', ProductConfigItem.TabletContent[]>;
|
|
76
|
+
type TwoInOneContent = Record<'2in1', ProductConfigItem.TwoInOneContent[]>;
|
|
77
|
+
type FoldableContent = Record<'Foldable', ProductConfigItem.FoldableContent[]>;
|
|
78
|
+
type WideFoldContent = Record<'WideFold', ProductConfigItem.WideFoldContent[]>;
|
|
79
|
+
type TripleFoldContent = Record<'TripleFold', ProductConfigItem.TripleFoldContent[]>;
|
|
80
|
+
type TwoInOneFoldableContent = Record<'2in1 Foldable', ProductConfigItem.TwoInOneFoldableContent[]>;
|
|
81
|
+
type TVContent = Record<'TV', ProductConfigItem.TVContent[]>;
|
|
82
|
+
type WearableContent = Record<'Wearable', ProductConfigItem.WearableContent[]>;
|
|
83
|
+
type WearableKidContent = Record<'WearableKid', ProductConfigItem.WearableKidContent[]>;
|
|
84
|
+
type Content = PhoneContent & TabletContent & TwoInOneContent & FoldableContent & WideFoldContent & TripleFoldContent & TwoInOneFoldableContent & TVContent & WearableContent & WearableKidContent;
|
|
85
|
+
type GenericContent<DeviceType extends ProductConfigFile.DeviceType = ProductConfigFile.DeviceType, Name extends ProductConfigItem.NameWithString = Content[DeviceType][number]['name']> = Content[DeviceType][number] extends {
|
|
86
|
+
name: Name;
|
|
87
|
+
} ? Content[DeviceType][number] : Content[DeviceType][number];
|
|
88
|
+
/** Names from device types other than DeviceType. Used to detect ambiguous names like "Customize". */
|
|
89
|
+
type OtherDeviceTypeNames<DeviceType extends ProductConfigFile.DeviceType> = Exclude<ProductConfigItem.Name, Content[DeviceType][number]['name']>;
|
|
90
|
+
interface Serializable extends BaseSerializable<ProductConfigFile> {}
|
|
91
|
+
interface Generic {
|
|
92
|
+
readonly deviceType: DeviceType;
|
|
93
|
+
readonly name: ProductConfigItem.NameWithString;
|
|
94
|
+
}
|
|
95
|
+
interface FindOptions<DeviceType extends ProductConfigFile.DeviceType = ProductConfigFile.DeviceType, Name extends ProductConfigFile.GenericContent<DeviceType>['name'] = ProductConfigFile.GenericContent<DeviceType>['name'], OtherName extends OtherDeviceTypeNames<DeviceType> = OtherDeviceTypeNames<DeviceType>> {
|
|
96
|
+
/**
|
|
97
|
+
* The device type to find.
|
|
98
|
+
*/
|
|
99
|
+
readonly deviceType?: DeviceType;
|
|
100
|
+
/**
|
|
101
|
+
* The name to find.
|
|
102
|
+
*
|
|
103
|
+
* @notes
|
|
104
|
+
*
|
|
105
|
+
* - Known wrong name (from other device type) → `never` (type error)
|
|
106
|
+
* - Known correct name → `Name` or `NameWithString` if ambiguous
|
|
107
|
+
* - Arbitrary string (not in predefined list) → `NameWithString` (allowed)
|
|
108
|
+
*/
|
|
109
|
+
readonly name?: Name extends OtherName ? never : Name extends Content[DeviceType][number]['name'] ? Name extends OtherName ? ProductConfigItem.NameWithString : Name : ProductConfigItem.NameWithString;
|
|
110
|
+
}
|
|
111
|
+
function is(value: unknown): value is ProductConfigFile;
|
|
99
112
|
}
|
|
100
113
|
//#endregion
|
|
101
|
-
//#region src/
|
|
102
|
-
interface
|
|
114
|
+
//#region src/configs/product/item.d.ts
|
|
115
|
+
interface ProductConfigItem<DeviceType extends ProductConfigFile.DeviceType = ProductConfigFile.DeviceType, Name extends ProductConfigFile.GenericContent<DeviceType>['name'] = ProductConfigFile.GenericContent<DeviceType>['name']> extends Serializable<ProductConfigItem.Serializable>, Omit<SerializableContent<ProductConfigFile.GenericContent<DeviceType, Name>>, 'toJSON'> {
|
|
103
116
|
/**
|
|
104
|
-
*
|
|
105
|
-
*/
|
|
106
|
-
imageBasePath?: string;
|
|
107
|
-
/**
|
|
108
|
-
* The path to store the deployed images.
|
|
109
|
-
*/
|
|
110
|
-
deployedPath?: string;
|
|
111
|
-
/**
|
|
112
|
-
* The base path to store the downloaded images zip files.
|
|
117
|
+
* Get the product config file of the product.
|
|
113
118
|
*
|
|
114
|
-
* @
|
|
119
|
+
* @returns The product config file of the product.
|
|
115
120
|
*/
|
|
116
|
-
|
|
121
|
+
getProductConfigFile(): ProductConfigFile;
|
|
117
122
|
/**
|
|
118
|
-
*
|
|
123
|
+
* Get the camel-case device type of the product.
|
|
119
124
|
*
|
|
120
|
-
* -
|
|
121
|
-
* - In Windows, it will be `C:\Program Files\Huawei\DevEco Studio\sdk\default\openharmony` by default;
|
|
122
|
-
* - In other platforms, it will be `~/.huawei/Sdk/default/openharmony` by default.
|
|
125
|
+
* @returns The camel-case device type of the product.
|
|
123
126
|
*/
|
|
124
|
-
|
|
127
|
+
getDeviceType(): DeviceType;
|
|
125
128
|
/**
|
|
126
|
-
*
|
|
129
|
+
* Get the dev model of the product.
|
|
127
130
|
*
|
|
128
|
-
* -
|
|
129
|
-
* -
|
|
130
|
-
* -
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
* The path to store the HarmonyOS log files.
|
|
131
|
+
* - `Phone` → `PHEMU-FD00`
|
|
132
|
+
* - `Foldable` → `PHEMU-FD01`
|
|
133
|
+
* - `WideFold` → `PHEMU-FD02`
|
|
134
|
+
* - `TripleFold` → `PHEMU-FD06`
|
|
135
|
+
* - `2in1 Foldable` → `PCEMU-FD05`
|
|
136
|
+
* - `Wearable` → `MCHEMU-AL00CN`
|
|
135
137
|
*
|
|
136
|
-
*
|
|
137
|
-
*
|
|
138
|
-
*
|
|
138
|
+
* Other cases will return `undefined`. It is very important to emulator to identify the device type.
|
|
139
|
+
* If the dev model is no correct the emulator screen and features maybe have some problems (e.g. the
|
|
140
|
+
* screen width and height is not correct、the foldable screen cannot be folded, etc.).
|
|
139
141
|
*/
|
|
140
|
-
|
|
141
|
-
/**
|
|
142
|
-
* The folder to store the emulator executable files.
|
|
143
|
-
*
|
|
144
|
-
* It must contain the `Emulator` (In windows, it will be `Emulator.exe`) executable file.
|
|
145
|
-
*
|
|
146
|
-
* - In macOS, it will be `/Applications/DevEco-Studio.app/Contents/tools/emulator`;
|
|
147
|
-
* - In Windows, it will be `C:\Program Files\Huawei\DevEco Studio\tools\emulator`;
|
|
148
|
-
* - In other platforms, it will be `~/.huawei/Emulator`.
|
|
149
|
-
*/
|
|
150
|
-
emulatorPath?: string;
|
|
151
|
-
os?: typeof node_os0;
|
|
152
|
-
fs?: typeof node_fs0;
|
|
153
|
-
path?: typeof node_path0;
|
|
154
|
-
process?: typeof node_process0;
|
|
155
|
-
crypto?: typeof node_crypto0;
|
|
156
|
-
child_process?: typeof node_child_process0;
|
|
157
|
-
}
|
|
158
|
-
type ResolvedImageManagerOptions = Required<ImageManagerOptions>;
|
|
159
|
-
//#endregion
|
|
160
|
-
//#region src/image-manager.d.ts
|
|
161
|
-
interface ImageManager {
|
|
162
|
-
/**
|
|
163
|
-
* Get the resolved options.
|
|
164
|
-
*/
|
|
165
|
-
getOptions(): ResolvedImageManagerOptions;
|
|
166
|
-
/**
|
|
167
|
-
* Get the images.
|
|
168
|
-
*
|
|
169
|
-
* @param supportVersion - The support version of the images. Default is `6.0-hos-single-9`.
|
|
170
|
-
*/
|
|
171
|
-
getImages(supportVersion?: string): Promise<Image[]>;
|
|
172
|
-
/**
|
|
173
|
-
* Get the product config.
|
|
174
|
-
*
|
|
175
|
-
* It will automatically read from the `imageBasePath/productConfig.json` file if it exists.
|
|
176
|
-
* If the file does not exist, it will use the default product config.
|
|
177
|
-
*/
|
|
178
|
-
getProductConfig(): Promise<ProductConfig>;
|
|
179
|
-
/**
|
|
180
|
-
* Write the product config.
|
|
181
|
-
*
|
|
182
|
-
* @param existSkip - If the file exists, skip writing. Defaults to `false`.
|
|
183
|
-
*/
|
|
184
|
-
writeDefaultProductConfig(existSkip?: boolean): Promise<void>;
|
|
185
|
-
/**
|
|
186
|
-
* Get the emulator config.
|
|
187
|
-
*
|
|
188
|
-
* It will automatically read from the `imageBasePath/emulatorConfig.json` file if it exists.
|
|
189
|
-
* If the file does not exist, it will use the default emulator config.
|
|
190
|
-
*/
|
|
191
|
-
getEmulatorConfig(): Promise<EmulatorConfig>;
|
|
192
|
-
/**
|
|
193
|
-
* Get the operating system.
|
|
194
|
-
*/
|
|
195
|
-
getOS(): OS;
|
|
196
|
-
/**
|
|
197
|
-
* Get the architecture.
|
|
198
|
-
*/
|
|
199
|
-
getArch(): Arch;
|
|
200
|
-
/**
|
|
201
|
-
* Check if the emulator is compatible with current image manager.
|
|
202
|
-
*/
|
|
203
|
-
isCompatible(): Promise<boolean>;
|
|
142
|
+
getDevModel(): ProductConfigItem.DevModelWithString | undefined;
|
|
204
143
|
}
|
|
205
|
-
declare
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
144
|
+
declare namespace ProductConfigItem {
|
|
145
|
+
type Customize = 'Customize';
|
|
146
|
+
type PhoneName = 'nova 15 Pro、nova 15 Ultra' | 'nova 15' | 'Mate 80 Pro Max、Mate 80 RS' | 'Mate 80、Mate 80 Pro' | 'Mate 70 Pro、Mate 70 Pro+、Mate 70 RS' | 'Mate 70' | 'Mate 70 Air' | 'Mate 60 Pro、Mate 60 Pro+、Mate 60 RS' | 'Mate 60' | 'Pura 80 Pro、Pura 80 Pro+、Pura 80 Ultra' | 'Pura 80' | 'Pura 70 Pro、Pura 70 Pro+、Pura 70 Ultra' | 'Pura 70' | 'nova 14 Ultra' | 'nova 14 Pro' | 'nova 14' | 'nova 13 Pro' | 'nova 13' | 'nova 12 Pro、nova 12 Ultra' | 'nova 12' | 'Pocket 2' | 'nova flip、nova flip S';
|
|
147
|
+
type TabletName = 'MatePad Pro 11' | 'MatePad Pro 12' | 'MatePad Pro 13' | 'MatePad 11 S' | 'MatePad Air 12';
|
|
148
|
+
type TwoInOneName = 'MateBook Pro';
|
|
149
|
+
type FoldableName = 'Mate X5' | 'Mate X6' | 'Mate X7';
|
|
150
|
+
type WideFoldName = 'Pura X';
|
|
151
|
+
type TripleFoldName = 'Mate XT';
|
|
152
|
+
type TVName = 'TV';
|
|
153
|
+
type WearableName = 'Wearable';
|
|
154
|
+
type WearableKidName = 'WearableKid';
|
|
155
|
+
type TwoInOneFoldableName = 'MateBook Fold';
|
|
156
|
+
type Name = PhoneName | TabletName | TwoInOneName | FoldableName | WideFoldName | TripleFoldName | TVName | WearableName | TwoInOneFoldableName | WearableKidName | Customize;
|
|
157
|
+
type NameWithString = Name | (string & {});
|
|
158
|
+
interface BaseContent {
|
|
159
|
+
/**
|
|
160
|
+
* The name of the product.
|
|
161
|
+
*/
|
|
162
|
+
readonly name: NameWithString;
|
|
163
|
+
/**
|
|
164
|
+
* The screen width of the product.
|
|
165
|
+
*/
|
|
166
|
+
readonly screenWidth: string;
|
|
167
|
+
/**
|
|
168
|
+
* The screen height of the product.
|
|
169
|
+
*/
|
|
170
|
+
readonly screenHeight: string;
|
|
171
|
+
/**
|
|
172
|
+
* The screen diagonal of the product.
|
|
173
|
+
*/
|
|
174
|
+
readonly screenDiagonal: string;
|
|
175
|
+
/**
|
|
176
|
+
* The screen density of the product.
|
|
177
|
+
*/
|
|
178
|
+
readonly screenDensity: string;
|
|
179
|
+
/**
|
|
180
|
+
* Whether the product is visible.
|
|
181
|
+
*/
|
|
182
|
+
readonly visible: boolean;
|
|
183
|
+
/**
|
|
184
|
+
* The dev model of the product.
|
|
185
|
+
*/
|
|
186
|
+
readonly devModel?: string;
|
|
187
|
+
}
|
|
188
|
+
interface BaseFoldContent extends BaseContent {
|
|
189
|
+
/**
|
|
190
|
+
* The name of the product.
|
|
191
|
+
*/
|
|
192
|
+
readonly name: FoldableName | WideFoldName | TripleFoldName | TwoInOneFoldableName | Customize;
|
|
193
|
+
/**
|
|
194
|
+
* The outer screen width of the product.
|
|
195
|
+
*/
|
|
196
|
+
readonly outerScreenWidth: string;
|
|
197
|
+
/**
|
|
198
|
+
* The outer screen height of the product.
|
|
199
|
+
*/
|
|
200
|
+
readonly outerScreenHeight: string;
|
|
201
|
+
/**
|
|
202
|
+
* The outer screen diagonal of the product.
|
|
203
|
+
*/
|
|
204
|
+
readonly outerScreenDiagonal: string;
|
|
222
205
|
}
|
|
206
|
+
interface PhoneContent extends BaseContent {
|
|
207
|
+
/**
|
|
208
|
+
* The name of the product.
|
|
209
|
+
*/
|
|
210
|
+
readonly name: PhoneName | Customize;
|
|
211
|
+
/**
|
|
212
|
+
* The one cutout path of the product.
|
|
213
|
+
*/
|
|
214
|
+
readonly oneCutoutPath?: string;
|
|
215
|
+
}
|
|
216
|
+
interface TabletContent extends BaseContent {
|
|
217
|
+
/**
|
|
218
|
+
* The name of the product.
|
|
219
|
+
*/
|
|
220
|
+
readonly name: TabletName | Customize;
|
|
221
|
+
}
|
|
222
|
+
interface TwoInOneContent extends BaseContent {
|
|
223
|
+
/**
|
|
224
|
+
* The name of the product.
|
|
225
|
+
*/
|
|
226
|
+
readonly name: TwoInOneName | Customize;
|
|
227
|
+
}
|
|
228
|
+
interface FoldableContent extends BaseFoldContent {
|
|
229
|
+
/**
|
|
230
|
+
* The name of the product.
|
|
231
|
+
*/
|
|
232
|
+
readonly name: FoldableName | Customize;
|
|
233
|
+
}
|
|
234
|
+
interface WideFoldContent extends BaseFoldContent {
|
|
235
|
+
/**
|
|
236
|
+
* The name of the product.
|
|
237
|
+
*/
|
|
238
|
+
readonly name: WideFoldName;
|
|
239
|
+
/**
|
|
240
|
+
* The outer screen width of the product.
|
|
241
|
+
*/
|
|
242
|
+
readonly outerScreenWidth: string;
|
|
243
|
+
/**
|
|
244
|
+
* The outer screen height of the product.
|
|
245
|
+
*/
|
|
246
|
+
readonly outerScreenHeight: string;
|
|
247
|
+
/**
|
|
248
|
+
* The outer screen diagonal of the product.
|
|
249
|
+
*/
|
|
250
|
+
readonly outerScreenDiagonal: string;
|
|
251
|
+
}
|
|
252
|
+
interface TripleFoldContent extends BaseFoldContent {
|
|
253
|
+
/**
|
|
254
|
+
* The name of the product.
|
|
255
|
+
*/
|
|
256
|
+
readonly name: TripleFoldName;
|
|
257
|
+
/**
|
|
258
|
+
* The outer screen height of the product.
|
|
259
|
+
*/
|
|
260
|
+
readonly outerDoubleScreenWidth: string;
|
|
261
|
+
/**
|
|
262
|
+
* The outer double screen height of the product.
|
|
263
|
+
*/
|
|
264
|
+
readonly outerDoubleScreenHeight: string;
|
|
265
|
+
/**
|
|
266
|
+
* The outer double screen diagonal of the product.
|
|
267
|
+
*/
|
|
268
|
+
readonly outerDoubleScreenDiagonal: string;
|
|
269
|
+
}
|
|
270
|
+
interface TwoInOneFoldableContent extends BaseFoldContent {
|
|
271
|
+
/**
|
|
272
|
+
* The name of the product.
|
|
273
|
+
*/
|
|
274
|
+
readonly name: TwoInOneFoldableName;
|
|
275
|
+
}
|
|
276
|
+
interface TVContent extends BaseContent {
|
|
277
|
+
/**
|
|
278
|
+
* The name of the product.
|
|
279
|
+
*/
|
|
280
|
+
readonly name: TVName;
|
|
281
|
+
}
|
|
282
|
+
interface WearableContent extends BaseContent {
|
|
283
|
+
/**
|
|
284
|
+
* The name of the product.
|
|
285
|
+
*/
|
|
286
|
+
readonly name: WearableName;
|
|
287
|
+
}
|
|
288
|
+
interface WearableKidContent extends BaseContent {
|
|
289
|
+
/**
|
|
290
|
+
* The name of the product.
|
|
291
|
+
*/
|
|
292
|
+
readonly name: WearableKidName;
|
|
293
|
+
}
|
|
294
|
+
type Content = PhoneContent | TabletContent | TwoInOneContent | FoldableContent | WideFoldContent | TripleFoldContent | TwoInOneFoldableContent | TVContent | WearableContent | WearableKidContent;
|
|
295
|
+
interface Serializable extends BaseSerializable<ProductConfigItem> {}
|
|
296
|
+
type DevModel = 'MCHEMU-AL00CN' | 'PHEMU-FD00' | 'PHEMU-FD01' | 'PHEMU-FD02' | 'PCEMU-FD05' | 'PHEMU-FD06';
|
|
297
|
+
type DevModelWithString = DevModel | (string & {});
|
|
298
|
+
function is(value: unknown): value is ProductConfigItem;
|
|
223
299
|
}
|
|
224
300
|
//#endregion
|
|
225
|
-
//#region src/
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
301
|
+
//#region src/configs/lists/lists.d.ts
|
|
302
|
+
interface ListsFile extends Serializable<ListsFile.Serializable>, Omit<SerializableFile, 'toJSON'> {
|
|
303
|
+
getListsFileItems(): ListsFileItem[];
|
|
304
|
+
addListsFileItem(listsFileItem: ListsFileItem.Content): ListsFileItem;
|
|
305
|
+
deleteListsFileItem(listsFileItem: ListsFileItem): this;
|
|
306
|
+
}
|
|
307
|
+
declare namespace ListsFile {
|
|
308
|
+
type Content = ListsFileItem.Content[];
|
|
309
|
+
interface Serializable extends BaseSerializable<ListsFile> {}
|
|
310
|
+
function is(value: unknown): value is ListsFile;
|
|
231
311
|
}
|
|
232
312
|
//#endregion
|
|
233
|
-
//#region src/
|
|
234
|
-
interface
|
|
235
|
-
|
|
236
|
-
getPath(): string;
|
|
237
|
-
getArch(): 'arm' | 'x86' | (string & {});
|
|
238
|
-
getChecksum(): string;
|
|
239
|
-
getReleaseType(): string;
|
|
240
|
-
getVersion(): string;
|
|
241
|
-
getApiVersion(): string;
|
|
242
|
-
getTargetOS(): string;
|
|
243
|
-
getTargetVersion(): string;
|
|
244
|
-
getFsPath(): string;
|
|
245
|
-
getDeviceType(): DeviceType | (string & {});
|
|
246
|
-
getSnakecaseDeviceType(): SnakecaseDeviceType | (string & {});
|
|
247
|
-
getUrl(): Promise<string | RequestUrlError>;
|
|
248
|
-
isDownloaded(): Promise<boolean>;
|
|
249
|
-
createDownloader(signal?: AbortSignal): Promise<ImageDownloader<this> | RequestUrlError>;
|
|
313
|
+
//#region src/configs/lists/item.d.ts
|
|
314
|
+
interface ListsFileItem<ProductDeviceType extends ProductConfigFile.DeviceType = ProductConfigFile.DeviceType, ProductName extends ProductConfigFile.GenericContent<ProductDeviceType>['name'] = ProductConfigFile.GenericContent<ProductDeviceType>['name']> extends Serializable<ListsFileItem.Serializable>, Omit<SerializableContent<ListsFileItem.Content<ProductDeviceType, ProductName>>, 'toJSON'> {
|
|
315
|
+
getListsFile(): ListsFile;
|
|
250
316
|
}
|
|
251
|
-
declare namespace
|
|
252
|
-
interface
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
317
|
+
declare namespace ListsFileItem {
|
|
318
|
+
interface Serializable extends BaseSerializable<ListsFileItem> {}
|
|
319
|
+
type DeviceType = 'phone' | 'tablet' | '2in1' | 'foldable' | 'widefold' | 'triplefold' | '2in1_foldable' | 'tv' | 'wearable';
|
|
320
|
+
type DeviceTypeWithString = DeviceType | (string & {});
|
|
321
|
+
interface Content<ProductDeviceType extends ProductConfigFile.DeviceType = ProductConfigFile.DeviceType, ProductName extends ProductConfigFile.GenericContent<ProductDeviceType>['name'] = ProductConfigFile.GenericContent<ProductDeviceType>['name']> {
|
|
322
|
+
/**
|
|
323
|
+
* Diagonal size.
|
|
324
|
+
*
|
|
325
|
+
* @example '1.6'
|
|
326
|
+
*/
|
|
327
|
+
readonly 'diagonalSize': string;
|
|
328
|
+
/**
|
|
329
|
+
* Density.
|
|
330
|
+
*
|
|
331
|
+
* @example '320'
|
|
332
|
+
*/
|
|
333
|
+
readonly 'density': string;
|
|
334
|
+
/**
|
|
335
|
+
* Resolution height.
|
|
336
|
+
*
|
|
337
|
+
* @example '466'
|
|
338
|
+
*/
|
|
339
|
+
readonly 'resolutionHeight': string;
|
|
340
|
+
/**
|
|
341
|
+
* Resolution width.
|
|
342
|
+
*
|
|
343
|
+
* @example '466'
|
|
344
|
+
*/
|
|
345
|
+
readonly 'resolutionWidth': string;
|
|
346
|
+
/**
|
|
347
|
+
* RAM size.
|
|
348
|
+
*
|
|
349
|
+
* @example '4096'
|
|
350
|
+
*/
|
|
351
|
+
readonly 'memoryRamSize': string;
|
|
352
|
+
/**
|
|
353
|
+
* CPU number.
|
|
354
|
+
*
|
|
355
|
+
* @example '4'
|
|
356
|
+
*/
|
|
357
|
+
readonly 'cpuNumber': string;
|
|
358
|
+
/**
|
|
359
|
+
* Data disk size.
|
|
360
|
+
*
|
|
361
|
+
* @example '6144'
|
|
362
|
+
*/
|
|
363
|
+
readonly 'dataDiskSize': string;
|
|
364
|
+
/**
|
|
365
|
+
* Deployed name.
|
|
366
|
+
*
|
|
367
|
+
* @example 'Huawei_Wearable'
|
|
368
|
+
*/
|
|
369
|
+
readonly 'name': string;
|
|
370
|
+
/**
|
|
371
|
+
* UUID.
|
|
372
|
+
*
|
|
373
|
+
* @example 'ce454934-3a1b-4770-9838-dc85c5d7b6c1'
|
|
374
|
+
*/
|
|
375
|
+
readonly 'uuid': string;
|
|
376
|
+
/**
|
|
377
|
+
* OpenHarmony/HarmonyOS version.
|
|
378
|
+
*
|
|
379
|
+
* @example '6.0.1'
|
|
380
|
+
*/
|
|
381
|
+
readonly 'hw.apiName': string;
|
|
382
|
+
/**
|
|
383
|
+
* Device model.
|
|
384
|
+
*
|
|
385
|
+
* @example 'MCHEMU-AL00CN'
|
|
386
|
+
*/
|
|
387
|
+
readonly 'devModel'?: ProductConfigItem.DevModelWithString;
|
|
388
|
+
/**
|
|
389
|
+
* Model.
|
|
390
|
+
*
|
|
391
|
+
* @example 'Mate 80 Pro Max、Mate 80 RS'
|
|
392
|
+
*/
|
|
393
|
+
readonly 'model'?: ProductName;
|
|
394
|
+
/**
|
|
395
|
+
* Image directory.
|
|
396
|
+
*
|
|
397
|
+
* @example 'system-image/HarmonyOS-6.0.1/wearable_arm/'
|
|
398
|
+
*/
|
|
399
|
+
readonly 'imageDir': string;
|
|
400
|
+
/**
|
|
401
|
+
* Image SDK version.
|
|
402
|
+
*
|
|
403
|
+
* @example '6.0.0.112'
|
|
404
|
+
*/
|
|
405
|
+
readonly 'version': string;
|
|
406
|
+
/**
|
|
407
|
+
* Device type.
|
|
408
|
+
*
|
|
409
|
+
* @example 'wearable', 'phone', 'tablet'
|
|
410
|
+
*/
|
|
411
|
+
readonly 'type': DeviceTypeWithString;
|
|
412
|
+
/**
|
|
413
|
+
* Architecture.
|
|
414
|
+
*
|
|
415
|
+
* @example 'arm'
|
|
416
|
+
*/
|
|
417
|
+
readonly 'abi': string;
|
|
418
|
+
/**
|
|
419
|
+
* API version.
|
|
420
|
+
*
|
|
421
|
+
* @example '21'
|
|
422
|
+
*/
|
|
423
|
+
readonly 'apiVersion': string;
|
|
424
|
+
/**
|
|
425
|
+
* Deployed path.
|
|
426
|
+
*
|
|
427
|
+
* @example '/Users/xxx/.Huawei/Emulator/deployed/Huawei_Wearable'
|
|
428
|
+
*/
|
|
429
|
+
readonly 'path': string;
|
|
430
|
+
/**
|
|
431
|
+
* Show version.
|
|
432
|
+
*
|
|
433
|
+
* @example 'HarmonyOS 6.0.1(21)'
|
|
434
|
+
*/
|
|
435
|
+
readonly 'showVersion': string;
|
|
436
|
+
/**
|
|
437
|
+
* HarmonyOS version.
|
|
438
|
+
*
|
|
439
|
+
* @example 'HarmonyOS-6.0.1'
|
|
440
|
+
*/
|
|
441
|
+
readonly 'harmonyOSVersion'?: string;
|
|
442
|
+
/**
|
|
443
|
+
* Guest version.
|
|
444
|
+
*
|
|
445
|
+
* @example 'HarmonyOS 6.0.1(21)'
|
|
446
|
+
*/
|
|
447
|
+
readonly 'guestVersion'?: string;
|
|
448
|
+
/**
|
|
449
|
+
* Cover resolution width.
|
|
450
|
+
*
|
|
451
|
+
* @example '2472'
|
|
452
|
+
*/
|
|
453
|
+
readonly 'coverResolutionWidth'?: string;
|
|
454
|
+
/**
|
|
455
|
+
* Cover resolution height.
|
|
456
|
+
*
|
|
457
|
+
* @example '1648'
|
|
458
|
+
*/
|
|
459
|
+
readonly 'coverResolutionHeight'?: string;
|
|
460
|
+
/**
|
|
461
|
+
* Cover diagonal size.
|
|
462
|
+
*
|
|
463
|
+
* @example '13.0'
|
|
464
|
+
*/
|
|
465
|
+
readonly 'coverDiagonalSize'?: string;
|
|
466
|
+
/**
|
|
467
|
+
* HarmonyOS SDK path.
|
|
468
|
+
*
|
|
469
|
+
* @example '/Applications/DevEco-Studio.app/Contents/sdk'
|
|
470
|
+
*/
|
|
471
|
+
readonly 'harmonyos.sdk.path': string;
|
|
472
|
+
/**
|
|
473
|
+
* HarmonyOS config path.
|
|
474
|
+
*
|
|
475
|
+
* @example '/Users/xxx/Library/Application Support/Huawei/DevEcoStudio6.0'
|
|
476
|
+
*/
|
|
477
|
+
readonly 'harmonyos.config.path': string;
|
|
478
|
+
/**
|
|
479
|
+
* HarmonyOS log path.
|
|
480
|
+
*
|
|
481
|
+
* @example '/Users/xxx/Library/Logs/Huawei/DevEcoStudio6.0'
|
|
482
|
+
*/
|
|
483
|
+
readonly 'harmonyos.log.path': string;
|
|
484
|
+
/**
|
|
485
|
+
* Additional properties.
|
|
486
|
+
*/
|
|
487
|
+
readonly [key: string]: any;
|
|
264
488
|
}
|
|
489
|
+
function is(value: unknown): value is ListsFileItem;
|
|
265
490
|
}
|
|
266
|
-
type Image = LocalImage | RemoteImage;
|
|
267
|
-
type ImageType = 'local' | 'remote';
|
|
268
491
|
//#endregion
|
|
269
|
-
//#region src/screens/
|
|
270
|
-
interface
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
}
|
|
278
|
-
declare namespace
|
|
492
|
+
//#region src/screens/customize-screen.d.ts
|
|
493
|
+
interface CustomizeScreen extends Serializable<CustomizeScreen.Serializable> {
|
|
494
|
+
/**
|
|
495
|
+
* Get the screen preset.
|
|
496
|
+
*
|
|
497
|
+
* @returns The screen preset.
|
|
498
|
+
*/
|
|
499
|
+
getScreenPreset(): ScreenPreset;
|
|
500
|
+
}
|
|
501
|
+
declare namespace CustomizeScreen {
|
|
279
502
|
interface Options {
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
503
|
+
configName: string;
|
|
504
|
+
diagonalSize: number;
|
|
505
|
+
resolutionWidth: number;
|
|
506
|
+
resolutionHeight: number;
|
|
507
|
+
density: number;
|
|
283
508
|
}
|
|
509
|
+
interface Serializable extends Omit<BaseSerializable<CustomizeScreen>, 'screenPreset'>, CustomizeScreen.Options {}
|
|
510
|
+
function is(value: unknown): value is CustomizeScreen;
|
|
284
511
|
}
|
|
285
512
|
//#endregion
|
|
286
|
-
//#region src/screens/
|
|
287
|
-
interface
|
|
288
|
-
|
|
513
|
+
//#region src/screens/customize-foldable-screen.d.ts
|
|
514
|
+
interface CustomizeFoldableScreen extends Serializable<CustomizeFoldableScreen.Serializable>, Omit<CustomizeScreen, 'toJSON'> {
|
|
515
|
+
getCoverResolutionWidth(): number;
|
|
516
|
+
getCoverResolutionHeight(): number;
|
|
517
|
+
getCoverDiagonalSize(): number;
|
|
289
518
|
}
|
|
290
|
-
declare namespace
|
|
291
|
-
interface Options
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
interface DoubleScreen {
|
|
299
|
-
getScreen(): Screen;
|
|
300
|
-
}
|
|
301
|
-
declare namespace DoubleScreen {
|
|
302
|
-
interface Options extends BaseScreen.Options {}
|
|
303
|
-
interface Stringifiable extends Options {}
|
|
304
|
-
function is(value: unknown): value is DoubleScreen;
|
|
519
|
+
declare namespace CustomizeFoldableScreen {
|
|
520
|
+
interface Options {
|
|
521
|
+
coverResolutionWidth: number;
|
|
522
|
+
coverResolutionHeight: number;
|
|
523
|
+
coverDiagonalSize: number;
|
|
524
|
+
}
|
|
525
|
+
interface Serializable extends CustomizeScreen.Serializable, CustomizeFoldableScreen.Options {}
|
|
526
|
+
function is(value: unknown): value is CustomizeFoldableScreen;
|
|
305
527
|
}
|
|
306
|
-
declare function createDoubleScreen(options: DoubleScreen.Options, screen: Screen): DoubleScreen;
|
|
307
528
|
//#endregion
|
|
308
|
-
//#region src/
|
|
309
|
-
interface
|
|
310
|
-
|
|
529
|
+
//#region src/configs/emulator/emulator-basic-item.d.ts
|
|
530
|
+
interface EmulatorBasicItem extends SerializableContent<EmulatorBasicItem.Content> {
|
|
531
|
+
getEmulatorFile(): EmulatorFile;
|
|
311
532
|
}
|
|
312
|
-
declare namespace
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
533
|
+
declare namespace EmulatorBasicItem {
|
|
534
|
+
type DeviceType = '2in1' | 'tablet' | 'tv' | 'wearable' | 'phone';
|
|
535
|
+
type DeviceTypeWithString = DeviceType | (string & {});
|
|
536
|
+
interface Content {
|
|
537
|
+
readonly name: string;
|
|
538
|
+
readonly deviceType: DeviceType;
|
|
539
|
+
readonly resolutionWidth: number;
|
|
540
|
+
readonly resolutionHeight: number;
|
|
541
|
+
readonly physicalWidth: number;
|
|
542
|
+
readonly physicalHeight: number;
|
|
543
|
+
readonly diagonalSize: number;
|
|
544
|
+
readonly density: number;
|
|
545
|
+
readonly memoryRamSize: number;
|
|
546
|
+
readonly datadiskSize: number;
|
|
547
|
+
readonly procNumber: number;
|
|
548
|
+
readonly api: number;
|
|
549
|
+
}
|
|
550
|
+
function is(value: unknown): value is EmulatorBasicItem;
|
|
551
|
+
function isDeviceType(value: unknown): value is DeviceType;
|
|
552
|
+
function isContent(value: unknown): value is Content;
|
|
316
553
|
}
|
|
317
|
-
declare function createOuterDoubleScreen(options: OuterDoubleScreen.Options, outerScreen: OuterScreen): OuterDoubleScreen;
|
|
318
554
|
//#endregion
|
|
319
|
-
//#region src/
|
|
320
|
-
interface
|
|
321
|
-
|
|
322
|
-
getOuterDoubleScreen(): OuterDoubleScreen | undefined;
|
|
323
|
-
setOuterDoubleScreen(outerDoubleScreen: OuterDoubleScreen | OuterDoubleScreen.Options): this;
|
|
555
|
+
//#region src/configs/emulator/emulator-fold-item.d.ts
|
|
556
|
+
interface EmulatorFoldItem extends SerializableContent<EmulatorFoldItem.Content> {
|
|
557
|
+
getEmulatorFile(): EmulatorFile;
|
|
324
558
|
}
|
|
325
|
-
declare namespace
|
|
326
|
-
|
|
327
|
-
|
|
559
|
+
declare namespace EmulatorFoldItem {
|
|
560
|
+
type DeviceType = 'foldable' | '2in1_foldable' | 'triplefold' | 'widefold';
|
|
561
|
+
interface Content extends Omit<EmulatorBasicItem.Content, 'deviceType'> {
|
|
562
|
+
readonly deviceType: DeviceType;
|
|
563
|
+
readonly coverResolutionWidth: number;
|
|
564
|
+
readonly coverResolutionHeight: number;
|
|
565
|
+
readonly coverDiagonalSize: number;
|
|
328
566
|
}
|
|
329
|
-
|
|
330
|
-
function
|
|
567
|
+
function is(value: unknown): value is EmulatorFoldItem;
|
|
568
|
+
function isDeviceType(value: unknown): value is DeviceType;
|
|
569
|
+
function isContent(value: unknown): value is Content;
|
|
331
570
|
}
|
|
332
|
-
declare function createOuterScreen(options: OuterScreen.Options, screen: Screen): OuterScreen;
|
|
333
571
|
//#endregion
|
|
334
|
-
//#region src/
|
|
335
|
-
interface
|
|
336
|
-
|
|
337
|
-
}
|
|
338
|
-
declare namespace SingleScreen {
|
|
339
|
-
interface Options extends BaseScreen.Options {}
|
|
340
|
-
interface Stringifiable extends Options {}
|
|
341
|
-
function is(value: unknown): value is SingleScreen;
|
|
572
|
+
//#region src/configs/emulator/emulator-triplefold-item.d.ts
|
|
573
|
+
interface EmulatorTripleFoldItem extends SerializableContent<EmulatorTripleFoldItem.Content> {
|
|
574
|
+
getEmulatorFile(): EmulatorFile;
|
|
342
575
|
}
|
|
343
|
-
declare
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
interface
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
getSingleScreen(): SingleScreen | undefined;
|
|
355
|
-
setSingleScreen(singleScreen: SingleScreen | SingleScreen.Options): this;
|
|
356
|
-
getDoubleScreen(): DoubleScreen | undefined;
|
|
357
|
-
setDoubleScreen(doubleScreen: DoubleScreen | DoubleScreen.Options): this;
|
|
358
|
-
getDensity(): number;
|
|
359
|
-
setDensity(density: number): this;
|
|
360
|
-
}
|
|
361
|
-
declare namespace Screen {
|
|
362
|
-
interface Options extends BaseScreen.Options {
|
|
363
|
-
density: number;
|
|
364
|
-
apiVersion: number;
|
|
365
|
-
deviceType: SnakecaseDeviceType;
|
|
366
|
-
outer?: OuterScreen | OuterScreen.Options;
|
|
367
|
-
cover?: CoverScreen | CoverScreen.Options;
|
|
368
|
-
single?: SingleScreen | SingleScreen.Options;
|
|
369
|
-
double?: DoubleScreen | DoubleScreen.Options;
|
|
576
|
+
declare namespace EmulatorTripleFoldItem {
|
|
577
|
+
type DeviceType = 'triplefold';
|
|
578
|
+
type DeviceTypeWithString = DeviceType;
|
|
579
|
+
interface Content extends Omit<EmulatorBasicItem.Content, 'deviceType'> {
|
|
580
|
+
readonly deviceType: DeviceType;
|
|
581
|
+
readonly singleResolutionWidth: number;
|
|
582
|
+
readonly singleResolutionHeight: number;
|
|
583
|
+
readonly singleDiagonalSize: number;
|
|
584
|
+
readonly doubleResolutionWidth: number;
|
|
585
|
+
readonly doubleResolutionHeight: number;
|
|
586
|
+
readonly doubleDiagonalSize: number;
|
|
370
587
|
}
|
|
371
|
-
|
|
372
|
-
function
|
|
588
|
+
function is(value: unknown): value is EmulatorTripleFoldItem;
|
|
589
|
+
function isDeviceType(value: unknown): value is DeviceType;
|
|
590
|
+
function isContent(value: unknown): value is Content;
|
|
373
591
|
}
|
|
374
|
-
declare function createScreen(options: Screen.Options): Screen;
|
|
375
592
|
//#endregion
|
|
376
|
-
//#region src/
|
|
377
|
-
interface
|
|
378
|
-
|
|
379
|
-
|
|
593
|
+
//#region src/configs/emulator/group-item.d.ts
|
|
594
|
+
interface EmulatorGroupItem extends SerializableContent<EmulatorGroupItem.Content> {
|
|
595
|
+
getEmulatorFile(): EmulatorFile;
|
|
596
|
+
getChildren(): EmulatorFile.DeviceItem[];
|
|
380
597
|
}
|
|
381
|
-
declare namespace
|
|
382
|
-
|
|
383
|
-
|
|
598
|
+
declare namespace EmulatorGroupItem {
|
|
599
|
+
type DeviceType = 'phone_all' | 'pc_all';
|
|
600
|
+
type DeviceTypeWithString = DeviceType | (string & {});
|
|
601
|
+
interface Content {
|
|
602
|
+
readonly name: string;
|
|
603
|
+
readonly deviceType: DeviceTypeWithString;
|
|
604
|
+
readonly api: number;
|
|
605
|
+
readonly children: EmulatorFile.ItemContent[];
|
|
384
606
|
}
|
|
607
|
+
function is(value: unknown): value is EmulatorGroupItem;
|
|
608
|
+
function isContent(value: unknown): value is EmulatorGroupItem.Content;
|
|
385
609
|
}
|
|
386
610
|
//#endregion
|
|
387
|
-
//#region src/
|
|
388
|
-
interface
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
611
|
+
//#region src/configs/emulator/emulator.d.ts
|
|
612
|
+
interface EmulatorFile extends Serializable<EmulatorFile.Serializable>, Omit<SerializableFile, 'toJSON'> {
|
|
613
|
+
findDeviceItems<DeviceType extends EmulatorFile.DeviceType>(options?: EmulatorFile.FindDeviceItemOptions<DeviceType extends EmulatorGroupItem.DeviceType ? never : DeviceType>): EmulatorFile.DeviceItem[];
|
|
614
|
+
findDeviceItem<DeviceType extends EmulatorFile.DeviceType>(options?: EmulatorFile.FindDeviceItemOptions<DeviceType extends EmulatorGroupItem.DeviceType ? never : DeviceType>): EmulatorFile.DeviceItem | undefined;
|
|
615
|
+
findItems(options?: EmulatorFile.FindItemOptions): EmulatorFile.Item[];
|
|
616
|
+
findItem(options?: EmulatorFile.FindItemOptions): EmulatorFile.Item | undefined;
|
|
617
|
+
getItems(): EmulatorFile.Item[];
|
|
392
618
|
}
|
|
393
|
-
declare namespace
|
|
394
|
-
interface
|
|
395
|
-
|
|
396
|
-
|
|
619
|
+
declare namespace EmulatorFile {
|
|
620
|
+
interface Serializable extends BaseSerializable<EmulatorFile> {}
|
|
621
|
+
type ItemContent = EmulatorBasicItem.Content | EmulatorFoldItem.Content | EmulatorTripleFoldItem.Content;
|
|
622
|
+
type Content = Array<ContentItem>;
|
|
623
|
+
type ContentItem = EmulatorGroupItem.Content | ItemContent;
|
|
624
|
+
type DeviceItem = EmulatorBasicItem | EmulatorFoldItem | EmulatorTripleFoldItem;
|
|
625
|
+
type Item = EmulatorGroupItem | DeviceItem;
|
|
626
|
+
type DeviceType = EmulatorBasicItem.DeviceType | EmulatorFoldItem.DeviceType | EmulatorTripleFoldItem.DeviceType;
|
|
627
|
+
type DeviceTypeWithString = DeviceType | (string & {});
|
|
628
|
+
type FullDeviceType = DeviceType | EmulatorGroupItem.DeviceType;
|
|
629
|
+
type FullDeviceTypeWithString = FullDeviceType | (string & {});
|
|
630
|
+
function is(value: unknown): value is EmulatorFile;
|
|
631
|
+
function isItemContent(value: unknown): value is EmulatorFile.ItemContent;
|
|
632
|
+
function isContentItem(value: unknown): value is EmulatorFile.ContentItem;
|
|
633
|
+
interface FindDeviceItemOptions<DeviceType extends DeviceTypeWithString = DeviceTypeWithString> {
|
|
634
|
+
/**
|
|
635
|
+
* The API version to find.
|
|
636
|
+
*/
|
|
637
|
+
readonly apiVersion?: number;
|
|
638
|
+
/**
|
|
639
|
+
* The device type to find.
|
|
640
|
+
*/
|
|
641
|
+
readonly deviceType?: DeviceType;
|
|
642
|
+
}
|
|
643
|
+
interface FindItemOptions {
|
|
644
|
+
/**
|
|
645
|
+
* The API version to find.
|
|
646
|
+
*/
|
|
647
|
+
readonly apiVersion?: number;
|
|
648
|
+
/**
|
|
649
|
+
* The device type to find.
|
|
650
|
+
*/
|
|
651
|
+
readonly fullDeviceType?: FullDeviceTypeWithString;
|
|
397
652
|
}
|
|
398
653
|
}
|
|
399
654
|
//#endregion
|
|
400
655
|
//#region src/screens/screen-preset.d.ts
|
|
401
|
-
interface ScreenPreset extends
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
656
|
+
interface ScreenPreset<ProductDeviceType extends ProductConfigFile.DeviceType = ProductConfigFile.DeviceType, ProductName extends ProductConfigFile.GenericContent<ProductDeviceType>['name'] = ProductConfigFile.GenericContent<ProductDeviceType>['name']> {
|
|
657
|
+
/**
|
|
658
|
+
* Get the emulator item content.
|
|
659
|
+
*
|
|
660
|
+
* @returns The emulator item content.
|
|
661
|
+
*/
|
|
662
|
+
getEmulatorDeviceItem(): EmulatorFile.DeviceItem;
|
|
663
|
+
/**
|
|
664
|
+
* Get the product config item content.
|
|
665
|
+
*
|
|
666
|
+
* @returns The product config item content.
|
|
667
|
+
*/
|
|
668
|
+
getProductConfigItem(): ProductConfigItem<ProductDeviceType, ProductName>;
|
|
669
|
+
/**
|
|
670
|
+
* Get the customize screen config.
|
|
671
|
+
*
|
|
672
|
+
* @returns The customize screen config.
|
|
673
|
+
*/
|
|
674
|
+
getCustomizeScreenConfig(): CustomizeScreen | CustomizeFoldableScreen | undefined;
|
|
405
675
|
}
|
|
406
676
|
declare namespace ScreenPreset {
|
|
407
|
-
interface
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
677
|
+
interface Serializable<ProductDeviceType extends ProductConfigFile.DeviceType = ProductConfigFile.DeviceType, ProductName extends ProductConfigFile.GenericContent<ProductDeviceType>['name'] = ProductConfigFile.GenericContent<ProductDeviceType>['name']> extends BaseSerializable<ScreenPreset<ProductDeviceType, ProductName>> {}
|
|
678
|
+
interface PresetOptions<ProductDeviceType extends ProductConfigFile.DeviceType = ProductConfigFile.DeviceType, ProductName extends ProductConfigFile.GenericContent<ProductDeviceType>['name'] = ProductConfigFile.GenericContent<ProductDeviceType>['name']> {
|
|
679
|
+
/**
|
|
680
|
+
* The emulator item content.
|
|
681
|
+
*/
|
|
682
|
+
readonly emulatorDeviceItem: EmulatorFile.DeviceItem;
|
|
683
|
+
/**
|
|
684
|
+
* The product config item content.
|
|
685
|
+
*/
|
|
686
|
+
readonly productConfigItem: ProductConfigItem<ProductDeviceType, ProductName>;
|
|
414
687
|
}
|
|
415
|
-
interface
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
688
|
+
interface CustomizeOptions<ProductDeviceType extends ProductConfigFile.DeviceType = ProductConfigFile.DeviceType, ProductName extends ProductConfigFile.GenericContent<ProductDeviceType>['name'] = ProductConfigFile.GenericContent<ProductDeviceType>['name']> extends PresetOptions<ProductDeviceType, ProductName> {
|
|
689
|
+
/**
|
|
690
|
+
* The customize screen options.
|
|
691
|
+
*/
|
|
692
|
+
readonly customizeScreen: CustomizeScreen.Options;
|
|
419
693
|
}
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
emulatorConfig: EmulatorConfigItem;
|
|
426
|
-
}
|
|
427
|
-
namespace EmulatorOptions {
|
|
428
|
-
function is(value: unknown): value is EmulatorOptions;
|
|
429
|
-
}
|
|
430
|
-
type Options = ScreenOptions | ProductOptions | EmulatorOptions;
|
|
431
|
-
interface Stringifiable {
|
|
432
|
-
emulatorPreset?: EmulatorPreset.Stringifiable;
|
|
433
|
-
productPreset?: ProductPreset.Stringifiable;
|
|
694
|
+
interface CustomizeFoldableOptions<ProductDeviceType extends ProductConfigFile.DeviceType = ProductConfigFile.DeviceType, ProductName extends ProductConfigFile.GenericContent<ProductDeviceType>['name'] = ProductConfigFile.GenericContent<ProductDeviceType>['name']> extends CustomizeOptions<ProductDeviceType, ProductName> {
|
|
695
|
+
/**
|
|
696
|
+
* The customize foldable screen options.
|
|
697
|
+
*/
|
|
698
|
+
readonly customizeFoldableScreen: CustomizeFoldableScreen.Options;
|
|
434
699
|
}
|
|
700
|
+
type Options<ProductDeviceType extends ProductConfigFile.DeviceType = ProductConfigFile.DeviceType, ProductName extends ProductConfigFile.GenericContent<ProductDeviceType>['name'] = ProductConfigFile.GenericContent<ProductDeviceType>['name']> = ProductName extends ProductConfigItem.Customize ? ProductDeviceType extends 'Foldable' ? CustomizeFoldableOptions<ProductDeviceType, ProductName> : CustomizeOptions<ProductDeviceType, ProductName> : PresetOptions<ProductDeviceType, ProductName>;
|
|
435
701
|
function is(value: unknown): value is ScreenPreset;
|
|
436
702
|
}
|
|
703
|
+
//#endregion
|
|
704
|
+
//#region src/devices/device.d.ts
|
|
705
|
+
interface Device<ProductDeviceType extends ProductConfigFile.DeviceType = ProductConfigFile.DeviceType, ProductName extends ProductConfigFile.GenericContent<ProductDeviceType>['name'] = ProductConfigFile.GenericContent<ProductDeviceType>['name']> extends Serializable<Device.Serializable<ProductDeviceType, ProductName>> {
|
|
706
|
+
/** Get the screen of the device. */
|
|
707
|
+
getScreen(): ScreenPreset<ProductDeviceType, ProductName>;
|
|
708
|
+
/** Get the image manager of the device. */
|
|
709
|
+
getImageManager(): ImageManager;
|
|
710
|
+
/** Get the lists file of the device. */
|
|
711
|
+
getListsFile(): ListsFile;
|
|
712
|
+
/** Get the lists file item of the device. */
|
|
713
|
+
getListsFileItem(): ListsFileItem;
|
|
714
|
+
/** Get the config INI file of the device. */
|
|
715
|
+
getConfigIniFile(): ConfigIniFile<ProductDeviceType, ProductName>;
|
|
716
|
+
/** Get the named INI file of the device. */
|
|
717
|
+
getNamedIniFile(): NamedIniFile<ProductDeviceType, ProductName>;
|
|
718
|
+
/** Get the executable URI of the device. */
|
|
719
|
+
getExecutableUri(): vscode_uri0.URI;
|
|
720
|
+
/** Get the snapshot URI of the device. */
|
|
721
|
+
getSnapshotUri(): vscode_uri0.URI;
|
|
722
|
+
/** Get the snapshot base64 string of the device. */
|
|
723
|
+
getSnapshot(): Promise<string>;
|
|
724
|
+
/** Get the start command of the device. */
|
|
725
|
+
getStartCommand(): [string, string[]];
|
|
726
|
+
/** Get the stop command of the device. */
|
|
727
|
+
getStopCommand(): [string, string[]];
|
|
728
|
+
/** Start the device. */
|
|
729
|
+
start(): Promise<child_process.ChildProcessByStdio<null, Readable, Readable>>;
|
|
730
|
+
/** Stop the device. */
|
|
731
|
+
stop(): Promise<child_process.ChildProcessByStdio<null, Readable, Readable>>;
|
|
732
|
+
/** Delete the device. */
|
|
733
|
+
delete(): Promise<void>;
|
|
734
|
+
/** Get the storage size of the device. */
|
|
735
|
+
getStorageSize(): Promise<number>;
|
|
736
|
+
/**
|
|
737
|
+
* Get the watcher of the device.
|
|
738
|
+
*
|
|
739
|
+
* - If the watcher is already created, it will return the existing watcher.
|
|
740
|
+
* - If the watcher is disposed, it will create a new watcher.
|
|
741
|
+
* - If the watcher is already created but disposed, it will create a new watcher.
|
|
742
|
+
*/
|
|
743
|
+
getWatcher(): Promise<FileSystemWatcher>;
|
|
744
|
+
}
|
|
745
|
+
declare namespace Device {
|
|
746
|
+
interface Serializable<ProductDeviceType extends ProductConfigFile.DeviceType = ProductConfigFile.DeviceType, ProductName extends ProductConfigFile.GenericContent<ProductDeviceType>['name'] = ProductConfigFile.GenericContent<ProductDeviceType>['name']> extends Omit<BaseSerializable<Device<ProductDeviceType, ProductName>>, 'imageManager'> {}
|
|
747
|
+
function is(value: unknown): value is Device;
|
|
748
|
+
}
|
|
749
|
+
//#endregion
|
|
750
|
+
//#region src/event-emitter.d.ts
|
|
437
751
|
/**
|
|
438
|
-
*
|
|
752
|
+
* Represents a typed event.
|
|
439
753
|
*
|
|
440
|
-
*
|
|
441
|
-
|
|
442
|
-
declare function createScreenPreset(options: ScreenPreset.ScreenOptions): ScreenPreset;
|
|
443
|
-
/**
|
|
444
|
-
* Create a screen preset with product options and local image.
|
|
754
|
+
* A function that represents an event to which you subscribe by calling it with
|
|
755
|
+
* a listener function as argument.
|
|
445
756
|
*
|
|
446
|
-
* @
|
|
757
|
+
* @example
|
|
758
|
+
* item.onDidChange(function(event) { console.log("Event happened: " + event); });
|
|
447
759
|
*/
|
|
448
|
-
|
|
449
|
-
//#endregion
|
|
450
|
-
//#region src/devices/list.d.ts
|
|
451
|
-
declare enum DevModel {
|
|
452
|
-
MCHEMU_AL00CN = "MCHEMU-AL00CN",
|
|
453
|
-
PHEMU_FD00 = "PHEMU-FD00",
|
|
454
|
-
PHEMU_FD01 = "PHEMU-FD01",
|
|
455
|
-
PHEMU_FD02 = "PHEMU-FD02",
|
|
456
|
-
PHEMU_FD06 = "PHEMU-FD06",
|
|
457
|
-
PCEMU_FD00 = "PCEMU-FD00",
|
|
458
|
-
PCEMU_FD05 = "PCEMU-FD05"
|
|
459
|
-
}
|
|
460
|
-
type DeployedDevModel = 'MCHEMU-AL00CN' | 'PHEMU-FD00' | 'PHEMU-FD01' | 'PHEMU-FD02' | 'PHEMU-FD06' | 'PCEMU-FD00' | 'PCEMU-FD05' | DevModel | (string & {});
|
|
461
|
-
type ProductNameable<T> = T & {
|
|
462
|
-
/**
|
|
463
|
-
* The name of the product.
|
|
464
|
-
*
|
|
465
|
-
* @example 'Mate 80 Pro Max、Mate 80 RS'
|
|
466
|
-
*/
|
|
467
|
-
productName: string;
|
|
468
|
-
};
|
|
469
|
-
interface DeployedImageConfig {
|
|
760
|
+
interface Event<T> {
|
|
470
761
|
/**
|
|
471
|
-
*
|
|
762
|
+
* A function that represents an event to which you subscribe by calling it with
|
|
763
|
+
* a listener function as argument.
|
|
472
764
|
*
|
|
473
|
-
* @
|
|
765
|
+
* @param listener The listener function will be called when the event happens.
|
|
766
|
+
* @param thisArgs The `this`-argument which will be used when calling the event listener.
|
|
767
|
+
* @param disposables An array to which a {@link Disposable} will be added.
|
|
768
|
+
* @returns A disposable which unsubscribes the event listener.
|
|
474
769
|
*/
|
|
475
|
-
|
|
770
|
+
(listener: (e: T) => any, thisArgs?: any, disposables?: Disposable[]): Disposable;
|
|
771
|
+
}
|
|
772
|
+
//#endregion
|
|
773
|
+
//#region src/image-downloader.d.ts
|
|
774
|
+
interface ImageDownloader {
|
|
775
|
+
getRemoteImage(): RemoteImage;
|
|
776
|
+
getUrl(): string;
|
|
777
|
+
getCacheUri(): vscode_uri0.URI;
|
|
778
|
+
startDownload(): Promise<void>;
|
|
779
|
+
checkChecksum(): Promise<boolean>;
|
|
780
|
+
extract(): Promise<void>;
|
|
781
|
+
onDownloadProgress: Event<ImageDownloader.DownloadProgress>;
|
|
782
|
+
onExtractProgress: Event<ImageDownloader.ExtractProgress>;
|
|
783
|
+
onChecksumProgress: Event<ImageDownloader.ChecksumProgress>;
|
|
784
|
+
}
|
|
785
|
+
declare namespace ImageDownloader {
|
|
786
|
+
type ProgressType = 'download' | 'extract';
|
|
787
|
+
interface BaseProgress {
|
|
788
|
+
/** Relative progress increment since last report, 0~100. */
|
|
789
|
+
increment: number;
|
|
790
|
+
/** Cureent progress, 0~100. */
|
|
791
|
+
progress: number;
|
|
792
|
+
}
|
|
793
|
+
interface DownloadProgress extends BaseProgress {
|
|
794
|
+
progressType: 'download';
|
|
795
|
+
/** Current network speed. */
|
|
796
|
+
network: number;
|
|
797
|
+
/** Current network speed unit, 'KB' or 'MB'. */
|
|
798
|
+
unit: 'KB' | 'MB';
|
|
799
|
+
/**
|
|
800
|
+
* When true, indicates resume from a previous session. Consumer should set
|
|
801
|
+
* accumulated progress to this event's `progress` instead of adding `increment`.
|
|
802
|
+
*/
|
|
803
|
+
reset?: boolean;
|
|
804
|
+
}
|
|
805
|
+
interface ExtractProgress extends BaseProgress {
|
|
806
|
+
progressType: 'extract';
|
|
807
|
+
}
|
|
808
|
+
interface ChecksumProgress extends BaseProgress {
|
|
809
|
+
progressType: 'checksum';
|
|
810
|
+
}
|
|
811
|
+
}
|
|
812
|
+
//#endregion
|
|
813
|
+
//#region src/sdk-list.d.ts
|
|
814
|
+
declare namespace SDKList {
|
|
815
|
+
type OS = 'windows' | 'mac' | 'linux';
|
|
816
|
+
type Arch = 'x86' | 'arm64';
|
|
817
|
+
interface Request {
|
|
818
|
+
/**
|
|
819
|
+
* The architecture of the operating system.
|
|
820
|
+
*/
|
|
821
|
+
readonly osArch: Arch;
|
|
822
|
+
/**
|
|
823
|
+
* The type of the operating system.
|
|
824
|
+
*/
|
|
825
|
+
readonly osType: OS;
|
|
826
|
+
/**
|
|
827
|
+
* The support version of the SDK.
|
|
828
|
+
*/
|
|
829
|
+
readonly supportVersion: string;
|
|
830
|
+
}
|
|
831
|
+
interface RemoteImageSDK {
|
|
832
|
+
/** @example 'system-image,HarmonyOS-6.0.2,pc_all_x86' */
|
|
833
|
+
readonly path: `${string},${string},${string}`;
|
|
834
|
+
/** @example '22' */
|
|
835
|
+
readonly apiVersion: string;
|
|
836
|
+
/** @example 'HarmonyOS-SDK' */
|
|
837
|
+
readonly license: string;
|
|
838
|
+
/** @example '6.0.0.129' */
|
|
839
|
+
readonly version: string;
|
|
840
|
+
/** @example 'System-image-pc_all' */
|
|
841
|
+
readonly displayName: string;
|
|
842
|
+
/** @example 'HarmonyOS emulator image for pc_all' */
|
|
843
|
+
readonly description: string;
|
|
844
|
+
/** @example '0' */
|
|
845
|
+
readonly experimentalFlag: string;
|
|
846
|
+
/** @example 'Beta1' */
|
|
847
|
+
readonly releaseType: string;
|
|
848
|
+
/** @example '1.0.0' */
|
|
849
|
+
readonly metaVersion: string;
|
|
850
|
+
readonly archive: {
|
|
851
|
+
complete: {
|
|
852
|
+
size: '2234888400';
|
|
853
|
+
checksum: 'd4541e398b61cae48545a95e0fe5bb946d18fd497cd57892e8f8a311568ac8fe';
|
|
854
|
+
osArch: 'x64';
|
|
855
|
+
};
|
|
856
|
+
};
|
|
857
|
+
/** The additional properties. */
|
|
858
|
+
readonly [key: string]: unknown;
|
|
859
|
+
}
|
|
860
|
+
namespace RemoteImageSDK {
|
|
861
|
+
interface Archive {
|
|
862
|
+
complete: Archive.Complete;
|
|
863
|
+
}
|
|
864
|
+
namespace Archive {
|
|
865
|
+
interface Complete {
|
|
866
|
+
size: string;
|
|
867
|
+
checksum: string;
|
|
868
|
+
osArch: string;
|
|
869
|
+
}
|
|
870
|
+
}
|
|
871
|
+
}
|
|
872
|
+
type OptionalRemoteImageSDK = Partial<RemoteImageSDK>;
|
|
873
|
+
type OKResponse = RemoteImageSDK[];
|
|
874
|
+
interface ErrorResponse {
|
|
875
|
+
/**
|
|
876
|
+
* The error code.
|
|
877
|
+
*/
|
|
878
|
+
readonly code: number;
|
|
879
|
+
/**
|
|
880
|
+
* The error message.
|
|
881
|
+
*/
|
|
882
|
+
readonly body: string;
|
|
883
|
+
}
|
|
884
|
+
type AxiosResponse = axios.AxiosResponse<OKResponse>;
|
|
885
|
+
type AxiosError = axios.AxiosError<ErrorResponse>;
|
|
886
|
+
type Result = AxiosResponse | AxiosError;
|
|
887
|
+
function isOKResponse(result: Result): result is AxiosResponse;
|
|
888
|
+
class SDKListError extends Error {
|
|
889
|
+
readonly code: SDKListError.Code;
|
|
890
|
+
readonly message: string;
|
|
891
|
+
readonly cause?: (AxiosError | AxiosResponse) | undefined;
|
|
892
|
+
constructor(code: SDKListError.Code, message: string, cause?: (AxiosError | AxiosResponse) | undefined);
|
|
893
|
+
}
|
|
894
|
+
namespace SDKListError {
|
|
895
|
+
enum Code {
|
|
896
|
+
VALIDATION_ERROR = 400,
|
|
897
|
+
REQUEST_ERROR = 500
|
|
898
|
+
}
|
|
899
|
+
}
|
|
900
|
+
}
|
|
901
|
+
//#endregion
|
|
902
|
+
//#region src/images/remote-image.d.ts
|
|
903
|
+
interface RemoteImage extends Serializable<RemoteImage.Serializable>, Omit<BaseImage, 'toJSON'> {
|
|
904
|
+
readonly imageType: 'remote';
|
|
476
905
|
/**
|
|
477
|
-
*
|
|
906
|
+
* Get the remote image SDK.
|
|
478
907
|
*
|
|
479
|
-
* @
|
|
908
|
+
* @returns The remote image SDK.
|
|
480
909
|
*/
|
|
481
|
-
|
|
910
|
+
getRemoteImageSDK(): SDKList.OptionalRemoteImageSDK;
|
|
482
911
|
/**
|
|
483
|
-
*
|
|
912
|
+
* Get the local image if it is already downloaded.
|
|
484
913
|
*
|
|
485
|
-
* @
|
|
914
|
+
* @param force - If `true` will reload the local image from the image manager and file system again. Default is `false`.
|
|
915
|
+
* @returns The local image if it is already downloaded, otherwise `undefined`.
|
|
486
916
|
*/
|
|
487
|
-
|
|
917
|
+
getLocalImage(force?: boolean): Promise<LocalImage | undefined>;
|
|
488
918
|
/**
|
|
489
|
-
*
|
|
919
|
+
* Create a downloader for the remote image.
|
|
490
920
|
*
|
|
491
|
-
* @
|
|
921
|
+
* @param signals - The signals to abort the download.
|
|
492
922
|
*/
|
|
493
|
-
|
|
923
|
+
createDownloader(signals?: AbortController): Promise<ImageDownloader>;
|
|
494
924
|
}
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
*
|
|
499
|
-
* @example 'Mate 80 Pro Max、Mate 80 RS'
|
|
500
|
-
*/
|
|
501
|
-
productName: string;
|
|
925
|
+
declare namespace RemoteImage {
|
|
926
|
+
interface Serializable extends BaseImage.Serializable, BaseSerializable<RemoteImage> {}
|
|
927
|
+
function is(value: unknown): value is RemoteImage;
|
|
502
928
|
}
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
929
|
+
//#endregion
|
|
930
|
+
//#region src/images/image.d.ts
|
|
931
|
+
type Image = LocalImage | RemoteImage;
|
|
932
|
+
declare namespace Image {
|
|
933
|
+
type RelativePath = `system-image/${string}/${string}`;
|
|
934
|
+
function is(value: unknown): value is Image;
|
|
935
|
+
}
|
|
936
|
+
//#endregion
|
|
937
|
+
//#region src/images/base-image.d.ts
|
|
938
|
+
interface BaseImage extends Serializable<BaseImage.Serializable> {
|
|
510
939
|
/**
|
|
511
|
-
*
|
|
512
|
-
*
|
|
513
|
-
* @example '4'
|
|
940
|
+
* The type of the image.
|
|
514
941
|
*/
|
|
515
|
-
'
|
|
942
|
+
readonly imageType: 'local' | 'remote';
|
|
516
943
|
/**
|
|
517
|
-
*
|
|
518
|
-
*
|
|
519
|
-
* @example '6144'
|
|
944
|
+
* Get the image manager.
|
|
520
945
|
*/
|
|
521
|
-
|
|
946
|
+
getImageManager(): ImageManager;
|
|
522
947
|
/**
|
|
523
|
-
*
|
|
524
|
-
*
|
|
525
|
-
* @example 'Huawei_Wearable'
|
|
948
|
+
* Get the relative path of the image.
|
|
526
949
|
*/
|
|
527
|
-
|
|
950
|
+
getRelativePath(): Image.RelativePath;
|
|
528
951
|
/**
|
|
529
|
-
*
|
|
530
|
-
*
|
|
531
|
-
* @example 'ce454934-3a1b-4770-9838-dc85c5d7b6c1'
|
|
952
|
+
* Get the full path of the image.
|
|
532
953
|
*/
|
|
533
|
-
|
|
954
|
+
getFullPath(): vscode_uri0.URI;
|
|
534
955
|
/**
|
|
535
|
-
*
|
|
536
|
-
*
|
|
537
|
-
* @example '6.0.1'
|
|
956
|
+
* Check if the image is downloaded.
|
|
538
957
|
*/
|
|
539
|
-
|
|
958
|
+
isDownloaded(): Promise<boolean>;
|
|
540
959
|
/**
|
|
541
|
-
*
|
|
542
|
-
*
|
|
543
|
-
* @example 'MCHEMU-AL00CN'
|
|
960
|
+
* Get the API version of the image.
|
|
544
961
|
*/
|
|
545
|
-
|
|
962
|
+
getApiVersion(): number;
|
|
546
963
|
/**
|
|
547
|
-
*
|
|
548
|
-
*
|
|
549
|
-
* @example 'Mate 80 Pro Max、Mate 80 RS'
|
|
964
|
+
* Get the device type of the image.
|
|
550
965
|
*/
|
|
551
|
-
|
|
966
|
+
getFullDeviceType(): EmulatorFile.FullDeviceTypeWithString;
|
|
552
967
|
}
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
968
|
+
declare namespace BaseImage {
|
|
969
|
+
interface Serializable extends BaseSerializable<BaseImage> {
|
|
970
|
+
imageType: 'local' | 'remote';
|
|
971
|
+
}
|
|
972
|
+
function is(value: unknown): value is BaseImage;
|
|
973
|
+
}
|
|
974
|
+
//#endregion
|
|
975
|
+
//#region src/images/local-image.d.ts
|
|
976
|
+
interface LocalImage extends Serializable<LocalImage.Serializable>, Omit<BaseImage, 'toJSON'> {
|
|
977
|
+
readonly imageType: 'local';
|
|
560
978
|
/**
|
|
561
|
-
*
|
|
979
|
+
* Get the SDK package file.
|
|
562
980
|
*
|
|
563
|
-
* @
|
|
981
|
+
* @returns The SDK package file.
|
|
564
982
|
*/
|
|
565
|
-
|
|
983
|
+
getSdkPkgFile(): LocalImage.OptionalSdkPkgFile;
|
|
566
984
|
/**
|
|
567
|
-
*
|
|
985
|
+
* Create a device from the local image.
|
|
568
986
|
*
|
|
569
|
-
* @
|
|
987
|
+
* @param options - The options to create the device.
|
|
570
988
|
*/
|
|
571
|
-
'
|
|
989
|
+
createDevice<ProductDeviceType extends ProductConfigFile.DeviceType = ProductConfigFile.DeviceType, ProductName extends ProductConfigFile.GenericContent<ProductDeviceType>['name'] = ProductConfigFile.GenericContent<ProductDeviceType>['name']>(options: LocalImage.CreateDeviceOptions<ProductDeviceType, ProductName>): Promise<Device<ProductDeviceType, ProductName>>;
|
|
990
|
+
}
|
|
991
|
+
declare namespace LocalImage {
|
|
992
|
+
interface Serializable extends BaseImage.Serializable, BaseSerializable<LocalImage> {}
|
|
993
|
+
interface SdkPkgFile {
|
|
994
|
+
/**
|
|
995
|
+
* The SDK package file data.
|
|
996
|
+
*/
|
|
997
|
+
readonly data: SdkPkgFile.Data;
|
|
998
|
+
}
|
|
999
|
+
namespace SdkPkgFile {
|
|
1000
|
+
interface Data {
|
|
1001
|
+
/** @example '13' */
|
|
1002
|
+
readonly apiVersion: string;
|
|
1003
|
+
/** @example 'System-image-foldable' */
|
|
1004
|
+
readonly displayName: string;
|
|
1005
|
+
/** @example 'system-image,HarmonyOS-5.0.1,foldable_arm' */
|
|
1006
|
+
readonly path: string;
|
|
1007
|
+
/** @example '5.0.1' */
|
|
1008
|
+
readonly platformVersion: string;
|
|
1009
|
+
/** @example 'Release' */
|
|
1010
|
+
readonly releaseType: string;
|
|
1011
|
+
/** @example '5.0.0.112' */
|
|
1012
|
+
readonly version: string;
|
|
1013
|
+
/** @example 'HarmonyOS 5.0.0.112(SP2)' */
|
|
1014
|
+
readonly guestVersion: string;
|
|
1015
|
+
/** @example 'Release' */
|
|
1016
|
+
readonly stage: string;
|
|
1017
|
+
}
|
|
1018
|
+
}
|
|
1019
|
+
type OptionalSdkPkgFile = DeepPartial<SdkPkgFile>;
|
|
1020
|
+
interface InfoFile {
|
|
1021
|
+
/** @example '21' */
|
|
1022
|
+
apiVersion: string;
|
|
1023
|
+
/** @example 'arm' */
|
|
1024
|
+
abi: string;
|
|
1025
|
+
/** @example '6.0.0.112' */
|
|
1026
|
+
version: string;
|
|
1027
|
+
}
|
|
1028
|
+
interface CreateDeviceOptions<ProductDeviceType extends ProductConfigFile.DeviceType = ProductConfigFile.DeviceType, ProductName extends ProductConfigFile.GenericContent<ProductDeviceType>['name'] = ProductConfigFile.GenericContent<ProductDeviceType>['name']> {
|
|
1029
|
+
/**
|
|
1030
|
+
* The name of the device.
|
|
1031
|
+
*
|
|
1032
|
+
* @example 'Huawei_Wearable'
|
|
1033
|
+
*/
|
|
1034
|
+
readonly name: string;
|
|
1035
|
+
/**
|
|
1036
|
+
* The CPU number.
|
|
1037
|
+
*
|
|
1038
|
+
* @example 4
|
|
1039
|
+
*/
|
|
1040
|
+
readonly cpuNumber: number;
|
|
1041
|
+
/**
|
|
1042
|
+
* The memory RAM size. (in MB)
|
|
1043
|
+
*
|
|
1044
|
+
* @example 4096
|
|
1045
|
+
*/
|
|
1046
|
+
readonly memoryRamSize: number;
|
|
1047
|
+
/**
|
|
1048
|
+
* The data disk size. (in MB)
|
|
1049
|
+
*
|
|
1050
|
+
* @example 6144
|
|
1051
|
+
*/
|
|
1052
|
+
readonly dataDiskSize: number;
|
|
1053
|
+
/**
|
|
1054
|
+
* The screen.
|
|
1055
|
+
*/
|
|
1056
|
+
readonly screen: ScreenPreset.Options<ProductDeviceType, ProductName>;
|
|
1057
|
+
/**
|
|
1058
|
+
* The vendor country.
|
|
1059
|
+
*
|
|
1060
|
+
* @example 'CN'
|
|
1061
|
+
*/
|
|
1062
|
+
readonly vendorCountry?: string;
|
|
1063
|
+
/**
|
|
1064
|
+
* @default true
|
|
1065
|
+
*/
|
|
1066
|
+
readonly isPublic?: boolean;
|
|
1067
|
+
}
|
|
1068
|
+
function is(value: unknown): value is LocalImage;
|
|
1069
|
+
}
|
|
1070
|
+
//#endregion
|
|
1071
|
+
//#region src/options.d.ts
|
|
1072
|
+
type ResolvedImageManagerAdapter = Required<ImageManager.Adapter>;
|
|
1073
|
+
type ResolvedImageManagerOptions = Omit<Required<ImageManager.Options>, 'imageBasePath' | 'deployedPath' | 'cachePath' | 'sdkPath' | 'configPath' | 'logPath' | 'emulatorPath'> & {
|
|
1074
|
+
adapter: ResolvedImageManagerAdapter;
|
|
1075
|
+
imageBasePath: vscode_uri0.URI;
|
|
1076
|
+
deployedPath: vscode_uri0.URI;
|
|
1077
|
+
cachePath: vscode_uri0.URI;
|
|
1078
|
+
sdkPath: vscode_uri0.URI;
|
|
1079
|
+
configPath: vscode_uri0.URI;
|
|
1080
|
+
logPath: vscode_uri0.URI;
|
|
1081
|
+
emulatorPath: vscode_uri0.URI;
|
|
1082
|
+
};
|
|
1083
|
+
//#endregion
|
|
1084
|
+
//#region src/image-manager.d.ts
|
|
1085
|
+
declare namespace ImageManager {
|
|
1086
|
+
interface Adapter {
|
|
1087
|
+
os?: Pick<typeof node_os0, 'homedir'>;
|
|
1088
|
+
fs?: FileSystem;
|
|
1089
|
+
join?: typeof vscode_uri0.Utils.joinPath;
|
|
1090
|
+
URI?: typeof vscode_uri0.URI;
|
|
1091
|
+
dirname?: typeof vscode_uri0.Utils.dirname;
|
|
1092
|
+
basename?: typeof vscode_uri0.Utils.basename;
|
|
1093
|
+
toWeb?: typeof node_stream0.Readable.toWeb;
|
|
1094
|
+
fromWeb?: typeof node_stream0.Readable.fromWeb;
|
|
1095
|
+
process?: Pick<typeof node_process0, 'platform' | 'env' | 'arch'>;
|
|
1096
|
+
crypto?: Pick<typeof node_crypto0, 'createHash' | 'randomUUID'>;
|
|
1097
|
+
child_process?: Pick<typeof node_child_process0, 'spawn'>;
|
|
1098
|
+
axios?: axios.AxiosInstance;
|
|
1099
|
+
isAxiosError?(error: unknown): error is axios.AxiosError;
|
|
1100
|
+
unzipper?: typeof unzipper;
|
|
1101
|
+
}
|
|
1102
|
+
interface Options {
|
|
1103
|
+
/**
|
|
1104
|
+
* The base path to store the images.
|
|
1105
|
+
*/
|
|
1106
|
+
imageBasePath?: string | vscode_uri0.URI;
|
|
1107
|
+
/**
|
|
1108
|
+
* The path to store the deployed images.
|
|
1109
|
+
*/
|
|
1110
|
+
deployedPath?: string | vscode_uri0.URI;
|
|
1111
|
+
/**
|
|
1112
|
+
* The base path to store the downloaded images zip files.
|
|
1113
|
+
*
|
|
1114
|
+
* @default `imageBasePath/cache`
|
|
1115
|
+
*/
|
|
1116
|
+
cachePath?: string | vscode_uri0.URI;
|
|
1117
|
+
/**
|
|
1118
|
+
* The path to store the HarmonyOS SDK.
|
|
1119
|
+
*
|
|
1120
|
+
* - In macOS, it will be `/Applications/DevEco-Studio.app/Contents/sdk/default/openharmony` by default;
|
|
1121
|
+
* - In Windows, it will be `C:\Program Files\Huawei\DevEco Studio\sdk\default\openharmony` by default;
|
|
1122
|
+
* - In other platforms, it will be `~/.huawei/Sdk/default/openharmony` by default.
|
|
1123
|
+
*/
|
|
1124
|
+
sdkPath?: string | vscode_uri0.URI;
|
|
1125
|
+
/**
|
|
1126
|
+
* The path to store the HarmonyOS configuration files.
|
|
1127
|
+
*
|
|
1128
|
+
* - In macOS, it will be `~/Library/Application Support/Huawei/DevEcoStudio6.0` by default;
|
|
1129
|
+
* - In Windows, it will be `%APPDATA%\Roaming\Huawei\DevEcoStudio6.0` by default;
|
|
1130
|
+
* - In other platforms, it will be `~/.huawei/DevEcoStudio6.0` by default.
|
|
1131
|
+
*/
|
|
1132
|
+
configPath?: string | vscode_uri0.URI;
|
|
1133
|
+
/**
|
|
1134
|
+
* The path to store the HarmonyOS log files.
|
|
1135
|
+
*
|
|
1136
|
+
* - In macOS, it will be `~/Library/Logs/Huawei/DevEcoStudio6.0` by default;
|
|
1137
|
+
* - In Windows, it will be `%APPDATA%\Local\Huawei\DevEcoStudio6.0\log` by default;
|
|
1138
|
+
* - In other platforms, it will be `~/.huawei/DevEcoStudio6.0/log` by default.
|
|
1139
|
+
*/
|
|
1140
|
+
logPath?: string | vscode_uri0.URI;
|
|
1141
|
+
/**
|
|
1142
|
+
* The folder to store the emulator executable files.
|
|
1143
|
+
*
|
|
1144
|
+
* It must contain the `Emulator` (In windows, it will be `Emulator.exe`) executable file.
|
|
1145
|
+
*
|
|
1146
|
+
* - In macOS, it will be `/Applications/DevEco-Studio.app/Contents/tools/emulator`;
|
|
1147
|
+
* - In Windows, it will be `C:\Program Files\Huawei\DevEco Studio\tools\emulator`;
|
|
1148
|
+
* - In other platforms, it will be `~/.huawei/Emulator`.
|
|
1149
|
+
*/
|
|
1150
|
+
emulatorPath?: string | vscode_uri0.URI;
|
|
1151
|
+
/**
|
|
1152
|
+
* The platform-specific adapters.
|
|
1153
|
+
*/
|
|
1154
|
+
adapter?: ImageManager.Adapter;
|
|
1155
|
+
}
|
|
1156
|
+
interface Serializable extends BaseSerializable<ImageManager> {}
|
|
1157
|
+
}
|
|
1158
|
+
interface ImageManager extends Serializable<ImageManager.Serializable> {
|
|
572
1159
|
/**
|
|
573
|
-
*
|
|
574
|
-
*
|
|
575
|
-
* @example 'arm'
|
|
1160
|
+
* Get the resolved image manager options.
|
|
576
1161
|
*/
|
|
577
|
-
|
|
1162
|
+
getOptions(): ResolvedImageManagerOptions;
|
|
578
1163
|
/**
|
|
579
|
-
*
|
|
580
|
-
*
|
|
581
|
-
* @example '21'
|
|
1164
|
+
* Get the operating system of the current image manager.
|
|
582
1165
|
*/
|
|
583
|
-
|
|
1166
|
+
getOperatingSystem(): SDKList.OS;
|
|
584
1167
|
/**
|
|
585
|
-
*
|
|
586
|
-
*
|
|
587
|
-
* @example '/Users/xxx/.Huawei/Emulator/deployed/Huawei_Wearable'
|
|
1168
|
+
* Get the architecture of the current image manager.
|
|
588
1169
|
*/
|
|
589
|
-
|
|
1170
|
+
getArch(): SDKList.Arch;
|
|
590
1171
|
/**
|
|
591
|
-
*
|
|
592
|
-
*
|
|
593
|
-
* @example 'HarmonyOS 6.0.1(21)'
|
|
1172
|
+
* Get local images.
|
|
594
1173
|
*/
|
|
595
|
-
|
|
1174
|
+
getLocalImages(): Promise<LocalImage[]>;
|
|
596
1175
|
/**
|
|
597
|
-
*
|
|
1176
|
+
* Get remote images.
|
|
598
1177
|
*
|
|
599
|
-
* @
|
|
1178
|
+
* @param supportVersion - The support version of the SDK. If not provided, the default value is `6.0-hos-single-9`.
|
|
600
1179
|
*/
|
|
601
|
-
|
|
1180
|
+
getRemoteImages(supportVersion?: string): Promise<RemoteImage[] | SDKList.SDKListError>;
|
|
602
1181
|
/**
|
|
603
|
-
*
|
|
1182
|
+
* Get downloaded remote images.
|
|
604
1183
|
*
|
|
605
|
-
* @
|
|
1184
|
+
* @param supportVersion - The support version of the SDK. If not provided, the default value is `6.0-hos-single-9`.
|
|
606
1185
|
*/
|
|
607
|
-
|
|
1186
|
+
getDownloadedRemoteImages(supportVersion?: string): Promise<RemoteImage[] | SDKList.SDKListError>;
|
|
608
1187
|
/**
|
|
609
|
-
*
|
|
610
|
-
*
|
|
611
|
-
* @example '2472'
|
|
1188
|
+
* Check if the emulator is compatible with current image manager.
|
|
612
1189
|
*/
|
|
613
|
-
|
|
1190
|
+
isCompatible(): Promise<boolean>;
|
|
614
1191
|
/**
|
|
615
|
-
*
|
|
616
|
-
*
|
|
617
|
-
* @example '1648'
|
|
1192
|
+
* Get the `lists.json` file path.
|
|
618
1193
|
*/
|
|
619
|
-
|
|
1194
|
+
getListsFilePath(): vscode_uri0.URI;
|
|
620
1195
|
/**
|
|
621
|
-
*
|
|
1196
|
+
* Read the `lists.json` file.
|
|
622
1197
|
*
|
|
623
|
-
* @
|
|
1198
|
+
* @returns The `lists.json` file.
|
|
624
1199
|
*/
|
|
625
|
-
|
|
1200
|
+
readListsFile(): Promise<ListsFile>;
|
|
626
1201
|
/**
|
|
627
|
-
*
|
|
1202
|
+
* Read the `emulator.json` file.
|
|
628
1203
|
*
|
|
629
|
-
* @
|
|
1204
|
+
* @returns The `emulator.json` file.
|
|
630
1205
|
*/
|
|
631
|
-
|
|
1206
|
+
readEmulatorFile(): Promise<EmulatorFile>;
|
|
632
1207
|
/**
|
|
633
|
-
*
|
|
1208
|
+
* Read the `product-config.json` file.
|
|
634
1209
|
*
|
|
635
|
-
* @
|
|
1210
|
+
* @returns The `product-config.json` file.
|
|
636
1211
|
*/
|
|
637
|
-
|
|
1212
|
+
readProductConfigFile(): Promise<ProductConfigFile>;
|
|
638
1213
|
/**
|
|
639
|
-
*
|
|
640
|
-
*
|
|
641
|
-
* @example '/Users/xxx/Library/Logs/Huawei/DevEcoStudio6.0'
|
|
1214
|
+
* Get deployed devices.
|
|
642
1215
|
*/
|
|
643
|
-
|
|
1216
|
+
getDeployedDevices(): Promise<Device[]>;
|
|
644
1217
|
}
|
|
1218
|
+
declare function createImageManager(options: ImageManager.Options): Promise<ImageManager>;
|
|
645
1219
|
//#endregion
|
|
646
|
-
//#region src/
|
|
647
|
-
interface
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
getUuid(): Device.UUID;
|
|
654
|
-
buildList(): FullDeployedImageOptions;
|
|
655
|
-
buildIni(): Record<string, string | undefined>;
|
|
656
|
-
toIniString(): string;
|
|
657
|
-
deploy(): Promise<void>;
|
|
658
|
-
delete(): Promise<void>;
|
|
659
|
-
isDeployed(): Promise<boolean>;
|
|
660
|
-
toJSON(): Device.Stringifiable;
|
|
1220
|
+
//#region src/common/serializable-file.d.ts
|
|
1221
|
+
interface SerializableFile extends Serializable<SerializableFile.Serializable>, SerializableContent<SerializableFile.Content> {
|
|
1222
|
+
getImageManager(): ImageManager;
|
|
1223
|
+
/** Serialize the serializable file to a string. */
|
|
1224
|
+
serialize(): Promise<string>;
|
|
1225
|
+
/** Write the serialized content to the file system. */
|
|
1226
|
+
write(): Promise<void>;
|
|
661
1227
|
}
|
|
662
|
-
declare namespace
|
|
663
|
-
type
|
|
664
|
-
interface
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
1228
|
+
declare namespace SerializableFile {
|
|
1229
|
+
type Content = SerializableContent.Content;
|
|
1230
|
+
interface Serializable extends BaseSerializable<SerializableFile> {}
|
|
1231
|
+
}
|
|
1232
|
+
//#endregion
|
|
1233
|
+
//#region src/configs/config-ini/config-ini.d.ts
|
|
1234
|
+
interface ConfigIniFile<ProductDeviceType extends ProductConfigFile.DeviceType = ProductConfigFile.DeviceType, ProductName extends ProductConfigFile.GenericContent<ProductDeviceType>['name'] = ProductConfigFile.GenericContent<ProductDeviceType>['name']> extends Serializable<ConfigIniFile.Serializable>, Omit<SerializableFile, 'toJSON'> {
|
|
1235
|
+
getDevice(): Device<ProductDeviceType, ProductName>;
|
|
1236
|
+
getFileUri(): vscode_uri0.URI;
|
|
1237
|
+
}
|
|
1238
|
+
declare namespace ConfigIniFile {
|
|
1239
|
+
type Content = Record<string, string | undefined>;
|
|
1240
|
+
type GenericContent<ProductDeviceType extends ProductConfigFile.DeviceType = ProductConfigFile.DeviceType, ProductName extends ProductConfigFile.GenericContent<ProductDeviceType>['name'] = ProductConfigFile.GenericContent<ProductDeviceType>['name']> = Content & {
|
|
1241
|
+
productModel: ProductName;
|
|
1242
|
+
};
|
|
1243
|
+
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'> {}
|
|
1244
|
+
function is(value: unknown): value is ConfigIniFile;
|
|
1245
|
+
}
|
|
1246
|
+
//#endregion
|
|
1247
|
+
//#region src/configs/named-ini/named-ini.d.ts
|
|
1248
|
+
interface NamedIniFile<ProductDeviceType extends ProductConfigFile.DeviceType = ProductConfigFile.DeviceType, ProductName extends ProductConfigFile.GenericContent<ProductDeviceType>['name'] = ProductConfigFile.GenericContent<ProductDeviceType>['name']> extends Serializable<NamedIniFile.Serializable>, Omit<SerializableFile, 'toJSON'> {
|
|
1249
|
+
getDevice(): Device<ProductDeviceType, ProductName>;
|
|
1250
|
+
getFileUri(): vscode_uri0.URI;
|
|
1251
|
+
}
|
|
1252
|
+
declare namespace NamedIniFile {
|
|
1253
|
+
type Content = Record<string, string>;
|
|
1254
|
+
interface Serializable<ProductDeviceType extends ProductConfigFile.DeviceType = ProductConfigFile.DeviceType, ProductName extends ProductConfigFile.GenericContent<ProductDeviceType>['name'] = ProductConfigFile.GenericContent<ProductDeviceType>['name']> extends Omit<BaseSerializable<NamedIniFile<ProductDeviceType, ProductName>>, 'device'> {}
|
|
1255
|
+
function is(value: unknown): value is NamedIniFile;
|
|
683
1256
|
}
|
|
684
1257
|
//#endregion
|
|
685
|
-
export {
|
|
1258
|
+
export { BaseImage, BaseSerializable, ConfigIniFile, CustomizeFoldableScreen, CustomizeScreen, DeepPartial, Device, EmulatorBasicItem, EmulatorFile, EmulatorFoldItem, EmulatorGroupItem, EmulatorTripleFoldItem, Image, type ImageManager, ListsFile, ListsFileItem, LocalImage, NamedIniFile, ProductConfigFile, ProductConfigItem, RemoteImage, SDKList, ScreenPreset, Serializable, createImageManager };
|