import type { ContentObject, OpenAPIObject, ReferenceObject, RequestBodyObject, ParameterObject, SchemaObject, ResponseObject } from 'openapi3-ts'; /** * This file is meant to hold Immutable overwrites of the values provided by the `openapi3-ts` * package due to issues with `as const` supporting only readonly values. */ /** * From {@link https://github.com/microsoft/TypeScript/issues/13923#issuecomment-653675557}, allows * us to convert from `as const` to the various OpenAPI types documented in `openapi3-ts`. * * @public */ export type Immutable = T extends Function | boolean | number | string | null | undefined ? T : T extends Map ? ReadonlyMap, Immutable> : T extends Set ? ReadonlySet> : { readonly [P in keyof T]: Immutable; }; /** * @public */ export type ImmutableObject = { readonly [K in keyof T]: Immutable; }; /** * @public */ export type ImmutableReferenceObject = ImmutableObject; /** * @public */ export type ImmutableOpenAPIObject = ImmutableObject; /** * @public */ export type ImmutableContentObject = ImmutableObject; /** * @public */ export type ImmutableRequestBodyObject = ImmutableObject; /** * @public */ export type ImmutableResponseObject = ImmutableObject; /** * @public */ export type ImmutableParameterObject = ImmutableObject; /** * @public */ export interface HeaderObject extends ParameterObject { in: 'header'; style: 'simple'; } /** * @public */ export type ImmutableHeaderObject = ImmutableObject; /** * @public */ export interface CookieObject extends ParameterObject { in: 'cookie'; style?: 'form'; } /** * @public */ export type ImmutableCookieObject = ImmutableObject; /** * @public */ export interface QueryObject extends ParameterObject { in: 'query'; style?: 'form' | 'deepObject' | 'pipeDelimited' | 'spaceDelimited'; } /** * @public */ export type ImmutableQueryObject = ImmutableObject; /** * @public */ export interface PathObject extends ParameterObject { in: 'path'; style?: 'simple' | 'label' | 'matrix'; } /** * @public */ export type ImmutablePathObject = ImmutableObject; /** * @public */ export type ImmutableSchemaObject = ImmutableObject;