Skip to content

Add default node web stream shim #362

@dsherret

Description

@dsherret

Something like this, but need to actually go through and figure out what everything is based on https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/node/stream/web.d.ts#L17 and https://github.com/denoland/deno/blob/7281775381cda79ef61df27820387dc2c74e0384/ext/web/lib.deno_web.d.ts

// in https://github.com/denoland/dnt/blob/main/lib/shims.ts
function getNodeWebStreamsShim(): Shim {
  return {
    package: {
      name: "node:stream/web",
    },
    globalNames: [
      "ReadableStream",
      "WritableStream",
      "TextDecoderStream",
      typeOnly("ReadableStreamController"),
      typeOnly("ReadableStreamDefaultReadValueResult"),
      typeOnly("ReadableStreamDefaultReader"),
      typeOnly("WritableStreamDefaultWriter"),
      typeOnly("QueuingStrategy"),
      {
        name: "PipeOptions",
        exportName: "StreamPipeOptions",
        typeOnly: true,
      },
    ],
  };
}

Then someone could just do: nodeWebStreams: true in their shims.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions