import type { OasMediaType } from '../mediaType/MediaType.js'; import type { OasRef } from '../ref/Ref.js'; import type { OasExample } from '../example/Example.js'; import type { OasSchema } from '../schema/Schema.js'; import type { ToJsonSchemaOptions } from '../schema/Schema.js'; import type { OpenAPIV3 } from 'openapi-types'; /** * Constructor fields for {@link OasHeader}. */ export type HeaderFields = { /** A brief description of the header */ description: string | undefined; /** Whether the header is required */ required: boolean | undefined; /** Whether the header is deprecated */ deprecated: boolean | undefined; /** Schema defining the header's data type */ schema: OasSchema | OasRef<'schema'> | undefined; /** Example values for the header */ examples: Record> | undefined; /** Content definitions for complex header values */ content: Record | undefined; /** Custom extension fields (x-* properties) */ extensionFields?: Record; }; /** * Represents a Header Object in the OpenAPI Specification. * * The `OasHeader` class encapsulates the definition of a single HTTP header that * can be sent with responses or expected in requests. Headers provide additional * metadata about the HTTP message and can include authentication tokens, content * information, pagination data, rate limiting details, and more. * * This class provides comprehensive support for header definitions with typed * values, validation schemas, examples, and documentation. * * @example Basic authentication header * ```typescript * import { OasHeader, OasString } from '@skmtc/core'; * * const authHeader = new OasHeader({ * description: 'Bearer token for API authentication', * required: true, * schema: new OasString({ * pattern: '^Bearer [A-Za-z0-9+/=]+$', * description: 'JWT bearer token' * }), * examples: { * valid: new OasExample({ * summary: 'Valid bearer token', * value: 'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...' * }) * } * }); * ``` */ export declare class OasHeader { oasType: 'header'; /** Brief description of header */ description: string | undefined; /** Indicates if header is mandatory. Default value is `false` */ required: boolean | undefined; /** Indicates if header is deprecated and should no longer be used. Default value is false */ deprecated: boolean | undefined; /** Schema for the header */ schema: OasSchema | OasRef<'schema'> | undefined; /** Examples of the header */ examples: Record> | undefined; /** Content of the header */ content: Record | undefined; /** Specification Extension fields */ extensionFields: Record | undefined; constructor(fields: HeaderFields); /** Returns true if object is a reference */ isRef(): this is OasRef<'header'>; /** Returns itself */ resolve(): OasHeader; resolveOnce(): OasHeader; /** Returns schema for the header. Either, `schema` property if * definedor value matching `mediaType` from `content` property. * * @param mediaType - Optional media type to get schema for. Defaults to `application/json` */ toSchema(mediaType?: string): OasSchema | OasRef<'schema'>; toJsonSchema(options: ToJsonSchemaOptions): OpenAPIV3.HeaderObject; } //# sourceMappingURL=Header.d.ts.map