@aiot-toolkit/emulator 2.0.6-beta.2 → 2.0.6-beta.4

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.
@@ -1,27 +1,35 @@
1
1
  import { Readable } from 'stream';
2
- import { MouseEvent } from './types/MouseEvent';
3
- import { GrpcKeyboardEvent } from './types/KeyEvent';
4
2
  import { GrpcClient } from './types/GrpcClient';
5
3
  import { EmulatorConfig } from '../../emulatorutil/running';
6
4
  import { Metadata } from '@grpc/grpc-js';
7
- export default class GrpcEmulator {
5
+ import { ImageFormat, KeyboardEvent, LogMessage, MouseEvent, SensorValue } from './types/proto-types';
6
+ import { UiControllerClient } from './types/UiControllerClient';
7
+ export declare const AuthorizationKey = "Authorization";
8
+ export declare class GrpcEmulator {
8
9
  eConf: EmulatorConfig;
9
- protoPath: string;
10
+ protoPath: string[];
11
+ ip: string;
10
12
  client: GrpcClient;
13
+ uiClient: UiControllerClient;
11
14
  connected: boolean;
12
15
  token: string;
13
16
  authMate: Metadata;
14
- deadline: Date;
15
17
  controller: any;
16
18
  screenshotStream?: Readable;
17
- constructor(eConf: EmulatorConfig, protoPath: string);
19
+ logcatStream?: Readable;
20
+ constructor(eConf: EmulatorConfig, protoPath: string[], ip?: string);
18
21
  close(): void;
19
22
  getAuthMeta(): Metadata;
20
23
  waitForReady(): Promise<boolean>;
21
- startStream(onStreamScreenshot: (buffer: Buffer) => void): Promise<void>;
24
+ streamScreenshot(imageFormat?: ImageFormat): Promise<Readable>;
22
25
  getScreenshot(): Promise<Buffer>;
23
26
  getStatus(): Promise<unknown>;
24
27
  sendMouse(message: MouseEvent): void;
25
- sendKey(data: GrpcKeyboardEvent): void;
28
+ sendKey(data: KeyboardEvent): void;
29
+ showExtendedControls(paneIndex?: number): Promise<unknown>;
30
+ closeExtendedControls(): Promise<unknown>;
31
+ setSensor(sensorValue: SensorValue): Promise<unknown>;
32
+ getSensor(sensorValue: SensorValue): Promise<unknown>;
33
+ streamLogcat(params?: LogMessage): Promise<Readable>;
26
34
  }
27
35
  export declare function createGrpcClient(eConf: EmulatorConfig): GrpcEmulator;
@@ -3,18 +3,22 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
+ exports.GrpcEmulator = exports.AuthorizationKey = void 0;
6
7
  exports.createGrpcClient = createGrpcClient;
7
- exports.default = void 0;
8
8
  var _path = _interopRequireDefault(require("path"));
9
9
  var _protoLoader = require("@grpc/proto-loader");
10
10
  var _grpcError = require("./grpcError");
11
11
  var _grpcJs = require("@grpc/grpc-js");
12
+ var _protoTypes = require("./types/proto-types");
12
13
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
14
+ const AuthorizationKey = exports.AuthorizationKey = 'Authorization';
13
15
  class GrpcEmulator {
14
16
  connected = false;
15
17
  constructor(eConf, protoPath) {
18
+ let ip = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '127.0.0.1';
16
19
  this.eConf = eConf;
17
20
  this.protoPath = protoPath;
21
+ this.ip = ip;
18
22
  this.token = eConf['grpc.token'];
19
23
  const packageDefinition = (0, _protoLoader.loadSync)(this.protoPath, {
20
24
  keepCase: true,
@@ -23,29 +27,35 @@ class GrpcEmulator {
23
27
  defaults: true,
24
28
  oneofs: true
25
29
  });
26
- this.deadline = new Date();
27
- this.deadline.setMinutes(this.deadline.getMinutes() + 2);
28
30
  this.controller = (0, _grpcJs.loadPackageDefinition)(packageDefinition).android.emulation.control;
29
31
  const mateInfo = new _grpcJs.Metadata();
30
- mateInfo.set('Authorization', `Bearer ${this.token}`);
32
+ mateInfo.set(AuthorizationKey, `Bearer ${this.token}`);
31
33
  this.authMate = mateInfo;
32
- this.client = new this.controller.EmulatorController(`127.0.0.1:${eConf['grpc.port']}`, _grpcJs.credentials.createInsecure());
34
+ this.client = new this.controller.EmulatorController(`${this.ip}:${eConf['grpc.port']}`, _grpcJs.credentials.createInsecure(), {
35
+ 'grpc.max_receive_message_length': 32 * 1024 * 1024,
36
+ // 32MB
37
+ 'grpc.max_send_message_length': 32 * 1024 * 1024 // 32MB
38
+ });
39
+ this.uiClient = new this.controller.UiController(`127.0.0.1:${eConf['grpc.port']}`, _grpcJs.credentials.createInsecure());
33
40
  }
34
41
  close() {
42
+ this.screenshotStream?.destroy();
43
+ this.logcatStream?.destroy();
44
+ this.client.getChannel().close();
35
45
  this.client.close();
36
46
  }
37
47
  getAuthMeta() {
38
- const token = this.eConf['grpc.token'];
39
- const mateInfo = new _grpcJs.Metadata();
40
- mateInfo.set('Authorization', `Bearer ${token}`);
41
- return mateInfo;
48
+ return this.authMate;
42
49
  }
43
50
  waitForReady() {
44
51
  if (this.connected) {
45
52
  return Promise.resolve(true);
46
53
  }
54
+ const deadline = new Date();
55
+ deadline.setMinutes(deadline.getMinutes() + 2); // 2 minutes timeout
56
+
47
57
  return new Promise((resolve, reject) => {
48
- this.client.waitForReady(this.deadline, err => {
58
+ this.client.waitForReady(deadline, err => {
49
59
  if (err) {
50
60
  this.connected = false;
51
61
  console.error(err);
@@ -56,18 +66,21 @@ class GrpcEmulator {
56
66
  });
57
67
  });
58
68
  }
59
- async startStream(onStreamScreenshot) {
69
+ async streamScreenshot(imageFormat) {
60
70
  await this.waitForReady();
61
71
  if (this.screenshotStream) {
62
72
  this.screenshotStream.destroy();
63
73
  }
64
- this.screenshotStream = this.client.streamScreenshot(this.controller.Image, this.authMate);
65
- this.screenshotStream.on('data', response => {
66
- onStreamScreenshot(response.image);
67
- });
68
- this.screenshotStream.on('error', err => {
69
- console.error(err.message);
74
+ const params = imageFormat || {
75
+ format: _protoTypes.ImageFormatType.PNG
76
+ };
77
+ this.screenshotStream = this.client.streamScreenshot(params, this.authMate);
78
+ // don't delete it, otherwise crash process when emulator exit
79
+ this.screenshotStream.on('error', () => {
80
+ // TODO: not care at now
81
+ // console.error('streamScreenshot error:', err)
70
82
  });
83
+ return this.screenshotStream;
71
84
  }
72
85
  getScreenshot() {
73
86
  return new Promise((resolve, reject) => {
@@ -109,9 +122,60 @@ class GrpcEmulator {
109
122
  if (err) console.error(err);
110
123
  });
111
124
  }
125
+ showExtendedControls() {
126
+ let paneIndex = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
127
+ if (!this.uiClient) return Promise.reject('UiController not available');
128
+ return new Promise((resolve, reject) => {
129
+ this.uiClient.showExtendedControls({
130
+ index: paneIndex
131
+ }, this.authMate, (err, response) => {
132
+ if (err) return reject(err);
133
+ resolve(response);
134
+ });
135
+ });
136
+ }
137
+ closeExtendedControls() {
138
+ if (!this.uiClient) return Promise.reject('UiController not available');
139
+ return new Promise((resolve, reject) => {
140
+ this.uiClient.closeExtendedControls({}, this.authMate, (err, response) => {
141
+ if (err) return reject(err);
142
+ resolve(response);
143
+ });
144
+ });
145
+ }
146
+ setSensor(sensorValue) {
147
+ if (!this.client) return Promise.reject('grpc client not available');
148
+ return new Promise((resolve, reject) => {
149
+ this.client.setSensor(sensorValue, this.authMate, (err, response) => {
150
+ if (err) return reject(err);
151
+ resolve(response);
152
+ });
153
+ });
154
+ }
155
+ getSensor(sensorValue) {
156
+ if (!this.client) return Promise.reject('grpc client not available');
157
+ return new Promise((resolve, reject) => {
158
+ this.client.getSensor(sensorValue, this.authMate, (err, response) => {
159
+ if (err) return reject(err);
160
+ resolve(response);
161
+ });
162
+ });
163
+ }
164
+ async streamLogcat(params) {
165
+ await this.waitForReady();
166
+ if (this.logcatStream) {
167
+ this.logcatStream.destroy();
168
+ }
169
+ const logMessage = params || {};
170
+ this.logcatStream = this.client.streamLogcat(logMessage, this.authMate);
171
+ this.logcatStream.on('error', err => {
172
+ console.error('streamLogcat error:', err?.message || err);
173
+ });
174
+ return this.logcatStream;
175
+ }
112
176
  }
113
- exports.default = GrpcEmulator;
177
+ exports.GrpcEmulator = GrpcEmulator;
114
178
  function createGrpcClient(eConf) {
115
- const protoPath = _path.default.join(__dirname, '../../static/proto/emulator_controller.proto');
179
+ const protoPath = [_path.default.resolve(__dirname, '../../static/proto/emulator_controller.proto'), _path.default.resolve(__dirname, '../../static/proto/ui_controller_service.proto')];
116
180
  return new GrpcEmulator(eConf, protoPath);
117
181
  }
@@ -1,4 +1,45 @@
1
- import { Client } from '@grpc/grpc-js';
1
+ import { Client, Metadata, ServiceError, ClientUnaryCall } from '@grpc/grpc-js';
2
+ import type { PhysicalModelValue, ClipData, BatteryState, GpsState, Fingerprint, TouchEvent, PhoneCall, PhoneResponse, SmsMessage, PhoneNumber, EmulatorStatus, ImageFormat, Image, AudioFormat, LogMessage, VmRunState, DisplayConfigurations, BrightnessValue, DisplayMode, RotationRadian, Velocity, Posture, SensorValue, KeyboardEvent, MouseEvent } from './proto-types';
2
3
  export interface GrpcClient extends Client {
3
- [i: string]: any;
4
+ setSensor(request: SensorValue, metadata: Metadata, callback: (error: ServiceError | null, response: {}) => void): ClientUnaryCall;
5
+ getSensor(request: SensorValue, metadata: Metadata, callback: (error: ServiceError | null, response: SensorValue) => void): ClientUnaryCall;
6
+ streamSensor(request: SensorValue, metadata: Metadata): NodeJS.ReadStream;
7
+ setPhysicalModel(request: PhysicalModelValue, metadata: Metadata, callback: (error: ServiceError | null, response: {}) => void): ClientUnaryCall;
8
+ getPhysicalModel(request: PhysicalModelValue, metadata: Metadata, callback: (error: ServiceError | null, response: PhysicalModelValue) => void): ClientUnaryCall;
9
+ streamPhysicalModel(request: PhysicalModelValue, metadata: Metadata): NodeJS.ReadStream;
10
+ setClipboard(request: ClipData, metadata: Metadata, callback: (error: ServiceError | null, response: {}) => void): ClientUnaryCall;
11
+ getClipboard(request: {}, metadata: Metadata, callback: (error: ServiceError | null, response: ClipData) => void): ClientUnaryCall;
12
+ streamClipboard(request: {}, metadata: Metadata): NodeJS.ReadStream;
13
+ setBattery(request: BatteryState, metadata: Metadata, callback: (error: ServiceError | null, response: {}) => void): ClientUnaryCall;
14
+ getBattery(request: {}, metadata: Metadata, callback: (error: ServiceError | null, response: BatteryState) => void): ClientUnaryCall;
15
+ setGps(request: GpsState, metadata: Metadata, callback: (error: ServiceError | null, response: {}) => void): ClientUnaryCall;
16
+ getGps(request: {}, metadata: Metadata, callback: (error: ServiceError | null, response: GpsState) => void): ClientUnaryCall;
17
+ sendFingerprint(request: Fingerprint, metadata: Metadata, callback: (error: ServiceError | null, response: {}) => void): ClientUnaryCall;
18
+ sendKey(request: KeyboardEvent, metadata: Metadata, callback: (error: ServiceError | null, response: {}) => void): ClientUnaryCall;
19
+ sendTouch(request: TouchEvent, metadata: Metadata, callback: (error: ServiceError | null, response: {}) => void): ClientUnaryCall;
20
+ sendMouse(request: MouseEvent, metadata: Metadata, callback: (error: ServiceError | null, response: {}) => void): ClientUnaryCall;
21
+ injectWheel(metadata: Metadata): NodeJS.WritableStream;
22
+ streamInputEvent(metadata: Metadata): NodeJS.WritableStream;
23
+ sendPhone(request: PhoneCall, metadata: Metadata, callback: (error: ServiceError | null, response: PhoneResponse) => void): ClientUnaryCall;
24
+ sendSms(request: SmsMessage, metadata: Metadata, callback: (error: ServiceError | null, response: PhoneResponse) => void): ClientUnaryCall;
25
+ setPhoneNumber(request: PhoneNumber, metadata: Metadata, callback: (error: ServiceError | null, response: PhoneResponse) => void): ClientUnaryCall;
26
+ getStatus(request: {}, metadata: Metadata, callback: (error: ServiceError | null, response: EmulatorStatus) => void): ClientUnaryCall;
27
+ getScreenshot(request: ImageFormat, metadata: Metadata, callback: (error: ServiceError | null, response: Image) => void): ClientUnaryCall;
28
+ streamScreenshot(request: ImageFormat, metadata: Metadata): NodeJS.ReadStream;
29
+ streamAudio(request: AudioFormat, metadata: Metadata): NodeJS.ReadStream;
30
+ injectAudio(metadata: Metadata): NodeJS.WritableStream;
31
+ getLogcat(request: LogMessage, metadata: Metadata, callback: (error: ServiceError | null, response: LogMessage) => void): ClientUnaryCall;
32
+ streamLogcat(request: LogMessage, metadata: Metadata): NodeJS.ReadStream;
33
+ setVmState(request: VmRunState, metadata: Metadata, callback: (error: ServiceError | null, response: {}) => void): ClientUnaryCall;
34
+ getVmState(request: {}, metadata: Metadata, callback: (error: ServiceError | null, response: VmRunState) => void): ClientUnaryCall;
35
+ setDisplayConfigurations(request: DisplayConfigurations, metadata: Metadata, callback: (error: ServiceError | null, response: DisplayConfigurations) => void): ClientUnaryCall;
36
+ getDisplayConfigurations(request: {}, metadata: Metadata, callback: (error: ServiceError | null, response: DisplayConfigurations) => void): ClientUnaryCall;
37
+ streamNotification(request: {}, metadata: Metadata): NodeJS.ReadStream;
38
+ getBrightness(request: BrightnessValue, metadata: Metadata, callback: (error: ServiceError | null, response: BrightnessValue) => void): ClientUnaryCall;
39
+ setBrightness(request: BrightnessValue, metadata: Metadata, callback: (error: ServiceError | null, response: {}) => void): ClientUnaryCall;
40
+ getDisplayMode(request: {}, metadata: Metadata, callback: (error: ServiceError | null, response: DisplayMode) => void): ClientUnaryCall;
41
+ setDisplayMode(request: DisplayMode, metadata: Metadata, callback: (error: ServiceError | null, response: {}) => void): ClientUnaryCall;
42
+ rotateVirtualSceneCamera(request: RotationRadian, metadata: Metadata, callback: (error: ServiceError | null, response: {}) => void): ClientUnaryCall;
43
+ setVirtualSceneCameraVelocity(request: Velocity, metadata: Metadata, callback: (error: ServiceError | null, response: {}) => void): ClientUnaryCall;
44
+ setPosture(request: Posture, metadata: Metadata, callback: (error: ServiceError | null, response: {}) => void): ClientUnaryCall;
4
45
  }
@@ -0,0 +1,23 @@
1
+ import { Metadata, ServiceError, ClientUnaryCall } from '@grpc/grpc-js';
2
+ export interface PaneEntry {
3
+ index: number;
4
+ }
5
+ export interface ThemingStyle {
6
+ style: number;
7
+ }
8
+ export interface ExtendedControlsStatus {
9
+ visibilityChanged: boolean;
10
+ }
11
+ export interface UserConfigEntry {
12
+ key: string;
13
+ value: string;
14
+ }
15
+ export interface UserConfig {
16
+ entries: UserConfigEntry[];
17
+ }
18
+ export interface UiControllerClient {
19
+ showExtendedControls(request: PaneEntry, metadata: Metadata, callback: (error: ServiceError | null, response: ExtendedControlsStatus) => void): ClientUnaryCall;
20
+ closeExtendedControls(request: {}, metadata: Metadata, callback: (error: ServiceError | null, response: ExtendedControlsStatus) => void): ClientUnaryCall;
21
+ setUiTheme(request: ThemingStyle, metadata: Metadata, callback: (error: ServiceError | null, response: {}) => void): ClientUnaryCall;
22
+ getUserConfig(request: {}, metadata: Metadata, callback: (error: ServiceError | null, response: UserConfig) => void): ClientUnaryCall;
23
+ }
@@ -0,0 +1,3 @@
1
+ export * from './GrpcClient';
2
+ export * from './proto-types';
3
+ export * from './UiControllerClient';
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var _GrpcClient = require("./GrpcClient");
7
+ Object.keys(_GrpcClient).forEach(function (key) {
8
+ if (key === "default" || key === "__esModule") return;
9
+ if (key in exports && exports[key] === _GrpcClient[key]) return;
10
+ Object.defineProperty(exports, key, {
11
+ enumerable: true,
12
+ get: function () {
13
+ return _GrpcClient[key];
14
+ }
15
+ });
16
+ });
17
+ var _protoTypes = require("./proto-types");
18
+ Object.keys(_protoTypes).forEach(function (key) {
19
+ if (key === "default" || key === "__esModule") return;
20
+ if (key in exports && exports[key] === _protoTypes[key]) return;
21
+ Object.defineProperty(exports, key, {
22
+ enumerable: true,
23
+ get: function () {
24
+ return _protoTypes[key];
25
+ }
26
+ });
27
+ });
28
+ var _UiControllerClient = require("./UiControllerClient");
29
+ Object.keys(_UiControllerClient).forEach(function (key) {
30
+ if (key === "default" || key === "__esModule") return;
31
+ if (key in exports && exports[key] === _UiControllerClient[key]) return;
32
+ Object.defineProperty(exports, key, {
33
+ enumerable: true,
34
+ get: function () {
35
+ return _UiControllerClient[key];
36
+ }
37
+ });
38
+ });
@@ -0,0 +1,178 @@
1
+ export interface PhysicalModelValue {
2
+ target: number;
3
+ status?: number;
4
+ value?: {
5
+ data: number[];
6
+ };
7
+ }
8
+ export interface ClipData {
9
+ text: string;
10
+ }
11
+ export interface BatteryState {
12
+ hasBattery: boolean;
13
+ isPresent: boolean;
14
+ charger: number;
15
+ chargeLevel: number;
16
+ health: number;
17
+ status: number;
18
+ }
19
+ export interface GpsState {
20
+ passiveUpdate: boolean;
21
+ latitude: number;
22
+ longitude: number;
23
+ speed?: number;
24
+ bearing?: number;
25
+ altitude?: number;
26
+ satellites?: number;
27
+ }
28
+ export interface Fingerprint {
29
+ isTouching: boolean;
30
+ touchId: number;
31
+ }
32
+ export interface TouchEvent {
33
+ touches: Array<{
34
+ x: number;
35
+ y: number;
36
+ identifier: number;
37
+ pressure: number;
38
+ touch_major?: number;
39
+ touch_minor?: number;
40
+ expiration?: number;
41
+ }>;
42
+ display?: number;
43
+ }
44
+ export interface PhoneCall {
45
+ operation: number;
46
+ number: string;
47
+ }
48
+ export interface PhoneResponse {
49
+ response: number;
50
+ }
51
+ export interface SmsMessage {
52
+ srcAddress: string;
53
+ text: string;
54
+ }
55
+ export interface PhoneNumber {
56
+ number: string;
57
+ }
58
+ export interface EmulatorStatus {
59
+ version: string;
60
+ uptime: number;
61
+ booted: boolean;
62
+ vmConfig: any;
63
+ hardwareConfig: Record<string, any>;
64
+ }
65
+ export interface ImageFormat {
66
+ format: number;
67
+ rotation?: any;
68
+ width?: number;
69
+ height?: number;
70
+ display?: number;
71
+ transport?: any;
72
+ }
73
+ export interface Image {
74
+ format: ImageFormat;
75
+ image: Buffer;
76
+ seq?: number;
77
+ timestampUs?: number;
78
+ }
79
+ export interface AudioFormat {
80
+ samplingRate: number;
81
+ channels: number;
82
+ format: number;
83
+ mode?: number;
84
+ }
85
+ export interface LogMessage {
86
+ contents?: string;
87
+ start?: number;
88
+ next?: number;
89
+ sort?: number;
90
+ entries?: any[];
91
+ }
92
+ export interface VmRunState {
93
+ state: number;
94
+ }
95
+ export interface DisplayConfigurations {
96
+ displays: any[];
97
+ userConfigurable: number;
98
+ maxDisplays: number;
99
+ }
100
+ export interface BrightnessValue {
101
+ target: number;
102
+ value: number;
103
+ }
104
+ export interface DisplayMode {
105
+ value: number;
106
+ }
107
+ export interface RotationRadian {
108
+ x: number;
109
+ y: number;
110
+ z: number;
111
+ }
112
+ export interface Velocity {
113
+ x: number;
114
+ y: number;
115
+ z: number;
116
+ }
117
+ export interface Posture {
118
+ value: number;
119
+ }
120
+ export interface SensorValue {
121
+ target: number;
122
+ status?: number;
123
+ value?: {
124
+ data: number[];
125
+ };
126
+ }
127
+ export interface KeyboardEvent {
128
+ codeType?: number;
129
+ eventType?: number;
130
+ keyCode?: number | string;
131
+ key?: string;
132
+ text?: string;
133
+ }
134
+ export interface MouseEvent {
135
+ x?: number;
136
+ y?: number;
137
+ buttons?: number;
138
+ display?: number;
139
+ }
140
+ export declare enum SensorType {
141
+ ACCELERATION = 0,
142
+ GYROSCOPE = 1,
143
+ MAGNETIC_FIELD = 2,
144
+ ORIENTATION = 3,
145
+ TEMPERATURE = 4,
146
+ PROXIMITY = 5,
147
+ LIGHT = 6,
148
+ PRESSURE = 7,
149
+ HUMIDITY = 8,
150
+ MAGNETIC_FIELD_UNCALIBRATED = 9,
151
+ GYROSCOPE_UNCALIBRATED = 10,
152
+ HEART_RATE = 14,
153
+ RGBC_LIGHT = 15,
154
+ ACCELERATION_UNCALIBRATED = 17
155
+ }
156
+ export declare enum SensorState {
157
+ OK = 0,
158
+ NO_SERVICE = -3,
159
+ DISABLED = -2,
160
+ UNKNOWN = -1
161
+ }
162
+ export declare enum KeyEventType {
163
+ KEYDOWN = 0,
164
+ KEYUP = 1,
165
+ KEYPRESS = 2
166
+ }
167
+ export declare enum KeyCodeType {
168
+ USB = 0,
169
+ EVDEV = 1,
170
+ XKB = 2,
171
+ WIN = 3,
172
+ MAC = 4
173
+ }
174
+ export declare enum ImageFormatType {
175
+ PNG = 0,
176
+ RGBA8888 = 1,
177
+ RGB888 = 2
178
+ }
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.SensorType = exports.SensorState = exports.KeyEventType = exports.KeyCodeType = exports.ImageFormatType = void 0;
7
+ let SensorType = exports.SensorType = /*#__PURE__*/function (SensorType) {
8
+ SensorType[SensorType["ACCELERATION"] = 0] = "ACCELERATION";
9
+ SensorType[SensorType["GYROSCOPE"] = 1] = "GYROSCOPE";
10
+ SensorType[SensorType["MAGNETIC_FIELD"] = 2] = "MAGNETIC_FIELD";
11
+ SensorType[SensorType["ORIENTATION"] = 3] = "ORIENTATION";
12
+ SensorType[SensorType["TEMPERATURE"] = 4] = "TEMPERATURE";
13
+ SensorType[SensorType["PROXIMITY"] = 5] = "PROXIMITY";
14
+ SensorType[SensorType["LIGHT"] = 6] = "LIGHT";
15
+ SensorType[SensorType["PRESSURE"] = 7] = "PRESSURE";
16
+ SensorType[SensorType["HUMIDITY"] = 8] = "HUMIDITY";
17
+ SensorType[SensorType["MAGNETIC_FIELD_UNCALIBRATED"] = 9] = "MAGNETIC_FIELD_UNCALIBRATED";
18
+ SensorType[SensorType["GYROSCOPE_UNCALIBRATED"] = 10] = "GYROSCOPE_UNCALIBRATED";
19
+ SensorType[SensorType["HEART_RATE"] = 14] = "HEART_RATE";
20
+ SensorType[SensorType["RGBC_LIGHT"] = 15] = "RGBC_LIGHT";
21
+ SensorType[SensorType["ACCELERATION_UNCALIBRATED"] = 17] = "ACCELERATION_UNCALIBRATED";
22
+ return SensorType;
23
+ }({});
24
+ let SensorState = exports.SensorState = /*#__PURE__*/function (SensorState) {
25
+ SensorState[SensorState["OK"] = 0] = "OK";
26
+ SensorState[SensorState["NO_SERVICE"] = -3] = "NO_SERVICE";
27
+ SensorState[SensorState["DISABLED"] = -2] = "DISABLED";
28
+ SensorState[SensorState["UNKNOWN"] = -1] = "UNKNOWN";
29
+ return SensorState;
30
+ }({});
31
+ let KeyEventType = exports.KeyEventType = /*#__PURE__*/function (KeyEventType) {
32
+ KeyEventType[KeyEventType["KEYDOWN"] = 0] = "KEYDOWN";
33
+ KeyEventType[KeyEventType["KEYUP"] = 1] = "KEYUP";
34
+ KeyEventType[KeyEventType["KEYPRESS"] = 2] = "KEYPRESS";
35
+ return KeyEventType;
36
+ }({});
37
+ let KeyCodeType = exports.KeyCodeType = /*#__PURE__*/function (KeyCodeType) {
38
+ KeyCodeType[KeyCodeType["USB"] = 0] = "USB";
39
+ KeyCodeType[KeyCodeType["EVDEV"] = 1] = "EVDEV";
40
+ KeyCodeType[KeyCodeType["XKB"] = 2] = "XKB";
41
+ KeyCodeType[KeyCodeType["WIN"] = 3] = "WIN";
42
+ KeyCodeType[KeyCodeType["MAC"] = 4] = "MAC";
43
+ return KeyCodeType;
44
+ }({});
45
+ let ImageFormatType = exports.ImageFormatType = /*#__PURE__*/function (ImageFormatType) {
46
+ ImageFormatType[ImageFormatType["PNG"] = 0] = "PNG";
47
+ ImageFormatType[ImageFormatType["RGBA8888"] = 1] = "RGBA8888";
48
+ ImageFormatType[ImageFormatType["RGB888"] = 2] = "RGB888";
49
+ return ImageFormatType;
50
+ }({});
@@ -3,13 +3,13 @@ import { IStartOptions, IStartWithSerialPort } from '../typing/Instance';
3
3
  import { EmulatorConfig } from '../emulatorutil';
4
4
  import { findInstance } from '../instance';
5
5
  import type { DownloadFileOptions } from 'ipull';
6
- import GrpcEmulator from './grpc';
6
+ import { GrpcEmulator } from './grpc';
7
7
  export declare const isHeadlessEnvironment: () => boolean;
8
8
  export declare class VvdManager {
9
9
  private vvdHome;
10
10
  private sdkHome;
11
11
  binFiles: string[];
12
- constructor(vvdResourcePaths: IVvdResourcePaths);
12
+ constructor(vvdResourcePaths?: IVvdResourcePaths);
13
13
  static getDebuggerCfgFile(): string;
14
14
  /**
15
15
  * 创建Vela端的 VVD ,统一保存在 .vela/vvd 目录下