/**
 * Pulled from https://github.com/varanauskas/oatx.
 */
import type { ComponentRef, ComponentTypes, ObjectWithContentSchema, RequiredDoc, DocOperation, DocPathMethod, ToTypeSafe, ValueOf, DocPath } from './common';
import { ImmutableReferenceObject, ImmutableResponseObject } from './immutable';
/**
 * @public
 */
export type Response<Doc extends RequiredDoc, Path extends DocPath<Doc>, Method extends DocPathMethod<Doc, Path>, StatusCode extends keyof DocOperation<Doc, Path, Method>['responses']> = DocOperation<Doc, Path, Method>['responses'][StatusCode] extends ImmutableReferenceObject ? 'responses' extends ComponentTypes<Doc> ? ComponentRef<Doc, 'responses', DocOperation<Doc, Path, Method>['responses'][StatusCode]> : never : DocOperation<Doc, Path, Method>['responses'][StatusCode];
/**
 * @public
 */
export type ResponseSchemas<Doc extends RequiredDoc, Path extends DocPath<Doc>, Method extends DocPathMethod<Doc, Path>> = {
    [StatusCode in keyof DocOperation<Doc, Path, Method>['responses']]: Response<Doc, Path, Method, StatusCode> extends ImmutableResponseObject ? ObjectWithContentSchema<Doc, Response<Doc, Path, Method, StatusCode>> : never;
};
/**
 * Transform the OpenAPI request body schema to a typesafe JSON schema.
 * @public
 */
export type ResponseBodyToJsonSchema<Doc extends RequiredDoc, Path extends DocPath<Doc>, Method extends DocPathMethod<Doc, Path>> = ToTypeSafe<ValueOf<ResponseSchemas<Doc, Path, Method>>>;
