/// /// /// import { Server as HttpServer } from "node:http"; import { Server as HTTPSServer } from "node:https"; import { Http2Server } from "node:http2"; import { Socket as SocketioSocket, Server as SocketIoServer, Namespace as SocketioNamespace } from "socket.io"; import { Response } from "../response/response"; import { Request as ParsedRequest } from "../request/request"; import { GlobalMiddleware } from "../middleware/global.middleware"; export declare type Socket = SocketioSocket; export declare type EventHandler = (socket: Socket, req: SocketRequest, res: Response) => any; export declare type NextFunction = (err?: any) => any; export declare type ErrorEventHandler = (err: any, socket: Socket, req: SocketRequest, res: Response) => any; export declare type Request = { body: any; }; export declare type SocketRequest = Request & ParsedRequest; export declare type HttpServerForWs = HttpServer | HTTPSServer; export declare type WsServer = SocketIoServer; export declare type WsNamespace = SocketioNamespace; export declare enum HttpMethods { GET = "GET", POST = "POST", PUT = "PUT", DELETE = "DELETE", PATCH = "PATCH", HEAD = "HEAD", OPTIONS = "OPTIONS" } export declare type HttpMiddleware = (req: ParsedRequest, res: any, next: NextFunction) => any; export declare type HttpMiddlewareWrapper = (middleware: HttpMiddleware) => GlobalMiddleware; export declare type Getter = { get(key: string): T; }; export declare type Modify = Omit & R; export declare type OnServerStartedEvent = (server: HttpServer | Http2Server) => void;