Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/typespec-ts/src/utils/modelUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ import { getModelNamespaceName } from "./namespaceUtils.js";
import { reportDiagnostic } from "../lib.js";

export const BINARY_TYPE_UNION =
"string | Uint8Array | ReadableStream<Uint8Array> | NodeJS.ReadableStream";
"string | Uint8Array | ReadableStream<Uint8Array> | AsyncIterable<Uint8Array>";

export const BINARY_AND_FILE_TYPE_UNION = `${BINARY_TYPE_UNION} | File`;

Expand Down
36 changes: 19 additions & 17 deletions packages/typespec-ts/test/unit/bytesGenerator.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ describe("bytes", () => {
| string
| Uint8Array
| ReadableStream<Uint8Array>
| NodeJS.ReadableStream;
| AsyncIterable<Uint8Array>;
}

export interface UploadFileViaBodyMediaTypesParam {
Expand Down Expand Up @@ -66,7 +66,7 @@ describe("bytes", () => {
| string
| Uint8Array
| ReadableStream<Uint8Array>
| NodeJS.ReadableStream;
| AsyncIterable<Uint8Array>;
}

export interface UploadFileViaBodyMediaTypesParam {
Expand Down Expand Up @@ -125,7 +125,7 @@ describe("bytes", () => {
| string
| Uint8Array
| ReadableStream<Uint8Array>
| NodeJS.ReadableStream;
| AsyncIterable<Uint8Array>;
}

export type ReadParameters = ReadBodyParam & RequestParameters;
Expand Down Expand Up @@ -201,7 +201,7 @@ describe("bytes", () => {
| string
| Uint8Array
| ReadableStream<Uint8Array>
| NodeJS.ReadableStream
| AsyncIterable<Uint8Array>
| File;
filename?: string;
contentType?: string;
Expand All @@ -212,7 +212,7 @@ describe("bytes", () => {
| string
| Uint8Array
| ReadableStream<Uint8Array>
| NodeJS.ReadableStream
| AsyncIterable<Uint8Array>
| File;
filename?: string;
contentType?: string;
Expand Down Expand Up @@ -263,7 +263,7 @@ describe("bytes", () => {
| string
| Uint8Array
| ReadableStream<Uint8Array>
| NodeJS.ReadableStream
| AsyncIterable<Uint8Array>
| File;
filename?: string;
contentType?: string;
Expand All @@ -274,7 +274,7 @@ describe("bytes", () => {
| string
| Uint8Array
| ReadableStream<Uint8Array>
| NodeJS.ReadableStream
| AsyncIterable<Uint8Array>
| File;
filename?: string;
contentType?: string;
Expand Down Expand Up @@ -370,7 +370,7 @@ describe("bytes", () => {
| string
| Uint8Array
| ReadableStream<Uint8Array>
| NodeJS.ReadableStream
| AsyncIterable<Uint8Array>
| File;
filename?: string;
contentType?: string;
Expand All @@ -382,7 +382,7 @@ describe("bytes", () => {
| string
| Uint8Array
| ReadableStream<Uint8Array>
| NodeJS.ReadableStream
| AsyncIterable<Uint8Array>
| File;
filename?: string;
contentType?: string;
Expand All @@ -391,11 +391,13 @@ describe("bytes", () => {
export interface FooFilesPartDescriptor {
name: "files";
body:
| string
| Uint8Array
| ReadableStream<Uint8Array>
| NodeJS.ReadableStream
| File;
| (
| string
| Uint8Array
| ReadableStream<Uint8Array>
| AsyncIterable<Uint8Array>
| File
)[];
filename?: string;
contentType?: string;
}
Expand All @@ -406,7 +408,7 @@ describe("bytes", () => {
| string
| Uint8Array
| ReadableStream<Uint8Array>
| NodeJS.ReadableStream
| AsyncIterable<Uint8Array>
| File
| number;
filename?: string;
Expand Down Expand Up @@ -528,7 +530,7 @@ describe("bytes", () => {

export interface ReadBodyParam {
/** Value may contain any sequence of octets */
body: string | Uint8Array | ReadableStream<Uint8Array> | NodeJS.ReadableStream;
body: string | Uint8Array | ReadableStream<Uint8Array> | AsyncIterable<Uint8Array>;
}

export interface ReadMediaTypesParam {
Expand Down Expand Up @@ -559,7 +561,7 @@ describe("bytes", () => {
| string
| Uint8Array
| ReadableStream<Uint8Array>
| NodeJS.ReadableStream;
| AsyncIterable<Uint8Array>;
}

export interface ReadMediaTypesParam {
Expand Down
Loading