import { XParameterObject, XSchemaObject } from '@ts-stack/openapi-spec';
import { AnyObj, HttpMethod, Class } from '@ditsmod/core';
type RequiredParamsIn = 'query' | 'header' | 'path' | 'cookie';
type OptionalParamsIn = 'query' | 'header' | 'cookie';
type KeyOf<T extends Class<AnyObj>> = Extract<keyof T['prototype'], string>;
type KeysOf<T extends Class<AnyObj>> = [KeyOf<T>, ...KeyOf<T>[]];
/**
 * Applies to importing `OpenapiModule.withParams()`. OAS parameter's property, indicates the parameter
 * should or not be bound to presence last param in a route path.
 */
export declare const BOUND_TO_PATH_PARAM = "x-bound-to-path-param";
/**
 * Applies to importing `OpenapiModule.withParams()`. OAS parameter's property, indicates the parameter
 * should or not be bound to HTTP method in a route path.
 */
export declare const BOUND_TO_HTTP_METHOD = "x-bound-to-http-method";
/**
 * Helper for OpenAPI `ParameterObject`s.
 */
export declare class Parameters {
    protected parameters: XParameterObject[];
    protected countOfLastPushedParams: number;
    required<T extends Class<AnyObj>>(paramsIn: RequiredParamsIn, model: T, ...params: KeysOf<T>): this;
    required(paramsIn: RequiredParamsIn, ...params: [string, ...string[]]): this;
    optional<T extends Class<AnyObj>>(paramsIn: OptionalParamsIn, model: T, ...params: KeysOf<T>): this;
    optional(paramsIn: OptionalParamsIn, ...params: [string, ...string[]]): this;
    getParams(): XParameterObject[];
    getParams<T extends Class<AnyObj>>(paramsIn: 'path', isRequired: true, model: T, ...params: KeysOf<T>): XParameterObject[];
    getParams<T extends Class<AnyObj>>(paramsIn: OptionalParamsIn, isRequired: boolean, model: T, ...params: KeysOf<T>): XParameterObject[];
    getParams(paramsIn: OptionalParamsIn, isRequired: boolean, ...params: [string, ...string[]]): XParameterObject[];
    /**
     * Applies to importing `OpenapiModule.withParams()`. Indicates the parameters that were added in the
     * previous step as bound to existence param in a route path.
     *
     * For example, if you first called `optional()` or `required()` with 2 parameters
     * and then called `bindTo('lastParamInPath', true)`, these 2 parameters will be marked as bound
     * to `posts/:postId`. In case `:postId` exists - parameters works.
     *
     * If you calls `bindTo('lastParamInPath')` (without last argument), and if in path param not
     * exists, parameters works too.
     */
    bindTo(to: 'lastParamInPath', ifExists?: boolean): this;
    /**
     * Applies to importing `OpenapiModule.withParams()`. Indicates the parameters that were added in the
     * previous step as bound to HTTP method in a route.
     *
     * For example, if you first called `optional()` or `required()` with 2 parameters
     * and then called `bindTo('httpMethod', 'GET')`, these 2 parameters will be marked as bound
     * to `GET` method. So, these parameters works only if you have request with `GET` method.
     */
    bindTo(to: 'httpMethod', httpMethod: HttpMethod): this;
    describe(...descriptions: [string, ...string[]]): this;
    use<T extends Class<Parameters>>(Plugin: T): T['prototype'] & this;
    protected getLastAddedParams(): XParameterObject[];
    protected setParams<T extends Class<AnyObj>>(isRequired: boolean, paramsIn: RequiredParamsIn, modelOrString: T | string, ...params: (KeyOf<T> | string)[]): this;
    protected transformParams(params: string[], paramsIn: RequiredParamsIn, isRequired?: boolean): XParameterObject[];
    /**
     * Sets metadata from a model to parameters.
     */
    protected setMetadata(model: Class, paramsObjects: XParameterObject[]): XParameterObject[];
    protected setPropertyType(schema: XSchemaObject, propertyType: Class<AnyObj>): void;
}
export declare function getParams<T extends Class<AnyObj>>(paramsIn: 'path', isRequired: true, model: T, ...params: KeysOf<T>): XParameterObject[];
export declare function getParams(paramsIn: 'path', isRequired: true, ...params: [string, ...string[]]): XParameterObject[];
export declare function getParams<T extends Class<AnyObj>>(paramsIn: OptionalParamsIn, isRequired: boolean, model: T, ...params: KeysOf<T>): XParameterObject[];
export declare function getParams(paramsIn: OptionalParamsIn, isRequired: boolean, ...params: [string, ...string[]]): XParameterObject[];
export {};
//# sourceMappingURL=parameters.d.ts.map