@versori/run 0.1.0-alpha.10 → 0.1.0-alpha.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 (155) hide show
  1. package/esm/_dnt.shims.d.ts +1 -5
  2. package/esm/_dnt.shims.d.ts.map +1 -1
  3. package/esm/_dnt.shims.js +1 -5
  4. package/esm/deps/jsr.io/@std/fs/1.0.16/exists.d.ts +1 -0
  5. package/esm/deps/jsr.io/@std/fs/1.0.16/exists.d.ts.map +1 -1
  6. package/esm/deps/jsr.io/@std/fs/1.0.16/exists.js +10 -12
  7. package/esm/deps/jsr.io/@std/log/0.224.14/base_handler.d.ts +0 -21
  8. package/esm/deps/jsr.io/@std/log/0.224.14/base_handler.d.ts.map +1 -1
  9. package/esm/deps/jsr.io/@std/log/0.224.14/file_handler.d.ts +2 -3
  10. package/esm/deps/jsr.io/@std/log/0.224.14/file_handler.d.ts.map +1 -1
  11. package/esm/deps/jsr.io/@std/log/0.224.14/file_handler.js +1 -2
  12. package/esm/deps/jsr.io/@std/log/0.224.14/rotating_file_handler.d.ts.map +1 -1
  13. package/esm/deps/jsr.io/@std/log/0.224.14/rotating_file_handler.js +6 -8
  14. package/esm/src/dsl/http/versori/configloader.d.ts.map +1 -1
  15. package/esm/src/dsl/http/versori/configloader.js +2 -3
  16. package/esm/src/dsl/http/versori/internalauth.d.ts.map +1 -1
  17. package/esm/src/dsl/http/versori/internalauth.js +5 -6
  18. package/esm/src/dsl/http/versori/platformapi.d.ts.map +1 -1
  19. package/esm/src/dsl/http/versori/platformapi.js +3 -4
  20. package/esm/src/dsl/http/versori/roundtripper.d.ts.map +1 -1
  21. package/esm/src/dsl/http/versori/roundtripper.js +4 -5
  22. package/esm/src/interpreter/memory/MemoryInterpreter.d.ts.map +1 -1
  23. package/esm/src/interpreter/memory/MemoryInterpreter.js +7 -5
  24. package/esm/src/kv/nats/NatsKeyValueProvider.d.ts +1 -2
  25. package/esm/src/kv/nats/NatsKeyValueProvider.d.ts.map +1 -1
  26. package/esm/src/kv/nats/NatsKeyValueProvider.js +8 -9
  27. package/package.json +2 -6
  28. package/script/_dnt.shims.d.ts +1 -5
  29. package/script/_dnt.shims.d.ts.map +1 -1
  30. package/script/_dnt.shims.js +2 -7
  31. package/script/deps/jsr.io/@std/fs/1.0.16/exists.d.ts +1 -0
  32. package/script/deps/jsr.io/@std/fs/1.0.16/exists.d.ts.map +1 -1
  33. package/script/deps/jsr.io/@std/fs/1.0.16/exists.js +10 -35
  34. package/script/deps/jsr.io/@std/log/0.224.14/base_handler.d.ts +0 -21
  35. package/script/deps/jsr.io/@std/log/0.224.14/base_handler.d.ts.map +1 -1
  36. package/script/deps/jsr.io/@std/log/0.224.14/file_handler.d.ts +2 -3
  37. package/script/deps/jsr.io/@std/log/0.224.14/file_handler.d.ts.map +1 -1
  38. package/script/deps/jsr.io/@std/log/0.224.14/file_handler.js +1 -25
  39. package/script/deps/jsr.io/@std/log/0.224.14/rotating_file_handler.d.ts.map +1 -1
  40. package/script/deps/jsr.io/@std/log/0.224.14/rotating_file_handler.js +6 -31
  41. package/script/src/dsl/http/versori/configloader.d.ts.map +1 -1
  42. package/script/src/dsl/http/versori/configloader.js +2 -26
  43. package/script/src/dsl/http/versori/internalauth.d.ts.map +1 -1
  44. package/script/src/dsl/http/versori/internalauth.js +5 -29
  45. package/script/src/dsl/http/versori/platformapi.d.ts.map +1 -1
  46. package/script/src/dsl/http/versori/platformapi.js +3 -27
  47. package/script/src/dsl/http/versori/roundtripper.d.ts.map +1 -1
  48. package/script/src/dsl/http/versori/roundtripper.js +4 -28
  49. package/script/src/interpreter/memory/MemoryInterpreter.d.ts.map +1 -1
  50. package/script/src/interpreter/memory/MemoryInterpreter.js +7 -28
  51. package/script/src/kv/nats/NatsKeyValueProvider.d.ts +1 -2
  52. package/script/src/kv/nats/NatsKeyValueProvider.d.ts.map +1 -1
  53. package/script/src/kv/nats/NatsKeyValueProvider.js +10 -34
  54. package/esm/deps/jsr.io/@nats-io/transport-deno/3.0.2/src/connect.d.ts +0 -3
  55. package/esm/deps/jsr.io/@nats-io/transport-deno/3.0.2/src/connect.d.ts.map +0 -1
  56. package/esm/deps/jsr.io/@nats-io/transport-deno/3.0.2/src/connect.js +0 -28
  57. package/esm/deps/jsr.io/@nats-io/transport-deno/3.0.2/src/deno_transport.d.ts +0 -36
  58. package/esm/deps/jsr.io/@nats-io/transport-deno/3.0.2/src/deno_transport.d.ts.map +0 -1
  59. package/esm/deps/jsr.io/@nats-io/transport-deno/3.0.2/src/deno_transport.js +0 -329
  60. package/esm/deps/jsr.io/@nats-io/transport-deno/3.0.2/src/mod.d.ts +0 -3
  61. package/esm/deps/jsr.io/@nats-io/transport-deno/3.0.2/src/mod.d.ts.map +0 -1
  62. package/esm/deps/jsr.io/@nats-io/transport-deno/3.0.2/src/mod.js +0 -2
  63. package/esm/deps/jsr.io/@nats-io/transport-deno/3.0.2/src/version.d.ts +0 -2
  64. package/esm/deps/jsr.io/@nats-io/transport-deno/3.0.2/src/version.d.ts.map +0 -1
  65. package/esm/deps/jsr.io/@nats-io/transport-deno/3.0.2/src/version.js +0 -2
  66. package/esm/deps/jsr.io/@std/bytes/1.0.5/_types.d.ts +0 -9
  67. package/esm/deps/jsr.io/@std/bytes/1.0.5/_types.d.ts.map +0 -1
  68. package/esm/deps/jsr.io/@std/bytes/1.0.5/_types.js +0 -2
  69. package/esm/deps/jsr.io/@std/bytes/1.0.5/concat.d.ts +0 -21
  70. package/esm/deps/jsr.io/@std/bytes/1.0.5/concat.d.ts.map +0 -1
  71. package/esm/deps/jsr.io/@std/bytes/1.0.5/concat.js +0 -32
  72. package/esm/deps/jsr.io/@std/bytes/1.0.5/copy.d.ts +0 -41
  73. package/esm/deps/jsr.io/@std/bytes/1.0.5/copy.d.ts.map +0 -1
  74. package/esm/deps/jsr.io/@std/bytes/1.0.5/copy.js +0 -50
  75. package/esm/deps/jsr.io/@std/io/0.225.2/_common.d.ts +0 -3
  76. package/esm/deps/jsr.io/@std/io/0.225.2/_common.d.ts.map +0 -1
  77. package/esm/deps/jsr.io/@std/io/0.225.2/_common.js +0 -8
  78. package/esm/deps/jsr.io/@std/io/0.225.2/_constants.d.ts +0 -3
  79. package/esm/deps/jsr.io/@std/io/0.225.2/_constants.d.ts.map +0 -1
  80. package/esm/deps/jsr.io/@std/io/0.225.2/_constants.js +0 -4
  81. package/esm/deps/jsr.io/@std/io/0.225.2/buffer.d.ts +0 -321
  82. package/esm/deps/jsr.io/@std/io/0.225.2/buffer.d.ts.map +0 -1
  83. package/esm/deps/jsr.io/@std/io/0.225.2/buffer.js +0 -488
  84. package/esm/deps/jsr.io/@std/io/0.225.2/copy.d.ts +0 -25
  85. package/esm/deps/jsr.io/@std/io/0.225.2/copy.d.ts.map +0 -1
  86. package/esm/deps/jsr.io/@std/io/0.225.2/copy.js +0 -36
  87. package/esm/deps/jsr.io/@std/io/0.225.2/iterate_reader.d.ts +0 -80
  88. package/esm/deps/jsr.io/@std/io/0.225.2/iterate_reader.d.ts.map +0 -1
  89. package/esm/deps/jsr.io/@std/io/0.225.2/iterate_reader.js +0 -96
  90. package/esm/deps/jsr.io/@std/io/0.225.2/mod.d.ts +0 -25
  91. package/esm/deps/jsr.io/@std/io/0.225.2/mod.d.ts.map +0 -1
  92. package/esm/deps/jsr.io/@std/io/0.225.2/mod.js +0 -25
  93. package/esm/deps/jsr.io/@std/io/0.225.2/read_all.d.ts +0 -42
  94. package/esm/deps/jsr.io/@std/io/0.225.2/read_all.d.ts.map +0 -1
  95. package/esm/deps/jsr.io/@std/io/0.225.2/read_all.js +0 -72
  96. package/esm/deps/jsr.io/@std/io/0.225.2/reader_from_stream_reader.d.ts +0 -20
  97. package/esm/deps/jsr.io/@std/io/0.225.2/reader_from_stream_reader.d.ts.map +0 -1
  98. package/esm/deps/jsr.io/@std/io/0.225.2/reader_from_stream_reader.js +0 -36
  99. package/esm/deps/jsr.io/@std/io/0.225.2/to_readable_stream.d.ts +0 -40
  100. package/esm/deps/jsr.io/@std/io/0.225.2/to_readable_stream.d.ts.map +0 -1
  101. package/esm/deps/jsr.io/@std/io/0.225.2/to_readable_stream.js +0 -54
  102. package/esm/deps/jsr.io/@std/io/0.225.2/to_writable_stream.d.ts +0 -27
  103. package/esm/deps/jsr.io/@std/io/0.225.2/to_writable_stream.d.ts.map +0 -1
  104. package/esm/deps/jsr.io/@std/io/0.225.2/to_writable_stream.js +0 -44
  105. package/script/deps/jsr.io/@nats-io/transport-deno/3.0.2/src/connect.d.ts +0 -3
  106. package/script/deps/jsr.io/@nats-io/transport-deno/3.0.2/src/connect.d.ts.map +0 -1
  107. package/script/deps/jsr.io/@nats-io/transport-deno/3.0.2/src/connect.js +0 -31
  108. package/script/deps/jsr.io/@nats-io/transport-deno/3.0.2/src/deno_transport.d.ts +0 -36
  109. package/script/deps/jsr.io/@nats-io/transport-deno/3.0.2/src/deno_transport.d.ts.map +0 -1
  110. package/script/deps/jsr.io/@nats-io/transport-deno/3.0.2/src/deno_transport.js +0 -357
  111. package/script/deps/jsr.io/@nats-io/transport-deno/3.0.2/src/mod.d.ts +0 -3
  112. package/script/deps/jsr.io/@nats-io/transport-deno/3.0.2/src/mod.d.ts.map +0 -1
  113. package/script/deps/jsr.io/@nats-io/transport-deno/3.0.2/src/mod.js +0 -20
  114. package/script/deps/jsr.io/@nats-io/transport-deno/3.0.2/src/version.d.ts +0 -2
  115. package/script/deps/jsr.io/@nats-io/transport-deno/3.0.2/src/version.d.ts.map +0 -1
  116. package/script/deps/jsr.io/@nats-io/transport-deno/3.0.2/src/version.js +0 -5
  117. package/script/deps/jsr.io/@std/bytes/1.0.5/_types.d.ts +0 -9
  118. package/script/deps/jsr.io/@std/bytes/1.0.5/_types.d.ts.map +0 -1
  119. package/script/deps/jsr.io/@std/bytes/1.0.5/_types.js +0 -3
  120. package/script/deps/jsr.io/@std/bytes/1.0.5/concat.d.ts +0 -21
  121. package/script/deps/jsr.io/@std/bytes/1.0.5/concat.d.ts.map +0 -1
  122. package/script/deps/jsr.io/@std/bytes/1.0.5/concat.js +0 -35
  123. package/script/deps/jsr.io/@std/bytes/1.0.5/copy.d.ts +0 -41
  124. package/script/deps/jsr.io/@std/bytes/1.0.5/copy.d.ts.map +0 -1
  125. package/script/deps/jsr.io/@std/bytes/1.0.5/copy.js +0 -53
  126. package/script/deps/jsr.io/@std/io/0.225.2/_common.d.ts +0 -3
  127. package/script/deps/jsr.io/@std/io/0.225.2/_common.d.ts.map +0 -1
  128. package/script/deps/jsr.io/@std/io/0.225.2/_common.js +0 -11
  129. package/script/deps/jsr.io/@std/io/0.225.2/_constants.d.ts +0 -3
  130. package/script/deps/jsr.io/@std/io/0.225.2/_constants.d.ts.map +0 -1
  131. package/script/deps/jsr.io/@std/io/0.225.2/_constants.js +0 -7
  132. package/script/deps/jsr.io/@std/io/0.225.2/buffer.d.ts +0 -321
  133. package/script/deps/jsr.io/@std/io/0.225.2/buffer.d.ts.map +0 -1
  134. package/script/deps/jsr.io/@std/io/0.225.2/buffer.js +0 -492
  135. package/script/deps/jsr.io/@std/io/0.225.2/copy.d.ts +0 -25
  136. package/script/deps/jsr.io/@std/io/0.225.2/copy.d.ts.map +0 -1
  137. package/script/deps/jsr.io/@std/io/0.225.2/copy.js +0 -39
  138. package/script/deps/jsr.io/@std/io/0.225.2/iterate_reader.d.ts +0 -80
  139. package/script/deps/jsr.io/@std/io/0.225.2/iterate_reader.d.ts.map +0 -1
  140. package/script/deps/jsr.io/@std/io/0.225.2/iterate_reader.js +0 -100
  141. package/script/deps/jsr.io/@std/io/0.225.2/mod.d.ts +0 -25
  142. package/script/deps/jsr.io/@std/io/0.225.2/mod.d.ts.map +0 -1
  143. package/script/deps/jsr.io/@std/io/0.225.2/mod.js +0 -41
  144. package/script/deps/jsr.io/@std/io/0.225.2/read_all.d.ts +0 -42
  145. package/script/deps/jsr.io/@std/io/0.225.2/read_all.d.ts.map +0 -1
  146. package/script/deps/jsr.io/@std/io/0.225.2/read_all.js +0 -76
  147. package/script/deps/jsr.io/@std/io/0.225.2/reader_from_stream_reader.d.ts +0 -20
  148. package/script/deps/jsr.io/@std/io/0.225.2/reader_from_stream_reader.d.ts.map +0 -1
  149. package/script/deps/jsr.io/@std/io/0.225.2/reader_from_stream_reader.js +0 -39
  150. package/script/deps/jsr.io/@std/io/0.225.2/to_readable_stream.d.ts +0 -40
  151. package/script/deps/jsr.io/@std/io/0.225.2/to_readable_stream.d.ts.map +0 -1
  152. package/script/deps/jsr.io/@std/io/0.225.2/to_readable_stream.js +0 -57
  153. package/script/deps/jsr.io/@std/io/0.225.2/to_writable_stream.d.ts +0 -27
  154. package/script/deps/jsr.io/@std/io/0.225.2/to_writable_stream.d.ts.map +0 -1
  155. package/script/deps/jsr.io/@std/io/0.225.2/to_writable_stream.js +0 -47
@@ -1,321 +0,0 @@
1
- import type { Reader, ReaderSync, Writer, WriterSync } from "./types.js";
2
- /**
3
- * A variable-sized buffer of bytes with `read()` and `write()` methods.
4
- *
5
- * Buffer is almost always used with some I/O like files and sockets. It allows
6
- * one to buffer up a download from a socket. Buffer grows and shrinks as
7
- * necessary.
8
- *
9
- * Buffer is NOT the same thing as Node's Buffer. Node's Buffer was created in
10
- * 2009 before JavaScript had the concept of ArrayBuffers. It's simply a
11
- * non-standard ArrayBuffer.
12
- *
13
- * ArrayBuffer is a fixed memory allocation. Buffer is implemented on top of
14
- * ArrayBuffer.
15
- *
16
- * Based on {@link https://golang.org/pkg/bytes/#Buffer | Go Buffer}.
17
- *
18
- * @example Usage
19
- * ```ts
20
- * import { Buffer } from "@std/io/buffer";
21
- * import { assertEquals } from "@std/assert/equals";
22
- *
23
- * const buf = new Buffer();
24
- * await buf.write(new TextEncoder().encode("Hello, "));
25
- * await buf.write(new TextEncoder().encode("world!"));
26
- *
27
- * const data = new Uint8Array(13);
28
- * await buf.read(data);
29
- *
30
- * assertEquals(new TextDecoder().decode(data), "Hello, world!");
31
- * ```
32
- */
33
- export declare class Buffer implements Writer, WriterSync, Reader, ReaderSync {
34
- #private;
35
- /**
36
- * Constructs a new instance with the specified {@linkcode ArrayBuffer} as its
37
- * initial contents.
38
- *
39
- * @param ab The ArrayBuffer to use as the initial contents of the buffer.
40
- */
41
- constructor(ab?: ArrayBufferLike | ArrayLike<number>);
42
- /**
43
- * Returns a slice holding the unread portion of the buffer.
44
- *
45
- * The slice is valid for use only until the next buffer modification (that
46
- * is, only until the next call to a method like `read()`, `write()`,
47
- * `reset()`, or `truncate()`). If `options.copy` is false the slice aliases the buffer content at
48
- * least until the next buffer modification, so immediate changes to the
49
- * slice will affect the result of future reads.
50
- *
51
- * @example Usage
52
- * ```ts
53
- * import { Buffer } from "@std/io/buffer";
54
- * import { assertEquals } from "@std/assert/equals";
55
- *
56
- * const buf = new Buffer();
57
- * await buf.write(new TextEncoder().encode("Hello, world!"));
58
- *
59
- * const slice = buf.bytes();
60
- * assertEquals(new TextDecoder().decode(slice), "Hello, world!");
61
- * ```
62
- *
63
- * @param options The options for the slice.
64
- * @returns A slice holding the unread portion of the buffer.
65
- */
66
- bytes(options?: {
67
- copy: boolean;
68
- }): Uint8Array;
69
- /**
70
- * Returns whether the unread portion of the buffer is empty.
71
- *
72
- * @example Usage
73
- * ```ts
74
- * import { Buffer } from "@std/io/buffer";
75
- * import { assertEquals } from "@std/assert/equals";
76
- *
77
- * const buf = new Buffer();
78
- * assertEquals(buf.empty(), true);
79
- * await buf.write(new TextEncoder().encode("Hello, world!"));
80
- * assertEquals(buf.empty(), false);
81
- * ```
82
- *
83
- * @returns `true` if the unread portion of the buffer is empty, `false`
84
- * otherwise.
85
- */
86
- empty(): boolean;
87
- /**
88
- * A read only number of bytes of the unread portion of the buffer.
89
- *
90
- * @example Usage
91
- * ```ts
92
- * import { Buffer } from "@std/io/buffer";
93
- * import { assertEquals } from "@std/assert/equals";
94
- *
95
- * const buf = new Buffer();
96
- * await buf.write(new TextEncoder().encode("Hello, world!"));
97
- *
98
- * assertEquals(buf.length, 13);
99
- * ```
100
- *
101
- * @returns The number of bytes of the unread portion of the buffer.
102
- */
103
- get length(): number;
104
- /**
105
- * The read only capacity of the buffer's underlying byte slice, that is,
106
- * the total space allocated for the buffer's data.
107
- *
108
- * @example Usage
109
- * ```ts
110
- * import { Buffer } from "@std/io/buffer";
111
- * import { assertEquals } from "@std/assert/equals";
112
- *
113
- * const buf = new Buffer();
114
- * assertEquals(buf.capacity, 0);
115
- * await buf.write(new TextEncoder().encode("Hello, world!"));
116
- * assertEquals(buf.capacity, 13);
117
- * ```
118
- *
119
- * @returns The capacity of the buffer.
120
- */
121
- get capacity(): number;
122
- /**
123
- * Discards all but the first `n` unread bytes from the buffer but
124
- * continues to use the same allocated storage. It throws if `n` is
125
- * negative or greater than the length of the buffer.
126
- *
127
- * @example Usage
128
- * ```ts
129
- * import { Buffer } from "@std/io/buffer";
130
- * import { assertEquals } from "@std/assert/equals";
131
- *
132
- * const buf = new Buffer();
133
- * await buf.write(new TextEncoder().encode("Hello, world!"));
134
- * buf.truncate(6);
135
- * assertEquals(buf.length, 6);
136
- * ```
137
- *
138
- * @param n The number of bytes to keep.
139
- */
140
- truncate(n: number): void;
141
- /**
142
- * Resets the contents
143
- *
144
- * @example Usage
145
- * ```ts
146
- * import { Buffer } from "@std/io/buffer";
147
- * import { assertEquals } from "@std/assert/equals";
148
- *
149
- * const buf = new Buffer();
150
- * await buf.write(new TextEncoder().encode("Hello, world!"));
151
- * buf.reset();
152
- * assertEquals(buf.length, 0);
153
- * ```
154
- */
155
- reset(): void;
156
- /**
157
- * Reads the next `p.length` bytes from the buffer or until the buffer is
158
- * drained. Returns the number of bytes read. If the buffer has no data to
159
- * return, the return is EOF (`null`).
160
- *
161
- * @example Usage
162
- * ```ts
163
- * import { Buffer } from "@std/io/buffer";
164
- * import { assertEquals } from "@std/assert/equals";
165
- *
166
- * const buf = new Buffer();
167
- * await buf.write(new TextEncoder().encode("Hello, world!"));
168
- *
169
- * const data = new Uint8Array(5);
170
- * const res = await buf.read(data);
171
- *
172
- * assertEquals(res, 5);
173
- * assertEquals(new TextDecoder().decode(data), "Hello");
174
- * ```
175
- *
176
- * @param p The buffer to read data into.
177
- * @returns The number of bytes read.
178
- */
179
- readSync(p: Uint8Array): number | null;
180
- /**
181
- * Reads the next `p.length` bytes from the buffer or until the buffer is
182
- * drained. Resolves to the number of bytes read. If the buffer has no
183
- * data to return, resolves to EOF (`null`).
184
- *
185
- * NOTE: This methods reads bytes synchronously; it's provided for
186
- * compatibility with `Reader` interfaces.
187
- *
188
- * @example Usage
189
- * ```ts
190
- * import { Buffer } from "@std/io/buffer";
191
- * import { assertEquals } from "@std/assert/equals";
192
- *
193
- * const buf = new Buffer();
194
- * await buf.write(new TextEncoder().encode("Hello, world!"));
195
- *
196
- * const data = new Uint8Array(5);
197
- * const res = await buf.read(data);
198
- *
199
- * assertEquals(res, 5);
200
- * assertEquals(new TextDecoder().decode(data), "Hello");
201
- * ```
202
- *
203
- * @param p The buffer to read data into.
204
- * @returns The number of bytes read.
205
- */
206
- read(p: Uint8Array): Promise<number | null>;
207
- /**
208
- * Writes the given data to the buffer.
209
- *
210
- * @example Usage
211
- * ```ts
212
- * import { Buffer } from "@std/io/buffer";
213
- * import { assertEquals } from "@std/assert/equals";
214
- *
215
- * const buf = new Buffer();
216
- * const data = new TextEncoder().encode("Hello, world!");
217
- * buf.writeSync(data);
218
- *
219
- * const slice = buf.bytes();
220
- * assertEquals(new TextDecoder().decode(slice), "Hello, world!");
221
- * ```
222
- *
223
- * @param p The data to write to the buffer.
224
- * @returns The number of bytes written.
225
- */
226
- writeSync(p: Uint8Array): number;
227
- /**
228
- * Writes the given data to the buffer. Resolves to the number of bytes
229
- * written.
230
- *
231
- * > [!NOTE]
232
- * > This methods writes bytes synchronously; it's provided for compatibility
233
- * > with the {@linkcode Writer} interface.
234
- *
235
- * @example Usage
236
- * ```ts
237
- * import { Buffer } from "@std/io/buffer";
238
- * import { assertEquals } from "@std/assert/equals";
239
- *
240
- * const buf = new Buffer();
241
- * const data = new TextEncoder().encode("Hello, world!");
242
- * await buf.write(data);
243
- *
244
- * const slice = buf.bytes();
245
- * assertEquals(new TextDecoder().decode(slice), "Hello, world!");
246
- * ```
247
- *
248
- * @param p The data to write to the buffer.
249
- * @returns The number of bytes written.
250
- */
251
- write(p: Uint8Array): Promise<number>;
252
- /** Grows the buffer's capacity, if necessary, to guarantee space for
253
- * another `n` bytes. After `.grow(n)`, at least `n` bytes can be written to
254
- * the buffer without another allocation. If `n` is negative, `.grow()` will
255
- * throw. If the buffer can't grow it will throw an error.
256
- *
257
- * Based on Go Lang's
258
- * {@link https://golang.org/pkg/bytes/#Buffer.Grow | Buffer.Grow}.
259
- *
260
- * @example Usage
261
- * ```ts
262
- * import { Buffer } from "@std/io/buffer";
263
- * import { assertEquals } from "@std/assert/equals";
264
- *
265
- * const buf = new Buffer();
266
- * buf.grow(10);
267
- * assertEquals(buf.capacity, 10);
268
- * ```
269
- *
270
- * @param n The number of bytes to grow the buffer by.
271
- */
272
- grow(n: number): void;
273
- /**
274
- * Reads data from `r` until EOF (`null`) and appends it to the buffer,
275
- * growing the buffer as needed. It resolves to the number of bytes read.
276
- * If the buffer becomes too large, `.readFrom()` will reject with an error.
277
- *
278
- * Based on Go Lang's
279
- * {@link https://golang.org/pkg/bytes/#Buffer.ReadFrom | Buffer.ReadFrom}.
280
- *
281
- * @example Usage
282
- * ```ts
283
- * import { Buffer } from "@std/io/buffer";
284
- * import { assertEquals } from "@std/assert/equals";
285
- *
286
- * const buf = new Buffer();
287
- * const r = new Buffer(new TextEncoder().encode("Hello, world!"));
288
- * const n = await buf.readFrom(r);
289
- *
290
- * assertEquals(n, 13);
291
- * ```
292
- *
293
- * @param r The reader to read from.
294
- * @returns The number of bytes read.
295
- */
296
- readFrom(r: Reader): Promise<number>;
297
- /** Reads data from `r` until EOF (`null`) and appends it to the buffer,
298
- * growing the buffer as needed. It returns the number of bytes read. If the
299
- * buffer becomes too large, `.readFromSync()` will throw an error.
300
- *
301
- * Based on Go Lang's
302
- * {@link https://golang.org/pkg/bytes/#Buffer.ReadFrom | Buffer.ReadFrom}.
303
- *
304
- * @example Usage
305
- * ```ts
306
- * import { Buffer } from "@std/io/buffer";
307
- * import { assertEquals } from "@std/assert/equals";
308
- *
309
- * const buf = new Buffer();
310
- * const r = new Buffer(new TextEncoder().encode("Hello, world!"));
311
- * const n = buf.readFromSync(r);
312
- *
313
- * assertEquals(n, 13);
314
- * ```
315
- *
316
- * @param r The reader to read from.
317
- * @returns The number of bytes read.
318
- */
319
- readFromSync(r: ReaderSync): number;
320
- }
321
- //# sourceMappingURL=buffer.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"buffer.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/io/0.225.2/buffer.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AASzE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,qBAAa,MAAO,YAAW,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU;;IAInE;;;;;OAKG;gBACS,EAAE,CAAC,EAAE,eAAe,GAAG,SAAS,CAAC,MAAM,CAAC;IAWpD;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,KAAK,CAAC,OAAO;;KAAiB,GAAG,UAAU;IAK3C;;;;;;;;;;;;;;;;OAgBG;IACH,KAAK,IAAI,OAAO;IAIhB;;;;;;;;;;;;;;;OAeG;IACH,IAAI,MAAM,IAAI,MAAM,CAEnB;IAED;;;;;;;;;;;;;;;;OAgBG;IACH,IAAI,QAAQ,IAAI,MAAM,CAErB;IAED;;;;;;;;;;;;;;;;;OAiBG;IACH,QAAQ,CAAC,CAAC,EAAE,MAAM;IAWlB;;;;;;;;;;;;;OAaG;IACH,KAAK;IAqBL;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,QAAQ,CAAC,CAAC,EAAE,UAAU,GAAG,MAAM,GAAG,IAAI;IAetC;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACH,IAAI,CAAC,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAK3C;;;;;;;;;;;;;;;;;;OAkBG;IACH,SAAS,CAAC,CAAC,EAAE,UAAU,GAAG,MAAM;IAKhC;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,KAAK,CAAC,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC;IAuCrC;;;;;;;;;;;;;;;;;;;OAmBG;IACH,IAAI,CAAC,CAAC,EAAE,MAAM;IAQd;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACG,QAAQ,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAwB1C;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,YAAY,CAAC,CAAC,EAAE,UAAU,GAAG,MAAM;CAuBpC"}