UNPKG

fluid-oas

Version:

Build declarative OpenApiv3.* specifications.

66 lines (65 loc) 2.23 kB
import type { OpenApiMediaContentType } from "../types"; import { Base, type BaseInterface } from "./base"; import type { OpenApiSchema } from "../schema/OpenApiSchema"; import type { OpenApiExample } from "./OpenApiExample"; import type { OpenApiMediaType } from "./OpenApiMedia"; import type { OpenApiReferenceObject } from "./OpenApiReferenceObject"; declare const ParameterBase: { new (...args: any[]): { _deprecated?: boolean; addDeprecated(val: boolean): /*elided*/ any; toJSON(): unknown; }; } & { new (...args: any[]): { _required?: boolean; addRequired(val: boolean): /*elided*/ any; toJSON(): unknown; }; } & { new (...args: any[]): { _description?: string; addDescription(val: string): /*elided*/ any; toJSON(): unknown; }; } & { new (...args: any[]): { _in?: "query" | "header" | "cookie" | "path" | undefined; addIn(val: "query" | "header" | "cookie" | "path"): /*elided*/ any; toJSON(): unknown; }; } & { new (...args: any[]): { _name?: string; addName(val: string): /*elided*/ any; toJSON(): unknown; }; } & typeof Base; interface ParameterBase extends BaseInterface { addName(name: string): this; addIn(inParameter: "query" | "header" | "path" | "cookie"): this; addDescription(description: string): this; addRequired(required: boolean): this; addDeprecated(deprecated: boolean): this; } export interface SchemaParameter extends ParameterBase { addStyle(style: "form" | "simple"): this; addExplode(explode: boolean): this; addAllowReserved(allowReserved: boolean): this; addSchema(schema: OpenApiSchema | OpenApiReferenceObject): this; addExample(example: any): this; addExamples(mappings: { [K in string]: OpenApiExample | OpenApiReferenceObject; }): this; } export interface ContentParameter extends ParameterBase { addContents(mappings: Partial<{ [K in OpenApiMediaContentType]: OpenApiMediaType; }>): this; } export declare const Parameter: { schema: SchemaParameter; header: ContentParameter; }; export type OpenApiParameter = SchemaParameter | ContentParameter; export {};