import { createParser as n } from "./index.js";
import { ParseError as i } from "./index.js";
class p extends TransformStream {
  constructor({ onError: t, onRetry: s, onComment: o } = {}) {
    let a;
    super({
      start(e) {
        a = n({
          onEvent: (r) => {
            e.enqueue(r);
          },
          onError(r) {
            t === "terminate" ? e.error(r) : typeof t == "function" && t(r);
          },
          onRetry: s,
          onComment: o
        });
      },
      transform(e) {
        a.feed(e);
      }
    });
  }
}
export {
  p as EventSourceParserStream,
  i as ParseError
};
//# sourceMappingURL=stream.js.map
