@yume-chan/adb 0.0.8 → 0.0.11
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/CHANGELOG.json +49 -0
- package/CHANGELOG.md +30 -0
- package/LICENSE +21 -21
- package/README.md +240 -257
- package/esm/adb.d.ts +48 -0
- package/esm/adb.d.ts.map +1 -0
- package/esm/adb.js +141 -145
- package/esm/adb.js.map +1 -1
- package/{dts → esm}/auth.d.ts +17 -7
- package/esm/auth.d.ts.map +1 -0
- package/esm/auth.js +69 -109
- package/esm/auth.js.map +1 -1
- package/esm/backend.d.ts +9 -0
- package/esm/backend.d.ts.map +1 -0
- package/{dts → esm}/commands/base.d.ts +1 -1
- package/esm/commands/base.d.ts.map +1 -0
- package/esm/commands/base.js +1 -0
- package/esm/commands/base.js.map +1 -1
- package/{dts → esm}/commands/framebuffer.d.ts +3 -3
- package/esm/commands/framebuffer.d.ts.map +1 -0
- package/esm/commands/framebuffer.js +15 -18
- package/esm/commands/framebuffer.js.map +1 -1
- package/esm/commands/index.d.ts +9 -0
- package/esm/commands/index.d.ts.map +1 -0
- package/esm/commands/index.js +8 -8
- package/esm/commands/index.js.map +1 -1
- package/esm/commands/install.d.ts +4 -0
- package/esm/commands/install.d.ts.map +1 -0
- package/esm/commands/install.js +21 -13
- package/esm/commands/install.js.map +1 -1
- package/esm/commands/power.d.ts +23 -0
- package/esm/commands/power.d.ts.map +1 -0
- package/esm/commands/power.js +45 -0
- package/esm/commands/power.js.map +1 -0
- package/{dts → esm}/commands/reverse.d.ts +3 -3
- package/esm/commands/reverse.d.ts.map +1 -0
- package/esm/commands/reverse.js +50 -60
- package/esm/commands/reverse.js.map +1 -1
- package/esm/commands/subprocess/index.d.ts +57 -0
- package/esm/commands/subprocess/index.d.ts.map +1 -0
- package/esm/commands/subprocess/index.js +83 -0
- package/esm/commands/subprocess/index.js.map +1 -0
- package/esm/commands/subprocess/legacy.d.ts +28 -0
- package/esm/commands/subprocess/legacy.d.ts.map +1 -0
- package/esm/commands/subprocess/legacy.js +44 -0
- package/esm/commands/subprocess/legacy.js.map +1 -0
- package/esm/commands/subprocess/protocol.d.ts +38 -0
- package/esm/commands/subprocess/protocol.d.ts.map +1 -0
- package/esm/commands/subprocess/protocol.js +155 -0
- package/esm/commands/subprocess/protocol.js.map +1 -0
- package/esm/commands/subprocess/types.d.ts +47 -0
- package/esm/commands/subprocess/types.d.ts.map +1 -0
- package/esm/commands/{shell → subprocess}/types.js +0 -0
- package/{cjs/commands/shell → esm/commands/subprocess}/types.js.map +1 -1
- package/{dts/commands/shell → esm/commands/subprocess}/utils.d.ts +0 -0
- package/esm/commands/subprocess/utils.d.ts.map +1 -0
- package/esm/commands/{shell → subprocess}/utils.js +0 -0
- package/esm/commands/subprocess/utils.js.map +1 -0
- package/esm/commands/sync/index.d.ts +8 -0
- package/esm/commands/sync/index.d.ts.map +1 -0
- package/esm/commands/sync/index.js +7 -7
- package/esm/commands/sync/index.js.map +1 -1
- package/{dts → esm}/commands/sync/list.d.ts +4 -4
- package/esm/commands/sync/list.d.ts.map +1 -0
- package/esm/commands/sync/list.js +16 -19
- package/esm/commands/sync/list.js.map +1 -1
- package/esm/commands/sync/pull.d.ts +11 -0
- package/esm/commands/sync/pull.d.ts.map +1 -0
- package/esm/commands/sync/pull.js +17 -11
- package/esm/commands/sync/pull.js.map +1 -1
- package/esm/commands/sync/push.d.ts +8 -0
- package/esm/commands/sync/push.d.ts.map +1 -0
- package/esm/commands/sync/push.js +19 -37
- package/esm/commands/sync/push.js.map +1 -1
- package/{dts → esm}/commands/sync/request.d.ts +3 -3
- package/esm/commands/sync/request.d.ts.map +1 -0
- package/esm/commands/sync/request.js +24 -26
- package/esm/commands/sync/request.js.map +1 -1
- package/{dts → esm}/commands/sync/response.d.ts +3 -3
- package/esm/commands/sync/response.d.ts.map +1 -0
- package/esm/commands/sync/response.js +16 -19
- package/esm/commands/sync/response.js.map +1 -1
- package/{dts → esm}/commands/sync/stat.d.ts +4 -4
- package/esm/commands/sync/stat.d.ts.map +1 -0
- package/esm/commands/sync/stat.js +22 -27
- package/esm/commands/sync/stat.js.map +1 -1
- package/esm/commands/sync/sync.d.ts +83 -0
- package/esm/commands/sync/sync.d.ts.map +1 -0
- package/esm/commands/sync/sync.js +92 -89
- package/esm/commands/sync/sync.js.map +1 -1
- package/{dts → esm}/commands/tcpip.d.ts +1 -1
- package/{dts → esm}/commands/tcpip.d.ts.map +1 -1
- package/esm/commands/tcpip.js +14 -19
- package/esm/commands/tcpip.js.map +1 -1
- package/esm/crypto.d.ts +24 -0
- package/esm/crypto.d.ts.map +1 -0
- package/esm/crypto.js +33 -31
- package/esm/crypto.js.map +1 -1
- package/{dts → esm}/features.d.ts +0 -0
- package/{dts → esm}/features.d.ts.map +0 -0
- package/esm/features.js +1 -1
- package/esm/features.js.map +1 -1
- package/esm/index.d.ts +11 -0
- package/esm/index.d.ts.map +1 -0
- package/esm/index.js +10 -10
- package/esm/index.js.map +1 -1
- package/esm/packet.d.ts +28 -0
- package/esm/packet.d.ts.map +1 -0
- package/esm/packet.js +26 -53
- package/esm/packet.js.map +1 -1
- package/esm/socket/controller.d.ts +37 -0
- package/esm/socket/controller.d.ts.map +1 -0
- package/esm/socket/controller.js +52 -66
- package/esm/socket/controller.js.map +1 -1
- package/{dts → esm}/socket/dispatcher.d.ts +10 -23
- package/esm/socket/dispatcher.d.ts.map +1 -0
- package/esm/socket/dispatcher.js +148 -164
- package/esm/socket/dispatcher.js.map +1 -1
- package/esm/socket/index.d.ts +3 -0
- package/esm/socket/index.d.ts.map +1 -0
- package/esm/socket/index.js +2 -6
- package/esm/socket/index.js.map +1 -1
- package/esm/socket/socket.d.ts +34 -0
- package/esm/socket/socket.d.ts.map +1 -0
- package/esm/socket/socket.js +69 -14
- package/esm/socket/socket.js.map +1 -1
- package/esm/stream/buffered.d.ts +35 -0
- package/esm/stream/buffered.d.ts.map +1 -0
- package/esm/stream/buffered.js +123 -0
- package/esm/stream/buffered.js.map +1 -0
- package/esm/stream/detect.bak.d.ts +240 -0
- package/esm/stream/detect.bak.d.ts.map +1 -0
- package/esm/stream/detect.bak.js +60 -0
- package/esm/stream/detect.bak.js.map +1 -0
- package/esm/stream/detect.d.ts +18 -0
- package/esm/stream/detect.d.ts.map +1 -0
- package/esm/stream/detect.js +6 -0
- package/esm/stream/detect.js.map +1 -0
- package/esm/stream/detect.native.d.ts +240 -0
- package/esm/stream/detect.native.d.ts.map +1 -0
- package/esm/stream/detect.native.js +60 -0
- package/esm/stream/detect.native.js.map +1 -0
- package/esm/stream/detect.polyfill.d.ts +18 -0
- package/esm/stream/detect.polyfill.d.ts.map +1 -0
- package/esm/stream/detect.polyfill.js +6 -0
- package/esm/stream/detect.polyfill.js.map +1 -0
- package/esm/stream/index.d.ts +4 -0
- package/esm/stream/index.d.ts.map +1 -0
- package/esm/stream/index.js +3 -2
- package/esm/stream/index.js.map +1 -1
- package/esm/stream/transform.d.ts +98 -0
- package/esm/stream/transform.d.ts.map +1 -0
- package/esm/stream/transform.js +352 -0
- package/esm/stream/transform.js.map +1 -0
- package/{dts → esm}/utils/auto-reset-event.d.ts +1 -1
- package/esm/utils/auto-reset-event.d.ts.map +1 -0
- package/esm/utils/auto-reset-event.js +2 -1
- package/esm/utils/auto-reset-event.js.map +1 -1
- package/esm/utils/base64.d.ts +5 -0
- package/esm/utils/base64.d.ts.map +1 -0
- package/esm/utils/base64.js +116 -80
- package/esm/utils/base64.js.map +1 -1
- package/esm/utils/encoding.d.ts +3 -0
- package/esm/utils/encoding.d.ts.map +1 -0
- package/esm/utils/encoding.js +11 -0
- package/esm/utils/encoding.js.map +1 -0
- package/esm/utils/index.d.ts +4 -0
- package/esm/utils/index.d.ts.map +1 -0
- package/esm/utils/index.js +3 -4
- package/esm/utils/index.js.map +1 -1
- package/package.json +49 -50
- package/src/adb.ts +247 -242
- package/src/auth.ts +170 -156
- package/src/backend.ts +11 -24
- package/src/commands/base.ts +11 -11
- package/src/commands/framebuffer.ts +73 -73
- package/src/commands/index.ts +8 -8
- package/src/commands/install.ts +32 -21
- package/src/commands/power.ts +54 -0
- package/src/commands/reverse.ts +136 -133
- package/src/commands/subprocess/index.ts +124 -0
- package/src/commands/subprocess/legacy.ts +58 -0
- package/src/commands/subprocess/protocol.ts +185 -0
- package/src/commands/subprocess/types.ts +55 -0
- package/src/commands/{shell → subprocess}/utils.ts +20 -20
- package/src/commands/sync/index.ts +7 -7
- package/src/commands/sync/list.ts +40 -39
- package/src/commands/sync/pull.ts +43 -34
- package/src/commands/sync/push.ts +41 -46
- package/src/commands/sync/request.ts +49 -48
- package/src/commands/sync/response.ts +58 -57
- package/src/commands/sync/stat.ts +123 -121
- package/src/commands/sync/sync.ts +145 -113
- package/src/commands/tcpip.ts +21 -21
- package/src/crypto.ts +280 -280
- package/src/features.ts +5 -5
- package/src/index.ts +11 -10
- package/src/packet.ts +69 -89
- package/src/socket/dispatcher.ts +256 -269
- package/src/socket/index.ts +2 -6
- package/src/socket/socket.ts +129 -28
- package/src/stream/buffered.ts +147 -0
- package/src/stream/detect.native.ts +362 -0
- package/src/stream/detect.polyfill.ts +25 -0
- package/src/stream/detect.ts +25 -0
- package/src/stream/index.ts +3 -2
- package/src/stream/transform.ts +427 -0
- package/src/utils/auto-reset-event.ts +41 -41
- package/src/utils/base64.ts +306 -274
- package/src/utils/encoding.ts +13 -0
- package/src/utils/index.ts +3 -4
- package/tsconfig.build.json +3 -0
- package/tsconfig.build.tsbuildinfo +1 -0
- package/tsconfig.test.json +10 -0
- package/cjs/adb.js +0 -205
- package/cjs/adb.js.map +0 -1
- package/cjs/auth.js +0 -141
- package/cjs/auth.js.map +0 -1
- package/cjs/backend.js +0 -3
- package/cjs/backend.js.map +0 -1
- package/cjs/commands/base.js +0 -12
- package/cjs/commands/base.js.map +0 -1
- package/cjs/commands/demo-mode.js +0 -174
- package/cjs/commands/demo-mode.js.map +0 -1
- package/cjs/commands/framebuffer.js +0 -66
- package/cjs/commands/framebuffer.js.map +0 -1
- package/cjs/commands/index.js +0 -12
- package/cjs/commands/index.js.map +0 -1
- package/cjs/commands/install.js +0 -20
- package/cjs/commands/install.js.map +0 -1
- package/cjs/commands/reverse.js +0 -105
- package/cjs/commands/reverse.js.map +0 -1
- package/cjs/commands/shell/index.js +0 -56
- package/cjs/commands/shell/index.js.map +0 -1
- package/cjs/commands/shell/legacy.js +0 -37
- package/cjs/commands/shell/legacy.js.map +0 -1
- package/cjs/commands/shell/protocol.js +0 -83
- package/cjs/commands/shell/protocol.js.map +0 -1
- package/cjs/commands/shell/types.js +0 -3
- package/cjs/commands/shell/utils.js +0 -23
- package/cjs/commands/shell/utils.js.map +0 -1
- package/cjs/commands/sync/index.js +0 -11
- package/cjs/commands/sync/index.js.map +0 -1
- package/cjs/commands/sync/list.js +0 -36
- package/cjs/commands/sync/list.js.map +0 -1
- package/cjs/commands/sync/pull.js +0 -34
- package/cjs/commands/sync/pull.js.map +0 -1
- package/cjs/commands/sync/push.js +0 -49
- package/cjs/commands/sync/push.js.map +0 -1
- package/cjs/commands/sync/request.js +0 -48
- package/cjs/commands/sync/request.js.map +0 -1
- package/cjs/commands/sync/response.js +0 -53
- package/cjs/commands/sync/response.js.map +0 -1
- package/cjs/commands/sync/stat.js +0 -109
- package/cjs/commands/sync/stat.js.map +0 -1
- package/cjs/commands/sync/sync.js +0 -118
- package/cjs/commands/sync/sync.js.map +0 -1
- package/cjs/commands/tcpip.js +0 -28
- package/cjs/commands/tcpip.js.map +0 -1
- package/cjs/crypto.js +0 -231
- package/cjs/crypto.js.map +0 -1
- package/cjs/features.js +0 -10
- package/cjs/features.js.map +0 -1
- package/cjs/index.js +0 -14
- package/cjs/index.js.map +0 -1
- package/cjs/packet.js +0 -77
- package/cjs/packet.js.map +0 -1
- package/cjs/socket/close-event-emitter.js +0 -32
- package/cjs/socket/close-event-emitter.js.map +0 -1
- package/cjs/socket/controller.js +0 -84
- package/cjs/socket/controller.js.map +0 -1
- package/cjs/socket/data-event-emitter.js +0 -29
- package/cjs/socket/data-event-emitter.js.map +0 -1
- package/cjs/socket/dispatcher.js +0 -219
- package/cjs/socket/dispatcher.js.map +0 -1
- package/cjs/socket/index.js +0 -10
- package/cjs/socket/index.js.map +0 -1
- package/cjs/socket/logger.js +0 -3
- package/cjs/socket/logger.js.map +0 -1
- package/cjs/socket/socket.js +0 -24
- package/cjs/socket/socket.js.map +0 -1
- package/cjs/stream/buffered-stream.js +0 -78
- package/cjs/stream/buffered-stream.js.map +0 -1
- package/cjs/stream/index.js +0 -6
- package/cjs/stream/index.js.map +0 -1
- package/cjs/stream/stream.js +0 -45
- package/cjs/stream/stream.js.map +0 -1
- package/cjs/utils/auto-reset-event.js +0 -37
- package/cjs/utils/auto-reset-event.js.map +0 -1
- package/cjs/utils/base64.js +0 -210
- package/cjs/utils/base64.js.map +0 -1
- package/cjs/utils/chunk.js +0 -75
- package/cjs/utils/chunk.js.map +0 -1
- package/cjs/utils/event-queue.js +0 -108
- package/cjs/utils/event-queue.js.map +0 -1
- package/cjs/utils/index.js +0 -8
- package/cjs/utils/index.js.map +0 -1
- package/dts/adb.d.ts +0 -46
- package/dts/adb.d.ts.map +0 -1
- package/dts/auth.d.ts.map +0 -1
- package/dts/backend.d.ts +0 -15
- package/dts/backend.d.ts.map +0 -1
- package/dts/commands/base.d.ts.map +0 -1
- package/dts/commands/demo-mode.d.ts +0 -41
- package/dts/commands/demo-mode.d.ts.map +0 -1
- package/dts/commands/framebuffer.d.ts.map +0 -1
- package/dts/commands/index.d.ts +0 -9
- package/dts/commands/index.d.ts.map +0 -1
- package/dts/commands/install.d.ts +0 -3
- package/dts/commands/install.d.ts.map +0 -1
- package/dts/commands/reverse.d.ts.map +0 -1
- package/dts/commands/shell/index.d.ts +0 -20
- package/dts/commands/shell/index.d.ts.map +0 -1
- package/dts/commands/shell/legacy.d.ts +0 -27
- package/dts/commands/shell/legacy.d.ts.map +0 -1
- package/dts/commands/shell/protocol.d.ts +0 -37
- package/dts/commands/shell/protocol.d.ts.map +0 -1
- package/dts/commands/shell/types.d.ts +0 -15
- package/dts/commands/shell/types.d.ts.map +0 -1
- package/dts/commands/shell/utils.d.ts.map +0 -1
- package/dts/commands/sync/index.d.ts +0 -8
- package/dts/commands/sync/index.d.ts.map +0 -1
- package/dts/commands/sync/list.d.ts.map +0 -1
- package/dts/commands/sync/pull.d.ts +0 -11
- package/dts/commands/sync/pull.d.ts.map +0 -1
- package/dts/commands/sync/push.d.ts +0 -8
- package/dts/commands/sync/push.d.ts.map +0 -1
- package/dts/commands/sync/request.d.ts.map +0 -1
- package/dts/commands/sync/response.d.ts.map +0 -1
- package/dts/commands/sync/stat.d.ts.map +0 -1
- package/dts/commands/sync/sync.d.ts +0 -68
- package/dts/commands/sync/sync.d.ts.map +0 -1
- package/dts/crypto.d.ts +0 -17
- package/dts/crypto.d.ts.map +0 -1
- package/dts/index.d.ts +0 -11
- package/dts/index.d.ts.map +0 -1
- package/dts/packet.d.ts +0 -27
- package/dts/packet.d.ts.map +0 -1
- package/dts/socket/close-event-emitter.d.ts +0 -8
- package/dts/socket/close-event-emitter.d.ts.map +0 -1
- package/dts/socket/controller.d.ts +0 -43
- package/dts/socket/controller.d.ts.map +0 -1
- package/dts/socket/data-event-emitter.d.ts +0 -10
- package/dts/socket/data-event-emitter.d.ts.map +0 -1
- package/dts/socket/dispatcher.d.ts.map +0 -1
- package/dts/socket/index.d.ts +0 -7
- package/dts/socket/index.d.ts.map +0 -1
- package/dts/socket/logger.d.ts +0 -9
- package/dts/socket/logger.d.ts.map +0 -1
- package/dts/socket/socket.d.ts +0 -22
- package/dts/socket/socket.d.ts.map +0 -1
- package/dts/stream/buffered-stream.d.ts +0 -30
- package/dts/stream/buffered-stream.d.ts.map +0 -1
- package/dts/stream/index.d.ts +0 -3
- package/dts/stream/index.d.ts.map +0 -1
- package/dts/stream/stream.d.ts +0 -15
- package/dts/stream/stream.d.ts.map +0 -1
- package/dts/utils/auto-reset-event.d.ts.map +0 -1
- package/dts/utils/base64.d.ts +0 -7
- package/dts/utils/base64.d.ts.map +0 -1
- package/dts/utils/chunk.d.ts +0 -3
- package/dts/utils/chunk.d.ts.map +0 -1
- package/dts/utils/event-queue.d.ts +0 -35
- package/dts/utils/event-queue.d.ts.map +0 -1
- package/dts/utils/index.d.ts +0 -5
- package/dts/utils/index.d.ts.map +0 -1
- package/esm/commands/demo-mode.js +0 -170
- package/esm/commands/demo-mode.js.map +0 -1
- package/esm/commands/shell/index.js +0 -52
- package/esm/commands/shell/index.js.map +0 -1
- package/esm/commands/shell/legacy.js +0 -33
- package/esm/commands/shell/legacy.js.map +0 -1
- package/esm/commands/shell/protocol.js +0 -79
- package/esm/commands/shell/protocol.js.map +0 -1
- package/esm/commands/shell/types.js.map +0 -1
- package/esm/commands/shell/utils.js.map +0 -1
- package/esm/socket/close-event-emitter.js +0 -28
- package/esm/socket/close-event-emitter.js.map +0 -1
- package/esm/socket/data-event-emitter.js +0 -25
- package/esm/socket/data-event-emitter.js.map +0 -1
- package/esm/socket/logger.js +0 -2
- package/esm/socket/logger.js.map +0 -1
- package/esm/stream/buffered-stream.js +0 -73
- package/esm/stream/buffered-stream.js.map +0 -1
- package/esm/stream/stream.js +0 -41
- package/esm/stream/stream.js.map +0 -1
- package/esm/utils/chunk.js +0 -70
- package/esm/utils/chunk.js.map +0 -1
- package/esm/utils/event-queue.js +0 -104
- package/esm/utils/event-queue.js.map +0 -1
- package/src/commands/demo-mode.ts +0 -160
- package/src/commands/shell/index.ts +0 -68
- package/src/commands/shell/legacy.ts +0 -42
- package/src/commands/shell/protocol.ts +0 -94
- package/src/commands/shell/types.ts +0 -21
- package/src/socket/close-event-emitter.ts +0 -28
- package/src/socket/controller.ts +0 -105
- package/src/socket/data-event-emitter.ts +0 -27
- package/src/socket/logger.ts +0 -12
- package/src/stream/buffered-stream.ts +0 -100
- package/src/stream/stream.ts +0 -50
- package/src/utils/chunk.ts +0 -70
- package/src/utils/event-queue.ts +0 -145
- package/tsconfig.cjs.json +0 -11
- package/tsconfig.esm.json +0 -28
- package/tsconfig.esm.tsbuildinfo +0 -1305
- package/tsconfig.json +0 -18
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { StructAsyncDeserializeStream } from '@yume-chan/struct';
|
|
2
|
+
import type { AdbSocket, AdbSocketInfo } from '../socket/index.js';
|
|
3
|
+
import type { ReadableStream, ReadableStreamDefaultReader } from './detect.js';
|
|
4
|
+
export declare class BufferedStreamEndedError extends Error {
|
|
5
|
+
constructor();
|
|
6
|
+
}
|
|
7
|
+
export declare class BufferedStream {
|
|
8
|
+
private buffer;
|
|
9
|
+
protected readonly stream: ReadableStream<Uint8Array>;
|
|
10
|
+
protected readonly reader: ReadableStreamDefaultReader<Uint8Array>;
|
|
11
|
+
constructor(stream: ReadableStream<Uint8Array>);
|
|
12
|
+
/**
|
|
13
|
+
*
|
|
14
|
+
* @param length
|
|
15
|
+
* @returns
|
|
16
|
+
*/
|
|
17
|
+
read(length: number): Promise<Uint8Array>;
|
|
18
|
+
/**
|
|
19
|
+
* Return a readable stream with unconsumed data (if any) and
|
|
20
|
+
* all data from the wrapped stream.
|
|
21
|
+
* @returns A `ReadableStream`
|
|
22
|
+
*/
|
|
23
|
+
release(): ReadableStream<Uint8Array>;
|
|
24
|
+
close(): void;
|
|
25
|
+
}
|
|
26
|
+
export declare class AdbBufferedStream extends BufferedStream implements AdbSocketInfo, StructAsyncDeserializeStream {
|
|
27
|
+
protected readonly socket: AdbSocket;
|
|
28
|
+
get localId(): number;
|
|
29
|
+
get remoteId(): number;
|
|
30
|
+
get localCreated(): boolean;
|
|
31
|
+
get serviceString(): string;
|
|
32
|
+
get writable(): import("web-streams-polyfill").WritableStream<Uint8Array>;
|
|
33
|
+
constructor(socket: AdbSocket);
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=buffered.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buffered.d.ts","sourceRoot":"","sources":["../../src/stream/buffered.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,mBAAmB,CAAC;AACtE,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnE,OAAO,KAAK,EAAE,cAAc,EAAE,2BAA2B,EAAE,MAAM,aAAa,CAAC;AAG/E,qBAAa,wBAAyB,SAAQ,KAAK;;CAOlD;AAED,qBAAa,cAAc;IACvB,OAAO,CAAC,MAAM,CAAyB;IAEvC,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,cAAc,CAAC,UAAU,CAAC,CAAC;IAEtD,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,2BAA2B,CAAC,UAAU,CAAC,CAAC;gBAEhD,MAAM,EAAE,cAAc,CAAC,UAAU,CAAC;IAKrD;;;;OAIG;IACU,IAAI,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC;IA4DtD;;;;OAIG;IACI,OAAO,IAAI,cAAc,CAAC,UAAU,CAAC;IA6BrC,KAAK;CAGf;AAED,qBAAa,iBACT,SAAQ,cACR,YAAW,aAAa,EAAE,4BAA4B;IACtD,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAC;IAErC,IAAW,OAAO,WAAkC;IACpD,IAAW,QAAQ,WAAmC;IACtD,IAAW,YAAY,YAAuC;IAC9D,IAAW,aAAa,WAAwC;IAEhE,IAAW,QAAQ,8DAAmC;gBAEnC,MAAM,EAAE,SAAS;CAIvC"}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { PushReadableStream } from "./transform.js";
|
|
2
|
+
export class BufferedStreamEndedError extends Error {
|
|
3
|
+
constructor() {
|
|
4
|
+
super('Stream ended');
|
|
5
|
+
// Fix Error's prototype chain when compiling to ES5
|
|
6
|
+
Object.setPrototypeOf(this, new.target.prototype);
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
export class BufferedStream {
|
|
10
|
+
buffer;
|
|
11
|
+
stream;
|
|
12
|
+
reader;
|
|
13
|
+
constructor(stream) {
|
|
14
|
+
this.stream = stream;
|
|
15
|
+
this.reader = stream.getReader();
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
*
|
|
19
|
+
* @param length
|
|
20
|
+
* @returns
|
|
21
|
+
*/
|
|
22
|
+
async read(length) {
|
|
23
|
+
let array;
|
|
24
|
+
let index;
|
|
25
|
+
if (this.buffer) {
|
|
26
|
+
const buffer = this.buffer;
|
|
27
|
+
if (buffer.byteLength > length) {
|
|
28
|
+
this.buffer = buffer.subarray(length);
|
|
29
|
+
return buffer.subarray(0, length);
|
|
30
|
+
}
|
|
31
|
+
array = new Uint8Array(length);
|
|
32
|
+
array.set(buffer);
|
|
33
|
+
index = buffer.byteLength;
|
|
34
|
+
this.buffer = undefined;
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
const { done, value } = await this.reader.read();
|
|
38
|
+
if (done) {
|
|
39
|
+
throw new BufferedStreamEndedError();
|
|
40
|
+
}
|
|
41
|
+
if (value.byteLength === length) {
|
|
42
|
+
return value;
|
|
43
|
+
}
|
|
44
|
+
if (value.byteLength > length) {
|
|
45
|
+
this.buffer = value.subarray(length);
|
|
46
|
+
return value.subarray(0, length);
|
|
47
|
+
}
|
|
48
|
+
array = new Uint8Array(length);
|
|
49
|
+
array.set(value);
|
|
50
|
+
index = value.byteLength;
|
|
51
|
+
}
|
|
52
|
+
while (index < length) {
|
|
53
|
+
const left = length - index;
|
|
54
|
+
const { done, value } = await this.reader.read();
|
|
55
|
+
if (done) {
|
|
56
|
+
throw new BufferedStreamEndedError();
|
|
57
|
+
}
|
|
58
|
+
if (value.byteLength === left) {
|
|
59
|
+
array.set(value, index);
|
|
60
|
+
return array;
|
|
61
|
+
}
|
|
62
|
+
if (value.byteLength > left) {
|
|
63
|
+
array.set(value.subarray(0, left), index);
|
|
64
|
+
this.buffer = value.subarray(left);
|
|
65
|
+
return array;
|
|
66
|
+
}
|
|
67
|
+
array.set(value, index);
|
|
68
|
+
index += value.byteLength;
|
|
69
|
+
}
|
|
70
|
+
return array;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Return a readable stream with unconsumed data (if any) and
|
|
74
|
+
* all data from the wrapped stream.
|
|
75
|
+
* @returns A `ReadableStream`
|
|
76
|
+
*/
|
|
77
|
+
release() {
|
|
78
|
+
if (this.buffer) {
|
|
79
|
+
return new PushReadableStream(async (controller) => {
|
|
80
|
+
// Put the remaining data back to the stream
|
|
81
|
+
await controller.enqueue(this.buffer);
|
|
82
|
+
// Manually pipe the stream
|
|
83
|
+
while (true) {
|
|
84
|
+
try {
|
|
85
|
+
const { done, value } = await this.reader.read();
|
|
86
|
+
if (done) {
|
|
87
|
+
controller.close();
|
|
88
|
+
break;
|
|
89
|
+
}
|
|
90
|
+
else {
|
|
91
|
+
await controller.enqueue(value);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
catch (e) {
|
|
95
|
+
controller.error(e);
|
|
96
|
+
break;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
else {
|
|
102
|
+
// Simply release the reader and return the stream
|
|
103
|
+
this.reader.releaseLock();
|
|
104
|
+
return this.stream;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
close() {
|
|
108
|
+
this.reader.cancel();
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
export class AdbBufferedStream extends BufferedStream {
|
|
112
|
+
socket;
|
|
113
|
+
get localId() { return this.socket.localId; }
|
|
114
|
+
get remoteId() { return this.socket.remoteId; }
|
|
115
|
+
get localCreated() { return this.socket.localCreated; }
|
|
116
|
+
get serviceString() { return this.socket.serviceString; }
|
|
117
|
+
get writable() { return this.socket.writable; }
|
|
118
|
+
constructor(socket) {
|
|
119
|
+
super(socket.readable);
|
|
120
|
+
this.socket = socket;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
//# sourceMappingURL=buffered.js.map
|
|
@@ -0,0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CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC;IAEhE,IAAW,QAAQ,KAAK,OAAO,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC;IAEtD,YAAmB,MAAiB;QAChC,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;QACvB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACzB,CAAC;CACJ"}
|
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
/** A controller object that allows you to abort one or more DOM requests as and when desired. */
|
|
2
|
+
export interface AbortController {
|
|
3
|
+
/**
|
|
4
|
+
* Returns the AbortSignal object associated with this object.
|
|
5
|
+
*/
|
|
6
|
+
readonly signal: AbortSignal;
|
|
7
|
+
/**
|
|
8
|
+
* Invoking this method will set this object's AbortSignal's aborted flag and signal to any observers that the associated activity is to be aborted.
|
|
9
|
+
*/
|
|
10
|
+
abort(): void;
|
|
11
|
+
}
|
|
12
|
+
export interface AbortSignalEventMap {
|
|
13
|
+
"abort": any;
|
|
14
|
+
}
|
|
15
|
+
export interface EventListenerOptions {
|
|
16
|
+
capture?: boolean;
|
|
17
|
+
}
|
|
18
|
+
export interface AddEventListenerOptions extends EventListenerOptions {
|
|
19
|
+
once?: boolean;
|
|
20
|
+
passive?: boolean;
|
|
21
|
+
signal?: AbortSignal;
|
|
22
|
+
}
|
|
23
|
+
/** A signal object that allows you to communicate with a DOM request (such as a Fetch) and abort it if required via an AbortController object. */
|
|
24
|
+
export interface AbortSignal {
|
|
25
|
+
/**
|
|
26
|
+
* Returns true if this AbortSignal's AbortController has signaled to abort, and false otherwise.
|
|
27
|
+
*/
|
|
28
|
+
readonly aborted: boolean;
|
|
29
|
+
onabort: ((this: AbortSignal, ev: any) => any) | null;
|
|
30
|
+
addEventListener<K extends keyof AbortSignalEventMap>(type: K, listener: (this: AbortSignal, ev: AbortSignalEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
31
|
+
addEventListener(type: string, listener: (ev: any) => void, options?: boolean | AddEventListenerOptions): void;
|
|
32
|
+
removeEventListener<K extends keyof AbortSignalEventMap>(type: K, listener: (this: AbortSignal, ev: AbortSignalEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
33
|
+
removeEventListener(type: string, listener: (ev: any) => void, options?: boolean | EventListenerOptions): void;
|
|
34
|
+
}
|
|
35
|
+
export declare let AbortController: {
|
|
36
|
+
prototype: AbortController;
|
|
37
|
+
new (): AbortController;
|
|
38
|
+
};
|
|
39
|
+
export declare let AbortSignal: {
|
|
40
|
+
prototype: AbortSignal;
|
|
41
|
+
new (): AbortSignal;
|
|
42
|
+
};
|
|
43
|
+
export interface QueuingStrategy<T = any> {
|
|
44
|
+
highWaterMark?: number;
|
|
45
|
+
size?: QueuingStrategySize<T>;
|
|
46
|
+
}
|
|
47
|
+
export interface QueuingStrategyInit {
|
|
48
|
+
/**
|
|
49
|
+
* Creates a new ByteLengthQueuingStrategy with the provided high water mark.
|
|
50
|
+
*
|
|
51
|
+
* Note that the provided high water mark will not be validated ahead of time. Instead, if it is negative, NaN, or not a number, the resulting ByteLengthQueuingStrategy will cause the corresponding stream constructor to throw.
|
|
52
|
+
*/
|
|
53
|
+
highWaterMark: number;
|
|
54
|
+
}
|
|
55
|
+
export interface ReadableStreamDefaultReadDoneResult {
|
|
56
|
+
done: true;
|
|
57
|
+
value?: undefined;
|
|
58
|
+
}
|
|
59
|
+
export interface ReadableStreamDefaultReadValueResult<T> {
|
|
60
|
+
done: false;
|
|
61
|
+
value: T;
|
|
62
|
+
}
|
|
63
|
+
export interface ReadableWritablePair<R = any, W = any> {
|
|
64
|
+
readable: ReadableStream<R>;
|
|
65
|
+
/**
|
|
66
|
+
* Provides a convenient, chainable way of piping this readable stream through a transform stream (or any other { writable, readable } pair). It simply pipes the stream into the writable side of the supplied pair, and returns the readable side for further use.
|
|
67
|
+
*
|
|
68
|
+
* Piping a stream will lock it for the duration of the pipe, preventing any other consumer from acquiring a reader.
|
|
69
|
+
*/
|
|
70
|
+
writable: WritableStream<W>;
|
|
71
|
+
}
|
|
72
|
+
export interface StreamPipeOptions {
|
|
73
|
+
preventAbort?: boolean;
|
|
74
|
+
preventCancel?: boolean;
|
|
75
|
+
/**
|
|
76
|
+
* Pipes this readable stream to a given writable stream destination. The way in which the piping process behaves under various error conditions can be customized with a number of passed options. It returns a promise that fulfills when the piping process completes successfully, or rejects if any errors were encountered.
|
|
77
|
+
*
|
|
78
|
+
* Piping a stream will lock it for the duration of the pipe, preventing any other consumer from acquiring a reader.
|
|
79
|
+
*
|
|
80
|
+
* Errors and closures of the source and destination streams propagate as follows:
|
|
81
|
+
*
|
|
82
|
+
* An error in this source readable stream will abort destination, unless preventAbort is truthy. The returned promise will be rejected with the source's error, or with any error that occurs during aborting the destination.
|
|
83
|
+
*
|
|
84
|
+
* An error in destination will cancel this source readable stream, unless preventCancel is truthy. The returned promise will be rejected with the destination's error, or with any error that occurs during canceling the source.
|
|
85
|
+
*
|
|
86
|
+
* When this source readable stream closes, destination will be closed, unless preventClose is truthy. The returned promise will be fulfilled once this process completes, unless an error is encountered while closing the destination, in which case it will be rejected with that error.
|
|
87
|
+
*
|
|
88
|
+
* If destination starts out closed or closing, this source readable stream will be canceled, unless preventCancel is true. The returned promise will be rejected with an error indicating piping to a closed stream failed, or with any error that occurs during canceling the source.
|
|
89
|
+
*
|
|
90
|
+
* The signal option can be set to an AbortSignal to allow aborting an ongoing pipe operation via the corresponding AbortController. In this case, this source readable stream will be canceled, and destination aborted, unless the respective options preventCancel or preventAbort are set.
|
|
91
|
+
*/
|
|
92
|
+
preventClose?: boolean;
|
|
93
|
+
signal?: AbortSignal;
|
|
94
|
+
}
|
|
95
|
+
export interface Transformer<I = any, O = any> {
|
|
96
|
+
flush?: TransformerFlushCallback<O>;
|
|
97
|
+
readableType?: undefined;
|
|
98
|
+
start?: TransformerStartCallback<O>;
|
|
99
|
+
transform?: TransformerTransformCallback<I, O>;
|
|
100
|
+
writableType?: undefined;
|
|
101
|
+
}
|
|
102
|
+
/** This Streams API interface represents a readable stream of byte data. The Fetch API offers a concrete instance of a ReadableStream through the body property of a Response object. */
|
|
103
|
+
export interface ReadableStream<R = any> {
|
|
104
|
+
readonly locked: boolean;
|
|
105
|
+
cancel(reason?: any): Promise<void>;
|
|
106
|
+
getReader(): ReadableStreamDefaultReader<R>;
|
|
107
|
+
pipeThrough<T>(transform: ReadableWritablePair<T, R>, options?: StreamPipeOptions): ReadableStream<T>;
|
|
108
|
+
pipeTo(destination: WritableStream<R>, options?: StreamPipeOptions): Promise<void>;
|
|
109
|
+
tee(): [ReadableStream<R>, ReadableStream<R>];
|
|
110
|
+
}
|
|
111
|
+
export declare let ReadableStream: {
|
|
112
|
+
prototype: ReadableStream;
|
|
113
|
+
new <R = any>(underlyingSource?: UnderlyingSource<R>, strategy?: QueuingStrategy<R>): ReadableStream<R>;
|
|
114
|
+
};
|
|
115
|
+
export interface ReadableStreamDefaultController<R = any> {
|
|
116
|
+
readonly desiredSize: number | null;
|
|
117
|
+
close(): void;
|
|
118
|
+
enqueue(chunk?: R): void;
|
|
119
|
+
error(e?: any): void;
|
|
120
|
+
}
|
|
121
|
+
export declare let ReadableStreamDefaultController: {
|
|
122
|
+
prototype: ReadableStreamDefaultController;
|
|
123
|
+
new (): ReadableStreamDefaultController;
|
|
124
|
+
};
|
|
125
|
+
export interface ReadableStreamDefaultReader<R = any> extends ReadableStreamGenericReader {
|
|
126
|
+
read(): Promise<ReadableStreamDefaultReadResult<R>>;
|
|
127
|
+
releaseLock(): void;
|
|
128
|
+
}
|
|
129
|
+
export declare let ReadableStreamDefaultReader: {
|
|
130
|
+
prototype: ReadableStreamDefaultReader;
|
|
131
|
+
new <R = any>(stream: ReadableStream<R>): ReadableStreamDefaultReader<R>;
|
|
132
|
+
};
|
|
133
|
+
export interface ReadableStreamGenericReader {
|
|
134
|
+
readonly closed: Promise<undefined>;
|
|
135
|
+
cancel(reason?: any): Promise<void>;
|
|
136
|
+
}
|
|
137
|
+
export interface TransformStream<I = any, O = any> {
|
|
138
|
+
readonly readable: ReadableStream<O>;
|
|
139
|
+
readonly writable: WritableStream<I>;
|
|
140
|
+
}
|
|
141
|
+
export declare let TransformStream: {
|
|
142
|
+
prototype: TransformStream;
|
|
143
|
+
new <I = any, O = any>(transformer?: Transformer<I, O>, writableStrategy?: QueuingStrategy<I>, readableStrategy?: QueuingStrategy<O>): TransformStream<I, O>;
|
|
144
|
+
};
|
|
145
|
+
export interface TransformStreamDefaultController<O = any> {
|
|
146
|
+
readonly desiredSize: number | null;
|
|
147
|
+
enqueue(chunk?: O): void;
|
|
148
|
+
error(reason?: any): void;
|
|
149
|
+
terminate(): void;
|
|
150
|
+
}
|
|
151
|
+
export declare let TransformStreamDefaultController: {
|
|
152
|
+
prototype: TransformStreamDefaultController;
|
|
153
|
+
new (): TransformStreamDefaultController;
|
|
154
|
+
};
|
|
155
|
+
/** This Streams API interface provides a standard abstraction for writing streaming data to a destination, known as a sink. This object comes with built-in backpressure and queuing. */
|
|
156
|
+
export interface WritableStream<W = any> {
|
|
157
|
+
readonly locked: boolean;
|
|
158
|
+
abort(reason?: any): Promise<void>;
|
|
159
|
+
close(): Promise<void>;
|
|
160
|
+
getWriter(): WritableStreamDefaultWriter<W>;
|
|
161
|
+
}
|
|
162
|
+
export declare let WritableStream: {
|
|
163
|
+
prototype: WritableStream;
|
|
164
|
+
new <W = any>(underlyingSink?: UnderlyingSink<W>, strategy?: QueuingStrategy<W>): WritableStream<W>;
|
|
165
|
+
};
|
|
166
|
+
/** This Streams API interface represents a controller allowing control of a WritableStream's state. When constructing a WritableStream, the underlying sink is given a corresponding WritableStreamDefaultController instance to manipulate. */
|
|
167
|
+
export interface WritableStreamDefaultController {
|
|
168
|
+
error(e?: any): void;
|
|
169
|
+
}
|
|
170
|
+
export declare let WritableStreamDefaultController: {
|
|
171
|
+
prototype: WritableStreamDefaultController;
|
|
172
|
+
new (): WritableStreamDefaultController;
|
|
173
|
+
};
|
|
174
|
+
/** This Streams API interface is the object returned by WritableStream.getWriter() and once created locks the < writer to the WritableStream ensuring that no other streams can write to the underlying sink. */
|
|
175
|
+
export interface WritableStreamDefaultWriter<W = any> {
|
|
176
|
+
readonly closed: Promise<undefined>;
|
|
177
|
+
readonly desiredSize: number | null;
|
|
178
|
+
readonly ready: Promise<undefined>;
|
|
179
|
+
abort(reason?: any): Promise<void>;
|
|
180
|
+
close(): Promise<void>;
|
|
181
|
+
releaseLock(): void;
|
|
182
|
+
write(chunk?: W): Promise<void>;
|
|
183
|
+
}
|
|
184
|
+
export declare let WritableStreamDefaultWriter: {
|
|
185
|
+
prototype: WritableStreamDefaultWriter;
|
|
186
|
+
new <W = any>(stream: WritableStream<W>): WritableStreamDefaultWriter<W>;
|
|
187
|
+
};
|
|
188
|
+
export interface QueuingStrategySize<T = any> {
|
|
189
|
+
(chunk: T): number;
|
|
190
|
+
}
|
|
191
|
+
export interface TransformerFlushCallback<O> {
|
|
192
|
+
(controller: TransformStreamDefaultController<O>): void | PromiseLike<void>;
|
|
193
|
+
}
|
|
194
|
+
export interface TransformerStartCallback<O> {
|
|
195
|
+
(controller: TransformStreamDefaultController<O>): any;
|
|
196
|
+
}
|
|
197
|
+
export interface TransformerTransformCallback<I, O> {
|
|
198
|
+
(chunk: I, controller: TransformStreamDefaultController<O>): void | PromiseLike<void>;
|
|
199
|
+
}
|
|
200
|
+
export interface UnderlyingSink<W = any> {
|
|
201
|
+
abort?: UnderlyingSinkAbortCallback;
|
|
202
|
+
close?: UnderlyingSinkCloseCallback;
|
|
203
|
+
start?: UnderlyingSinkStartCallback;
|
|
204
|
+
type?: undefined;
|
|
205
|
+
write?: UnderlyingSinkWriteCallback<W>;
|
|
206
|
+
}
|
|
207
|
+
export interface UnderlyingSource<R = any> {
|
|
208
|
+
cancel?: UnderlyingSourceCancelCallback;
|
|
209
|
+
pull?: UnderlyingSourcePullCallback<R> | undefined;
|
|
210
|
+
start?: UnderlyingSourceStartCallback<R>;
|
|
211
|
+
type?: undefined;
|
|
212
|
+
}
|
|
213
|
+
export interface UnderlyingSinkAbortCallback {
|
|
214
|
+
(reason?: any): void | PromiseLike<void>;
|
|
215
|
+
}
|
|
216
|
+
export interface UnderlyingSinkCloseCallback {
|
|
217
|
+
(): void | PromiseLike<void>;
|
|
218
|
+
}
|
|
219
|
+
export interface UnderlyingSinkStartCallback {
|
|
220
|
+
(controller: WritableStreamDefaultController): any;
|
|
221
|
+
}
|
|
222
|
+
export interface UnderlyingSinkWriteCallback<W> {
|
|
223
|
+
(chunk: W, controller: WritableStreamDefaultController): void | PromiseLike<void>;
|
|
224
|
+
}
|
|
225
|
+
export interface UnderlyingSourceCancelCallback {
|
|
226
|
+
(reason?: any): void | PromiseLike<void>;
|
|
227
|
+
}
|
|
228
|
+
export interface UnderlyingSourcePullCallback<R> {
|
|
229
|
+
(controller: ReadableStreamController<R>): void | PromiseLike<void>;
|
|
230
|
+
}
|
|
231
|
+
export interface UnderlyingSourceStartCallback<R> {
|
|
232
|
+
(controller: ReadableStreamController<R>): any;
|
|
233
|
+
}
|
|
234
|
+
export declare type ReadableStreamController<T> = ReadableStreamDefaultController<T>;
|
|
235
|
+
export declare type ReadableStreamDefaultReadResult<T> = ReadableStreamDefaultReadValueResult<T> | ReadableStreamDefaultReadDoneResult;
|
|
236
|
+
export declare type ReadableStreamReader<T> = ReadableStreamDefaultReader<T>;
|
|
237
|
+
export interface ReadableStreamIteratorOptions {
|
|
238
|
+
preventCancel?: boolean;
|
|
239
|
+
}
|
|
240
|
+
//# sourceMappingURL=detect.bak.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"detect.bak.d.ts","sourceRoot":"","sources":["../../src/stream/detect.bak.ts"],"names":[],"mappings":"AAaA,iGAAiG;AACjG,MAAM,WAAW,eAAe;IAC5B;;OAEG;IAEH,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;IAC7B;;OAEG;IACH,KAAK,IAAI,IAAI,CAAC;CACjB;AAGD,MAAM,WAAW,mBAA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AY,+BAA+B,CAAC,CAAC,IAAI,oCAAoC,CAAC,CAAC,CAAC,GAAG,mCAAmC,CAAC;AAC/H,oBAAY,oBAAoB,CAAC,CAAC,IAAI,2BAA2B,CAAC,CAAC,CAAC,CAAC;AAGrE,MAAM,WAAW,6BAA6B;IAC1C,aAAa,CAAC,EAAE,OAAO,CAAC;CAC3B"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
// cspell: ignore chainable
|
|
2
|
+
// cspell: ignore backpressure
|
|
3
|
+
// cspell: ignore endregion
|
|
4
|
+
export let AbortController;
|
|
5
|
+
export let AbortSignal;
|
|
6
|
+
({ AbortController, AbortSignal } = globalThis);
|
|
7
|
+
export let ReadableStream;
|
|
8
|
+
export let ReadableStreamDefaultController;
|
|
9
|
+
export let ReadableStreamDefaultReader;
|
|
10
|
+
export let TransformStream;
|
|
11
|
+
export let TransformStreamDefaultController;
|
|
12
|
+
export let WritableStream;
|
|
13
|
+
export let WritableStreamDefaultController;
|
|
14
|
+
export let WritableStreamDefaultWriter;
|
|
15
|
+
// This library can't use `@types/node` or `lib: dom`
|
|
16
|
+
// because they will pollute the global scope
|
|
17
|
+
// So `ReadableStream`, `WritableStream` and `TransformStream` are not available
|
|
18
|
+
if ('ReadableStream' in globalThis && 'WritableStream' in globalThis && 'TransformStream' in globalThis) {
|
|
19
|
+
({
|
|
20
|
+
ReadableStream,
|
|
21
|
+
ReadableStreamDefaultController,
|
|
22
|
+
ReadableStreamDefaultReader,
|
|
23
|
+
TransformStream,
|
|
24
|
+
TransformStreamDefaultController,
|
|
25
|
+
WritableStream,
|
|
26
|
+
WritableStreamDefaultController,
|
|
27
|
+
WritableStreamDefaultWriter,
|
|
28
|
+
} = globalThis);
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
try {
|
|
32
|
+
// // Node.js 16 has Web Streams types in `stream/web` module
|
|
33
|
+
// ({
|
|
34
|
+
// // @ts-ignore
|
|
35
|
+
// ReadableStream,
|
|
36
|
+
// // @ts-ignore
|
|
37
|
+
// ReadableStreamDefaultController,
|
|
38
|
+
// // @ts-ignore
|
|
39
|
+
// ReadableStreamDefaultReader,
|
|
40
|
+
// // @ts-ignore
|
|
41
|
+
// TransformStream,
|
|
42
|
+
// // @ts-ignore
|
|
43
|
+
// TransformStreamDefaultController,
|
|
44
|
+
// // @ts-ignore
|
|
45
|
+
// WritableStream,
|
|
46
|
+
// // @ts-ignore
|
|
47
|
+
// WritableStreamDefaultController,
|
|
48
|
+
// // @ts-ignore
|
|
49
|
+
// WritableStreamDefaultWriter,
|
|
50
|
+
// // @ts-ignore
|
|
51
|
+
// } = await import(/* webpackIgnore: true */ 'stream/web'));
|
|
52
|
+
}
|
|
53
|
+
catch { }
|
|
54
|
+
}
|
|
55
|
+
// TODO: stream/detect: Load some polyfills
|
|
56
|
+
// @ts-ignore
|
|
57
|
+
if (!ReadableStream || !WritableStream || !TransformStream) {
|
|
58
|
+
// throw new Error('Web Streams API is not available');
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=detect.bak.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"detect.bak.js","sourceRoot":"","sources":["../../src/stream/detect.bak.ts"],"names":[],"mappings":"AAAA,2BAA2B;AAC3B,8BAA8B;AAC9B,2BAA2B;AAqD3B,MAAM,CAAC,IAAI,eAGV,CAAC;AAEF,MAAM,CAAC,IAAI,WAIV,CAAC;AAEF,CAAC,EAAE,eAAe,EAAE,WAAW,EAAE,GAAG,UAAiB,CAAC,CAAC;AAoFvD,MAAM,CAAC,IAAI,cAGV,CAAC;AASF,MAAM,CAAC,IAAI,+BAGV,CAAC;AAOF,MAAM,CAAC,IAAI,2BAGV,CAAC;AAaF,MAAM,CAAC,IAAI,eAGV,CAAC;AASF,MAAM,CAAC,IAAI,gCAGV,CAAC;AAWF,MAAM,CAAC,IAAI,cAGV,CAAC;AAOF,MAAM,CAAC,IAAI,+BAGV,CAAC;AAaF,MAAM,CAAC,IAAI,2BAGV,CAAC;AAyEF,qDAAqD;AACrD,6CAA6C;AAC7C,gFAAgF;AAEhF,IAAI,gBAAgB,IAAI,UAAU,IAAI,gBAAgB,IAAI,UAAU,IAAI,iBAAiB,IAAI,UAAU,EAAE;IACrG,CAAC;QACG,cAAc;QACd,+BAA+B;QAC/B,2BAA2B;QAC3B,eAAe;QACf,gCAAgC;QAChC,cAAc;QACd,+BAA+B;QAC/B,2BAA2B;KAC9B,GAAG,UAAiB,CAAC,CAAC;CAC1B;KAAM;IACH,IAAI;QACA,6DAA6D;QAC7D,KAAK;QACL,oBAAoB;QACpB,sBAAsB;QACtB,oBAAoB;QACpB,uCAAuC;QACvC,oBAAoB;QACpB,mCAAmC;QACnC,oBAAoB;QACpB,uBAAuB;QACvB,oBAAoB;QACpB,wCAAwC;QACxC,oBAAoB;QACpB,sBAAsB;QACtB,oBAAoB;QACpB,uCAAuC;QACvC,oBAAoB;QACpB,mCAAmC;QACnC,oBAAoB;QACpB,6DAA6D;KAChE;IAAC,MAAM,GAAG;CACd;AAED,2CAA2C;AAE3C,aAAa;AACb,IAAI,CAAC,cAAc,IAAI,CAAC,cAAc,IAAI,CAAC,eAAe,EAAE;IACxD,uDAAuD;CAC1D"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { AbortSignal } from "web-streams-polyfill";
|
|
2
|
+
export * from 'web-streams-polyfill';
|
|
3
|
+
/** A controller object that allows you to abort one or more DOM requests as and when desired. */
|
|
4
|
+
export interface AbortController {
|
|
5
|
+
/**
|
|
6
|
+
* Returns the AbortSignal object associated with this object.
|
|
7
|
+
*/
|
|
8
|
+
readonly signal: AbortSignal;
|
|
9
|
+
/**
|
|
10
|
+
* Invoking this method will set this object's AbortSignal's aborted flag and signal to any observers that the associated activity is to be aborted.
|
|
11
|
+
*/
|
|
12
|
+
abort(): void;
|
|
13
|
+
}
|
|
14
|
+
export declare let AbortController: {
|
|
15
|
+
prototype: AbortController;
|
|
16
|
+
new (): AbortController;
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=detect.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"detect.d.ts","sourceRoot":"","sources":["../../src/stream/detect.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAExD,cAAc,sBAAsB,CAAC;AAErC,iGAAiG;AACjG,MAAM,WAAW,eAAe;IAC5B;;OAEG;IAEH,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;IAC7B;;OAEG;IACH,KAAK,IAAI,IAAI,CAAC;CACjB;AAED,eAAO,IAAI,eAAe,EAAE;IACxB,SAAS,EAAE,eAAe,CAAC;IAC3B,QAAO,eAAe,CAAC;CAC1B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"detect.js","sourceRoot":"","sources":["../../src/stream/detect.ts"],"names":[],"mappings":"AAAA,0BAA0B;AAG1B,6DAA6D;AAC7D,cAAc,sBAAsB,CAAC;AAerC,MAAM,CAAC,IAAI,eAGV,CAAC;AAEF,CAAC,EAAE,eAAe,EAAE,GAAG,UAAiB,CAAC,CAAC"}
|