asu_tools_service/index.d.ts

25 lines
748 B
TypeScript

import type http from "node:http";
declare global {
type ReportModel = {
date: string;
equipment: string;
reason_call: string;
job_description: string;
root_cause: string;
applicantName: string;
executorNames: string;
};
type HTTPResponse = {
sendJson: (data: any, statusCode?: number = 200) => http.ServerResponse;
sendText: (text: string, statusCode?: number = 200) => http.ServerResponse;
res: http.ServerResponse | null;
};
type HTTPRoute = { method: "POST" | "GET"; handle: HTTPRouteHandler };
type HTTPRouteHandler = (ctx: HTTPContext) => Promise<void>;
type HTTPRouteMap = Record<string, HTTPRoute>;
type HTTPContext = { data: any; req: http.IncomingMessage; res: HTTPResponse };
}