quickwire
Version:
Automatic API generator for Next.js applications that creates API routes and TypeScript client functions from backend functions
35 lines • 903 B
TypeScript
import ts from "typescript";
import { NextRequest } from "next/server";
export interface QuickwireContext {
req: NextRequest;
getHeaders: () => Record<string, string>;
getCookies: () => Record<string, string>;
getIp: () => string;
getUserAgent: () => string;
}
export interface ExportedFunction {
name: string;
type: "function" | "arrow" | "variable";
parameters: {
name: string;
type: string;
optional?: boolean;
}[];
returnType?: string;
isAsync?: boolean;
httpMethod?: string;
needsContext?: boolean;
node: ts.Node;
}
export interface ExportedType {
name: string;
type: "interface" | "type" | "enum" | "class";
declaration: string;
node: ts.Node;
}
export interface ModuleExports {
functions: ExportedFunction[];
types: ExportedType[];
imports: string[];
}
//# sourceMappingURL=types.d.ts.map