import type core from 'express-serve-static-core';
import { DocPath, DocPathMethod, MethodAwareDocPath, PathTemplate, RequiredDoc, TemplateToDocPath } from './common';
import { PathSchema, QuerySchema } from './params';
import { RequestBodyToJsonSchema } from './requests';
import { ResponseBodyToJsonSchema } from './responses';
/**
 * Typed express request handler.
 * @public
 */
export type DocRequestHandler<Doc extends RequiredDoc, Path extends DocPath<Doc>, Method extends DocPathMethod<Doc, Path>> = core.RequestHandler<PathSchema<Doc, Path, Method>, ResponseBodyToJsonSchema<Doc, Path, Method>, RequestBodyToJsonSchema<Doc, Path, Method>, QuerySchema<Doc, Path, Method>, Record<string, string>>;
/**
 * Typed express error handler / request handler union type.
 * @public
 */
export type DocRequestHandlerParams<Doc extends RequiredDoc, Path extends DocPath<Doc>, Method extends DocPathMethod<Doc, Path>> = core.RequestHandlerParams<PathSchema<Doc, Path, Method>, ResponseBodyToJsonSchema<Doc, Path, Method>, RequestBodyToJsonSchema<Doc, Path, Method>, QuerySchema<Doc, Path, Method>, Record<string, string>>;
/**
 * Superset of the express router path matcher that enforces typed request and response bodies.
 * @public
 */
export interface DocRequestMatcher<Doc extends RequiredDoc, T, Method extends 'all' | 'get' | 'post' | 'put' | 'delete' | 'patch' | 'options' | 'head'> {
    <Path extends MethodAwareDocPath<Doc, PathTemplate<Extract<keyof Doc['paths'], string>>, Method>>(path: Path, ...handlers: Array<DocRequestHandler<Doc, TemplateToDocPath<Doc, Path>, Method>>): T;
    <Path extends MethodAwareDocPath<Doc, PathTemplate<Extract<keyof Doc['paths'], string>>, Method>>(path: Path, ...handlers: Array<DocRequestHandlerParams<Doc, TemplateToDocPath<Doc, Path>, Method>>): T;
}
