fix(demo): adapt API changes

This commit is contained in:
Simon Chan 2021-01-17 20:18:22 +08:00
parent 70b4d0817c
commit c0d13f5a27
2 changed files with 4 additions and 4 deletions

View file

@ -7,7 +7,7 @@
"build:watch": "lerna run --scope @yume-chan/adb-backend-web --stream build:watch", "build:watch": "lerna run --scope @yume-chan/adb-backend-web --stream build:watch",
"build:demo": "lerna run --scope demo --stream build", "build:demo": "lerna run --scope demo --stream build",
"start:demo": "lerna run --scope demo --stream start", "start:demo": "lerna run --scope demo --stream start",
"test": "lerna run --stream test" "test": "lerna run --stream --no-bail coverage"
}, },
"devDependencies": { "devDependencies": {
"lerna": "3.22.1" "lerna": "3.22.1"

View file

@ -1,5 +1,5 @@
import { IconButton, IListProps, List, mergeStyles, mergeStyleSets, Stack } from '@fluentui/react'; import { IconButton, IListProps, List, mergeStyles, mergeStyleSets, Stack } from '@fluentui/react';
import { AdbLogger, AdbPacket } from '@yume-chan/adb'; import { AdbLogger, AdbPacket, AdbPacketInit } from '@yume-chan/adb';
import { decodeUtf8 } from '@yume-chan/adb-backend-web'; import { decodeUtf8 } from '@yume-chan/adb-backend-web';
import { DisposableList, EventEmitter } from '@yume-chan/event'; import { DisposableList, EventEmitter } from '@yume-chan/event';
import React, { createContext, useCallback, useContext, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react'; import React, { createContext, useCallback, useContext, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
@ -29,7 +29,7 @@ export class AdbEventLogger {
private readonly _incomingPacketEvent = new EventEmitter<AdbPacket>(); private readonly _incomingPacketEvent = new EventEmitter<AdbPacket>();
public get onIncomingPacket() { return this._incomingPacketEvent.event; } public get onIncomingPacket() { return this._incomingPacketEvent.event; }
private readonly _outgoingPacketEvent = new EventEmitter<AdbPacket>(); private readonly _outgoingPacketEvent = new EventEmitter<AdbPacketInit>();
public get onOutgoingPacket() { return this._outgoingPacketEvent.event; } public get onOutgoingPacket() { return this._outgoingPacketEvent.event; }
public constructor() { public constructor() {
@ -44,7 +44,7 @@ export class AdbEventLogger {
} }
} }
function serializePacket(packet: AdbPacket) { function serializePacket(packet: AdbPacketInit) {
const command = decodeUtf8(new Uint32Array([packet.command]).buffer); const command = decodeUtf8(new Uint32Array([packet.command]).buffer);
const parts = [ const parts = [