UNPKG

next-rest-framework

Version:

Next REST Framework - write type-safe, self-documenting REST APIs in Next.js

21 lines (20 loc) 995 B
import { type NextRestFrameworkConfig } from '../types'; import { type OpenAPIV3_1 } from 'openapi-types'; import { ValidMethod } from '../constants'; import { type DefineRouteParams } from '../types/define-route'; export declare const getHTMLForSwaggerUI: ({ config: { openApiJsonPath, swaggerUiConfig: { defaultTheme, title, description, faviconHref, logoHref } }, baseUrl, theme }: { config: NextRestFrameworkConfig; baseUrl: string; theme?: string | undefined; }) => string; export declare const getOrCreateOpenApiSpec: ({ config, baseUrl }: { config: NextRestFrameworkConfig; baseUrl: string; }) => Promise<any>; export declare const defaultResponse: OpenAPIV3_1.ResponseObject; export declare const isValidMethod: (x: unknown) => x is ValidMethod; export declare const getPathsFromMethodHandlers: ({ config, methodHandlers, route }: { config: NextRestFrameworkConfig; methodHandlers: DefineRouteParams; route: string; }) => OpenAPIV3_1.PathsObject<{}, {}>;