mirror of
https://github.com/yume-chan/ya-webadb.git
synced 2025-10-03 01:39:21 +02:00
chore: enable noImplicitOverride
This commit is contained in:
parent
d730d101c2
commit
fb4f73ddec
22 changed files with 34 additions and 36 deletions
|
@ -41,6 +41,6 @@
|
|||
"@types/react": "17.0.27",
|
||||
"eslint": "7.32.0",
|
||||
"eslint-config-next": "^12.0.7",
|
||||
"typescript": "^4.4.3"
|
||||
"typescript": "^4.5.4"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -30,13 +30,12 @@
|
|||
"build:watch": "build-ts-package --incremental"
|
||||
},
|
||||
"devDependencies": {
|
||||
"typescript": "^4.4.3",
|
||||
"typescript": "^4.5.4",
|
||||
"@types/jest": "^27.4.0",
|
||||
"@yume-chan/ts-package-builder": "^1.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@yume-chan/adb": "^0.0.9",
|
||||
"@yume-chan/async": "^2.1.4",
|
||||
"@yume-chan/event": "^0.0.9",
|
||||
"tslib": "^2.3.1"
|
||||
}
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
},
|
||||
"devDependencies": {
|
||||
"jest": "^26.6.3",
|
||||
"typescript": "^4.4.3",
|
||||
"typescript": "^4.5.4",
|
||||
"@yume-chan/ts-package-builder": "^1.0.0"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
"build:watch": "build-ts-package --incremental"
|
||||
},
|
||||
"devDependencies": {
|
||||
"typescript": "^4.4.3",
|
||||
"typescript": "^4.5.4",
|
||||
"@yume-chan/ts-package-builder": "^1.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
|
|
|
@ -29,13 +29,11 @@
|
|||
"build:watch": "build-ts-package --incremental"
|
||||
},
|
||||
"devDependencies": {
|
||||
"typescript": "^4.4.3",
|
||||
"typescript": "^4.5.4",
|
||||
"@yume-chan/ts-package-builder": "^1.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@yume-chan/adb": "^0.0.9",
|
||||
"@yume-chan/async": "^2.1.4",
|
||||
"@yume-chan/event": "^0.0.9",
|
||||
"tslib": "^2.3.1"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
},
|
||||
"devDependencies": {
|
||||
"jest": "^26.6.3",
|
||||
"typescript": "^4.4.3",
|
||||
"typescript": "^4.5.4",
|
||||
"@yume-chan/ts-package-builder": "^1.0.0"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -106,7 +106,7 @@ export class AdbSync extends AutoDisposable {
|
|||
}
|
||||
}
|
||||
|
||||
public dispose() {
|
||||
public override dispose() {
|
||||
super.dispose();
|
||||
this.stream.close();
|
||||
}
|
||||
|
|
|
@ -6,7 +6,7 @@ NoopRemoveEventListener.dispose = NoopRemoveEventListener;
|
|||
export class CloseEventEmitter extends EventEmitter<void, void>{
|
||||
private closed = false;
|
||||
|
||||
protected addEventListener(info: EventListenerInfo<void, void>) {
|
||||
protected override addEventListener(info: EventListenerInfo<void, void>) {
|
||||
if (this.closed) {
|
||||
info.listener.apply(info.thisArg, [undefined, ...info.args]);
|
||||
return NoopRemoveEventListener;
|
||||
|
@ -15,13 +15,13 @@ export class CloseEventEmitter extends EventEmitter<void, void>{
|
|||
}
|
||||
}
|
||||
|
||||
public fire() {
|
||||
public override fire() {
|
||||
super.fire();
|
||||
this.closed = true;
|
||||
this.listeners.length = 0;
|
||||
}
|
||||
|
||||
public dispose() {
|
||||
public override dispose() {
|
||||
this.fire();
|
||||
super.dispose();
|
||||
}
|
||||
|
|
|
@ -97,7 +97,7 @@ export class AdbSocketController extends AutoDisposable implements AdbSocketInfo
|
|||
}
|
||||
}
|
||||
|
||||
public dispose() {
|
||||
public override dispose() {
|
||||
this._closed = true;
|
||||
this.closeEvent.fire();
|
||||
super.dispose();
|
||||
|
|
|
@ -9,7 +9,7 @@ export type AsyncEvent<TEvent> = Event<TEvent, AsyncEventResult>;
|
|||
export class DataEventEmitter<TEvent> extends EventEmitter<TEvent, AsyncEventResult> {
|
||||
private dispatchLock = new PromiseResolver<void>();
|
||||
|
||||
protected addEventListener(info: EventListenerInfo<TEvent, AsyncEventResult>) {
|
||||
protected override addEventListener(info: EventListenerInfo<TEvent, AsyncEventResult>) {
|
||||
const remove = super.addEventListener(info);
|
||||
if (this.listeners.length === 1) {
|
||||
this.dispatchLock.resolve();
|
||||
|
@ -17,7 +17,7 @@ export class DataEventEmitter<TEvent> extends EventEmitter<TEvent, AsyncEventRes
|
|||
return remove;
|
||||
}
|
||||
|
||||
public async fire(e: TEvent) {
|
||||
public override async fire(e: TEvent) {
|
||||
await this.dispatchLock.promise;
|
||||
|
||||
for (const info of this.listeners) {
|
||||
|
|
|
@ -256,7 +256,7 @@ export class AdbPacketDispatcher extends AutoDisposable {
|
|||
}
|
||||
}
|
||||
|
||||
public dispose() {
|
||||
public override dispose() {
|
||||
this._running = false;
|
||||
|
||||
for (const socket of this.sockets.values()) {
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
},
|
||||
"devDependencies": {
|
||||
"jest": "^26.6.3",
|
||||
"typescript": "^4.4.3",
|
||||
"typescript": "^4.5.4",
|
||||
"@yume-chan/ts-package-builder": "^1.0.0"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -48,7 +48,7 @@
|
|||
"gh-release-fetch": "^2.0.4",
|
||||
"jest": "^26.6.3",
|
||||
"tinyh264": "^0.0.7",
|
||||
"typescript": "^4.4.3",
|
||||
"typescript": "^4.5.4",
|
||||
"yuv-buffer": "^1.0.0",
|
||||
"yuv-canvas": "^1.2.7"
|
||||
},
|
||||
|
|
|
@ -53,7 +53,7 @@ export class ScrcpyClientReverseConnection extends ScrcpyClientConnection {
|
|||
|
||||
private address!: string;
|
||||
|
||||
public async initialize(): Promise<void> {
|
||||
public override async initialize(): Promise<void> {
|
||||
try {
|
||||
// try to unbind first
|
||||
await this.device.reverse.remove('localabstract:scrcpy');
|
||||
|
@ -80,7 +80,7 @@ export class ScrcpyClientReverseConnection extends ScrcpyClientConnection {
|
|||
];
|
||||
}
|
||||
|
||||
public dispose() {
|
||||
public override dispose() {
|
||||
// Don't await this!
|
||||
// `reverse.remove`'s response will never arrive
|
||||
// before we read all pending data from `videoStream`
|
||||
|
|
|
@ -47,7 +47,7 @@ export class TinyH264Wrapper extends AutoDisposable {
|
|||
}, [data]);
|
||||
}
|
||||
|
||||
public dispose() {
|
||||
public override dispose() {
|
||||
super.dispose();
|
||||
worker!.postMessage({
|
||||
type: 'release',
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { Adb } from "@yume-chan/adb";
|
||||
import { type Adb } from "@yume-chan/adb";
|
||||
import Struct, { placeholder } from "@yume-chan/struct";
|
||||
import { AndroidCodecLevel, AndroidCodecProfile } from "../codec";
|
||||
import { ScrcpyClientConnection, ScrcpyClientForwardConnection, ScrcpyClientReverseConnection } from "../connection";
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { Adb } from "@yume-chan/adb";
|
||||
import { type Adb } from "@yume-chan/adb";
|
||||
import Struct, { placeholder } from "@yume-chan/struct";
|
||||
import { AndroidKeyEventAction, ScrcpyControlMessageType } from "../message";
|
||||
import { ScrcpyOptions1_16, ScrcpyOptions1_16Type } from "./1_16";
|
||||
import { type AndroidKeyEventAction, ScrcpyControlMessageType } from "../message";
|
||||
import { ScrcpyOptions1_16, type ScrcpyOptions1_16Type } from "./1_16";
|
||||
|
||||
export interface ScrcpyOptions1_18Type extends ScrcpyOptions1_16Type {
|
||||
powerOffOnClose: boolean;
|
||||
|
|
|
@ -25,7 +25,7 @@ export class ScrcpyOptions1_21<T extends ScrcpyOptions1_21Type = ScrcpyOptions1_
|
|||
});
|
||||
}
|
||||
|
||||
public formatGetEncoderListArguments(): string[] {
|
||||
public override formatGetEncoderListArguments(): string[] {
|
||||
return Object.entries(this.value).map(([key, value]) => {
|
||||
if (key === 'encoderName') {
|
||||
value = '_';
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
},
|
||||
"devDependencies": {
|
||||
"jest": "^26.6.3",
|
||||
"typescript": "^4.4.3",
|
||||
"typescript": "^4.5.4",
|
||||
"@yume-chan/ts-package-builder": "^1.0.0",
|
||||
"@types/jest": "^27.4.0",
|
||||
"@types/node": "^16.11.19",
|
||||
|
|
|
@ -178,7 +178,7 @@ export class ArrayBufferLikeFieldValue<
|
|||
this.arrayBuffer = arrayBuffer;
|
||||
}
|
||||
|
||||
public set(value: TDefinition['TValue']): void {
|
||||
public override set(value: TDefinition['TValue']): void {
|
||||
super.set(value);
|
||||
this.arrayBuffer = undefined;
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@ export class VariableLengthArrayBufferLikeFieldDefinition<
|
|||
return 0;
|
||||
}
|
||||
|
||||
protected getDeserializeSize(struct: StructValue) {
|
||||
protected override getDeserializeSize(struct: StructValue) {
|
||||
let value = struct.value[this.options.lengthField] as number | string;
|
||||
if (typeof value === 'string') {
|
||||
value = Number.parseInt(value, this.options.lengthFieldBase ?? 10);
|
||||
|
@ -33,7 +33,7 @@ export class VariableLengthArrayBufferLikeFieldDefinition<
|
|||
return value;
|
||||
}
|
||||
|
||||
public create(
|
||||
public override create(
|
||||
options: Readonly<StructOptions>,
|
||||
struct: StructValue,
|
||||
value: TType['TTypeScriptType'],
|
||||
|
@ -80,7 +80,7 @@ export class VariableLengthArrayBufferLikeStructFieldValue<
|
|||
struct.set(lengthField, this.lengthFieldValue);
|
||||
}
|
||||
|
||||
public getSize() {
|
||||
public override getSize() {
|
||||
if (this.length === undefined) {
|
||||
this.length = this.definition.type.getSize(this.value);
|
||||
if (this.length === -1) {
|
||||
|
@ -92,7 +92,7 @@ export class VariableLengthArrayBufferLikeStructFieldValue<
|
|||
return this.length;
|
||||
}
|
||||
|
||||
public set(value: unknown) {
|
||||
public override set(value: unknown) {
|
||||
super.set(value);
|
||||
this.arrayBuffer = undefined;
|
||||
this.length = undefined;
|
||||
|
@ -118,11 +118,11 @@ export class VariableLengthArrayBufferLikeFieldLengthValue
|
|||
this.arrayBufferField = arrayBufferField;
|
||||
}
|
||||
|
||||
public getSize() {
|
||||
public override getSize() {
|
||||
return this.originalField.getSize();
|
||||
}
|
||||
|
||||
get() {
|
||||
public override get() {
|
||||
let value: string | number = this.arrayBufferField.getSize();
|
||||
|
||||
const originalValue = this.originalField.get();
|
||||
|
@ -133,7 +133,7 @@ export class VariableLengthArrayBufferLikeFieldLengthValue
|
|||
return value;
|
||||
}
|
||||
|
||||
set() { }
|
||||
public override set() { }
|
||||
|
||||
serialize(dataView: DataView, offset: number) {
|
||||
this.originalField.set(this.get());
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
/* Additional Checks */
|
||||
// "noUnusedLocals": true, /* Report errors on unused locals. */
|
||||
// "noUnusedParameters": true, /* Report errors on unused parameters. */
|
||||
"noImplicitOverride": true,
|
||||
"noImplicitReturns": true, // /* Report error when not all code paths in function return a value. */
|
||||
"noFallthroughCasesInSwitch": true, // /* Report errors for fallthrough cases in switch statement. */
|
||||
"forceConsistentCasingInFileNames": true, /* Disallow inconsistently-cased references to the same file. */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue