@yume-chan/adb 0.0.10 → 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.
Files changed (318) hide show
  1. package/CHANGELOG.json +26 -0
  2. package/CHANGELOG.md +15 -1
  3. package/LICENSE +1 -1
  4. package/README.md +56 -43
  5. package/esm/adb.d.ts +48 -0
  6. package/esm/adb.d.ts.map +1 -0
  7. package/esm/adb.js +141 -146
  8. package/esm/adb.js.map +1 -1
  9. package/{dts → esm}/auth.d.ts +8 -8
  10. package/esm/auth.d.ts.map +1 -0
  11. package/esm/auth.js +68 -108
  12. package/esm/auth.js.map +1 -1
  13. package/esm/backend.d.ts +9 -0
  14. package/esm/backend.d.ts.map +1 -0
  15. package/{dts → esm}/commands/base.d.ts +1 -1
  16. package/esm/commands/base.d.ts.map +1 -0
  17. package/esm/commands/base.js +1 -0
  18. package/esm/commands/base.js.map +1 -1
  19. package/{dts → esm}/commands/framebuffer.d.ts +3 -3
  20. package/esm/commands/framebuffer.d.ts.map +1 -0
  21. package/esm/commands/framebuffer.js +15 -18
  22. package/esm/commands/framebuffer.js.map +1 -1
  23. package/esm/commands/index.d.ts +9 -0
  24. package/esm/commands/index.d.ts.map +1 -0
  25. package/esm/commands/index.js +8 -8
  26. package/esm/commands/index.js.map +1 -1
  27. package/esm/commands/install.d.ts +4 -0
  28. package/esm/commands/install.d.ts.map +1 -0
  29. package/esm/commands/install.js +21 -13
  30. package/esm/commands/install.js.map +1 -1
  31. package/esm/commands/power.d.ts +23 -0
  32. package/esm/commands/power.d.ts.map +1 -0
  33. package/esm/commands/power.js +45 -0
  34. package/esm/commands/power.js.map +1 -0
  35. package/{dts → esm}/commands/reverse.d.ts +3 -3
  36. package/esm/commands/reverse.d.ts.map +1 -0
  37. package/esm/commands/reverse.js +49 -60
  38. package/esm/commands/reverse.js.map +1 -1
  39. package/esm/commands/subprocess/index.d.ts +57 -0
  40. package/esm/commands/subprocess/index.d.ts.map +1 -0
  41. package/esm/commands/subprocess/index.js +83 -0
  42. package/esm/commands/subprocess/index.js.map +1 -0
  43. package/esm/commands/subprocess/legacy.d.ts +28 -0
  44. package/esm/commands/subprocess/legacy.d.ts.map +1 -0
  45. package/esm/commands/subprocess/legacy.js +44 -0
  46. package/esm/commands/subprocess/legacy.js.map +1 -0
  47. package/esm/commands/subprocess/protocol.d.ts +38 -0
  48. package/esm/commands/subprocess/protocol.d.ts.map +1 -0
  49. package/esm/commands/subprocess/protocol.js +155 -0
  50. package/esm/commands/subprocess/protocol.js.map +1 -0
  51. package/esm/commands/subprocess/types.d.ts +47 -0
  52. package/esm/commands/subprocess/types.d.ts.map +1 -0
  53. package/esm/commands/{shell → subprocess}/types.js +0 -0
  54. package/esm/commands/{shell → subprocess}/types.js.map +1 -1
  55. package/{dts/commands/shell → esm/commands/subprocess}/utils.d.ts +0 -0
  56. package/esm/commands/subprocess/utils.d.ts.map +1 -0
  57. package/esm/commands/{shell → subprocess}/utils.js +0 -0
  58. package/esm/commands/subprocess/utils.js.map +1 -0
  59. package/esm/commands/sync/index.d.ts +8 -0
  60. package/esm/commands/sync/index.d.ts.map +1 -0
  61. package/esm/commands/sync/index.js +7 -7
  62. package/esm/commands/sync/index.js.map +1 -1
  63. package/{dts → esm}/commands/sync/list.d.ts +4 -4
  64. package/esm/commands/sync/list.d.ts.map +1 -0
  65. package/esm/commands/sync/list.js +16 -19
  66. package/esm/commands/sync/list.js.map +1 -1
  67. package/esm/commands/sync/pull.d.ts +11 -0
  68. package/esm/commands/sync/pull.d.ts.map +1 -0
  69. package/esm/commands/sync/pull.js +17 -11
  70. package/esm/commands/sync/pull.js.map +1 -1
  71. package/esm/commands/sync/push.d.ts +8 -0
  72. package/esm/commands/sync/push.d.ts.map +1 -0
  73. package/esm/commands/sync/push.js +19 -37
  74. package/esm/commands/sync/push.js.map +1 -1
  75. package/{dts → esm}/commands/sync/request.d.ts +3 -3
  76. package/esm/commands/sync/request.d.ts.map +1 -0
  77. package/esm/commands/sync/request.js +24 -27
  78. package/esm/commands/sync/request.js.map +1 -1
  79. package/{dts → esm}/commands/sync/response.d.ts +2 -2
  80. package/esm/commands/sync/response.d.ts.map +1 -0
  81. package/esm/commands/sync/response.js +16 -20
  82. package/esm/commands/sync/response.js.map +1 -1
  83. package/{dts → esm}/commands/sync/stat.d.ts +4 -4
  84. package/esm/commands/sync/stat.d.ts.map +1 -0
  85. package/esm/commands/sync/stat.js +22 -27
  86. package/esm/commands/sync/stat.js.map +1 -1
  87. package/esm/commands/sync/sync.d.ts +83 -0
  88. package/esm/commands/sync/sync.d.ts.map +1 -0
  89. package/esm/commands/sync/sync.js +92 -89
  90. package/esm/commands/sync/sync.js.map +1 -1
  91. package/{dts → esm}/commands/tcpip.d.ts +1 -1
  92. package/{dts → esm}/commands/tcpip.d.ts.map +1 -1
  93. package/esm/commands/tcpip.js +14 -19
  94. package/esm/commands/tcpip.js.map +1 -1
  95. package/{dts → esm}/crypto.d.ts +7 -7
  96. package/esm/crypto.d.ts.map +1 -0
  97. package/esm/crypto.js +26 -29
  98. package/esm/crypto.js.map +1 -1
  99. package/{dts → esm}/features.d.ts +0 -0
  100. package/{dts → esm}/features.d.ts.map +0 -0
  101. package/esm/features.js +1 -1
  102. package/esm/features.js.map +1 -1
  103. package/esm/index.d.ts +11 -0
  104. package/esm/index.d.ts.map +1 -0
  105. package/esm/index.js +10 -10
  106. package/esm/index.js.map +1 -1
  107. package/esm/packet.d.ts +28 -0
  108. package/esm/packet.d.ts.map +1 -0
  109. package/esm/packet.js +26 -51
  110. package/esm/packet.js.map +1 -1
  111. package/esm/socket/controller.d.ts +37 -0
  112. package/esm/socket/controller.d.ts.map +1 -0
  113. package/esm/socket/controller.js +52 -66
  114. package/esm/socket/controller.js.map +1 -1
  115. package/{dts → esm}/socket/dispatcher.d.ts +10 -23
  116. package/esm/socket/dispatcher.d.ts.map +1 -0
  117. package/esm/socket/dispatcher.js +148 -164
  118. package/esm/socket/dispatcher.js.map +1 -1
  119. package/esm/socket/index.d.ts +3 -0
  120. package/esm/socket/index.d.ts.map +1 -0
  121. package/esm/socket/index.js +2 -6
  122. package/esm/socket/index.js.map +1 -1
  123. package/esm/socket/socket.d.ts +34 -0
  124. package/esm/socket/socket.d.ts.map +1 -0
  125. package/esm/socket/socket.js +69 -14
  126. package/esm/socket/socket.js.map +1 -1
  127. package/esm/stream/buffered.d.ts +35 -0
  128. package/esm/stream/buffered.d.ts.map +1 -0
  129. package/esm/stream/buffered.js +123 -0
  130. package/esm/stream/buffered.js.map +1 -0
  131. package/esm/stream/detect.bak.d.ts +240 -0
  132. package/esm/stream/detect.bak.d.ts.map +1 -0
  133. package/esm/stream/detect.bak.js +60 -0
  134. package/esm/stream/detect.bak.js.map +1 -0
  135. package/esm/stream/detect.d.ts +18 -0
  136. package/esm/stream/detect.d.ts.map +1 -0
  137. package/esm/stream/detect.js +6 -0
  138. package/esm/stream/detect.js.map +1 -0
  139. package/esm/stream/detect.native.d.ts +240 -0
  140. package/esm/stream/detect.native.d.ts.map +1 -0
  141. package/esm/stream/detect.native.js +60 -0
  142. package/esm/stream/detect.native.js.map +1 -0
  143. package/esm/stream/detect.polyfill.d.ts +18 -0
  144. package/esm/stream/detect.polyfill.d.ts.map +1 -0
  145. package/esm/stream/detect.polyfill.js +6 -0
  146. package/esm/stream/detect.polyfill.js.map +1 -0
  147. package/esm/stream/index.d.ts +4 -0
  148. package/esm/stream/index.d.ts.map +1 -0
  149. package/esm/stream/index.js +3 -2
  150. package/esm/stream/index.js.map +1 -1
  151. package/esm/stream/transform.d.ts +98 -0
  152. package/esm/stream/transform.d.ts.map +1 -0
  153. package/esm/stream/transform.js +352 -0
  154. package/esm/stream/transform.js.map +1 -0
  155. package/{dts → esm}/utils/auto-reset-event.d.ts +1 -1
  156. package/esm/utils/auto-reset-event.d.ts.map +1 -0
  157. package/esm/utils/auto-reset-event.js +2 -1
  158. package/esm/utils/auto-reset-event.js.map +1 -1
  159. package/esm/utils/base64.d.ts +5 -0
  160. package/esm/utils/base64.d.ts.map +1 -0
  161. package/esm/utils/base64.js +116 -80
  162. package/esm/utils/base64.js.map +1 -1
  163. package/esm/utils/encoding.d.ts +3 -0
  164. package/{dts → esm}/utils/encoding.d.ts.map +1 -1
  165. package/esm/utils/encoding.js +1 -1
  166. package/esm/utils/encoding.js.map +1 -1
  167. package/esm/utils/index.d.ts +4 -0
  168. package/esm/utils/index.d.ts.map +1 -0
  169. package/esm/utils/index.js +3 -5
  170. package/esm/utils/index.js.map +1 -1
  171. package/package.json +50 -44
  172. package/src/adb.ts +147 -143
  173. package/src/auth.ts +23 -19
  174. package/src/backend.ts +3 -12
  175. package/src/commands/base.ts +1 -1
  176. package/src/commands/framebuffer.ts +4 -4
  177. package/src/commands/index.ts +8 -8
  178. package/src/commands/install.ts +26 -15
  179. package/src/commands/power.ts +54 -0
  180. package/src/commands/reverse.ts +10 -8
  181. package/src/commands/subprocess/index.ts +124 -0
  182. package/src/commands/subprocess/legacy.ts +58 -0
  183. package/src/commands/subprocess/protocol.ts +185 -0
  184. package/src/commands/subprocess/types.ts +55 -0
  185. package/src/commands/{shell → subprocess}/utils.ts +0 -0
  186. package/src/commands/sync/index.ts +7 -7
  187. package/src/commands/sync/list.ts +7 -6
  188. package/src/commands/sync/pull.ts +27 -18
  189. package/src/commands/sync/push.ts +25 -30
  190. package/src/commands/sync/request.ts +7 -7
  191. package/src/commands/sync/response.ts +4 -4
  192. package/src/commands/sync/stat.ts +8 -6
  193. package/src/commands/sync/sync.ts +64 -32
  194. package/src/commands/tcpip.ts +3 -3
  195. package/src/crypto.ts +38 -43
  196. package/src/index.ts +11 -10
  197. package/src/packet.ts +37 -52
  198. package/src/socket/dispatcher.ts +90 -103
  199. package/src/socket/index.ts +2 -6
  200. package/src/socket/socket.ts +117 -16
  201. package/src/stream/buffered.ts +147 -0
  202. package/src/stream/detect.native.ts +362 -0
  203. package/src/stream/detect.polyfill.ts +25 -0
  204. package/src/stream/detect.ts +25 -0
  205. package/src/stream/index.ts +3 -2
  206. package/src/stream/transform.ts +427 -0
  207. package/src/utils/auto-reset-event.ts +1 -1
  208. package/src/utils/base64.ts +161 -129
  209. package/src/utils/encoding.ts +3 -3
  210. package/src/utils/index.ts +3 -5
  211. package/tsconfig.build.json +3 -0
  212. package/tsconfig.build.tsbuildinfo +1 -0
  213. package/tsconfig.test.json +10 -0
  214. package/dts/adb.d.ts +0 -46
  215. package/dts/adb.d.ts.map +0 -1
  216. package/dts/auth.d.ts.map +0 -1
  217. package/dts/backend.d.ts +0 -13
  218. package/dts/backend.d.ts.map +0 -1
  219. package/dts/commands/base.d.ts.map +0 -1
  220. package/dts/commands/demo-mode.d.ts +0 -41
  221. package/dts/commands/demo-mode.d.ts.map +0 -1
  222. package/dts/commands/framebuffer.d.ts.map +0 -1
  223. package/dts/commands/index.d.ts +0 -9
  224. package/dts/commands/index.d.ts.map +0 -1
  225. package/dts/commands/install.d.ts +0 -3
  226. package/dts/commands/install.d.ts.map +0 -1
  227. package/dts/commands/reverse.d.ts.map +0 -1
  228. package/dts/commands/shell/index.d.ts +0 -46
  229. package/dts/commands/shell/index.d.ts.map +0 -1
  230. package/dts/commands/shell/legacy.d.ts +0 -38
  231. package/dts/commands/shell/legacy.d.ts.map +0 -1
  232. package/dts/commands/shell/protocol.d.ts +0 -45
  233. package/dts/commands/shell/protocol.d.ts.map +0 -1
  234. package/dts/commands/shell/types.d.ts +0 -47
  235. package/dts/commands/shell/types.d.ts.map +0 -1
  236. package/dts/commands/shell/utils.d.ts.map +0 -1
  237. package/dts/commands/sync/index.d.ts +0 -8
  238. package/dts/commands/sync/index.d.ts.map +0 -1
  239. package/dts/commands/sync/list.d.ts.map +0 -1
  240. package/dts/commands/sync/pull.d.ts +0 -11
  241. package/dts/commands/sync/pull.d.ts.map +0 -1
  242. package/dts/commands/sync/push.d.ts +0 -8
  243. package/dts/commands/sync/push.d.ts.map +0 -1
  244. package/dts/commands/sync/request.d.ts.map +0 -1
  245. package/dts/commands/sync/response.d.ts.map +0 -1
  246. package/dts/commands/sync/stat.d.ts.map +0 -1
  247. package/dts/commands/sync/sync.d.ts +0 -68
  248. package/dts/commands/sync/sync.d.ts.map +0 -1
  249. package/dts/crypto.d.ts.map +0 -1
  250. package/dts/index.d.ts +0 -11
  251. package/dts/index.d.ts.map +0 -1
  252. package/dts/packet.d.ts +0 -27
  253. package/dts/packet.d.ts.map +0 -1
  254. package/dts/socket/close-event-emitter.d.ts +0 -8
  255. package/dts/socket/close-event-emitter.d.ts.map +0 -1
  256. package/dts/socket/controller.d.ts +0 -43
  257. package/dts/socket/controller.d.ts.map +0 -1
  258. package/dts/socket/data-event-emitter.d.ts +0 -10
  259. package/dts/socket/data-event-emitter.d.ts.map +0 -1
  260. package/dts/socket/dispatcher.d.ts.map +0 -1
  261. package/dts/socket/index.d.ts +0 -7
  262. package/dts/socket/index.d.ts.map +0 -1
  263. package/dts/socket/logger.d.ts +0 -9
  264. package/dts/socket/logger.d.ts.map +0 -1
  265. package/dts/socket/socket.d.ts +0 -22
  266. package/dts/socket/socket.d.ts.map +0 -1
  267. package/dts/stream/buffered-stream.d.ts +0 -28
  268. package/dts/stream/buffered-stream.d.ts.map +0 -1
  269. package/dts/stream/index.d.ts +0 -3
  270. package/dts/stream/index.d.ts.map +0 -1
  271. package/dts/stream/stream.d.ts +0 -15
  272. package/dts/stream/stream.d.ts.map +0 -1
  273. package/dts/utils/auto-reset-event.d.ts.map +0 -1
  274. package/dts/utils/base64.d.ts +0 -7
  275. package/dts/utils/base64.d.ts.map +0 -1
  276. package/dts/utils/chunk.d.ts +0 -3
  277. package/dts/utils/chunk.d.ts.map +0 -1
  278. package/dts/utils/encoding.d.ts +0 -3
  279. package/dts/utils/event-queue.d.ts +0 -35
  280. package/dts/utils/event-queue.d.ts.map +0 -1
  281. package/dts/utils/index.d.ts +0 -6
  282. package/dts/utils/index.d.ts.map +0 -1
  283. package/esm/commands/demo-mode.js +0 -170
  284. package/esm/commands/demo-mode.js.map +0 -1
  285. package/esm/commands/shell/index.js +0 -62
  286. package/esm/commands/shell/index.js.map +0 -1
  287. package/esm/commands/shell/legacy.js +0 -49
  288. package/esm/commands/shell/legacy.js.map +0 -1
  289. package/esm/commands/shell/protocol.js +0 -106
  290. package/esm/commands/shell/protocol.js.map +0 -1
  291. package/esm/commands/shell/utils.js.map +0 -1
  292. package/esm/socket/close-event-emitter.js +0 -28
  293. package/esm/socket/close-event-emitter.js.map +0 -1
  294. package/esm/socket/data-event-emitter.js +0 -25
  295. package/esm/socket/data-event-emitter.js.map +0 -1
  296. package/esm/socket/logger.js +0 -2
  297. package/esm/socket/logger.js.map +0 -1
  298. package/esm/stream/buffered-stream.js +0 -67
  299. package/esm/stream/buffered-stream.js.map +0 -1
  300. package/esm/stream/stream.js +0 -41
  301. package/esm/stream/stream.js.map +0 -1
  302. package/esm/utils/chunk.js +0 -70
  303. package/esm/utils/chunk.js.map +0 -1
  304. package/esm/utils/event-queue.js +0 -104
  305. package/esm/utils/event-queue.js.map +0 -1
  306. package/src/commands/demo-mode.ts +0 -160
  307. package/src/commands/shell/index.ts +0 -87
  308. package/src/commands/shell/legacy.ts +0 -59
  309. package/src/commands/shell/protocol.ts +0 -121
  310. package/src/commands/shell/types.ts +0 -55
  311. package/src/socket/close-event-emitter.ts +0 -28
  312. package/src/socket/controller.ts +0 -105
  313. package/src/socket/data-event-emitter.ts +0 -27
  314. package/src/socket/logger.ts +0 -12
  315. package/src/stream/buffered-stream.ts +0 -92
  316. package/src/stream/stream.ts +0 -50
  317. package/src/utils/chunk.ts +0 -70
  318. package/src/utils/event-queue.ts +0 -145
@@ -6,7 +6,6 @@ const paddingChar = '='.charCodeAt(0);
6
6
  function addRange(start: string, end: string) {
7
7
  const charCodeStart = start.charCodeAt(0);
8
8
  const charCodeEnd = end.charCodeAt(0);
9
- const length = charCodeEnd - charCodeStart + 1;
10
9
 
11
10
  for (let charCode = charCodeStart; charCode <= charCodeEnd; charCode += 1) {
12
11
  charToIndex[String.fromCharCode(charCode)] = indexToChar.length;
@@ -27,122 +26,156 @@ export function calculateBase64EncodedLength(inputLength: number): [outputLength
27
26
  }
28
27
 
29
28
  export function encodeBase64(
30
- input: ArrayBuffer | Uint8Array,
31
- inputOffset?: number,
32
- inputLength?: number,
33
- ): ArrayBuffer; // overload 1
29
+ input: Uint8Array,
30
+ ): Uint8Array;
34
31
  export function encodeBase64(
35
- input: ArrayBuffer | Uint8Array,
36
- output: ArrayBuffer | Uint8Array,
37
- outputOffset?: number
38
- ): number; // overload 2
32
+ input: Uint8Array,
33
+ output: Uint8Array,
34
+ ): number;
39
35
  export function encodeBase64(
40
- input: ArrayBuffer | Uint8Array,
41
- inputOffset: number,
42
- output: ArrayBuffer | Uint8Array,
43
- outputOffset?: number
44
- ): number; // overload 3
45
- export function encodeBase64(
46
- input: ArrayBuffer | Uint8Array,
47
- inputOffset: number,
48
- inputLength: number,
49
- output: ArrayBuffer | Uint8Array,
50
- outputOffset?: number
51
- ): number; // overload 4
52
- export function encodeBase64(
53
- input: ArrayBuffer | Uint8Array,
54
- arg1?: number | ArrayBuffer | Uint8Array,
55
- arg2?: number | ArrayBuffer | Uint8Array,
56
- _arg3?: number | ArrayBuffer | Uint8Array,
57
- _arg4?: number,
58
- ): ArrayBuffer | number {
59
- if (input instanceof ArrayBuffer) {
60
- input = new Uint8Array(input);
61
- }
36
+ input: Uint8Array,
37
+ output?: Uint8Array,
38
+ ): Uint8Array | number {
39
+ const [outputLength, paddingLength] = calculateBase64EncodedLength(input.length);
40
+
41
+ if (!output) {
42
+ output = new Uint8Array(outputLength);
43
+ encodeForward(input, output, paddingLength);
44
+ return output;
45
+ } else {
46
+ if (output.length < outputLength) {
47
+ throw new Error('output buffer is too small');
48
+ }
49
+
50
+ output = output.subarray(0, outputLength);
51
+
52
+ // When input and output are on same ArrayBuffer,
53
+ // we check if it's possible to encode in-place.
54
+ if (input.buffer !== output.buffer) {
55
+ encodeForward(input, output, paddingLength);
56
+ } else if (output.byteOffset + output.length - (paddingLength + 1) <= input.byteOffset + input.length) {
57
+ // Output ends before input ends
58
+ // So output won't catch up with input.
59
+
60
+ // Depends on padding length,
61
+ // it's possible to write 1-3 bytes after input ends.
62
+ // spell: disable-next-line
63
+ // | aaaaaabb | | | |
64
+ // | aaaaaa | bb0000 | = | = |
65
+ //
66
+ // spell: disable-next-line
67
+ // | aaaaaabb | bbbbcccc | | |
68
+ // | aaaaaa | bbbbbb | cccc00 | = |
69
+ //
70
+ // spell: disable-next-line
71
+ // | aaaaaabb | bbbbcccc | ccdddddd | |
72
+ // | aaaaaa | bbbbbb | cccccc | dddddd |
73
+
74
+ // Must encode forwards.
75
+ encodeForward(input, output, paddingLength);
76
+ } else if (output.byteOffset >= input.byteOffset - 1) {
77
+ // Output starts after input starts
78
+ // So in backwards, output can't catch up with input.
79
+
80
+ // Because first 3 bytes becomes 4 bytes,
81
+ // it's possible to write 1 byte before input starts.
82
+ // spell: disable-next-line
83
+ // | | aaaaaabb | bbbbcccc | ccdddddd |
84
+ // | aaaaaa | bbbbbb | cccccc | dddddd |
85
+
86
+ // Must encode backwards.
87
+ encodeBackward(input, output, paddingLength);
88
+ } else {
89
+ // Input is in the middle of output,
90
+ // not possible to read neither first or last three bytes,
91
+ throw new Error('input and output cannot overlap');
92
+ }
62
93
 
63
- // Because `Uint8Array` is type compatible with `ArrayBuffer`,
64
- // TypeScript doesn't correctly narrow `input` to `Uint8Array` when assigning.
65
- // Manually eliminate `ArrayBuffer` from `input` with a type guard.
66
- if (input instanceof ArrayBuffer) {
67
- return input;
94
+ return outputLength;
68
95
  }
96
+ }
69
97
 
70
- let inputOffset: number;
71
- let inputLength: number;
72
- let output: Uint8Array;
73
- let outputOffset: number;
98
+ function encodeForward(input: Uint8Array, output: Uint8Array, paddingLength: number) {
99
+ let inputIndex = 0;
100
+ let outputIndex = 0;
74
101
 
75
- let outputArgumentIndex: number;
76
- if (typeof arg1 === 'number') {
77
- // overload 1, 3, 4
78
- inputOffset = arg1;
102
+ while (inputIndex < input.length - 2) {
103
+ /* cspell: disable-next-line */
104
+ // aaaaaabb
105
+ const x = input[inputIndex]!;
106
+ inputIndex += 1;
79
107
 
80
- if (typeof arg2 === 'number') {
81
- // overload 1, 4
82
- inputLength = arg2;
83
- outputArgumentIndex = 3;
84
- } else {
85
- // overload 3
86
- inputLength = input.byteLength - inputOffset;
87
- outputArgumentIndex = 2;
88
- }
89
- } else {
90
- // overload 2
91
- inputOffset = 0;
92
- inputLength = input.byteLength;
93
- outputArgumentIndex = 1;
94
- }
108
+ /* cspell: disable-next-line */
109
+ // bbbbcccc
110
+ const y = input[inputIndex]!;
111
+ inputIndex += 1;
95
112
 
96
- const [outputLength, paddingLength] = calculateBase64EncodedLength(inputLength);
113
+ /* cspell: disable-next-line */
114
+ // ccdddddd
115
+ const z = input[inputIndex]!;
116
+ inputIndex += 1;
97
117
 
98
- let maybeOutput: ArrayBuffer | Uint8Array | undefined = arguments[outputArgumentIndex];
99
- let outputType: 'ArrayBuffer' | 'number';
100
- if (maybeOutput) {
101
- outputOffset = arguments[outputArgumentIndex + 1] ?? 0;
118
+ output[outputIndex] = indexToChar[x >> 2]!;
119
+ outputIndex += 1;
102
120
 
103
- if (maybeOutput.byteLength - outputOffset < outputLength) {
104
- throw new Error('output buffer is too small');
105
- }
121
+ output[outputIndex] = indexToChar[((x & 0b11) << 4) | (y >> 4)]!;
122
+ outputIndex += 1;
106
123
 
107
- if (maybeOutput instanceof ArrayBuffer) {
108
- output = new Uint8Array(maybeOutput);
109
- } else {
110
- output = maybeOutput;
111
- }
124
+ output[outputIndex] = indexToChar[((y & 0b1111) << 2) | (z >> 6)]!;
125
+ outputIndex += 1;
112
126
 
113
- outputType = 'number';
114
- } else {
115
- const buffer = new ArrayBuffer(outputLength);
116
- output = new Uint8Array(buffer);
117
- outputOffset = 0;
118
- outputType = 'ArrayBuffer';
127
+ output[outputIndex] = indexToChar[z & 0b111111]!;
128
+ outputIndex += 1;
119
129
  }
120
130
 
121
- // Because `Uint8Array` is type compatible with `ArrayBuffer`,
122
- // TypeScript doesn't correctly narrow `output` to `Uint8Array` when assigning.
123
- // Manually eliminate `ArrayBuffer` from `output` with a type guard.
124
- if (output instanceof ArrayBuffer) {
125
- return output;
126
- }
131
+ if (paddingLength === 2) {
132
+ /* cspell: disable-next-line */
133
+ // aaaaaabb
134
+ const x = input[inputIndex]!;
135
+ inputIndex += 1;
127
136
 
128
- if (input.buffer === output.buffer) {
129
- const bufferInputStart = input.byteOffset + inputOffset;
130
- const bufferOutputStart = output.byteOffset + outputOffset;
131
- if (bufferOutputStart < bufferInputStart - 1) {
132
- const bufferOutputEnd = bufferOutputStart + outputLength;
133
- if (bufferOutputEnd >= bufferInputStart) {
134
- throw new Error('input and output buffer can not be overlapping');
135
- }
136
- }
137
+ output[outputIndex] = indexToChar[x >> 2]!;
138
+ outputIndex += 1;
139
+
140
+ output[outputIndex] = indexToChar[((x & 0b11) << 4)]!;
141
+ outputIndex += 1;
142
+
143
+ output[outputIndex] = paddingChar;
144
+ outputIndex += 1;
145
+
146
+ output[outputIndex] = paddingChar;
147
+ } else if (paddingLength === 1) {
148
+ /* cspell: disable-next-line */
149
+ // aaaaaabb
150
+ const x = input[inputIndex]!;
151
+ inputIndex += 1;
152
+
153
+ /* cspell: disable-next-line */
154
+ // bbbbcccc
155
+ const y = input[inputIndex]!;
156
+ inputIndex += 1;
157
+
158
+ output[outputIndex] = indexToChar[x >> 2]!;
159
+ outputIndex += 1;
160
+
161
+ output[outputIndex] = indexToChar[((x & 0b11) << 4) | (y >> 4)]!;
162
+ outputIndex += 1;
163
+
164
+ output[outputIndex] = indexToChar[((y & 0b1111) << 2)]!;
165
+ outputIndex += 1;
166
+
167
+ output[outputIndex] = paddingChar;
137
168
  }
169
+ }
138
170
 
139
- // Run backward to do in-place overwrite
140
- let inputIndex = inputOffset + inputLength - 1;
141
- let outputIndex = outputOffset + outputLength - 1;
171
+ function encodeBackward(input: Uint8Array, output: Uint8Array, paddingLength: number) {
172
+ let inputIndex = input.length - 1;
173
+ let outputIndex = output.length - 1;
142
174
 
143
175
  if (paddingLength === 2) {
176
+ /* cspell: disable-next-line */
144
177
  // aaaaaabb
145
- const x = input[inputIndex];
178
+ const x = input[inputIndex]!;
146
179
  inputIndex -= 1;
147
180
 
148
181
  output[outputIndex] = paddingChar;
@@ -151,67 +184,66 @@ export function encodeBase64(
151
184
  output[outputIndex] = paddingChar;
152
185
  outputIndex -= 1;
153
186
 
154
- output[outputIndex] = indexToChar[((x & 0b11) << 4)];
187
+ output[outputIndex] = indexToChar[((x & 0b11) << 4)]!;
155
188
  outputIndex -= 1;
156
189
 
157
- output[outputIndex] = indexToChar[x >> 2];
190
+ output[outputIndex] = indexToChar[x >> 2]!;
158
191
  outputIndex -= 1;
159
192
  } else if (paddingLength === 1) {
193
+ /* cspell: disable-next-line */
160
194
  // bbbbcccc
161
- const y = input[inputIndex];
195
+ const y = input[inputIndex]!;
162
196
  inputIndex -= 1;
163
197
 
198
+ /* cspell: disable-next-line */
164
199
  // aaaaaabb
165
- const x = input[inputIndex];
200
+ const x = input[inputIndex]!;
166
201
  inputIndex -= 1;
167
202
 
168
203
  output[outputIndex] = paddingChar;
169
204
  outputIndex -= 1;
170
205
 
171
- output[outputIndex] = indexToChar[((y & 0b1111) << 2)];
206
+ output[outputIndex] = indexToChar[((y & 0b1111) << 2)]!;
172
207
  outputIndex -= 1;
173
208
 
174
- output[outputIndex] = indexToChar[((x & 0b11) << 4) | (y >> 4)];
209
+ output[outputIndex] = indexToChar[((x & 0b11) << 4) | (y >> 4)]!;
175
210
  outputIndex -= 1;
176
211
 
177
- output[outputIndex] = indexToChar[x >> 2];
212
+ output[outputIndex] = indexToChar[x >> 2]!;
178
213
  outputIndex -= 1;
179
214
  }
180
215
 
181
- while (inputIndex >= inputOffset) {
216
+ while (inputIndex >= 0) {
217
+ /* cspell: disable-next-line */
182
218
  // ccdddddd
183
- const z = input[inputIndex];
219
+ const z = input[inputIndex]!;
184
220
  inputIndex -= 1;
185
221
 
222
+ /* cspell: disable-next-line */
186
223
  // bbbbcccc
187
- const y = input[inputIndex];
224
+ const y = input[inputIndex]!;
188
225
  inputIndex -= 1;
189
226
 
227
+ /* cspell: disable-next-line */
190
228
  // aaaaaabb
191
- const x = input[inputIndex];
229
+ const x = input[inputIndex]!;
192
230
  inputIndex -= 1;
193
231
 
194
- output[outputIndex] = indexToChar[z & 0b111111];
232
+ output[outputIndex] = indexToChar[z & 0b111111]!;
195
233
  outputIndex -= 1;
196
234
 
197
- output[outputIndex] = indexToChar[((y & 0b1111) << 2) | (z >> 6)];
235
+ output[outputIndex] = indexToChar[((y & 0b1111) << 2) | (z >> 6)]!;
198
236
  outputIndex -= 1;
199
237
 
200
- output[outputIndex] = indexToChar[((x & 0b11) << 4) | (y >> 4)];
238
+ output[outputIndex] = indexToChar[((x & 0b11) << 4) | (y >> 4)]!;
201
239
  outputIndex -= 1;
202
240
 
203
- output[outputIndex] = indexToChar[x >> 2];
241
+ output[outputIndex] = indexToChar[x >> 2]!;
204
242
  outputIndex -= 1;
205
243
  }
206
-
207
- if (outputType === 'ArrayBuffer') {
208
- return output.buffer;
209
- } else {
210
- return outputLength;
211
- }
212
244
  }
213
245
 
214
- export function decodeBase64(input: string): ArrayBuffer {
246
+ export function decodeBase64(input: string): Uint8Array {
215
247
  let padding: number;
216
248
  if (input[input.length - 2] === '=') {
217
249
  padding = 2;
@@ -226,16 +258,16 @@ export function decodeBase64(input: string): ArrayBuffer {
226
258
  let dIndex = 0;
227
259
 
228
260
  while (sIndex < input.length - (padding !== 0 ? 4 : 0)) {
229
- const a = charToIndex[input[sIndex]];
261
+ const a = charToIndex[input[sIndex]!]!;
230
262
  sIndex += 1;
231
263
 
232
- const b = charToIndex[input[sIndex]];
264
+ const b = charToIndex[input[sIndex]!]!;
233
265
  sIndex += 1;
234
266
 
235
- const c = charToIndex[input[sIndex]];
267
+ const c = charToIndex[input[sIndex]!]!;
236
268
  sIndex += 1;
237
269
 
238
- const d = charToIndex[input[sIndex]];
270
+ const d = charToIndex[input[sIndex]!]!;
239
271
  sIndex += 1;
240
272
 
241
273
  result[dIndex] = (a << 2) | ((b & 0b11_0000) >> 4);
@@ -249,26 +281,26 @@ export function decodeBase64(input: string): ArrayBuffer {
249
281
  }
250
282
 
251
283
  if (padding === 1) {
252
- const a = charToIndex[input[sIndex]];
284
+ const a = charToIndex[input[sIndex]!]!;
253
285
  sIndex += 1;
254
286
 
255
- const b = charToIndex[input[sIndex]];
287
+ const b = charToIndex[input[sIndex]!]!;
256
288
  sIndex += 1;
257
289
 
258
- const c = charToIndex[input[sIndex]];
290
+ const c = charToIndex[input[sIndex]!]!;
259
291
 
260
292
  result[dIndex] = (a << 2) | ((b & 0b11_0000) >> 4);
261
293
  dIndex += 1;
262
294
 
263
295
  result[dIndex] = ((b & 0b1111) << 4) | ((c & 0b11_1100) >> 2);
264
296
  } else if (padding === 2) {
265
- const a = charToIndex[input[sIndex]];
297
+ const a = charToIndex[input[sIndex]!]!;
266
298
  sIndex += 1;
267
299
 
268
- const b = charToIndex[input[sIndex]];
300
+ const b = charToIndex[input[sIndex]!]!;
269
301
 
270
302
  result[dIndex] = (a << 2) | ((b & 0b11_0000) >> 4);
271
303
  }
272
304
 
273
- return result.buffer;
305
+ return result;
274
306
  }
@@ -4,10 +4,10 @@ const Utf8Encoder = new TextEncoder();
4
4
  // @ts-expect-error @types/node missing `TextDecoder`
5
5
  const Utf8Decoder = new TextDecoder();
6
6
 
7
- export function encodeUtf8(input: string): ArrayBuffer {
8
- return Utf8Encoder.encode(input).buffer;
7
+ export function encodeUtf8(input: string): Uint8Array {
8
+ return Utf8Encoder.encode(input);
9
9
  }
10
10
 
11
- export function decodeUtf8(buffer: ArrayBuffer): string {
11
+ export function decodeUtf8(buffer: ArrayBufferView | ArrayBuffer): string {
12
12
  return Utf8Decoder.decode(buffer);
13
13
  }
@@ -1,5 +1,3 @@
1
- export * from './auto-reset-event';
2
- export * from './base64';
3
- export * from './chunk';
4
- export * from './encoding';
5
- export * from './event-queue';
1
+ export * from './auto-reset-event.js';
2
+ export * from './base64.js';
3
+ export * from './encoding.js';
@@ -0,0 +1,3 @@
1
+ {
2
+ "extends": "./node_modules/@yume-chan/ts-package-builder/tsconfig.base.json"
3
+ }
@@ -0,0 +1 @@
1
+ {"program":{"fileNames":["../../common/temp/node_modules/.pnpm/typescript@4.7.0-dev.20220403/node_modules/typescript/lib/lib.es5.d.ts","../../common/temp/node_modules/.pnpm/typescript@4.7.0-dev.20220403/node_modules/typescript/lib/lib.es2015.d.ts","../../common/temp/node_modules/.pnpm/typescript@4.7.0-dev.20220403/node_modules/typescript/lib/lib.es2016.d.ts","../../common/temp/node_modules/.pnpm/typescript@4.7.0-dev.20220403/node_modules/typescript/lib/lib.es2017.d.ts","../../common/temp/node_modules/.pnpm/typescript@4.7.0-dev.20220403/node_modules/typescript/lib/lib.es2018.d.ts","../../common/temp/node_modules/.pnpm/typescript@4.7.0-dev.20220403/node_modules/typescript/lib/lib.es2019.d.ts","../../common/temp/node_modules/.pnpm/typescript@4.7.0-dev.20220403/node_modules/typescript/lib/lib.es2020.d.ts","../../common/temp/node_modules/.pnpm/typescript@4.7.0-dev.20220403/node_modules/typescript/lib/lib.es2021.d.ts","../../common/temp/node_modules/.pnpm/typescript@4.7.0-dev.20220403/node_modules/typescript/lib/lib.es2022.d.ts","../../common/temp/node_modules/.pnpm/typescript@4.7.0-dev.20220403/node_modules/typescript/lib/lib.esnext.d.ts","../../common/temp/node_modules/.pnpm/typescript@4.7.0-dev.20220403/node_modules/typescript/lib/lib.es2015.core.d.ts","../../common/temp/node_modules/.pnpm/typescript@4.7.0-dev.20220403/node_modules/typescript/lib/lib.es2015.collection.d.ts","../../common/temp/node_modules/.pnpm/typescript@4.7.0-dev.20220403/node_modules/typescript/lib/lib.es2015.generator.d.ts","../../common/temp/node_modules/.pnpm/typescript@4.7.0-dev.20220403/node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../common/temp/node_modules/.pnpm/typescript@4.7.0-dev.20220403/node_modules/typescript/lib/lib.es2015.promise.d.ts","../../common/temp/node_modules/.pnpm/typescript@4.7.0-dev.20220403/node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../common/temp/node_modules/.pnpm/typescript@4.7.0-dev.20220403/node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../common/temp/node_modules/.pnpm/typescript@4.7.0-dev.20220403/node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../common/temp/node_modules/.pnpm/typescript@4.7.0-dev.20220403/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../common/temp/node_modules/.pnpm/typescript@4.7.0-dev.20220403/node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../common/temp/node_modules/.pnpm/typescript@4.7.0-dev.20220403/node_modules/typescript/lib/lib.es2017.object.d.ts","../../common/temp/node_modules/.pnpm/typescript@4.7.0-dev.20220403/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../common/temp/node_modules/.pnpm/typescript@4.7.0-dev.20220403/node_modules/typescript/lib/lib.es2017.string.d.ts","../../common/temp/node_modules/.pnpm/typescript@4.7.0-dev.20220403/node_modules/typescript/lib/lib.es2017.intl.d.ts","../../common/temp/node_modules/.pnpm/typescript@4.7.0-dev.20220403/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../common/temp/node_modules/.pnpm/typescript@4.7.0-dev.20220403/node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../common/temp/node_modules/.pnpm/typescript@4.7.0-dev.20220403/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../common/temp/node_modules/.pnpm/typescript@4.7.0-dev.20220403/node_modules/typescript/lib/lib.es2018.intl.d.ts","../../common/temp/node_modules/.pnpm/typescript@4.7.0-dev.20220403/node_modules/typescript/lib/lib.es2018.promise.d.ts","../../common/temp/node_modules/.pnpm/typescript@4.7.0-dev.20220403/node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../common/temp/node_modules/.pnpm/typescript@4.7.0-dev.20220403/node_modules/typescript/lib/lib.es2019.array.d.ts","../../common/temp/node_modules/.pnpm/typescript@4.7.0-dev.20220403/node_modules/typescript/lib/lib.es2019.object.d.ts","../../common/temp/node_modules/.pnpm/typescript@4.7.0-dev.20220403/node_modules/typescript/lib/lib.es2019.string.d.ts","../../common/temp/node_modules/.pnpm/typescript@4.7.0-dev.20220403/node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../common/temp/node_modules/.pnpm/typescript@4.7.0-dev.20220403/node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../common/temp/node_modules/.pnpm/typescript@4.7.0-dev.20220403/node_modules/typescript/lib/lib.es2020.date.d.ts","../../common/temp/node_modules/.pnpm/typescript@4.7.0-dev.20220403/node_modules/typescript/lib/lib.es2020.promise.d.ts","../../common/temp/node_modules/.pnpm/typescript@4.7.0-dev.20220403/node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../common/temp/node_modules/.pnpm/typescript@4.7.0-dev.20220403/node_modules/typescript/lib/lib.es2020.string.d.ts","../../common/temp/node_modules/.pnpm/typescript@4.7.0-dev.20220403/node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../common/temp/node_modules/.pnpm/typescript@4.7.0-dev.20220403/node_modules/typescript/lib/lib.es2020.intl.d.ts","../../common/temp/node_modules/.pnpm/typescript@4.7.0-dev.20220403/node_modules/typescript/lib/lib.es2020.number.d.ts","../../common/temp/node_modules/.pnpm/typescript@4.7.0-dev.20220403/node_modules/typescript/lib/lib.es2021.promise.d.ts","../../common/temp/node_modules/.pnpm/typescript@4.7.0-dev.20220403/node_modules/typescript/lib/lib.es2021.string.d.ts","../../common/temp/node_modules/.pnpm/typescript@4.7.0-dev.20220403/node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../common/temp/node_modules/.pnpm/typescript@4.7.0-dev.20220403/node_modules/typescript/lib/lib.es2021.intl.d.ts","../../common/temp/node_modules/.pnpm/typescript@4.7.0-dev.20220403/node_modules/typescript/lib/lib.es2022.array.d.ts","../../common/temp/node_modules/.pnpm/typescript@4.7.0-dev.20220403/node_modules/typescript/lib/lib.es2022.error.d.ts","../../common/temp/node_modules/.pnpm/typescript@4.7.0-dev.20220403/node_modules/typescript/lib/lib.es2022.object.d.ts","../../common/temp/node_modules/.pnpm/typescript@4.7.0-dev.20220403/node_modules/typescript/lib/lib.es2022.string.d.ts","../../common/temp/node_modules/.pnpm/typescript@4.7.0-dev.20220403/node_modules/typescript/lib/lib.esnext.intl.d.ts","../../common/temp/node_modules/.pnpm/tslib@2.3.1/node_modules/tslib/tslib.d.ts","../../common/temp/node_modules/.pnpm/@yume-chan+async@2.1.4/node_modules/@yume-chan/async/dts/async-operation-manager.d.ts","../../common/temp/node_modules/.pnpm/@yume-chan+async@2.1.4/node_modules/@yume-chan/async/dts/promise-resolver.d.ts","../../common/temp/node_modules/.pnpm/@yume-chan+async@2.1.4/node_modules/@yume-chan/async/dts/index.d.ts","../event/esm/disposable.d.ts","../event/esm/event.d.ts","../event/esm/event-emitter.d.ts","../event/esm/utils.d.ts","../event/esm/index.d.ts","../struct/esm/basic/stream.d.ts","../struct/esm/basic/options.d.ts","../struct/esm/basic/struct-value.d.ts","../struct/esm/basic/field-value.d.ts","../struct/esm/basic/definition.d.ts","../struct/esm/basic/index.d.ts","../struct/esm/types/bigint.d.ts","../struct/esm/types/buffer/base.d.ts","../struct/esm/types/buffer/fixed-length.d.ts","../struct/esm/utils.d.ts","../struct/esm/types/buffer/variable-length.d.ts","../struct/esm/types/buffer/index.d.ts","../struct/esm/types/number.d.ts","../struct/esm/types/index.d.ts","../struct/esm/struct.d.ts","../struct/esm/index.d.ts","../dataview-bigint-polyfill/esm/fallback.d.ts","./src/crypto.ts","./src/utils/auto-reset-event.ts","./src/utils/base64.ts","./src/utils/encoding.ts","./src/utils/index.ts","./src/socket/dispatcher.ts","./src/socket/socket.ts","./src/socket/index.ts","../../common/temp/node_modules/.pnpm/web-streams-polyfill@3.2.0/node_modules/web-streams-polyfill/dist/types/ts3.6/polyfill.d.ts","./src/stream/detect.ts","./src/stream/transform.ts","./src/stream/buffered.ts","./src/stream/index.ts","./src/packet.ts","./src/auth.ts","./src/commands/base.ts","./src/commands/framebuffer.ts","./src/commands/subprocess/types.ts","./src/commands/subprocess/legacy.ts","./src/features.ts","./src/commands/subprocess/protocol.ts","./src/commands/subprocess/utils.ts","./src/commands/subprocess/index.ts","./src/commands/sync/request.ts","./src/commands/sync/response.ts","./src/commands/sync/stat.ts","./src/commands/sync/list.ts","./src/commands/sync/pull.ts","./src/commands/sync/push.ts","./src/commands/sync/sync.ts","./src/commands/sync/index.ts","./src/commands/install.ts","./src/commands/power.ts","./src/commands/reverse.ts","./src/commands/tcpip.ts","./src/commands/index.ts","./src/adb.ts","./src/backend.ts","./src/index.ts","./src/stream/detect.native.ts","./src/stream/detect.polyfill.ts"],"fileInfos":[{"version":"05e5ff32bb69fdf10b81d78e757c4632b81b64ddad5ec1febc9d0ff0cd3a67ad","affectsGlobalScope":true,"impliedFormat":1},"dc47c4fa66b9b9890cf076304de2a9c5201e94b740cffdf09f87296d877d71f6","7a387c58583dfca701b6c85e0adaf43fb17d590fb16d5b2dc0a2fbd89f35c467","8a12173c586e95f4433e0c6dc446bc88346be73ffe9ca6eec7aa63c8f3dca7f9","5f4e733ced4e129482ae2186aae29fde948ab7182844c3a5a51dd346182c7b06","e6b724280c694a9f588847f754198fb96c43d805f065c3a5b28bbc9594541c84","1fc5ab7a764205c68fa10d381b08417795fc73111d6dd16b5b1ed36badb743d9","746d62152361558ea6d6115cf0da4dd10ede041d14882ede3568bce5dc4b4f1f","2f93dda35dafec68ec217c9ce67f0f4fbbbb030c055ac312641565ad60dd7e26","aea179452def8a6152f98f63b191b84e7cbd69b0e248c91e61fb2e52328abe8c",{"version":"adb996790133eb33b33aadb9c09f15c2c575e71fb57a62de8bf74dbf59ec7dfb","affectsGlobalScope":true,"impliedFormat":1},{"version":"43fb1d932e4966a39a41b464a12a81899d9ae5f2c829063f5571b6b87e6d2f9c","affectsGlobalScope":true,"impliedFormat":1},{"version":"cdccba9a388c2ee3fd6ad4018c640a471a6c060e96f1232062223063b0a5ac6a","affectsGlobalScope":true,"impliedFormat":1},{"version":"c5c05907c02476e4bde6b7e76a79ffcd948aedd14b6a8f56e4674221b0417398","affectsGlobalScope":true,"impliedFormat":1},{"version":"0d5f52b3174bee6edb81260ebcd792692c32c81fd55499d69531496f3f2b25e7","affectsGlobalScope":true,"impliedFormat":1},{"version":"810627a82ac06fb5166da5ada4159c4ec11978dfbb0805fe804c86406dab8357","affectsGlobalScope":true,"impliedFormat":1},{"version":"181f1784c6c10b751631b24ce60c7f78b20665db4550b335be179217bacc0d5f","affectsGlobalScope":true,"impliedFormat":1},{"version":"3013574108c36fd3aaca79764002b3717da09725a36a6fc02eac386593110f93","affectsGlobalScope":true,"impliedFormat":1},{"version":"75ec0bdd727d887f1b79ed6619412ea72ba3c81d92d0787ccb64bab18d261f14","affectsGlobalScope":true,"impliedFormat":1},{"version":"3be5a1453daa63e031d266bf342f3943603873d890ab8b9ada95e22389389006","affectsGlobalScope":true,"impliedFormat":1},{"version":"17bb1fc99591b00515502d264fa55dc8370c45c5298f4a5c2083557dccba5a2a","affectsGlobalScope":true,"impliedFormat":1},{"version":"7ce9f0bde3307ca1f944119f6365f2d776d281a393b576a18a2f2893a2d75c98","affectsGlobalScope":true,"impliedFormat":1},{"version":"6a6b173e739a6a99629a8594bfb294cc7329bfb7b227f12e1f7c11bc163b8577","affectsGlobalScope":true,"impliedFormat":1},{"version":"12a310447c5d23c7d0d5ca2af606e3bd08afda69100166730ab92c62999ebb9d","affectsGlobalScope":true,"impliedFormat":1},{"version":"b0124885ef82641903d232172577f2ceb5d3e60aed4da1153bab4221e1f6dd4e","affectsGlobalScope":true,"impliedFormat":1},{"version":"0eb85d6c590b0d577919a79e0084fa1744c1beba6fd0d4e951432fa1ede5510a","affectsGlobalScope":true,"impliedFormat":1},{"version":"da233fc1c8a377ba9e0bed690a73c290d843c2c3d23a7bd7ec5cd3d7d73ba1e0","affectsGlobalScope":true,"impliedFormat":1},{"version":"d154ea5bb7f7f9001ed9153e876b2d5b8f5c2bb9ec02b3ae0d239ec769f1f2ae","affectsGlobalScope":true,"impliedFormat":1},{"version":"bb2d3fb05a1d2ffbca947cc7cbc95d23e1d053d6595391bd325deb265a18d36c","affectsGlobalScope":true,"impliedFormat":1},{"version":"c80df75850fea5caa2afe43b9949338ce4e2de086f91713e9af1a06f973872b8","affectsGlobalScope":true,"impliedFormat":1},{"version":"9d57b2b5d15838ed094aa9ff1299eecef40b190722eb619bac4616657a05f951","affectsGlobalScope":true,"impliedFormat":1},{"version":"6c51b5dd26a2c31dbf37f00cfc32b2aa6a92e19c995aefb5b97a3a64f1ac99de","affectsGlobalScope":true,"impliedFormat":1},{"version":"6e7997ef61de3132e4d4b2250e75343f487903ddf5370e7ce33cf1b9db9a63ed","affectsGlobalScope":true,"impliedFormat":1},{"version":"2ad234885a4240522efccd77de6c7d99eecf9b4de0914adb9a35c0c22433f993","affectsGlobalScope":true,"impliedFormat":1},{"version":"369ef81ec43a468c7e58d2d70f55354f399ac5127a260a4f488f12db88cb90fa","affectsGlobalScope":true,"impliedFormat":1},{"version":"d7f680a43f8cd12a6b6122c07c54ba40952b0c8aa140dcfcf32eb9e6cb028596","affectsGlobalScope":true,"impliedFormat":1},{"version":"3787b83e297de7c315d55d4a7c546ae28e5f6c0a361b7a1dcec1f1f50a54ef11","affectsGlobalScope":true,"impliedFormat":1},{"version":"e7e8e1d368290e9295ef18ca23f405cf40d5456fa9f20db6373a61ca45f75f40","affectsGlobalScope":true,"impliedFormat":1},{"version":"faf0221ae0465363c842ce6aa8a0cbda5d9296940a8e26c86e04cc4081eea21e","affectsGlobalScope":true,"impliedFormat":1},{"version":"06393d13ea207a1bfe08ec8d7be562549c5e2da8983f2ee074e00002629d1871","affectsGlobalScope":true,"impliedFormat":1},{"version":"ef193b21b99f3d42e0f88a7c4fde6ad14c98111b46981862fafa286ece4fcbb3","affectsGlobalScope":true,"impliedFormat":1},{"version":"b248e32ca52e8f5571390a4142558ae4f203ae2f94d5bac38a3084d529ef4e58","affectsGlobalScope":true,"impliedFormat":1},{"version":"6c55633c733c8378db65ac3da7a767c3cf2cf3057f0565a9124a16a3a2019e87","affectsGlobalScope":true,"impliedFormat":1},{"version":"fb4416144c1bf0323ccbc9afb0ab289c07312214e8820ad17d709498c865a3fe","affectsGlobalScope":true,"impliedFormat":1},{"version":"5b0ca94ec819d68d33da516306c15297acec88efeb0ae9e2b39f71dbd9685ef7","affectsGlobalScope":true,"impliedFormat":1},{"version":"b66f5f0cc4133c194f9b1ecab09b57c5c9035c76c5460552ad03ed808b704dd8","affectsGlobalScope":true,"impliedFormat":1},{"version":"34478567f8a80171f88f2f30808beb7da15eac0538ae91282dd33dce928d98ed","affectsGlobalScope":true,"impliedFormat":1},{"version":"6ea9ab679ea030cf46c16a711a316078e9e02619ebaf07a7fcd16964aba88f2d","affectsGlobalScope":true,"impliedFormat":1},{"version":"aedb8de1abb2ff1095c153854a6df7deae4a5709c37297f9d6e9948b6806fa66","affectsGlobalScope":true,"impliedFormat":1},{"version":"11ffe3c281f375fff9ffdde8bbec7669b4dd671905509079f866f2354a788064","affectsGlobalScope":true,"impliedFormat":1},{"version":"c37f8a49593a0030eecb51bbfa270e709bec9d79a6cc3bb851ef348d4e6b26f8","affectsGlobalScope":true,"impliedFormat":1},"12f4cfe2fe60b810c3174537bc2ddb20c1067b7768643d12cb1266fd183afb75","f6ad331f1763968b8a2d5575c1a8581f056009464e98415a266cab49762bc7a5","b309791da689ee6cc3029bd77ff301b011a490021f1c5e87b97029a2ab1c8a1a","52e6225011e81e8a56d58b88823de3926d5e5113583250ed2d58dc04e1d37347","3d4fc1ed5c1c6f311aebeff68ec8038718a12eaef5d0ae5cbd5133112956356f","68b04ac11e3d6a641d8004373420cb061c5056692eea594eb5848d24a3750209","56626e4d962c8eed0cb0d9df0d116dcf7ac4dd166c74e6e1b731203b4c4fca71","aacfeda09eafef77950b51b382d6e29c876b38178a36b7775afb3722ab10c415","8cc812db40101403f8753561d5d56444e582d6658a1825fd65d8b6dc33001854","42c58a27eb98e797c79bef3bdabb4c7fca56897a871caf5c56f8fc21c66695e5","a916bd79fa897dfbfcfef0885727e005c015727e5ade51a5ca91f61eeca4b00f","280512e685352f327cccf84b94972811eef44d5cfdaebaff920ec93d7b84fc96","f82ff502240e2b1cd9e2de9e8e46d7ba4320e08cf866599817ae009a667d423b","6ee02f787d62dd0744f470f9ee6b0cb42144933e3a5cda844271be0be70f442d","4000865d5ddad64d7894da59d95ef9900473502006100a4ed82cc950cf7c2f56","5297a6a60076abaf8d3e3d76d978d9e4949e0856e1bbf6a7ac042847c68209ef","7614ccd9e58f7baa91a3cbbcc275122f6b785bb6ae6a77bc300b12b8ac6b417a","1785accb5aa4a677f20f824c12a924c68fc81955f2c12899c412993eccbc6ca8","0fce61a4965600605902f03675e336882e1bbbc387ee95539666f5f614a9da9a","ce38bb4dfd58ea3c841d674beb3515f7bac7c7226c7a4f4616cc9e9136955857","05ff8aaf99e2fe90a8bead1f2abe7001b1f2883b3733f68edc138d42d4a64fbc","7499b53a6122ba8f7e4cd7cbb51121fa40fdc4ba7fef7271fd776839df24f076","deb19b18352719845b83f911ec5f6520b11918c45327267d828658ad3e15f59a","05997167d658924a4823163a5b443fcbd7ce8c745e0075f1c95dbf834133dec0",{"version":"16b6014cf97bb1eed71f5955ba76e1714f852e0ada929661c2f3215b8b2694f7","affectsGlobalScope":true,"impliedFormat":99},"ea9a35cd9e4fc405c1e35f2ab6d2219205cc1d0a99338af5d462472ebcfbd855","01e8b271487d4b2cc8db5eb2ce5e4af24d2375d2dce58b49d5a5a9b615ea3a19","7fda0e19d2d2422812264b69dac056db145e9ea6e512c6ff8b507629fd402929","99d2eb500b030c6fff24f65ae75a4b6083bbe579550986cef63aa2e7f78c7212","b6693c397638374586a3158038a7558ca6d2d442738472597101dbd24a7a48b7","dca8644ef6431878705964ed34f0255d2049c973f5c8fb4ce877e7ddccc318bf","122fe5f16767d817602f75729be733b47ade4e08b912062dcd885eabe2337180","a1611e50cbda9c454d1554b0b1fb56776f205538a99527917b1b02b1328214a5","0de7c253a483479d15abdaa8bc41d67b34f53991ca72001de6840d973fa81114","39bf6bdc4a79a0a88ceeac26f98a01a87c910f8fb7a13bff2d4d60f4df5239b7","f3c4ed278eff2d4a0de0412d3f3ca1a6ef393ff255495af918879a464784fef1","03929c6b3d76d1764692c990a5bbe2dad477003c058c4a27e82dc089e9836441","73bd8d8ed88f2c7fc37bf269b11817b1b7bb38c9b7700d53066d92510e8a3953","ec01f9873abc1b4c2318768379795f2a0c33dcd81ff5e3359b52b12421d2b057","36f32e40cb56c9165f275a99ceeb7e21b0fe6375af0021aa179f2145d064dba3","50dc979de9b018ab1bd831138b5136919aaff103b134b240c4b73b0c6292795d","6b212aad521a3550d8c95588d03aff03a1352f548aa52856d1027461717eecdb","0f7b94b71ebdbfded57a811c8c77d9ec0fe3d74a2acaab875223a6802a5406a0","98cf98938f1ffc4c4c7122cd1214f486a7039f433c7743ccd3772aa43b12b572","7cabfd5c8e043cd92ffe3ca1e0c0470baca3fc9101d095da9fec32fd8cc5155b","6d029cd908827fdb30cf44e6655532382fd1be948f238b3d757f90a81ab053e7","516efbe58819d719221670cbc75461ddc5e79591249c6d73cea2f8630e9ba3d1","e001cbffd541e15372c9546f22a2eded9b49d977b87dd177e050e7a192338fcd","696d5199cf062464ddffc8a5ad0a49d9b0d5434a04e13e2afdde4d17ebb71b59","5b994911c6f7001cf1b39b16fff3e7d029c5509826177a3e6b9cd12f2f589211","1caaf084e2eccded1618d5030af2993bae819a184b3015b17d49b6bd9e151dc8","c64699f2ae460ae5c4d83b27052d0dd4205c19cb99ea8c27c8516a1ac93d91b2","4a477f0706897d0e6e7681fad3936f9841bc1dfdcd6ed7d39f48aeb7c7b1c63c","cec79de073ea5ae9956e4463b929f592ea85c97267bd12d7511f6cce21e4acd0","844250a267b978b383a7f767229b33a785b3255e756f0c2ebc7ad9aa62b683ba","8fa607d77a91f494522f607f0b1a1dbcf476392eb172d859591fa7e85358f055","59de09194b42abd91858e592b0c722567c8a087d64300d8b6662cfafb5bbab75","291ccd5bd78c196a063215a5f88e9d9e8d116a616282cb027d13a9ee7ddde177","94b4b259adc35a7394efa77750bed8af3fa7c7454ad4fdc3ac242d1f9be1b1b9","3cf7249d3a757047aea8a393c2c9c3c9eb802cff610fe58d1070209f4a8865b7","eaed0ef9b975fe55e6ec0dcab890d2aefc9f8060c3be0029a52f76b460478497","ff2bb6bbf0dad381971dd6c0153c5ce9046f4d9b5c7663f74a0976c76bec7f05","c1aaaa49e5cd3bfca2cfa172e793e4cadb2341dc626a679759edc08ca2e52743","90a07136e99e3f4a04d7215f4cb138b936d356a8b629d1b34df8cf860e37eec0","9c68c4d988655092e8653b37c2ab00832c5cdd75a13b67d2f0d33862c936a84b","9645a041f967fede75c4c57132406be199da37da7d597638f29ea5c1745d6e7c","f3c4ed278eff2d4a0de0412d3f3ca1a6ef393ff255495af918879a464784fef1"],"options":{"composite":true,"declaration":true,"declarationDir":"./esm","declarationMap":true,"esModuleInterop":true,"exactOptionalPropertyTypes":true,"importHelpers":true,"importsNotUsedAsValues":2,"module":100,"noFallthroughCasesInSwitch":true,"noImplicitAny":true,"noImplicitOverride":true,"noImplicitReturns":true,"noImplicitThis":true,"noUncheckedIndexedAccess":true,"noUnusedLocals":true,"outDir":"./esm","rootDir":"./src","skipLibCheck":true,"sourceMap":true,"strict":true,"stripInternal":true,"target":99},"fileIdsList":[[53,54],[52,55,82,85,90,91,92,97,113],[52,55,60,76,78,82,91],[52,76,90,91],[52,60,114],[52,76,90,114],[52,93,94,100,108,109,110,111,112],[52,90,100,108,114],[52,93],[52,60,76,82,85,90,91],[52,90,95,96,98,99,114],[52,85,90,95,114],[52,55,76,82,85,90,95,97,114],[52,76,85,90,114],[52],[52,101,102,103,104,105,106,107],[52,76,90,101,102,103],[52,76,90,101,102],[52,76,82,90],[52,60,82,85,90,97,103,104,105,106,114],[52,77],[52,78,82,85,90,91,92,97,113,114,115],[52,76,90],[52,55,60,82,84,90,91],[52,83,84],[52,55,83,90,91],[52,76,85,87,88],[52,86],[52,87,88,89],[52,55,76,82,87,89],[52,55,60],[52,79,80,81],[56,57],[56],[56,57,58,59],[57],[61,62,63,64],[62,63,65],[61,62,63,64,65],[64],[66,70,74,75],[66,70,74],[66],[68],[68,69,71],[66,68,70],[67,72,73]],"referencedMap":[[55,1],[114,2],[92,3],[115,4],[93,5],[94,6],[113,7],[109,8],[110,9],[111,10],[100,11],[96,12],[98,13],[95,14],[99,15],[108,16],[104,17],[105,18],[106,17],[101,19],[102,19],[103,18],[107,20],[112,9],[78,21],[97,15],[116,22],[91,23],[83,24],[85,25],[84,26],[89,27],[117,15],[118,28],[87,28],[90,29],[88,30],[79,31],[80,15],[81,15],[82,32],[58,33],[57,34],[60,35],[59,36],[65,37],[64,38],[66,39],[63,40],[76,41],[75,42],[67,43],[68,43],[69,44],[72,45],[71,46],[74,47],[73,43]],"exportedModulesMap":[[55,1],[114,2],[92,3],[115,4],[93,5],[94,6],[113,7],[109,8],[110,9],[111,10],[100,11],[96,12],[98,13],[95,14],[99,15],[108,16],[104,17],[105,18],[106,17],[101,19],[102,19],[103,18],[107,20],[112,9],[78,21],[97,15],[116,22],[91,23],[83,24],[85,25],[84,26],[89,27],[117,15],[118,28],[87,28],[90,29],[88,30],[79,31],[80,15],[81,15],[82,32],[58,33],[57,34],[60,35],[59,36],[65,37],[64,38],[66,39],[63,40],[76,41],[75,42],[67,43],[68,43],[69,44],[72,45],[71,46],[74,47],[73,43]],"semanticDiagnosticsPerFile":[53,55,54,52,12,11,2,13,14,15,16,17,18,19,20,3,4,24,21,22,23,25,26,27,5,28,29,30,31,6,32,33,34,35,7,36,41,42,37,38,39,40,8,46,43,44,45,47,9,48,49,50,1,10,51,86,114,92,115,93,94,113,109,110,111,100,96,98,95,99,108,104,105,106,101,102,103,107,112,78,97,116,91,83,85,84,89,117,118,87,90,88,79,80,81,82,77,56,58,57,60,59,65,64,66,62,61,63,76,75,67,68,69,72,71,74,73,70]},"version":"4.7.0-dev.20220403"}
@@ -0,0 +1,10 @@
1
+ {
2
+ "extends": "./tsconfig.build.json",
3
+ "compilerOptions": {
4
+ "types": [
5
+ "node",
6
+ "jest",
7
+ ],
8
+ },
9
+ "exclude": []
10
+ }
package/dts/adb.d.ts DELETED
@@ -1,46 +0,0 @@
1
- import { AdbCredentialStore } from './auth';
2
- import { AdbBackend } from './backend';
3
- import { AdbChildProcess, AdbDemoMode, AdbFrameBuffer, AdbReverseCommand, AdbSync, AdbTcpIpCommand } from './commands';
4
- import { AdbFeatures } from './features';
5
- import { AdbLogger, AdbSocket } from './socket';
6
- export declare enum AdbPropKey {
7
- Product = "ro.product.name",
8
- Model = "ro.product.model",
9
- Device = "ro.product.device",
10
- Features = "features"
11
- }
12
- export declare class Adb {
13
- private readonly _backend;
14
- get backend(): AdbBackend;
15
- private readonly packetDispatcher;
16
- get onDisconnected(): import("@yume-chan/event").Event<void, unknown>;
17
- private _connected;
18
- get connected(): boolean;
19
- get name(): string | undefined;
20
- private _protocolVersion;
21
- get protocolVersion(): number | undefined;
22
- private _product;
23
- get product(): string | undefined;
24
- private _model;
25
- get model(): string | undefined;
26
- private _device;
27
- get device(): string | undefined;
28
- private _features;
29
- get features(): AdbFeatures[] | undefined;
30
- readonly tcpip: AdbTcpIpCommand;
31
- readonly reverse: AdbReverseCommand;
32
- readonly demoMode: AdbDemoMode;
33
- readonly childProcess: AdbChildProcess;
34
- constructor(backend: AdbBackend, logger?: AdbLogger);
35
- connect(credentialStore: AdbCredentialStore, authenticators?: import("./auth").AdbAuthenticator[]): Promise<void>;
36
- private parseBanner;
37
- getProp(key: string): Promise<string>;
38
- rm(...filenames: string[]): Promise<string>;
39
- install(apk: ArrayLike<number> | ArrayBufferLike | AsyncIterable<ArrayBuffer>, onProgress?: (uploaded: number) => void): Promise<void>;
40
- sync(): Promise<AdbSync>;
41
- framebuffer(): Promise<AdbFrameBuffer>;
42
- createSocket(service: string): Promise<AdbSocket>;
43
- createSocketAndReadAll(service: string): Promise<string>;
44
- dispose(): Promise<void>;
45
- }
46
- //# sourceMappingURL=adb.d.ts.map
package/dts/adb.d.ts.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"adb.d.ts","sourceRoot":"","sources":["../src/adb.ts"],"names":[],"mappings":"AAEA,OAAO,EAA4B,kBAAkB,EAA4B,MAAM,QAAQ,CAAC;AAChG,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,cAAc,EAAE,iBAAiB,EAAE,OAAO,EAAE,eAAe,EAAmC,MAAM,YAAY,CAAC;AACxJ,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEzC,OAAO,EAAE,SAAS,EAAuB,SAAS,EAAE,MAAM,UAAU,CAAC;AAGrE,oBAAY,UAAU;IAClB,OAAO,oBAAoB;IAC3B,KAAK,qBAAqB;IAC1B,MAAM,sBAAsB;IAC5B,QAAQ,aAAa;CACxB;AAED,qBAAa,GAAG;IACZ,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAa;IAEtC,IAAW,OAAO,IAAI,UAAU,CAA0B;IAE1D,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAsB;IAEvD,IAAW,cAAc,oDAA0C;IAEnE,OAAO,CAAC,UAAU,CAAS;IAC3B,IAAW,SAAS,YAA8B;IAElD,IAAW,IAAI,uBAAgC;IAE/C,OAAO,CAAC,gBAAgB,CAAqB;IAC7C,IAAW,eAAe,uBAAoC;IAE9D,OAAO,CAAC,QAAQ,CAAqB;IACrC,IAAW,OAAO,uBAA4B;IAE9C,OAAO,CAAC,MAAM,CAAqB;IACnC,IAAW,KAAK,uBAA0B;IAE1C,OAAO,CAAC,OAAO,CAAqB;IACpC,IAAW,MAAM,uBAA2B;IAE5C,OAAO,CAAC,SAAS,CAA4B;IAC7C,IAAW,QAAQ,8BAA6B;IAEhD,SAAgB,KAAK,EAAE,eAAe,CAAC;IAEvC,SAAgB,OAAO,EAAE,iBAAiB,CAAC;IAE3C,SAAgB,QAAQ,EAAE,WAAW,CAAC;IAEtC,SAAgB,YAAY,EAAE,eAAe,CAAC;gBAE3B,OAAO,EAAE,UAAU,EAAE,MAAM,CAAC,EAAE,SAAS;IAY7C,OAAO,CAChB,eAAe,EAAE,kBAAkB,EACnC,cAAc,sCAA2B,GAC1C,OAAO,CAAC,IAAI,CAAC;IA8FhB,OAAO,CAAC,WAAW;IAmCN,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAKrC,EAAE,CAAC,GAAG,SAAS,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC;IAI3C,OAAO,CAChB,GAAG,EAAE,SAAS,CAAC,MAAM,CAAC,GAAG,eAAe,GAAG,aAAa,CAAC,WAAW,CAAC,EACrE,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,GACxC,OAAO,CAAC,IAAI,CAAC;IAIH,IAAI,IAAI,OAAO,CAAC,OAAO,CAAC;IAKxB,WAAW,IAAI,OAAO,CAAC,cAAc,CAAC;IAItC,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC;IAIjD,sBAAsB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAWxD,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;CAIxC"}
package/dts/auth.d.ts.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD,OAAO,EAAc,SAAS,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAGhE,oBAAY,cAAc,GAAG,QAAQ,CAAC,WAAW,CAAC,GAAG,aAAa,CAAC,WAAW,CAAC,CAAC;AAEhF,MAAM,WAAW,kBAAkB;IAC/B;;;;OAIG;IACH,WAAW,IAAI,cAAc,CAAC,WAAW,CAAC,CAAC;IAE3C;;;;OAIG;IACH,WAAW,IAAI,cAAc,CAAC;CACjC;AAED,oBAAY,WAAW;IACnB,KAAK,IAAI;IACT,SAAS,IAAI;IACb,SAAS,IAAI;CAChB;AAED,MAAM,WAAW,gBAAgB;IAC7B;;;;;;;;;;OAUG;IACH,CACI,eAAe,EAAE,kBAAkB,EACnC,cAAc,EAAE,MAAM,OAAO,CAAC,SAAS,CAAC,GACzC,aAAa,CAAC,aAAa,CAAC,CAAC;CACnC;AAED,eAAO,MAAM,yBAAyB,EAAE,gBAmBvC,CAAC;AAEF,eAAO,MAAM,yBAAyB,EAAE,gBAoCvC,CAAC;AAEF,eAAO,MAAM,wBAAwB,EAAE,gBAAgB,EAGtD,CAAC;AAEF,qBAAa,wBAAyB,YAAW,UAAU;IACvD,SAAgB,cAAc,EAAE,SAAS,gBAAgB,EAAE,CAAC;IAE5D,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAqB;IAErD,OAAO,CAAC,cAAc,CAAoC;IAE1D,OAAO,CAAC,QAAQ,CAA2C;gBAGvD,cAAc,EAAE,SAAS,gBAAgB,EAAE,EAC3C,eAAe,EAAE,kBAAkB;IAMvC,OAAO,CAAC,cAAc,CAEpB;YAEa,gBAAgB;IAkBlB,MAAM,CAAC,MAAM,EAAE,SAAS,GAAG,OAAO,CAAC,aAAa,CAAC;IAUvD,OAAO;CAGjB"}
package/dts/backend.d.ts DELETED
@@ -1,13 +0,0 @@
1
- import type { Event } from '@yume-chan/event';
2
- import type { ValueOrPromise } from '@yume-chan/struct';
3
- export interface AdbBackend {
4
- readonly serial: string;
5
- readonly name: string | undefined;
6
- readonly connected: boolean;
7
- readonly onDisconnected: Event<void>;
8
- connect?(): ValueOrPromise<void>;
9
- read(length: number): ValueOrPromise<ArrayBuffer>;
10
- write(buffer: ArrayBuffer): ValueOrPromise<void>;
11
- dispose(): ValueOrPromise<void>;
12
- }
13
- //# sourceMappingURL=backend.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"backend.d.ts","sourceRoot":"","sources":["../src/backend.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAExD,MAAM,WAAW,UAAU;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAExB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;IAElC,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAE5B,QAAQ,CAAC,cAAc,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;IAErC,OAAO,CAAC,IAAI,cAAc,CAAC,IAAI,CAAC,CAAC;IAEjC,IAAI,CAAC,MAAM,EAAE,MAAM,GAAG,cAAc,CAAC,WAAW,CAAC,CAAC;IAElD,KAAK,CAAC,MAAM,EAAE,WAAW,GAAG,cAAc,CAAC,IAAI,CAAC,CAAC;IAEjD,OAAO,IAAI,cAAc,CAAC,IAAI,CAAC,CAAC;CACnC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../src/commands/base.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAC;AAE7B,qBAAa,cAAe,SAAQ,cAAc;IAC9C,SAAS,CAAC,GAAG,EAAE,GAAG,CAAC;gBAEA,GAAG,EAAE,GAAG;CAI9B"}
@@ -1,41 +0,0 @@
1
- import { AdbCommandBase } from './base';
2
- export declare enum AdbDemoModeSignalStrength {
3
- Hidden = "null",
4
- Level0 = "0",
5
- Level1 = "1",
6
- Level2 = "2",
7
- Level3 = "3",
8
- Level4 = "4"
9
- }
10
- export declare const AdbDemoModeMobileDataTypes: readonly ["1x", "3g", "4g", "4g+", "5g", "5ge", "5g+", "e", "g", "h", "h+", "lte", "lte+", "dis", "not", "null"];
11
- export declare type AdbDemoModeMobileDataType = (typeof AdbDemoModeMobileDataTypes)[number];
12
- export declare const AdbDemoModeStatusBarModes: readonly ["opaque", "translucent", "semi-transparent", "transparent", "warning"];
13
- export declare type AdbDemoModeStatusBarMode = (typeof AdbDemoModeStatusBarModes)[number];
14
- export declare class AdbDemoMode extends AdbCommandBase {
15
- static readonly AllowedSettingKey = "sysui_demo_allowed";
16
- static readonly EnabledSettingKey = "sysui_tuner_demo_on";
17
- getAllowed(): Promise<boolean>;
18
- setAllowed(value: boolean): Promise<void>;
19
- getEnabled(): Promise<boolean>;
20
- setEnabled(value: boolean): Promise<void>;
21
- broadcast(command: string, extra?: Record<string, string>): Promise<void>;
22
- setBatteryLevel(level: number): Promise<void>;
23
- setBatteryCharging(value: boolean): Promise<void>;
24
- setPowerSaveMode(value: boolean): Promise<void>;
25
- setAirplaneMode(show: boolean): Promise<void>;
26
- setWifiSignalStrength(value: AdbDemoModeSignalStrength): Promise<void>;
27
- setMobileDataType(value: AdbDemoModeMobileDataType): Promise<void>;
28
- setMobileSignalStrength(value: AdbDemoModeSignalStrength): Promise<void>;
29
- setNoSimCardIcon(show: boolean): Promise<void>;
30
- setStatusBarMode(mode: AdbDemoModeStatusBarMode): Promise<void>;
31
- setVibrateModeEnabled(value: boolean): Promise<void>;
32
- setBluetoothConnected(value: boolean): Promise<void>;
33
- setLocatingIcon(show: boolean): Promise<void>;
34
- setAlarmIcon(show: boolean): Promise<void>;
35
- setSyncingIcon(show: boolean): Promise<void>;
36
- setMuteIcon(show: boolean): Promise<void>;
37
- setSpeakerPhoneIcon(show: boolean): Promise<void>;
38
- setNotificationsVisibility(show: boolean): Promise<void>;
39
- setTime(hour: number, minute: number): Promise<void>;
40
- }
41
- //# sourceMappingURL=demo-mode.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"demo-mode.d.ts","sourceRoot":"","sources":["../../src/commands/demo-mode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAExC,oBAAY,yBAAyB;IACjC,MAAM,SAAS;IACf,MAAM,MAAM;IACZ,MAAM,MAAM;IACZ,MAAM,MAAM;IACZ,MAAM,MAAM;IACZ,MAAM,MAAM;CACf;AAGD,eAAO,MAAM,0BAA0B,kHAC+B,CAAC;AAEvE,oBAAY,yBAAyB,GAAG,CAAC,OAAO,0BAA0B,CAAC,CAAC,MAAM,CAAC,CAAC;AAGpF,eAAO,MAAM,yBAAyB,kFAAmF,CAAC;AAE1H,oBAAY,wBAAwB,GAAG,CAAC,OAAO,yBAAyB,CAAC,CAAC,MAAM,CAAC,CAAC;AAElF,qBAAa,WAAY,SAAQ,cAAc;IAC3C,gBAAuB,iBAAiB,wBAAwB;IAKhE,gBAAuB,iBAAiB,yBAAyB;IAEpD,UAAU,IAAI,OAAO,CAAC,OAAO,CAAC;IAK9B,UAAU,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IASzC,UAAU,IAAI,OAAO,CAAC,OAAO,CAAC;IAK9B,UAAU,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IASzC,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAazE,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAI7C,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAIjD,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAI/C,eAAe,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAI7C,qBAAqB,CAAC,KAAK,EAAE,yBAAyB,GAAG,OAAO,CAAC,IAAI,CAAC;IAItE,iBAAiB,CAAC,KAAK,EAAE,yBAAyB,GAAG,OAAO,CAAC,IAAI,CAAC;IAkBlE,uBAAuB,CAAC,KAAK,EAAE,yBAAyB,GAAG,OAAO,CAAC,IAAI,CAAC;IAIxE,gBAAgB,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAI9C,gBAAgB,CAAC,IAAI,EAAE,wBAAwB,GAAG,OAAO,CAAC,IAAI,CAAC;IAI/D,qBAAqB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAKpD,qBAAqB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAKpD,eAAe,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAI7C,YAAY,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAI1C,cAAc,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAI5C,WAAW,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAIzC,mBAAmB,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAIjD,0BAA0B,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAKxD,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAGpE"}