@oniroproject/core 0.12.0 → 0.14.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 +26 -13
- package/dist/index.cjs +1227 -311
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +483 -27
- package/dist/index.d.ts +483 -27
- package/dist/index.js +1187 -311
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -83,7 +83,9 @@ declare class OniroError extends Error {
|
|
|
83
83
|
declare class SdkNotInstalledError extends OniroError {
|
|
84
84
|
readonly api: string;
|
|
85
85
|
readonly expectedPath: string;
|
|
86
|
-
|
|
86
|
+
readonly version?: string | undefined;
|
|
87
|
+
/** `version` is the release that ships `api` (e.g. `6.0` for API 20), when one is known. */
|
|
88
|
+
constructor(api: string, expectedPath: string, version?: string | undefined);
|
|
87
89
|
}
|
|
88
90
|
declare class CmdToolsNotInstalledError extends OniroError {
|
|
89
91
|
readonly expectedPath: string;
|
|
@@ -240,6 +242,15 @@ declare function getHdcPath(config: ConfigProvider): string;
|
|
|
240
242
|
*/
|
|
241
243
|
declare function getHvigorwPath(config: ConfigProvider, projectDir: string, platform?: NodeJS.Platform): string;
|
|
242
244
|
|
|
245
|
+
/**
|
|
246
|
+
* The OpenHarmony SDK an OpenHarmony project builds against is missing, as a typed
|
|
247
|
+
* error naming the release to install, or null when it is installed or the project
|
|
248
|
+
* declares no numeric `compileSdkVersion`. hvigor looks for
|
|
249
|
+
* `<sdk home>/<compileSdkVersion>`, the home being `OHOS_BASE_SDK_HOME` or the
|
|
250
|
+
* project's `local.properties` `sdk.dir`, and otherwise fails late with
|
|
251
|
+
* `00308018 SDK path does not exist` / "SDK license agreement is not accepted".
|
|
252
|
+
*/
|
|
253
|
+
declare function findMissingProjectSdk(config: ConfigProvider, projectRoot: string): SdkNotInstalledError | null;
|
|
243
254
|
/**
|
|
244
255
|
* Detect the SDK API a project targets by reading `build-profile.json5`.
|
|
245
256
|
* Returns the `compileSdkVersion` of the first declared product, or undefined
|
|
@@ -461,11 +472,28 @@ declare function installCmdTools(opts: InstallCmdToolsOptions): Promise<void>;
|
|
|
461
472
|
interface CmdToolsStatus {
|
|
462
473
|
installed: boolean;
|
|
463
474
|
status: string;
|
|
475
|
+
/** Install directory (the configured `cmdToolsPath`). */
|
|
476
|
+
path: string;
|
|
477
|
+
/** Which SDK flavour the tools ship; see {@link detectCmdToolsFlavour}. Set when installed. */
|
|
478
|
+
flavour?: CmdToolsFlavour;
|
|
479
|
+
/** The hdc binary commands use, and whether it exists. */
|
|
480
|
+
hdc: {
|
|
481
|
+
path: string;
|
|
482
|
+
exists: boolean;
|
|
483
|
+
};
|
|
464
484
|
}
|
|
485
|
+
type CmdToolsFlavour = 'HarmonyOS' | 'OpenHarmony';
|
|
486
|
+
/**
|
|
487
|
+
* The flavour of a command-line tools install: `HarmonyOS` when it bundles the
|
|
488
|
+
* HarmonyOS SDK (`sdk/default/hms`, as the Huawei developer-portal download
|
|
489
|
+
* does), otherwise `OpenHarmony`. codelinter only fully checks projects of its
|
|
490
|
+
* own flavour (`runtimeOS` in build-profile.json5).
|
|
491
|
+
*/
|
|
492
|
+
declare function detectCmdToolsFlavour(cmdToolsPath: string): CmdToolsFlavour;
|
|
465
493
|
/**
|
|
466
|
-
* Reports whether ohpm is present at the configured path, and if so its version
|
|
467
|
-
* Prefers reading `version.txt`
|
|
468
|
-
* the binary with `-v`.
|
|
494
|
+
* Reports whether ohpm is present at the configured path, and if so its version,
|
|
495
|
+
* flavour, and the hdc binary in use. Prefers reading `version.txt`
|
|
496
|
+
* (`# Version: x.y.z`) before falling back to executing the binary with `-v`.
|
|
469
497
|
*/
|
|
470
498
|
declare function getCmdToolsStatus(config: ConfigProvider): CmdToolsStatus;
|
|
471
499
|
declare function isCmdToolsInstalled(config: ConfigProvider): boolean;
|
|
@@ -543,6 +571,14 @@ interface GenerateSigningConfigsOptions {
|
|
|
543
571
|
* existing `allowed-acls` is left alone.
|
|
544
572
|
*/
|
|
545
573
|
acls?: string[];
|
|
574
|
+
/**
|
|
575
|
+
* Privileges to write into the profile's `app-privilege-capabilities`, e.g.
|
|
576
|
+
* `AllowAppUsePrivilegeExtension` for an app that declares a privileged extension
|
|
577
|
+
* ability (else install fails with 9568344 "not allow use privilege extension"),
|
|
578
|
+
* `AllowAppMultiProcess` or `AllowAppDesktopIconHide`. When omitted, the
|
|
579
|
+
* template's value is left alone.
|
|
580
|
+
*/
|
|
581
|
+
appPrivilegeCapabilities?: string[];
|
|
546
582
|
/**
|
|
547
583
|
* Keystore passwords written into the profile sign step and the build-profile
|
|
548
584
|
* signingConfigs. Defaults to `'123456'` (the SDK's bundled OpenHarmony.p12
|
|
@@ -637,6 +673,26 @@ interface StartEmulatorOptions {
|
|
|
637
673
|
*/
|
|
638
674
|
declare function startEmulator(opts: StartEmulatorOptions): Promise<void>;
|
|
639
675
|
declare function stopEmulator(logger?: Logger): Promise<void>;
|
|
676
|
+
interface EmulatorStatus {
|
|
677
|
+
installed: boolean;
|
|
678
|
+
/** The configured emulator directory. */
|
|
679
|
+
dir: string;
|
|
680
|
+
/** Whether an emulator QEMU process is alive. */
|
|
681
|
+
running: boolean;
|
|
682
|
+
/** The hdc address checked for `connected`. */
|
|
683
|
+
address: string;
|
|
684
|
+
/** hdc lists `address` as a Connected target. */
|
|
685
|
+
connected: boolean;
|
|
686
|
+
}
|
|
687
|
+
/**
|
|
688
|
+
* Report on the Oniro emulator without starting it: installed, running, and whether
|
|
689
|
+
* hdc sees it at `address` (default `127.0.0.1:55555`). Other emulators, such as
|
|
690
|
+
* DevEco Studio's HarmonyOS emulator, are not covered: they appear in `listDevices`.
|
|
691
|
+
*/
|
|
692
|
+
declare function getEmulatorStatus(config: ConfigProvider, opts?: {
|
|
693
|
+
address?: string;
|
|
694
|
+
logger?: Logger;
|
|
695
|
+
}): Promise<EmulatorStatus>;
|
|
640
696
|
|
|
641
697
|
/**
|
|
642
698
|
* True when `command` must be routed through `cmd.exe` to run at all —
|
|
@@ -736,11 +792,33 @@ interface RunProcessOptions {
|
|
|
736
792
|
* (e.g. missing binary), timeout, or abort.
|
|
737
793
|
*/
|
|
738
794
|
declare function runProcess(opts: RunProcessOptions): Promise<HdcExecResult>;
|
|
795
|
+
/**
|
|
796
|
+
* The device to address: an explicit serial wins, then the `ONIRO_DEVICE_SERIAL` /
|
|
797
|
+
* `DEVICE_SERIAL` env vars. `auto`, or nothing at all, leaves the choice to hdc,
|
|
798
|
+
* which only works while a single target is connected.
|
|
799
|
+
*/
|
|
800
|
+
declare function resolveDeviceSerial(explicit?: string, env?: NodeJS.ProcessEnv): string | undefined;
|
|
801
|
+
/** `['-t', <serial>]` for the device {@link resolveDeviceSerial} picks, or `[]` to let hdc choose. */
|
|
802
|
+
declare function hdcTargetArgs(explicit?: string): string[];
|
|
803
|
+
/** The `-t <serial>` prefix for `hdc <args...>`, following {@link HdcExecOptions.deviceSerial}'s rules. */
|
|
804
|
+
declare function hdcTargetArgsFor(args: readonly string[], explicit?: string): string[];
|
|
805
|
+
/**
|
|
806
|
+
* The `[Fail]…` line hdc printed instead of running the command, or null. hdc
|
|
807
|
+
* exits 0 even then: `[Fail]ExecuteCommand need connect-key?` (several targets
|
|
808
|
+
* and no `-t`), `[Fail]Not match target founded` (unknown serial), a failed file
|
|
809
|
+
* transfer. Only the first line of output counts, so device-side output further
|
|
810
|
+
* down that happens to contain the marker is left alone. Pure/testable.
|
|
811
|
+
*/
|
|
812
|
+
declare function hdcClientFailure(output: string): string | null;
|
|
739
813
|
interface HdcExecOptions {
|
|
740
814
|
config: ConfigProvider;
|
|
741
815
|
/** Args passed to hdc verbatim, e.g. `['shell','aa','start','-a',ability,'-b',bundle]`. */
|
|
742
816
|
args: readonly string[];
|
|
743
|
-
/**
|
|
817
|
+
/**
|
|
818
|
+
* Device serial; prepends `['-t', serial]`. When unset, `ONIRO_DEVICE_SERIAL`
|
|
819
|
+
* applies (see {@link resolveDeviceSerial}), except for hdc server commands
|
|
820
|
+
* such as `list targets` and `tconn`.
|
|
821
|
+
*/
|
|
744
822
|
deviceSerial?: string;
|
|
745
823
|
/** Default 60_000. */
|
|
746
824
|
timeoutMs?: number;
|
|
@@ -750,7 +828,8 @@ interface HdcExecOptions {
|
|
|
750
828
|
}
|
|
751
829
|
/**
|
|
752
830
|
* Run `hdc [-t <serial>] <args...>`. Resolves with `{ code, stdout, stderr }`
|
|
753
|
-
* for any exit code; use {@link ensureOk} to throw on non-zero.
|
|
831
|
+
* for any exit code; use {@link ensureOk} to throw on non-zero. A `[Fail]` line
|
|
832
|
+
* from hdc itself is reported as exit code 1 (see {@link hdcClientFailure}).
|
|
754
833
|
*/
|
|
755
834
|
declare function hdcExec(opts: HdcExecOptions): Promise<HdcExecResult>;
|
|
756
835
|
interface HdcShellOptions extends Omit<HdcExecOptions, 'args'> {
|
|
@@ -828,28 +907,62 @@ interface ParamOptions {
|
|
|
828
907
|
timeoutMs?: number;
|
|
829
908
|
logger?: Logger;
|
|
830
909
|
}
|
|
831
|
-
/** Read a system property via `hdc shell param get <key>`. Returns the trimmed value. */
|
|
910
|
+
/** Read a system property via `hdc shell param get <key>`. Returns the trimmed value; throws when it is unset. */
|
|
832
911
|
declare function paramGet(config: ConfigProvider, key: string, opts?: ParamOptions): Promise<string>;
|
|
912
|
+
/**
|
|
913
|
+
* Split the output of {@link paramGetMany}'s single shell call back into one value
|
|
914
|
+
* per key; unset properties come back undefined. Pure/testable.
|
|
915
|
+
*/
|
|
916
|
+
declare function parseParamValues(keys: readonly string[], stdout: string): Record<string, string | undefined>;
|
|
917
|
+
/** Read several system properties in one `hdc shell` round trip. Unset properties come back undefined. */
|
|
918
|
+
declare function paramGetMany(config: ConfigProvider, keys: readonly string[], opts?: ParamOptions): Promise<Record<string, string | undefined>>;
|
|
833
919
|
/**
|
|
834
920
|
* Set a system property via `hdc shell param set <key> <value>`. The canonical
|
|
835
921
|
* reboot path is `paramSet(config, 'ohos.startup.powerctrl', 'reboot')`.
|
|
836
922
|
*/
|
|
837
923
|
declare function paramSet(config: ConfigProvider, key: string, value: string, opts?: ParamOptions): Promise<void>;
|
|
838
924
|
|
|
925
|
+
/**
|
|
926
|
+
* A host path in the form hdc understands: absolute, with native separators and,
|
|
927
|
+
* on Windows, no 8.3 short names. hdc treats a forward-slash Windows path such as
|
|
928
|
+
* `C:/Users/me/x.txt` as relative and joins it onto the current directory. The
|
|
929
|
+
* last component may not exist yet (a `recv` destination).
|
|
930
|
+
*/
|
|
931
|
+
declare function normaliseLocalPath(local: string): string;
|
|
932
|
+
/**
|
|
933
|
+
* Reject a device path that a Windows shell already rewrote into a host path:
|
|
934
|
+
* Git Bash turns `/data/local/tmp/x` into `C:/Program Files/Git/data/local/tmp/x`
|
|
935
|
+
* before the CLI sees it. Device paths never start with a drive letter.
|
|
936
|
+
*/
|
|
937
|
+
declare function assertDevicePath(remote: string): void;
|
|
938
|
+
/** Where `hdc shell` sees an app's el2 sandbox; the app itself sees it as `/data/storage/el2/base`. */
|
|
939
|
+
declare function appSandboxDir(bundle: string): string;
|
|
839
940
|
interface SendFileOptions {
|
|
840
941
|
config: ConfigProvider;
|
|
841
942
|
/** Local source path. */
|
|
842
943
|
local: string;
|
|
843
|
-
/**
|
|
944
|
+
/**
|
|
945
|
+
* Remote destination path on the device. With `bundle`, a relative path is
|
|
946
|
+
* resolved inside that app's sandbox (`files/x` is the app's application-level
|
|
947
|
+
* filesDir, `haps/entry/files/x` the entry module's).
|
|
948
|
+
*/
|
|
844
949
|
remote: string;
|
|
950
|
+
/**
|
|
951
|
+
* Push into this app's sandbox and give the file to the app's user afterwards:
|
|
952
|
+
* hdc writes files as root, which the app cannot read until they are chowned.
|
|
953
|
+
*/
|
|
954
|
+
bundle?: string;
|
|
845
955
|
deviceSerial?: string;
|
|
846
956
|
timeoutMs?: number;
|
|
847
957
|
abortSignal?: AbortSignal;
|
|
848
958
|
onOutput?: OutputSink;
|
|
849
959
|
logger?: Logger;
|
|
850
960
|
}
|
|
851
|
-
/**
|
|
852
|
-
|
|
961
|
+
/**
|
|
962
|
+
* Push a local file to the device via `hdc file send <local> <remote>`. Returns
|
|
963
|
+
* the device path the file was written to.
|
|
964
|
+
*/
|
|
965
|
+
declare function sendFile(opts: SendFileOptions): Promise<string>;
|
|
853
966
|
interface RecvFileOptions {
|
|
854
967
|
config: ConfigProvider;
|
|
855
968
|
/** Remote source path on the device. */
|
|
@@ -1008,13 +1121,20 @@ interface SendInputOptions {
|
|
|
1008
1121
|
pxY2?: number;
|
|
1009
1122
|
/** Velocity for swipe/drag/fling. */
|
|
1010
1123
|
speed?: number;
|
|
1011
|
-
/** Key id
|
|
1124
|
+
/** Key for keyEvent: a KeyCode id, a name (Back, Delete, Enter, …), or a combo like `Ctrl+A`. See {@link resolveKeyEvent}. */
|
|
1012
1125
|
key?: string | number;
|
|
1013
1126
|
/** Text for inputText. */
|
|
1014
1127
|
text?: string;
|
|
1015
1128
|
deviceSerial?: string;
|
|
1016
1129
|
logger?: Logger;
|
|
1017
1130
|
}
|
|
1131
|
+
/**
|
|
1132
|
+
* Resolve a key spec to `uitest uiInput keyEvent` arguments. Accepts uitest's
|
|
1133
|
+
* own names (Back/Home/Power), numeric KeyCode ids, named keys (Delete, Enter,
|
|
1134
|
+
* Tab, Escape, MoveHome, …), single letters, and combos of up to three keys
|
|
1135
|
+
* joined by "+" (e.g. `Ctrl+A`) or given as space-separated ids. Pure.
|
|
1136
|
+
*/
|
|
1137
|
+
declare function resolveKeyEvent(key: string | number): string;
|
|
1018
1138
|
/**
|
|
1019
1139
|
* Build the `uitest uiInput …` command for an input action, in pixel space.
|
|
1020
1140
|
* Pure (no I/O) so it is unit-testable. Mirrors the proven MCP construction
|
|
@@ -1125,6 +1245,8 @@ interface LayoutNode {
|
|
|
1125
1245
|
type?: string;
|
|
1126
1246
|
text?: string;
|
|
1127
1247
|
desc?: string;
|
|
1248
|
+
/** Placeholder text, e.g. an empty TextInput's "you@example.com". */
|
|
1249
|
+
hint?: string;
|
|
1128
1250
|
id?: string;
|
|
1129
1251
|
key?: string;
|
|
1130
1252
|
bundle?: string;
|
|
@@ -1135,28 +1257,105 @@ interface LayoutNode {
|
|
|
1135
1257
|
focus?: boolean;
|
|
1136
1258
|
scroll?: boolean;
|
|
1137
1259
|
longClick?: boolean;
|
|
1260
|
+
/** The component is disabled (`enabled: false`). */
|
|
1261
|
+
disabled?: boolean;
|
|
1262
|
+
/** The node's center is painted over by a later filled node (an overlay, a
|
|
1263
|
+
* dialog scrim, the soft keyboard), so a tap there would land on that instead. */
|
|
1264
|
+
covered?: boolean;
|
|
1138
1265
|
children?: LayoutNode[];
|
|
1139
1266
|
}
|
|
1267
|
+
/** The soft keyboard, when an input-method window is on screen. */
|
|
1268
|
+
interface KeyboardState {
|
|
1269
|
+
shown: boolean;
|
|
1270
|
+
/** Bundle of the input-method window. */
|
|
1271
|
+
bundle?: string;
|
|
1272
|
+
/** Bounds [x1,y1,x2,y2] normalized to 0–1 of the display. */
|
|
1273
|
+
b?: [number, number, number, number];
|
|
1274
|
+
}
|
|
1140
1275
|
interface DumpLayoutResult {
|
|
1141
1276
|
display: DisplaySize | null;
|
|
1142
1277
|
tree: LayoutNode;
|
|
1278
|
+
/** Present when the dump was asked to detect the soft keyboard. */
|
|
1279
|
+
keyboard?: KeyboardState;
|
|
1143
1280
|
}
|
|
1144
1281
|
/** Parse a uitest bounds string `"[x1,y1][x2,y2]"` into a tuple, or null. */
|
|
1145
1282
|
declare function parseBounds(s: string | undefined): [number, number, number, number] | null;
|
|
1283
|
+
/**
|
|
1284
|
+
* Find nodes whose center is painted over by a later node with a visible
|
|
1285
|
+
* background fill — a full-screen overlay, a dialog scrim, a sticky bar, or the
|
|
1286
|
+
* soft-keyboard window. Paint order is depth-first, siblings ordered by
|
|
1287
|
+
* `zIndex`, windows in dump order; ancestors and descendants never cover a node.
|
|
1288
|
+
*
|
|
1289
|
+
* A heuristic: only background fills count (an Image or Text drawn on top does
|
|
1290
|
+
* not), which is what overlays in practice use.
|
|
1291
|
+
*/
|
|
1292
|
+
declare function findCoveredNodes(root: RawLayoutNode): Set<RawLayoutNode>;
|
|
1146
1293
|
/**
|
|
1147
1294
|
* Prune a raw `uitest dumpLayout` tree into a compact, signal-bearing tree with
|
|
1148
1295
|
* bounds/center normalized to 0–1 of the display. Structural wrapper nodes with
|
|
1149
1296
|
* no signal collapse into their children. Returns a node, a flat list of nodes
|
|
1150
1297
|
* (collapsed wrapper with multiple children), or null (nothing useful). Ported
|
|
1151
|
-
*
|
|
1298
|
+
* from the proven MCP `pruneNode`; `covered` (from {@link findCoveredNodes})
|
|
1299
|
+
* marks nodes hidden under an overlay.
|
|
1300
|
+
*/
|
|
1301
|
+
declare function pruneLayout(node: RawLayoutNode, display: DisplaySize | null, covered?: ReadonlySet<RawLayoutNode>): LayoutNode | LayoutNode[] | null;
|
|
1302
|
+
/** A pruned layout node without children, tagged with the window it belongs to. */
|
|
1303
|
+
interface FlatLayoutNode extends Omit<LayoutNode, 'children'> {
|
|
1304
|
+
/** Bundle of the enclosing window (the nearest node carrying `bundle`). */
|
|
1305
|
+
window?: string;
|
|
1306
|
+
}
|
|
1307
|
+
/** Flatten a pruned layout tree into a depth-first (paint-order) list. */
|
|
1308
|
+
declare function flattenLayout(tree: LayoutNode): FlatLayoutNode[];
|
|
1309
|
+
/** Selects layout nodes by what an agent can read off the screen. */
|
|
1310
|
+
interface LayoutSelector {
|
|
1311
|
+
/** Matches `text`, `desc`, or `hint`: case-insensitive exact matches win; otherwise substring matches. */
|
|
1312
|
+
text?: string;
|
|
1313
|
+
/** Matches `id` or `key` exactly. */
|
|
1314
|
+
id?: string;
|
|
1315
|
+
/** Restricts to a component type (e.g. `Button`, `TextInput`); case-insensitive. */
|
|
1316
|
+
type?: string;
|
|
1317
|
+
}
|
|
1318
|
+
/** Throw unless `selector` constrains something: a non-blank text, an id, or a type. */
|
|
1319
|
+
declare function assertLayoutSelector(selector: LayoutSelector): void;
|
|
1320
|
+
/**
|
|
1321
|
+
* The tree without the windows owned by `bundle` — e.g. the soft keyboard, whose
|
|
1322
|
+
* keys ("Done", "9") would otherwise match element selectors. Pure.
|
|
1323
|
+
*/
|
|
1324
|
+
declare function withoutWindow(tree: LayoutNode, bundle: string): LayoutNode;
|
|
1325
|
+
/**
|
|
1326
|
+
* Find the nodes matching `selector` in a pruned layout tree, in paint order.
|
|
1327
|
+
* For `text`, exact (case-insensitive, trimmed) matches are returned when any
|
|
1328
|
+
* exist; otherwise substring matches. Covered nodes are included — callers
|
|
1329
|
+
* decide what to do with them (see {@link pickTarget}).
|
|
1330
|
+
*/
|
|
1331
|
+
declare function findLayoutNodes(tree: LayoutNode, selector: LayoutSelector): FlatLayoutNode[];
|
|
1332
|
+
/** One-line summary of a node, used in errors and logs. */
|
|
1333
|
+
declare function describeLayoutNode(n: FlatLayoutNode): string;
|
|
1334
|
+
/** Why {@link pickTarget} could not choose a node. */
|
|
1335
|
+
type PickTargetFailure = 'none' | 'covered' | 'ambiguous';
|
|
1336
|
+
declare class TargetNotFoundError extends OniroError {
|
|
1337
|
+
readonly reason: PickTargetFailure;
|
|
1338
|
+
constructor(message: string, reason: PickTargetFailure);
|
|
1339
|
+
}
|
|
1340
|
+
/**
|
|
1341
|
+
* Choose the single node to act on for `selector`. Covered nodes are skipped;
|
|
1342
|
+
* clickable matches are preferred over plain ones (a "Sign in" Button over the
|
|
1343
|
+
* "Sign in" title); a match nested inside another clickable match collapses
|
|
1344
|
+
* into it. `index` picks among what remains, in paint order. Throws
|
|
1345
|
+
* {@link TargetNotFoundError} when nothing (or more than one node) qualifies.
|
|
1152
1346
|
*/
|
|
1153
|
-
declare function
|
|
1347
|
+
declare function pickTarget(tree: LayoutNode, selector: LayoutSelector, index?: number): FlatLayoutNode;
|
|
1154
1348
|
interface DumpLayoutOptions {
|
|
1155
1349
|
config: ConfigProvider;
|
|
1156
1350
|
/** Filter to a single window/bundle (`uitest dumpLayout -b '<bundle>'`). */
|
|
1157
1351
|
bundleName?: string;
|
|
1158
1352
|
/** When false, return the parsed-but-unpruned tree. Default true. */
|
|
1159
1353
|
prune?: boolean;
|
|
1354
|
+
/**
|
|
1355
|
+
* Also report whether the soft keyboard is on screen (one extra `hidumper` call).
|
|
1356
|
+
* Ignored with `bundleName`, which filters the keyboard window out of the dump.
|
|
1357
|
+
*/
|
|
1358
|
+
detectKeyboard?: boolean;
|
|
1160
1359
|
deviceSerial?: string;
|
|
1161
1360
|
timeoutMs?: number;
|
|
1162
1361
|
logger?: Logger;
|
|
@@ -1167,6 +1366,125 @@ interface DumpLayoutOptions {
|
|
|
1167
1366
|
*/
|
|
1168
1367
|
declare function dumpLayout(opts: DumpLayoutOptions): Promise<DumpLayoutResult>;
|
|
1169
1368
|
|
|
1369
|
+
/**
|
|
1370
|
+
* Extract input-method bundle names from `hidumper -s 3703 -a -a` output, whose
|
|
1371
|
+
* `imeList` entries look like `"ime": "com.example.kikakeyboard/ServiceExtAbility"`.
|
|
1372
|
+
* The current IME comes first. Pure.
|
|
1373
|
+
*/
|
|
1374
|
+
declare function parseImeBundles(output: string): string[];
|
|
1375
|
+
/**
|
|
1376
|
+
* List the installed input-method bundles (current first). Empty when hidumper
|
|
1377
|
+
* fails or times out, so keyboard detection never fails the caller.
|
|
1378
|
+
*/
|
|
1379
|
+
declare function getImeBundles(config: ConfigProvider, opts?: {
|
|
1380
|
+
deviceSerial?: string;
|
|
1381
|
+
logger?: Logger;
|
|
1382
|
+
}): Promise<string[]>;
|
|
1383
|
+
/**
|
|
1384
|
+
* Find the input-method window in a pruned layout tree. uitest lists the soft
|
|
1385
|
+
* keyboard as its own window (a node carrying the IME's `bundle`) only while it
|
|
1386
|
+
* is shown. With no known IME bundles, falls back to a name heuristic. Pure.
|
|
1387
|
+
*/
|
|
1388
|
+
declare function findKeyboardWindow(tree: LayoutNode, imeBundles: readonly string[]): LayoutNode | null;
|
|
1389
|
+
|
|
1390
|
+
/** `uitest uiInput` actions plus the composite ones built on top of them. */
|
|
1391
|
+
type UiInputType = InputType | 'clearText' | 'hideKeyboard';
|
|
1392
|
+
interface DeviceOptions {
|
|
1393
|
+
config: ConfigProvider;
|
|
1394
|
+
deviceSerial?: string;
|
|
1395
|
+
logger?: Logger;
|
|
1396
|
+
}
|
|
1397
|
+
/**
|
|
1398
|
+
* Dismiss the soft keyboard with Back — only when it is actually on screen, since
|
|
1399
|
+
* Back without a keyboard navigates away. Returns whether a keyboard was dismissed.
|
|
1400
|
+
*/
|
|
1401
|
+
declare function hideKeyboard(opts: DeviceOptions): Promise<boolean>;
|
|
1402
|
+
interface LocateTargetOptions extends DeviceOptions {
|
|
1403
|
+
selector: LayoutSelector;
|
|
1404
|
+
/** Picks among several matching elements (see {@link pickTarget}). */
|
|
1405
|
+
index?: number;
|
|
1406
|
+
/**
|
|
1407
|
+
* When the soft keyboard is up and the target is missing, covered, or matches
|
|
1408
|
+
* only a non-clickable label (the button may be hidden below the keyboard),
|
|
1409
|
+
* dismiss the keyboard and look again. Default true.
|
|
1410
|
+
*/
|
|
1411
|
+
hideKeyboard?: boolean;
|
|
1412
|
+
}
|
|
1413
|
+
interface LocatedTarget {
|
|
1414
|
+
node: FlatLayoutNode;
|
|
1415
|
+
/** Center of the element in device pixels. */
|
|
1416
|
+
x: number;
|
|
1417
|
+
y: number;
|
|
1418
|
+
display: DisplaySize;
|
|
1419
|
+
/** The soft keyboard was dismissed to reach the element. */
|
|
1420
|
+
keyboardHidden: boolean;
|
|
1421
|
+
}
|
|
1422
|
+
/**
|
|
1423
|
+
* Resolve a selector against the live layout to one element and its pixel
|
|
1424
|
+
* center. Keys on the soft keyboard are not candidates.
|
|
1425
|
+
*/
|
|
1426
|
+
declare function locateTarget(opts: LocateTargetOptions): Promise<LocatedTarget>;
|
|
1427
|
+
interface PerformInputOptions extends DeviceOptions {
|
|
1428
|
+
type: UiInputType;
|
|
1429
|
+
/** Start point in device pixels. */
|
|
1430
|
+
pxX?: number;
|
|
1431
|
+
pxY?: number;
|
|
1432
|
+
/** End point in device pixels (swipe/drag/fling). */
|
|
1433
|
+
pxX2?: number;
|
|
1434
|
+
pxY2?: number;
|
|
1435
|
+
/** Start point as 0–1 fractions of the display. */
|
|
1436
|
+
fx?: number;
|
|
1437
|
+
fy?: number;
|
|
1438
|
+
/** End point as 0–1 fractions of the display. */
|
|
1439
|
+
fx2?: number;
|
|
1440
|
+
fy2?: number;
|
|
1441
|
+
/** Start point: the center of the element matching this selector. */
|
|
1442
|
+
target?: LayoutSelector;
|
|
1443
|
+
/** Picks among several elements matching `target`. */
|
|
1444
|
+
targetIndex?: number;
|
|
1445
|
+
/** Velocity for swipe/drag/fling. */
|
|
1446
|
+
speed?: number;
|
|
1447
|
+
/** Key for keyEvent (see `resolveKeyEvent`). */
|
|
1448
|
+
key?: string | number;
|
|
1449
|
+
/** Text for inputText. */
|
|
1450
|
+
text?: string;
|
|
1451
|
+
/** inputText: clear the field before typing. */
|
|
1452
|
+
clear?: boolean;
|
|
1453
|
+
/** Dismiss the soft keyboard after the action, if it is up. */
|
|
1454
|
+
hideKeyboard?: boolean;
|
|
1455
|
+
}
|
|
1456
|
+
interface PerformInputResult {
|
|
1457
|
+
/** Resolved start point in device pixels, when the action has one. */
|
|
1458
|
+
x?: number;
|
|
1459
|
+
y?: number;
|
|
1460
|
+
/** The element `target` resolved to. */
|
|
1461
|
+
target?: FlatLayoutNode;
|
|
1462
|
+
/** The soft keyboard was dismissed (to reach the target, or because it was asked to). */
|
|
1463
|
+
keyboardHidden: boolean;
|
|
1464
|
+
}
|
|
1465
|
+
/**
|
|
1466
|
+
* Perform a UI input action. Beyond the raw `uitest uiInput` primitives, this
|
|
1467
|
+
* resolves the start point from an element selector (`target`), 0–1 display
|
|
1468
|
+
* fractions, or pixels; clears text fields (Ctrl+A, Delete); and dismisses the
|
|
1469
|
+
* soft keyboard only when it is up.
|
|
1470
|
+
*/
|
|
1471
|
+
declare function performInput(opts: PerformInputOptions): Promise<PerformInputResult>;
|
|
1472
|
+
interface WaitForTargetOptions extends DeviceOptions {
|
|
1473
|
+
selector: LayoutSelector;
|
|
1474
|
+
/** Wait until no uncovered element matches, instead of until one does. */
|
|
1475
|
+
gone?: boolean;
|
|
1476
|
+
timeoutMs: number;
|
|
1477
|
+
/** Poll interval. Default 500 (each poll is a full layout dump). */
|
|
1478
|
+
pollMs?: number;
|
|
1479
|
+
abortSignal?: AbortSignal;
|
|
1480
|
+
}
|
|
1481
|
+
/**
|
|
1482
|
+
* Poll the layout until an uncovered element matches `selector` (resolving with
|
|
1483
|
+
* it), or with `gone`, until none does (resolving null). Keys on the soft
|
|
1484
|
+
* keyboard are ignored. Throws on timeout.
|
|
1485
|
+
*/
|
|
1486
|
+
declare function waitForTarget(opts: WaitForTargetOptions): Promise<FlatLayoutNode | null>;
|
|
1487
|
+
|
|
1170
1488
|
/**
|
|
1171
1489
|
* Read the project's bundle name from `AppScope/app.json5`.
|
|
1172
1490
|
*/
|
|
@@ -1185,8 +1503,10 @@ interface InstallAppOptions {
|
|
|
1185
1503
|
config: ConfigProvider;
|
|
1186
1504
|
projectDir: string;
|
|
1187
1505
|
/**
|
|
1188
|
-
* Explicit path (absolute, or relative to projectDir) to the
|
|
1189
|
-
*
|
|
1506
|
+
* Explicit path (absolute, or relative to projectDir) to the `.hap`. Falls back
|
|
1507
|
+
* to the `hapPath` config key, then to the well-known signed entry HAP, then to
|
|
1508
|
+
* the HAPs the build produced (signed first, else unsigned). A `*-signed.hap`
|
|
1509
|
+
* that does not exist falls back to its `*-unsigned.hap` sibling.
|
|
1190
1510
|
*/
|
|
1191
1511
|
hapPath?: string;
|
|
1192
1512
|
deviceSerial?: string;
|
|
@@ -1201,7 +1521,50 @@ interface InstallAppResult {
|
|
|
1201
1521
|
/** Combined stdout+stderr from the install, trimmed. */
|
|
1202
1522
|
output: string;
|
|
1203
1523
|
}
|
|
1524
|
+
/**
|
|
1525
|
+
* The bundle manager's rejection in `hdc install` output, or null when the
|
|
1526
|
+
* install went through. hdc exits 0 either way: success prints `msg:install
|
|
1527
|
+
* bundle successfully.`, a rejection `msg:error: failed to install bundle.`
|
|
1528
|
+
* with a `code:95xxxxx`. Pure/testable.
|
|
1529
|
+
*/
|
|
1530
|
+
declare function detectInstallFailure(output: string): string | null;
|
|
1531
|
+
/** The HAP an install is about to push, and how it was chosen. */
|
|
1532
|
+
interface InstallCandidate {
|
|
1533
|
+
path: string;
|
|
1534
|
+
/** True when no signed HAP was found and this unsigned one was taken instead. */
|
|
1535
|
+
fallback?: boolean;
|
|
1536
|
+
}
|
|
1537
|
+
/** Whether a HAP is an `*-unsigned.hap`, by its file name as hvigor writes it. */
|
|
1538
|
+
declare function isUnsignedHap(hapPath: string): boolean;
|
|
1539
|
+
/**
|
|
1540
|
+
* The bundle manager's reason from rejected `hdc install` output, e.g. `code
|
|
1541
|
+
* 9568320: no signature file`, else the output's first line. Pure/testable.
|
|
1542
|
+
*/
|
|
1543
|
+
declare function installFailureReason(output: string): string;
|
|
1544
|
+
/**
|
|
1545
|
+
* The message for a target that rejected an unsigned HAP: what was tried, the
|
|
1546
|
+
* bundle manager's reason, and, when the reason is the missing signature, how to
|
|
1547
|
+
* sign for the target. Pure/testable.
|
|
1548
|
+
*/
|
|
1549
|
+
declare function unsignedHapRejection(output: string, hap: InstallCandidate): string;
|
|
1550
|
+
/**
|
|
1551
|
+
* Throw when hdc or the bundle manager rejected an install: a typed
|
|
1552
|
+
* {@link CommandFailedError}, or, when the bundle manager turned down an unsigned
|
|
1553
|
+
* `hap`, an {@link OniroError} explaining {@link unsignedHapRejection why}.
|
|
1554
|
+
*/
|
|
1555
|
+
declare function ensureInstallOk(result: HdcExecResult, command: string, hap?: InstallCandidate): HdcExecResult;
|
|
1556
|
+
/**
|
|
1557
|
+
* An existing HAP at `hapPath`, or, when that is a `*-signed.hap` that does not
|
|
1558
|
+
* exist, its `*-unsigned.hap` sibling. Undefined when neither exists.
|
|
1559
|
+
*/
|
|
1560
|
+
declare function existingHapOrUnsigned(hapPath: string): InstallCandidate | undefined;
|
|
1204
1561
|
declare function installApp(opts: InstallAppOptions): Promise<InstallAppResult>;
|
|
1562
|
+
/**
|
|
1563
|
+
* Whether `bm dump -n <bundle>` finds the bundle on the device. A missing bundle
|
|
1564
|
+
* prints `error: failed to get information…`; an installed one, `<bundle>:` and
|
|
1565
|
+
* its JSON.
|
|
1566
|
+
*/
|
|
1567
|
+
declare function isBundleInstalled(opts: BundleOptions): Promise<boolean>;
|
|
1205
1568
|
interface LaunchAppOptions {
|
|
1206
1569
|
config: ConfigProvider;
|
|
1207
1570
|
/** Project mode: resolve bundle + main ability from the project. Required unless `bundleName` is given. */
|
|
@@ -1247,6 +1610,7 @@ interface RunningProcess {
|
|
|
1247
1610
|
declare function listRunningProcesses(config: ConfigProvider, options?: {
|
|
1248
1611
|
targetProcessName?: string;
|
|
1249
1612
|
timeoutMs?: number;
|
|
1613
|
+
deviceSerial?: string;
|
|
1250
1614
|
logger?: Logger;
|
|
1251
1615
|
}): Promise<RunningProcess[] | string>;
|
|
1252
1616
|
declare function findAppProcessId(config: ConfigProvider, projectDir: string, logger?: Logger): Promise<string>;
|
|
@@ -1290,6 +1654,7 @@ interface HilogEntry {
|
|
|
1290
1654
|
interface SetHilogLevelOptions {
|
|
1291
1655
|
config: ConfigProvider;
|
|
1292
1656
|
level: HilogLevel;
|
|
1657
|
+
deviceSerial?: string;
|
|
1293
1658
|
logger?: Logger;
|
|
1294
1659
|
}
|
|
1295
1660
|
/**
|
|
@@ -1304,7 +1669,7 @@ interface StreamHilogOptions {
|
|
|
1304
1669
|
processId?: string;
|
|
1305
1670
|
/** Filter by hilog domain, e.g. '0xD003900' (passed as `-D <domain>`). */
|
|
1306
1671
|
domain?: string | number;
|
|
1307
|
-
/** Address a specific device (`-t <serial>`)
|
|
1672
|
+
/** Address a specific device (`-t <serial>`); defaults to `ONIRO_DEVICE_SERIAL`. */
|
|
1308
1673
|
deviceSerial?: string;
|
|
1309
1674
|
}
|
|
1310
1675
|
/**
|
|
@@ -1356,6 +1721,38 @@ interface WatchLogOptions {
|
|
|
1356
1721
|
}
|
|
1357
1722
|
/** Collect all hilog entries matching `pattern` for `durationMs`. Deduped by default. */
|
|
1358
1723
|
declare function watchLog(opts: WatchLogOptions): Promise<HilogEntry[]>;
|
|
1724
|
+
interface CaptureLogOptions {
|
|
1725
|
+
config: ConfigProvider;
|
|
1726
|
+
/** File the hilog lines are appended to. */
|
|
1727
|
+
file: string;
|
|
1728
|
+
/** Stop after this long. Default: run until `abortSignal` fires. */
|
|
1729
|
+
durationMs?: number;
|
|
1730
|
+
/** Keep only the lines this matches. Default: every line. */
|
|
1731
|
+
pattern?: RegExp;
|
|
1732
|
+
/** Clear the device's log buffer first (`hilog -r`), so the file covers only this session. */
|
|
1733
|
+
clear?: boolean;
|
|
1734
|
+
domain?: string | number;
|
|
1735
|
+
deviceSerial?: string;
|
|
1736
|
+
abortSignal?: AbortSignal;
|
|
1737
|
+
logger?: Logger;
|
|
1738
|
+
}
|
|
1739
|
+
interface CaptureLogResult {
|
|
1740
|
+
file: string;
|
|
1741
|
+
/** Lines written to `file`. */
|
|
1742
|
+
lines: number;
|
|
1743
|
+
/** How many times the stream dropped and was respawned. */
|
|
1744
|
+
reconnects: number;
|
|
1745
|
+
}
|
|
1746
|
+
/**
|
|
1747
|
+
* Stream hilog into `file` until `durationMs` passes or `abortSignal` fires. The
|
|
1748
|
+
* device's log buffer is small (256 KB per type by default) and chatty components
|
|
1749
|
+
* such as ArkWeb wrap it within seconds, so a dump taken at the end of a session
|
|
1750
|
+
* loses its start; a capture running throughout does not. Each chunk is written
|
|
1751
|
+
* synchronously, so killing the process keeps what was captured. The stream is
|
|
1752
|
+
* respawned when it drops (a reboot, a lost connection). Resolves at the deadline
|
|
1753
|
+
* or on abort.
|
|
1754
|
+
*/
|
|
1755
|
+
declare function captureLog(opts: CaptureLogOptions): Promise<CaptureLogResult>;
|
|
1359
1756
|
interface DumpLogOptions {
|
|
1360
1757
|
config: ConfigProvider;
|
|
1361
1758
|
/** Cap the result to the last N lines (device-side `tail -n`). */
|
|
@@ -1438,9 +1835,23 @@ interface DiscoverHapsOptions {
|
|
|
1438
1835
|
* by build module name (parsed from the HAP filename). Skips `node_modules` /
|
|
1439
1836
|
* `oh_modules` / `.git`. Ported from the proven MCP `findHaps`, extended with
|
|
1440
1837
|
* per-module grouping so multi-module projects can install the right HAP.
|
|
1441
|
-
*
|
|
1838
|
+
* Each list is newest first, so a fresh build wins over HAPs committed to the
|
|
1839
|
+
* repository. Empty object when nothing is built.
|
|
1442
1840
|
*/
|
|
1443
1841
|
declare function discoverHaps(opts: DiscoverHapsOptions): Promise<Record<string, ModuleHaps>>;
|
|
1842
|
+
interface PickedHap {
|
|
1843
|
+
module: string;
|
|
1844
|
+
path: string;
|
|
1845
|
+
/** False for an `*-unsigned.hap`, which targets that verify signatures reject. */
|
|
1846
|
+
signed: boolean;
|
|
1847
|
+
}
|
|
1848
|
+
/**
|
|
1849
|
+
* The HAP to install from {@link discoverHaps} output: a module's newest signed
|
|
1850
|
+
* HAP, else its newest unsigned one. Without `module`, the single module that
|
|
1851
|
+
* has a signed HAP, else the single one that has any HAP. Null when nothing is
|
|
1852
|
+
* built; throws when several modules qualify and none was named.
|
|
1853
|
+
*/
|
|
1854
|
+
declare function pickHap(haps: Record<string, ModuleHaps>, module?: string): PickedHap | null;
|
|
1444
1855
|
|
|
1445
1856
|
interface RunOhpmOptions {
|
|
1446
1857
|
config: ConfigProvider;
|
|
@@ -1478,23 +1889,52 @@ declare function ensureOhModules(opts: {
|
|
|
1478
1889
|
interface CodelinterFinding {
|
|
1479
1890
|
file: string;
|
|
1480
1891
|
line: number;
|
|
1892
|
+
/** Column, when the report gives one. */
|
|
1893
|
+
column?: number;
|
|
1894
|
+
/** `error`, `warning`, `suggestion` or `info` (codelinter's `warn` reads as `warning`). */
|
|
1481
1895
|
severity: string;
|
|
1482
1896
|
/** Rule code/id when present in the output, else ''. */
|
|
1483
1897
|
code: string;
|
|
1484
1898
|
message: string;
|
|
1485
1899
|
}
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1900
|
+
/** codelinter's own totals, from its `-Defects: N; Errors: N; Warns: N; Suggestions: N;` line. */
|
|
1901
|
+
interface CodelinterSummary {
|
|
1902
|
+
defects: number;
|
|
1903
|
+
errors: number;
|
|
1904
|
+
warnings: number;
|
|
1905
|
+
suggestions: number;
|
|
1906
|
+
}
|
|
1907
|
+
interface CodelinterReport {
|
|
1489
1908
|
findings: CodelinterFinding[];
|
|
1490
|
-
/**
|
|
1909
|
+
/** The totals codelinter printed (all zero for "No defects found"), or null when it printed none. */
|
|
1910
|
+
summary: CodelinterSummary | null;
|
|
1911
|
+
/**
|
|
1912
|
+
* codelinter's remarks about the run itself rather than the code, e.g. "The type of
|
|
1913
|
+
* command line tools does not match that of the project".
|
|
1914
|
+
*/
|
|
1915
|
+
notices: string[];
|
|
1916
|
+
/** True when codelinter warned that the report may be incomplete. */
|
|
1917
|
+
incomplete: boolean;
|
|
1918
|
+
}
|
|
1919
|
+
interface CodelinterResult extends CodelinterReport {
|
|
1920
|
+
/** codelinter process exit code: 1 whenever it found any defect, warnings included. */
|
|
1921
|
+
code: number;
|
|
1922
|
+
/** Combined stdout+stderr, with colour codes and progress-bar redraws removed. */
|
|
1491
1923
|
raw: string;
|
|
1492
1924
|
}
|
|
1493
1925
|
/**
|
|
1494
|
-
*
|
|
1495
|
-
*
|
|
1496
|
-
* match are ignored. Exported as a pure function so it is unit-testable.
|
|
1926
|
+
* codelinter output as plain lines: colour codes stripped, and of each line redrawn
|
|
1927
|
+
* with `\r` (its progress bar) only the final state kept.
|
|
1497
1928
|
*/
|
|
1929
|
+
declare function cleanCodelinterOutput(output: string): string;
|
|
1930
|
+
/**
|
|
1931
|
+
* Parse a codelinter report. Pure/testable. Understands the table codelinter prints
|
|
1932
|
+
* (a `<file>(<count>)` header followed by `<line>:<col> <severity> <message> <rule>`
|
|
1933
|
+
* rows, then a `-Defects: …` summary) and the one-line
|
|
1934
|
+
* `<file>:<line>[:<col>]: <severity>: <message> [<rule>]` shape. Other lines are ignored.
|
|
1935
|
+
*/
|
|
1936
|
+
declare function parseCodelinterReport(output: string): CodelinterReport;
|
|
1937
|
+
/** The findings of a codelinter report; see {@link parseCodelinterReport}. */
|
|
1498
1938
|
declare function parseCodelinterFindings(output: string): CodelinterFinding[];
|
|
1499
1939
|
interface RunCodelinterOptions {
|
|
1500
1940
|
config: ConfigProvider;
|
|
@@ -1505,9 +1945,14 @@ interface RunCodelinterOptions {
|
|
|
1505
1945
|
abortSignal?: AbortSignal;
|
|
1506
1946
|
logger?: Logger;
|
|
1507
1947
|
}
|
|
1508
|
-
/** Run the OpenHarmony codelinter and return parsed
|
|
1948
|
+
/** Run the OpenHarmony codelinter and return the parsed report + the cleaned raw output. */
|
|
1509
1949
|
declare function runCodelinter(opts: RunCodelinterOptions): Promise<CodelinterResult>;
|
|
1510
1950
|
|
|
1951
|
+
/**
|
|
1952
|
+
* A hint for build output whose cause the compiler errors do not name, or
|
|
1953
|
+
* undefined. Pure/testable.
|
|
1954
|
+
*/
|
|
1955
|
+
declare function diagnoseBuildFailure(output: string): string | undefined;
|
|
1511
1956
|
interface BuildHapOptions {
|
|
1512
1957
|
config: ConfigProvider;
|
|
1513
1958
|
projectDir: string;
|
|
@@ -1630,6 +2075,7 @@ interface PrepareSigningOptions {
|
|
|
1630
2075
|
apl?: Apl;
|
|
1631
2076
|
appFeature?: AppFeature;
|
|
1632
2077
|
acls?: string[];
|
|
2078
|
+
appPrivilegeCapabilities?: string[];
|
|
1633
2079
|
passwords?: SigningPasswords;
|
|
1634
2080
|
logger?: Logger;
|
|
1635
2081
|
}
|
|
@@ -1676,10 +2122,20 @@ interface DeviceFullInfo {
|
|
|
1676
2122
|
model?: string;
|
|
1677
2123
|
manufacturer?: string;
|
|
1678
2124
|
brand?: string;
|
|
2125
|
+
/** `HarmonyOS` when the device reports a HarmonyOS distribution, else `OpenHarmony` (Oniro included). */
|
|
2126
|
+
osFamily?: 'HarmonyOS' | 'OpenHarmony';
|
|
2127
|
+
/** Distribution name (`const.product.os.dist.name`): `HarmonyOS`; unset on OpenHarmony. */
|
|
2128
|
+
osDistName?: string;
|
|
2129
|
+
/** Distribution version (`const.product.os.dist.version`), e.g. `6.1.0` on HarmonyOS. */
|
|
2130
|
+
osDistVersion?: string;
|
|
1679
2131
|
osFullName?: string;
|
|
1680
2132
|
osReleaseType?: string;
|
|
1681
2133
|
sdkApiVersion?: string;
|
|
1682
2134
|
buildVersion?: string;
|
|
2135
|
+
/** CPU ABIs (`const.product.cpu.abilist`), e.g. `arm64-v8a` or `x86_64`: native libraries must match. */
|
|
2136
|
+
abi?: string;
|
|
2137
|
+
/** `phone`, `tablet`, `wearable`, `default`, … */
|
|
2138
|
+
deviceType?: string;
|
|
1683
2139
|
display: {
|
|
1684
2140
|
width: number;
|
|
1685
2141
|
height: number;
|
|
@@ -1691,7 +2147,7 @@ interface GetDeviceInfoOptions {
|
|
|
1691
2147
|
timeoutMs?: number;
|
|
1692
2148
|
logger?: Logger;
|
|
1693
2149
|
}
|
|
1694
|
-
/** Collate device properties (`param get`
|
|
2150
|
+
/** Collate device properties (one `param get` round trip) and the display resolution. */
|
|
1695
2151
|
declare function getDeviceInfo(opts: GetDeviceInfoOptions): Promise<DeviceFullInfo>;
|
|
1696
2152
|
|
|
1697
2153
|
interface HapAssetDiff {
|
|
@@ -2069,4 +2525,4 @@ declare function harmonyOsAutoSign(opts: HarmonyOsAutoSignOptions): Promise<Harm
|
|
|
2069
2525
|
|
|
2070
2526
|
declare const VERSION: string;
|
|
2071
2527
|
|
|
2072
|
-
export { ALL_SDKS, APL_VALUES, APP_FEATURE_VALUES, type AbilityInfo, type AgcAuthInfo, AgcError, type Apl, type AppFeature, type ApplyChangesOptions, type ApplyChangesResult, type BuildHapOptions, type BuildHapResult, type BundleOptions, CancelledError, type CaptureBurstOptions, ChecksumMismatchError, CmdToolsNotInstalledError, type CmdToolsStatus, type CmdWrapper, type CodelinterFinding, type CodelinterResult, CommandFailedError, type ConfigKey, type ConfigProvider, type CreateScaffoldOptions, type CreateScaffoldResult, type DeveloperAgreementStatus, type DeviceFullInfo, type DeviceInfo, type DiscoverHapsOptions, type DisplaySize, type DisplaySizeOptions, type DownloadOptions, type DumpLayoutOptions, type DumpLayoutResult, type DumpLogOptions, type ExtractZipOptions, type GenerateSigningConfigsOptions, type GestureUitestOptions, type GetDeviceInfoOptions, HARMONYOS_SDK_VERSIONS, HUAWEI_SITES, type HapAssetDiff, type HarmonyOsAutoSignOptions, type HarmonyOsSdk, type HarmonyOsSession, type HarmonyOsSessionOptions, type HarmonyOsSigningResult, type HdcExecOptions, type HdcExecResult, type HdcShellOptions, type HidumperOptions, type HilogEntry, type HilogLevel, type HuaweiSite, type HuaweiSiteCode, type HuaweiTeam, type HuaweiUserInfo, INSTALL_TMP_DIRNAME, type InputType, type InstallAppOptions, type InstallAppResult, type InstallCmdToolsOptions, type InstallEmulatorOptions, type InstallMethod, type InstallSdkOptions, type InstallTempDir, type InstallTempDirOptions, InsufficientSpaceError, type LaunchAppOptions, type LayoutNode, type Logger, type ModuleHaps, OHOS_URL_BASE, type OniroContext, OniroError, type OsFolder, type OutputSink, type ParamOptions, type PrepareSigningOptions, type PrepareSigningResult, type ProgressReporter, type ProgressUpdate, type ProjectModule, type Prompter, type ProvisionProfileInfo, type RawLayoutNode, type RawTouchEvent, type RebootDecision, type RebootOptions, type RecvFileOptions, type RunCodelinterOptions, type RunHvigorwOptions, type RunHvigorwResult, type RunOhpmOptions, type RunProcessOptions, type RunningProcess, type RuntimeOs, SIGNING_ERRORS, type ScreenDump, type Screenshot, type ScreenshotOptions, type SdkArchiveInfo, type SdkInfo, SdkNotInstalledError, type SdkRelease, type SendFileOptions, type SendGestureOptions, type SendInputOptions, type SendRawTouchOptions, type SetHilogLevelOptions, type SigningKind, type SigningMaterialPaths, type SigningPasswords, type StartEmulatorOptions, type StoredSession, type StreamHilogOptions, TMP_DIR_HINT, type TemplateOption, type TokenStore, UnsupportedPlatformError, VERSION, type WaitForBootOptions, type WaitForBundleOptions, type WaitForConditionOptions, type WaitForLogOptions, type WatchLogOptions, type Waypoint, applyChanges, attemptHdcConnection, buildCmdWrapper, buildGestureCommands, buildGestureUitestCommand, buildHap, buildHvigorwArgs, buildInputCommand, buildRawTouchCommand, captureBurst, consoleLogger, createHarmonyOsSession, createInstallTempDir, createMaterial, createScaffold, createTempWorkDir, createTokenStore, decideInstallMethod, decideReboot, decryptPwd, dedupEntries, defaultContext, defaultPaths, detectAaStartFailure, detectProjectSdkVersion, detectRuntimeOs, detectSigningConfigNames, diffEntryNames, diffHapAssets, discoverHaps, downloadAndInstallSdk, downloadFile, dumpLayout, dumpLog, dumpRenderService, dumpScreen, dumpWindow, encryptPwd, ensureFreeSpace, ensureOhModules, ensureOk, ensureRemoteOk, escapeCmdArgument, escapeCmdCommand, extractTarball, extractZipWithProgress, findAppProcessId, findCmdToolsSourceDir, findHarmonyOsSdk, findRunningProcess, forceStop, formatBytes, generateSigningConfigs, getBundleName, getCmdToolsBin, getCmdToolsDownloadUrl, getCmdToolsPath, getCmdToolsStatus, getDeviceInfo, getDisplaySize, getEmulatorDir, getFreeSpaceBytes, getHdcPath, getHvigorwPath, getInstalledSdks, getKey, getMainAbility, getOhosBaseSdkHome, getOhpmPath, getOsFolder, getSdkFilename, getSdkRootDir, getSupportedSdksForUi, harmonyOsAutoSign, harmonyOsSdkLabelForApi, hdcExec, installApp, installCmdTools, installEmulator, isCmdToolsInstalled, isEmulatorInstalled, isOutOfSpaceError, isRamBackedPath, isValidBundleName, isValidProjectName, killProcessTree, launchApp, listAbilities, listDevices, listModules, listRunningProcesses, listTemplates, needsCmdWrapper, nonInteractivePrompter, noopLogger, noopProgress, paramGet, paramSet, parseBounds, parseCodelinterFindings, parseDeviceList, parseHilogLine, parseMainAbilityFromBmDump, parseRemoteExit, pickSigningKind, prepareSigning, pruneLayout, readJson5File, readJsonFile, readProvisionProfile, reboot, recvFile, removeCmdTools, removeEmulator, removeSdk, removeTempWorkDir, requireHarmonyOsSdk, resolveTmpRoot, runCodelinter, runHvigorw, runOhpm, runProcess, scopedLogger, selectDevice, sendFile, sendGesture, sendInput, sendRawTouch, setHilogLevel, shell, shellChecked, spawnCompat, startEmulator, staticConfig, stopEmulator, streamHilog, takeScreenshot, toLongPath, toSpaceError, uninstallApp, validateTemplateLayout, verifySha256, waitForBoot, waitForBundle, waitForCondition, waitForLog, watchLog, waypointsToRawEvents, writeJson5File, writeJsonFile };
|
|
2528
|
+
export { ALL_SDKS, APL_VALUES, APP_FEATURE_VALUES, type AbilityInfo, type AgcAuthInfo, AgcError, type Apl, type AppFeature, type ApplyChangesOptions, type ApplyChangesResult, type BuildHapOptions, type BuildHapResult, type BundleOptions, CancelledError, type CaptureBurstOptions, type CaptureLogOptions, type CaptureLogResult, ChecksumMismatchError, type CmdToolsFlavour, CmdToolsNotInstalledError, type CmdToolsStatus, type CmdWrapper, type CodelinterFinding, type CodelinterReport, type CodelinterResult, type CodelinterSummary, CommandFailedError, type ConfigKey, type ConfigProvider, type CreateScaffoldOptions, type CreateScaffoldResult, type DeveloperAgreementStatus, type DeviceFullInfo, type DeviceInfo, type DiscoverHapsOptions, type DisplaySize, type DisplaySizeOptions, type DownloadOptions, type DumpLayoutOptions, type DumpLayoutResult, type DumpLogOptions, type EmulatorStatus, type ExtractZipOptions, type FlatLayoutNode, type GenerateSigningConfigsOptions, type GestureUitestOptions, type GetDeviceInfoOptions, HARMONYOS_SDK_VERSIONS, HUAWEI_SITES, type HapAssetDiff, type HarmonyOsAutoSignOptions, type HarmonyOsSdk, type HarmonyOsSession, type HarmonyOsSessionOptions, type HarmonyOsSigningResult, type HdcExecOptions, type HdcExecResult, type HdcShellOptions, type HidumperOptions, type HilogEntry, type HilogLevel, type HuaweiSite, type HuaweiSiteCode, type HuaweiTeam, type HuaweiUserInfo, INSTALL_TMP_DIRNAME, type InputType, type InstallAppOptions, type InstallAppResult, type InstallCandidate, type InstallCmdToolsOptions, type InstallEmulatorOptions, type InstallMethod, type InstallSdkOptions, type InstallTempDir, type InstallTempDirOptions, InsufficientSpaceError, type KeyboardState, type LaunchAppOptions, type LayoutNode, type LayoutSelector, type LocateTargetOptions, type LocatedTarget, type Logger, type ModuleHaps, OHOS_URL_BASE, type OniroContext, OniroError, type OsFolder, type OutputSink, type ParamOptions, type PerformInputOptions, type PerformInputResult, type PickTargetFailure, type PickedHap, type PrepareSigningOptions, type PrepareSigningResult, type ProgressReporter, type ProgressUpdate, type ProjectModule, type Prompter, type ProvisionProfileInfo, type RawLayoutNode, type RawTouchEvent, type RebootDecision, type RebootOptions, type RecvFileOptions, type RunCodelinterOptions, type RunHvigorwOptions, type RunHvigorwResult, type RunOhpmOptions, type RunProcessOptions, type RunningProcess, type RuntimeOs, SIGNING_ERRORS, type ScreenDump, type Screenshot, type ScreenshotOptions, type SdkArchiveInfo, type SdkInfo, SdkNotInstalledError, type SdkRelease, type SendFileOptions, type SendGestureOptions, type SendInputOptions, type SendRawTouchOptions, type SetHilogLevelOptions, type SigningKind, type SigningMaterialPaths, type SigningPasswords, type StartEmulatorOptions, type StoredSession, type StreamHilogOptions, TMP_DIR_HINT, TargetNotFoundError, type TemplateOption, type TokenStore, type UiInputType, UnsupportedPlatformError, VERSION, type WaitForBootOptions, type WaitForBundleOptions, type WaitForConditionOptions, type WaitForLogOptions, type WaitForTargetOptions, type WatchLogOptions, type Waypoint, appSandboxDir, applyChanges, assertDevicePath, assertLayoutSelector, attemptHdcConnection, buildCmdWrapper, buildGestureCommands, buildGestureUitestCommand, buildHap, buildHvigorwArgs, buildInputCommand, buildRawTouchCommand, captureBurst, captureLog, cleanCodelinterOutput, consoleLogger, createHarmonyOsSession, createInstallTempDir, createMaterial, createScaffold, createTempWorkDir, createTokenStore, decideInstallMethod, decideReboot, decryptPwd, dedupEntries, defaultContext, defaultPaths, describeLayoutNode, detectAaStartFailure, detectCmdToolsFlavour, detectInstallFailure, detectProjectSdkVersion, detectRuntimeOs, detectSigningConfigNames, diagnoseBuildFailure, diffEntryNames, diffHapAssets, discoverHaps, downloadAndInstallSdk, downloadFile, dumpLayout, dumpLog, dumpRenderService, dumpScreen, dumpWindow, encryptPwd, ensureFreeSpace, ensureInstallOk, ensureOhModules, ensureOk, ensureRemoteOk, escapeCmdArgument, escapeCmdCommand, existingHapOrUnsigned, extractTarball, extractZipWithProgress, findAppProcessId, findCmdToolsSourceDir, findCoveredNodes, findHarmonyOsSdk, findKeyboardWindow, findLayoutNodes, findMissingProjectSdk, findRunningProcess, flattenLayout, forceStop, formatBytes, generateSigningConfigs, getBundleName, getCmdToolsBin, getCmdToolsDownloadUrl, getCmdToolsPath, getCmdToolsStatus, getDeviceInfo, getDisplaySize, getEmulatorDir, getEmulatorStatus, getFreeSpaceBytes, getHdcPath, getHvigorwPath, getImeBundles, getInstalledSdks, getKey, getMainAbility, getOhosBaseSdkHome, getOhpmPath, getOsFolder, getSdkFilename, getSdkRootDir, getSupportedSdksForUi, harmonyOsAutoSign, harmonyOsSdkLabelForApi, hdcClientFailure, hdcExec, hdcTargetArgs, hdcTargetArgsFor, hideKeyboard, installApp, installCmdTools, installEmulator, installFailureReason, isBundleInstalled, isCmdToolsInstalled, isEmulatorInstalled, isOutOfSpaceError, isRamBackedPath, isUnsignedHap, isValidBundleName, isValidProjectName, killProcessTree, launchApp, listAbilities, listDevices, listModules, listRunningProcesses, listTemplates, locateTarget, needsCmdWrapper, nonInteractivePrompter, noopLogger, noopProgress, normaliseLocalPath, paramGet, paramGetMany, paramSet, parseBounds, parseCodelinterFindings, parseCodelinterReport, parseDeviceList, parseHilogLine, parseImeBundles, parseMainAbilityFromBmDump, parseParamValues, parseRemoteExit, performInput, pickHap, pickSigningKind, pickTarget, prepareSigning, pruneLayout, readJson5File, readJsonFile, readProvisionProfile, reboot, recvFile, removeCmdTools, removeEmulator, removeSdk, removeTempWorkDir, requireHarmonyOsSdk, resolveDeviceSerial, resolveKeyEvent, resolveTmpRoot, runCodelinter, runHvigorw, runOhpm, runProcess, scopedLogger, selectDevice, sendFile, sendGesture, sendInput, sendRawTouch, setHilogLevel, shell, shellChecked, spawnCompat, startEmulator, staticConfig, stopEmulator, streamHilog, takeScreenshot, toLongPath, toSpaceError, uninstallApp, unsignedHapRejection, validateTemplateLayout, verifySha256, waitForBoot, waitForBundle, waitForCondition, waitForLog, waitForTarget, watchLog, waypointsToRawEvents, withoutWindow, writeJson5File, writeJsonFile };
|