import type { Combine, StrictOmit, Type } from 'ts-gems'; import { type Validator } from 'valgen'; import { OpraSchema } from '../../schema/index.js'; import type { ApiDocument } from '../api-document.js'; import { DocumentElement } from '../common/document-element.js'; import { DataType } from '../data-type/data-type.js'; import type { HttpMultipartField } from './http-multipart-field.js'; /** * Type definition for HttpMediaType * @class HttpMediaType */ interface HttpMediaTypeStatic { new (parent: DocumentElement, initArgs: HttpMediaType.InitArguments): HttpMediaType; prototype: HttpMediaType; } /** * Type definition of HttpMediaType prototype * @interface HttpMediaType */ export interface HttpMediaType extends HttpMediaTypeClass { } export declare const HttpMediaType: HttpMediaTypeStatic; /** * @class HttpMediaType */ declare class HttpMediaTypeClass extends DocumentElement { readonly owner: DocumentElement; description?: string; /** A media type inside a request body's `content` array has no identity * of its own beyond `contentType`, which is optional — so when the body * declares just one content (by far the common case) this adds no level * at all and its texts sit directly under the body's own key. */ get docKeyUnstable(): boolean; protected get docKeySegment(): string | string[] | undefined; contentType?: string | string[]; contentEncoding?: string; type?: DataType; isArray?: boolean; example?: string; examples?: Record; multipartFields: HttpMultipartField[]; maxParts?: number; maxPartSize?: number; maxFieldSize?: number; maxTotalSize?: number; designType?: Type; findMultipartField(fieldName: string, fieldType?: OpraSchema.HttpMultipartFieldType): HttpMultipartField | undefined; toJSON(options?: ApiDocument.ExportOptions): OpraSchema.HttpMediaType; generateCodec(codec: 'encode' | 'decode', options?: DataType.GenerateCodecOptions, properties?: object): Validator; } /** * @namespace HttpMediaType */ export declare namespace HttpMediaType { interface Metadata extends Partial> { type?: Type | string; multipartFields?: HttpMultipartField.Metadata[]; designType?: Type; /** Authoring-only; never exported. See `DocumentElement#docKey`. */ docKey?: string; } interface Options extends Partial> { type?: Type | string; /** Authoring-only; never exported. See `DocumentElement#docKey`. */ docKey?: string; } interface InitArguments extends Combine<{ type?: DataType | string | Type; }, StrictOmit> { } } export {};