/**
 * Pulled from https://github.com/varanauskas/oatx.
 */
import type { ComponentRef, ComponentTypes, ObjectWithContentSchema, RequiredDoc, DocOperation, DocPath, DocPathMethod, ToTypeSafe } from './common';
import { ImmutableReferenceObject, ImmutableRequestBodyObject } from './immutable';
/**
 * @public
 */
export type RequestBody<Doc extends RequiredDoc, Path extends Extract<keyof Doc['paths'], string>, Method extends keyof Doc['paths'][Path]> = DocOperation<Doc, Path, Method>['requestBody'] extends ImmutableReferenceObject ? 'requestBodies' extends ComponentTypes<Doc> ? ComponentRef<Doc, 'requestBodies', DocOperation<Doc, Path, Method>['requestBody']> : never : DocOperation<Doc, Path, Method>['requestBody'];
/**
 * @public
 */
export type RequestBodySchema<Doc extends RequiredDoc, Path extends DocPath<Doc>, Method extends DocPathMethod<Doc, Path>> = RequestBody<Doc, Path, Method> extends ImmutableRequestBodyObject ? ObjectWithContentSchema<Doc, RequestBody<Doc, Path, Method>> : never;
/**
 * Transform the OpenAPI request body schema to a typesafe JSON schema.
 * @public
 */
export type RequestBodyToJsonSchema<Doc extends RequiredDoc, Path extends DocPath<Doc>, Method extends DocPathMethod<Doc, Path>> = ToTypeSafe<RequestBodySchema<Doc, Path, Method>>;
