From 4584ceaaa6d9000ae3145f2f7055dfd85e454ff6 Mon Sep 17 00:00:00 2001 From: William Oldham Date: Sun, 17 Dec 2023 22:09:33 +0000 Subject: [PATCH] Move SSE type into declaration and comment existence --- src/index.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index 0ef3e9e..34f32d7 100644 --- a/src/index.ts +++ b/src/index.ts @@ -10,11 +10,14 @@ import { ZodError } from 'zod'; import { mediaSchema } from '@/schema'; import { validateTurnstile } from '@/turnstile'; +// hono doesn't export this type, so we retrieve it from a function +type SSEStreamingApi = Parameters['1']>['0']; + const app = new Hono(); let eventId = 0; async function writeSSEEvent( - stream: Parameters['1']>['0'], + stream: SSEStreamingApi, event: string, data: any | undefined, ) {