Move SSE type into declaration and comment existence

This commit is contained in:
William Oldham
2023-12-17 22:09:33 +00:00
parent dd37fecf57
commit 4584ceaaa6

View File

@@ -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<Parameters<typeof streamSSE>['1']>['0'];
const app = new Hono();
let eventId = 0;
async function writeSSEEvent(
stream: Parameters<Parameters<typeof streamSSE>['1']>['0'],
stream: SSEStreamingApi,
event: string,
data: any | undefined,
) {