UNPKG

@tsed/schema

Version:
19 lines (18 loc) 840 B
import { OS3MediaType, OS3Response } from "@tsed/openspec"; import { JsonHeader } from "../interfaces/JsonOpenSpec.js"; import { JsonMap } from "./JsonMap.js"; import { JsonMedia } from "./JsonMedia.js"; import { JsonSchema } from "./JsonSchema.js"; export type JsonResponseOptions = OS3Response<JsonSchema, string | JsonHeader>; export declare class JsonResponse extends JsonMap<JsonResponseOptions> { $kind: string; status: number; constructor(obj?: Partial<JsonResponseOptions>); description(description: string): this; headers(headers: Record<string, string | JsonHeader>): this; content(content: Record<string, OS3MediaType<JsonSchema>>): this; getContent(): JsonMap<JsonMedia>; getMedia(mediaType: string, create?: boolean): JsonMedia; addMedia(mediaType: string): this; isBinary(): boolean; }