Skip to content

Commit

Permalink
feat: export event-stream types
Browse files Browse the repository at this point in the history
resolves #760
  • Loading branch information
pi0 committed Jun 19, 2024
1 parent 76736ea commit 112fa33
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/utils/sse/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type { H3Event } from "../../event";
import { EventStream } from "./event-stream";
import { EventStreamOptions } from "./types";
import type { EventStreamOptions } from "./types";
import { EventStream as _EventStream } from "./event-stream";

/**
* Initialize an EventStream instance for creating [server sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events)
*
Expand Down Expand Up @@ -33,6 +34,9 @@ import { EventStreamOptions } from "./types";
export function createEventStream(
event: H3Event,
opts?: EventStreamOptions,
): EventStream {
return new EventStream(event, opts);
): _EventStream {
return new _EventStream(event, opts);
}

export type EventStream = ReturnType<typeof createEventStream>;
export type { EventStreamOptions, EventStreamMessage } from "./types";

0 comments on commit 112fa33

Please sign in to comment.