import { RouterOptions } from "express"; import { IArkosRouter } from "./types"; import { OpenAPIV3 } from "openapi-types"; import { Arkos } from "../../types/arkos"; import { ArkosRouterBaseUploadConfig } from "./types/upload-config"; export type ArkosRouterOptions = { /** * Prefix to apply to all routes in this router. * Nested routers inherit and concatenate prefixes from parent routers. * * @since 1.5.0-beta * @example * // All routes in this router will be prefixed with "/api" * prefix: "/api" */ prefix?: string | RegExp | Array; /** * OpenAPI metadata to apply to all routes in this router. * Nested routers inherit from parent routers unless explicitly overridden. * Route-level openapi config fully replaces inherited values when defined. * * @since 1.6.0-beta * @example * openapi: { * tags: ["Users"], * security: [{ bearerAuth: [] }] * } */ openapi?: { /** * Tags to apply to all routes in this router, used to group them in OpenAPI documentation. * Route-level tags fully replaces this value when defined. * * @since 1.6.0-beta * @example * // Group all routes in this router under "Users" * tags: ["Users"] */ tags?: string[]; /** * Security requirements to apply to all routes in this router. * Route-level security fully replaces this value when defined. * * @since 1.6.2-canary.1 * @example * // Require bearer auth for all routes in this router * security: [{ bearerAuth: [] }] * * // Explicitly make all routes public (overridable per route) * security: [] */ security?: OpenAPIV3.SecurityRequirementObject[]; /** * Server definitions to apply to all routes in this router. * Follows the OpenAPI 3.0 Server Object specification. * Route-level servers fully replaces this value when defined. * * @since 1.6.2-canary.1 * @example * servers: [{ url: "https://api.example.com/v2", description: "V2 API" }] */ servers?: OpenAPIV3.ServerObject[]; /** * External documentation to apply to all routes in this router. * Route-level externalDocs fully replaces this value when defined. * * @since 1.6.2-canary.1 * @example * externalDocs: { * description: "Find more information here", * url: "https://docs.example.com/users" * } */ externalDocs?: OpenAPIV3.ExternalDocumentationObject; }; /** * Allow customizing uploads on route level * * @since 1.7.0-canary.39 */ uploads?: ArkosRouterBaseUploadConfig; }; /** * Creates an enhanced Express Router with features like OpenAPI documentation capabilities and smart data validation. * * The ArkosRouter extends the standard Express Router with the ability to * automatically capture OpenAPI metadata from route configurations. * * @example * const router = ArkosRouter(); * * router.get( * { * path: "/users/:id", * openapi: { * summary: "Get user by ID", * tags: ["Users"] * } * }, * (req, res) => { ... } * ); * * @returns {IArkosRouter} A proxied Express Router instance with enhanced OpenAPI capabilities * * @see {@link https://www.arkosjs.com/docs/reference/arkos-router} for configuration options * @since 1.4.0-beta */ export default function ArkosRouter(options?: RouterOptions & ArkosRouterOptions): IArkosRouter; export declare function generateOpenAPIFromApp(app: Arkos): Record>>;