diff --git a/libraries/adb-backend-direct-sockets/src/index.ts b/libraries/adb-backend-direct-sockets/src/index.ts index 758a7497..eedbc7ab 100644 --- a/libraries/adb-backend-direct-sockets/src/index.ts +++ b/libraries/adb-backend-direct-sockets/src/index.ts @@ -1,4 +1,4 @@ -import { AdbBackend, ReadableStream, WritableStream } from '@yume-chan/adb'; +import type { AdbBackend, ReadableStream, WritableStream } from '@yume-chan/adb'; declare global { interface TCPSocket { diff --git a/libraries/adb/src/auth.ts b/libraries/adb/src/auth.ts index f0f3d8c3..9450e52b 100644 --- a/libraries/adb/src/auth.ts +++ b/libraries/adb/src/auth.ts @@ -1,6 +1,6 @@ import { PromiseResolver } from '@yume-chan/async'; -import { Disposable } from '@yume-chan/event'; -import { ValueOrPromise } from '@yume-chan/struct'; +import type { Disposable } from '@yume-chan/event'; +import type { ValueOrPromise } from '@yume-chan/struct'; import { calculatePublicKey, calculatePublicKeyLength, sign } from './crypto'; import { AdbCommand, AdbPacket, AdbPacketCore } from './packet'; import { calculateBase64EncodedLength, encodeBase64 } from './utils'; diff --git a/libraries/adb/src/commands/base.ts b/libraries/adb/src/commands/base.ts index 27c6e1d9..8ba5e758 100644 --- a/libraries/adb/src/commands/base.ts +++ b/libraries/adb/src/commands/base.ts @@ -1,5 +1,5 @@ import { AutoDisposable } from '@yume-chan/event'; -import { Adb } from '../adb'; +import type { Adb } from '../adb'; export class AdbCommandBase extends AutoDisposable { protected adb: Adb; diff --git a/libraries/adb/src/commands/framebuffer.ts b/libraries/adb/src/commands/framebuffer.ts index cca34b74..16e311d8 100644 --- a/libraries/adb/src/commands/framebuffer.ts +++ b/libraries/adb/src/commands/framebuffer.ts @@ -1,5 +1,5 @@ import Struct from "@yume-chan/struct"; -import { Adb } from '../adb'; +import type { Adb } from '../adb'; import { AdbBufferedStream } from '../stream'; const Version = diff --git a/libraries/adb/src/commands/install.ts b/libraries/adb/src/commands/install.ts index d843b133..148500b3 100644 --- a/libraries/adb/src/commands/install.ts +++ b/libraries/adb/src/commands/install.ts @@ -1,7 +1,7 @@ -import { Adb } from "../adb"; +import type { Adb } from "../adb"; import { WrapWritableStream, WritableStream } from "../stream"; import { escapeArg } from "./subprocess"; -import { AdbSync } from "./sync"; +import type { AdbSync } from "./sync"; export function install( adb: Adb, diff --git a/libraries/adb/src/commands/sync/list.ts b/libraries/adb/src/commands/sync/list.ts index 9f48dd48..59d28e8c 100644 --- a/libraries/adb/src/commands/sync/list.ts +++ b/libraries/adb/src/commands/sync/list.ts @@ -1,5 +1,5 @@ import Struct from '@yume-chan/struct'; -import { AdbBufferedStream, WritableStreamDefaultWriter } from '../../stream'; +import type { AdbBufferedStream, WritableStreamDefaultWriter } from '../../stream'; import { AdbSyncRequestId, adbSyncWriteRequest } from './request'; import { AdbSyncDoneResponse, adbSyncReadResponse, AdbSyncResponseId } from './response'; import { AdbSyncLstatResponse } from './stat'; diff --git a/libraries/adb/src/commands/sync/request.ts b/libraries/adb/src/commands/sync/request.ts index 53f27aa5..4a37d89b 100644 --- a/libraries/adb/src/commands/sync/request.ts +++ b/libraries/adb/src/commands/sync/request.ts @@ -1,5 +1,5 @@ import Struct from '@yume-chan/struct'; -import { WritableStreamDefaultWriter } from "../../stream"; +import type { WritableStreamDefaultWriter } from "../../stream"; import { encodeUtf8 } from "../../utils"; export enum AdbSyncRequestId { diff --git a/libraries/adb/src/commands/sync/response.ts b/libraries/adb/src/commands/sync/response.ts index a57a4803..c36d1a1c 100644 --- a/libraries/adb/src/commands/sync/response.ts +++ b/libraries/adb/src/commands/sync/response.ts @@ -1,5 +1,5 @@ import Struct, { StructAsyncDeserializeStream, StructLike, StructValueType } from '@yume-chan/struct'; -import { AdbBufferedStream } from '../../stream'; +import type { AdbBufferedStream } from '../../stream'; import { decodeUtf8 } from "../../utils"; export enum AdbSyncResponseId { diff --git a/libraries/adb/src/commands/sync/stat.ts b/libraries/adb/src/commands/sync/stat.ts index b9dd8138..b377211c 100644 --- a/libraries/adb/src/commands/sync/stat.ts +++ b/libraries/adb/src/commands/sync/stat.ts @@ -1,5 +1,5 @@ import Struct, { placeholder } from '@yume-chan/struct'; -import { AdbBufferedStream, WritableStreamDefaultWriter } from '../../stream'; +import type { AdbBufferedStream, WritableStreamDefaultWriter } from '../../stream'; import { AdbSyncRequestId, adbSyncWriteRequest } from './request'; import { adbSyncReadResponse, AdbSyncResponseId } from './response'; diff --git a/libraries/adb/src/commands/sync/sync.ts b/libraries/adb/src/commands/sync/sync.ts index a194d589..667e4660 100644 --- a/libraries/adb/src/commands/sync/sync.ts +++ b/libraries/adb/src/commands/sync/sync.ts @@ -1,7 +1,7 @@ import { AutoDisposable } from '@yume-chan/event'; -import { Adb } from '../../adb'; +import type { Adb } from '../../adb'; import { AdbFeatures } from '../../features'; -import { AdbSocket } from '../../socket'; +import type { AdbSocket } from '../../socket'; import { AdbBufferedStream, ReadableStream, WrapReadableStream, WrapWritableStream, WritableStream, WritableStreamDefaultWriter } from '../../stream'; import { AutoResetEvent } from '../../utils'; import { AdbSyncEntryResponse, adbSyncOpenDir } from './list'; diff --git a/libraries/adb/src/socket/controller.ts b/libraries/adb/src/socket/controller.ts index d3b0e261..730a4d43 100644 --- a/libraries/adb/src/socket/controller.ts +++ b/libraries/adb/src/socket/controller.ts @@ -1,7 +1,7 @@ import { PromiseResolver } from "@yume-chan/async"; import { AdbCommand } from '../packet'; import { ChunkStream, DuplexStreamFactory, pipeFrom, PushReadableStreamController, ReadableStream, WritableStream } from '../stream'; -import { AdbPacketDispatcher } from './dispatcher'; +import type { AdbPacketDispatcher } from './dispatcher'; export interface AdbSocketInfo { localId: number; diff --git a/libraries/adb/src/socket/socket.ts b/libraries/adb/src/socket/socket.ts index 3bf2bd86..88740e67 100644 --- a/libraries/adb/src/socket/socket.ts +++ b/libraries/adb/src/socket/socket.ts @@ -1,5 +1,5 @@ -import { ReadableStream, WritableStream } from "../stream"; -import { AdbSocketController, AdbSocketInfo } from './controller'; +import type { ReadableStream, WritableStream } from "../stream"; +import type { AdbSocketController, AdbSocketInfo } from './controller'; export class AdbSocket implements AdbSocketInfo { private readonly controller: AdbSocketController; diff --git a/libraries/adb/src/stream/buffered.ts b/libraries/adb/src/stream/buffered.ts index 832a6ae2..c974d283 100644 --- a/libraries/adb/src/stream/buffered.ts +++ b/libraries/adb/src/stream/buffered.ts @@ -1,6 +1,6 @@ -import { StructAsyncDeserializeStream } from '@yume-chan/struct'; -import { AdbSocket, AdbSocketInfo } from '../socket'; -import { ReadableStream, ReadableStreamDefaultReader } from './detect'; +import type { StructAsyncDeserializeStream } from '@yume-chan/struct'; +import type { AdbSocket, AdbSocketInfo } from '../socket'; +import type { ReadableStream, ReadableStreamDefaultReader } from './detect'; import { PushReadableStream } from "./transform"; export class BufferedStreamEndedError extends Error { diff --git a/libraries/adb/src/stream/transform.ts b/libraries/adb/src/stream/transform.ts index 640b071f..c3ffd02e 100644 --- a/libraries/adb/src/stream/transform.ts +++ b/libraries/adb/src/stream/transform.ts @@ -1,5 +1,6 @@ import { PromiseResolver } from "@yume-chan/async"; -import Struct, { StructValueType } from "@yume-chan/struct"; +import type Struct from "@yume-chan/struct"; +import type { StructValueType } from "@yume-chan/struct"; import { decodeUtf8 } from "../utils"; import { BufferedStream, BufferedStreamEndedError } from "./buffered"; import { AbortController, AbortSignal, QueuingStrategy, ReadableStream, ReadableStreamController, ReadableStreamDefaultReader, ReadableWritablePair, TransformStream, UnderlyingSink, UnderlyingSource, WritableStream, WritableStreamDefaultWriter } from "./detect"; diff --git a/libraries/adb/src/utils/auto-reset-event.ts b/libraries/adb/src/utils/auto-reset-event.ts index 82003699..672fafe9 100644 --- a/libraries/adb/src/utils/auto-reset-event.ts +++ b/libraries/adb/src/utils/auto-reset-event.ts @@ -1,5 +1,5 @@ import { PromiseResolver } from '@yume-chan/async'; -import { Disposable } from '@yume-chan/event'; +import type { Disposable } from '@yume-chan/event'; export class AutoResetEvent implements Disposable { private readonly list: PromiseResolver[] = []; diff --git a/libraries/scrcpy/src/connection.ts b/libraries/scrcpy/src/connection.ts index 4593dbfb..ceea7bba 100644 --- a/libraries/scrcpy/src/connection.ts +++ b/libraries/scrcpy/src/connection.ts @@ -1,6 +1,6 @@ import { Adb, AdbBufferedStream, AdbSocket } from "@yume-chan/adb"; -import { Disposable } from "@yume-chan/event"; -import { ValueOrPromise } from "@yume-chan/struct"; +import type { Disposable } from "@yume-chan/event"; +import type { ValueOrPromise } from "@yume-chan/struct"; import { delay } from "./utils"; export interface ScrcpyClientConnectionOptions { diff --git a/toolchain/ts-package-builder/tsconfig.base.json b/toolchain/ts-package-builder/tsconfig.base.json index 26eea596..36f757c5 100644 --- a/toolchain/ts-package-builder/tsconfig.base.json +++ b/toolchain/ts-package-builder/tsconfig.base.json @@ -34,6 +34,7 @@ "noImplicitThis": true, "noUncheckedIndexedAccess": true, "resolveJsonModule": true, + "importsNotUsedAsValues": "error", /* Module Resolution Options */ "moduleResolution": "Node", // /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */ // "baseUrl": "./", /* Base directory to resolve non-absolute module names. */