@yume-chan/adb 0.0.15 → 0.0.16

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 (103) hide show
  1. package/CHANGELOG.json +21 -0
  2. package/CHANGELOG.md +11 -1
  3. package/LICENSE +21 -21
  4. package/README.md +247 -247
  5. package/esm/adb.d.ts +7 -0
  6. package/esm/adb.d.ts.map +1 -1
  7. package/esm/adb.js +7 -0
  8. package/esm/adb.js.map +1 -1
  9. package/esm/commands/subprocess/protocols/none.d.ts +1 -0
  10. package/esm/commands/subprocess/protocols/none.d.ts.map +1 -1
  11. package/esm/commands/subprocess/protocols/none.js +6 -5
  12. package/esm/commands/subprocess/protocols/none.js.map +1 -1
  13. package/esm/commands/sync/stat.d.ts.map +1 -1
  14. package/esm/commands/sync/stat.js.map +1 -1
  15. package/esm/socket/dispatcher.d.ts +4 -1
  16. package/esm/socket/dispatcher.d.ts.map +1 -1
  17. package/esm/socket/dispatcher.js +11 -8
  18. package/esm/socket/dispatcher.js.map +1 -1
  19. package/esm/socket/socket.d.ts +6 -1
  20. package/esm/socket/socket.d.ts.map +1 -1
  21. package/esm/socket/socket.js +17 -7
  22. package/esm/socket/socket.js.map +1 -1
  23. package/esm/stream/buffered.d.ts +6 -2
  24. package/esm/stream/buffered.d.ts.map +1 -1
  25. package/esm/stream/buffered.js +67 -47
  26. package/esm/stream/buffered.js.map +1 -1
  27. package/esm/stream/detect.js +1 -0
  28. package/esm/stream/detect.js.map +1 -1
  29. package/esm/stream/detect.polyfill.d.ts.map +1 -1
  30. package/esm/stream/detect.polyfill.js +0 -5
  31. package/esm/stream/detect.polyfill.js.map +1 -1
  32. package/esm/stream/transform.d.ts +20 -0
  33. package/esm/stream/transform.d.ts.map +1 -1
  34. package/esm/stream/transform.js +7 -1
  35. package/esm/stream/transform.js.map +1 -1
  36. package/package.json +10 -10
  37. package/src/adb.ts +280 -273
  38. package/src/auth.ts +173 -173
  39. package/src/backend.ts +11 -11
  40. package/src/commands/base.ts +11 -11
  41. package/src/commands/framebuffer.ts +73 -73
  42. package/src/commands/index.ts +8 -8
  43. package/src/commands/install.ts +30 -30
  44. package/src/commands/power.ts +54 -54
  45. package/src/commands/reverse.ts +140 -140
  46. package/src/commands/subprocess/index.ts +139 -139
  47. package/src/commands/subprocess/protocols/none.ts +70 -68
  48. package/src/commands/subprocess/protocols/shell.ts +190 -190
  49. package/src/commands/subprocess/protocols/types.ts +59 -59
  50. package/src/commands/subprocess/utils.ts +20 -20
  51. package/src/commands/sync/index.ts +7 -7
  52. package/src/commands/sync/list.ts +86 -86
  53. package/src/commands/sync/pull.ts +46 -46
  54. package/src/commands/sync/push.ts +41 -41
  55. package/src/commands/sync/request.ts +50 -50
  56. package/src/commands/sync/response.ts +64 -64
  57. package/src/commands/sync/stat.ts +151 -150
  58. package/src/commands/sync/sync.ts +181 -181
  59. package/src/commands/tcpip.ts +21 -21
  60. package/src/crypto.ts +296 -296
  61. package/src/features.ts +9 -9
  62. package/src/index.ts +11 -11
  63. package/src/packet.ts +80 -80
  64. package/src/socket/dispatcher.ts +305 -304
  65. package/src/socket/index.ts +2 -2
  66. package/src/socket/socket.ts +155 -144
  67. package/src/stream/buffered.ts +168 -147
  68. package/src/stream/detect.native.ts +362 -362
  69. package/src/stream/detect.polyfill.ts +22 -28
  70. package/src/stream/detect.ts +7 -5
  71. package/src/stream/index.ts +3 -3
  72. package/src/stream/transform.ts +474 -447
  73. package/src/utils/auto-reset-event.ts +41 -41
  74. package/src/utils/base64.ts +306 -306
  75. package/src/utils/index.ts +3 -3
  76. package/tsconfig.build.json +3 -3
  77. package/tsconfig.build.tsbuildinfo +1 -1
  78. package/tsconfig.test.json +9 -10
  79. package/web-streams-polyfill-4.0.0-beta.2.tgz +0 -0
  80. package/esm/commands/subprocess/legacy.d.ts +0 -35
  81. package/esm/commands/subprocess/legacy.d.ts.map +0 -1
  82. package/esm/commands/subprocess/legacy.js +0 -53
  83. package/esm/commands/subprocess/legacy.js.map +0 -1
  84. package/esm/commands/subprocess/protocol.d.ts +0 -39
  85. package/esm/commands/subprocess/protocol.d.ts.map +0 -1
  86. package/esm/commands/subprocess/protocol.js +0 -157
  87. package/esm/commands/subprocess/protocol.js.map +0 -1
  88. package/esm/commands/subprocess/types.d.ts +0 -50
  89. package/esm/commands/subprocess/types.d.ts.map +0 -1
  90. package/esm/commands/subprocess/types.js +0 -2
  91. package/esm/commands/subprocess/types.js.map +0 -1
  92. package/esm/socket/controller.d.ts +0 -37
  93. package/esm/socket/controller.d.ts.map +0 -1
  94. package/esm/socket/controller.js +0 -66
  95. package/esm/socket/controller.js.map +0 -1
  96. package/esm/stream/detect.bak.d.ts +0 -240
  97. package/esm/stream/detect.bak.d.ts.map +0 -1
  98. package/esm/stream/detect.bak.js +0 -60
  99. package/esm/stream/detect.bak.js.map +0 -1
  100. package/esm/utils/encoding.d.ts +0 -3
  101. package/esm/utils/encoding.d.ts.map +0 -1
  102. package/esm/utils/encoding.js +0 -11
  103. package/esm/utils/encoding.js.map +0 -1
@@ -1,41 +1,41 @@
1
- import { PromiseResolver } from '@yume-chan/async';
2
- import type { Disposable } from '@yume-chan/event';
3
-
4
- export class AutoResetEvent implements Disposable {
5
- private readonly list: PromiseResolver<void>[] = [];
6
-
7
- private blocking: boolean;
8
-
9
- public constructor(initialSet = false) {
10
- this.blocking = initialSet;
11
- }
12
-
13
- public wait(): Promise<void> {
14
- if (!this.blocking) {
15
- this.blocking = true;
16
-
17
- if (this.list.length === 0) {
18
- return Promise.resolve();
19
- }
20
- }
21
-
22
- const resolver = new PromiseResolver<void>();
23
- this.list.push(resolver);
24
- return resolver.promise;
25
- }
26
-
27
- public notify() {
28
- if (this.list.length !== 0) {
29
- this.list.pop()!.resolve();
30
- } else {
31
- this.blocking = false;
32
- }
33
- }
34
-
35
- public dispose() {
36
- for (const item of this.list) {
37
- item.reject(new Error('The AutoResetEvent has been disposed'));
38
- }
39
- this.list.length = 0;
40
- }
41
- }
1
+ import { PromiseResolver } from '@yume-chan/async';
2
+ import type { Disposable } from '@yume-chan/event';
3
+
4
+ export class AutoResetEvent implements Disposable {
5
+ private readonly list: PromiseResolver<void>[] = [];
6
+
7
+ private blocking: boolean;
8
+
9
+ public constructor(initialSet = false) {
10
+ this.blocking = initialSet;
11
+ }
12
+
13
+ public wait(): Promise<void> {
14
+ if (!this.blocking) {
15
+ this.blocking = true;
16
+
17
+ if (this.list.length === 0) {
18
+ return Promise.resolve();
19
+ }
20
+ }
21
+
22
+ const resolver = new PromiseResolver<void>();
23
+ this.list.push(resolver);
24
+ return resolver.promise;
25
+ }
26
+
27
+ public notify() {
28
+ if (this.list.length !== 0) {
29
+ this.list.pop()!.resolve();
30
+ } else {
31
+ this.blocking = false;
32
+ }
33
+ }
34
+
35
+ public dispose() {
36
+ for (const item of this.list) {
37
+ item.reject(new Error('The AutoResetEvent has been disposed'));
38
+ }
39
+ this.list.length = 0;
40
+ }
41
+ }