mirror of
https://github.com/movie-web/providers-api.git
synced 2025-09-13 11:53:25 +00:00
Move SSE type into declaration and comment existence
This commit is contained in:
@@ -10,11 +10,14 @@ import { ZodError } from 'zod';
|
|||||||
import { mediaSchema } from '@/schema';
|
import { mediaSchema } from '@/schema';
|
||||||
import { validateTurnstile } from '@/turnstile';
|
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();
|
const app = new Hono();
|
||||||
|
|
||||||
let eventId = 0;
|
let eventId = 0;
|
||||||
async function writeSSEEvent(
|
async function writeSSEEvent(
|
||||||
stream: Parameters<Parameters<typeof streamSSE>['1']>['0'],
|
stream: SSEStreamingApi,
|
||||||
event: string,
|
event: string,
|
||||||
data: any | undefined,
|
data: any | undefined,
|
||||||
) {
|
) {
|
||||||
|
Reference in New Issue
Block a user