Skip to content

Commit 112fa33

Browse files
committed
feat: export event-stream types
resolves #760
1 parent 76736ea commit 112fa33

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/utils/sse/index.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import type { H3Event } from "../../event";
2-
import { EventStream } from "./event-stream";
3-
import { EventStreamOptions } from "./types";
2+
import type { EventStreamOptions } from "./types";
3+
import { EventStream as _EventStream } from "./event-stream";
4+
45
/**
56
* 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)
67
*
@@ -33,6 +34,9 @@ import { EventStreamOptions } from "./types";
3334
export function createEventStream(
3435
event: H3Event,
3536
opts?: EventStreamOptions,
36-
): EventStream {
37-
return new EventStream(event, opts);
37+
): _EventStream {
38+
return new _EventStream(event, opts);
3839
}
40+
41+
export type EventStream = ReturnType<typeof createEventStream>;
42+
export type { EventStreamOptions, EventStreamMessage } from "./types";

0 commit comments

Comments
 (0)