@@ -5,7 +5,11 @@ import type { ReadableStreamLike } from "./utils/stream";
55import type { DecodeOptions } from "./decode" ;
66import type { SplitUndefined } from "./context" ;
77
8- export async function decodeAsync < ContextType > (
8+ /**
9+ * @throws {@link RangeError } if the buffer is incomplete, including the case where the buffer is empty.
10+ * @throws {@link DecodeError } if the buffer contains invalid data.
11+ */
12+ export async function decodeAsync < ContextType > (
913 streamLike : ReadableStreamLike < ArrayLike < number > | BufferSource > ,
1014 options : DecodeOptions < SplitUndefined < ContextType > > = defaultDecodeOptions as any ,
1115) : Promise < unknown > {
@@ -23,7 +27,11 @@ export async function decodeAsync<ContextType>(
2327 return decoder . decodeAsync ( stream ) ;
2428}
2529
26- export function decodeArrayStream < ContextType > (
30+ /**
31+ * @throws {@link RangeError } if the buffer is incomplete, including the case where the buffer is empty.
32+ * @throws {@link DecodeError } if the buffer contains invalid data.
33+ */
34+ export function decodeArrayStream < ContextType > (
2735 streamLike : ReadableStreamLike < ArrayLike < number > | BufferSource > ,
2836 options : DecodeOptions < SplitUndefined < ContextType > > = defaultDecodeOptions as any ,
2937) : AsyncGenerator < unknown , void , unknown > {
@@ -42,6 +50,10 @@ export function decodeArrayStream<ContextType>(
4250 return decoder . decodeArrayStream ( stream ) ;
4351}
4452
53+ /**
54+ * @throws {@link RangeError } if the buffer is incomplete, including the case where the buffer is empty.
55+ * @throws {@link DecodeError } if the buffer contains invalid data.
56+ */
4557export function decodeMultiStream < ContextType > (
4658 streamLike : ReadableStreamLike < ArrayLike < number > | BufferSource > ,
4759 options : DecodeOptions < SplitUndefined < ContextType > > = defaultDecodeOptions as any ,
0 commit comments