import type { JSX } from "solid-js"; import { RequestEvent } from "solid-js/web"; import { HTTPEvent } from "vinxi/http"; export type DocumentComponentProps = { assets: JSX.Element; scripts: JSX.Element; children?: JSX.Element; }; export type Asset = { tag: "style"; attrs: JSX.StyleHTMLAttributes & { key?: string; }; children?: JSX.Element; } | { tag: "script"; attrs: JSX.ScriptHTMLAttributes & { key?: string; }; } | { tag: "link"; attrs: JSX.LinkHTMLAttributes & { key?: string; }; }; export type HandlerOptions = { mode?: "sync" | "async" | "stream"; nonce?: string; renderId?: string; onCompleteAll?: (options: { write: (v: any) => void; }) => void; onCompleteShell?: (options: { write: (v: any) => void; }) => void; }; export type ContextMatches = { originalPath: string; pattern: string; path: string; params: unknown; }; export interface ResponseStub { status?: number; statusText?: string; headers: Headers; } export interface FetchEvent { request: Request; response: ResponseStub; clientAddress?: string; locals: App.RequestEventLocals; nativeEvent: HTTPEvent; } export interface PageEvent extends RequestEvent { manifest: any; assets: any; routes: any[]; $islands: Set; complete: boolean; } export interface APIEvent extends FetchEvent { params: { [key: string]: string; }; } export interface APIHandler { (event: APIEvent): Promise; } export interface ServerFunctionMeta { id: string; } declare module "solid-js/web" { interface RequestEvent extends FetchEvent { serverOnly?: boolean; } }