import type { NonEmptyArray } from "../../Array.ts";
import * as Context from "../../Context.ts";
import * as JsonSchema from "../../JsonSchema.ts";
import * as HttpApi from "./HttpApi.ts";
import type * as HttpApiGroup from "./HttpApiGroup.ts";
declare const Identifier_base: Context.ServiceClass<Identifier, "effect/httpapi/OpenApi/Identifier", string>;
/**
 * @since 4.0.0
 * @category annotations
 */
export declare class Identifier extends Identifier_base {
}
declare const Title_base: Context.ServiceClass<Title, "effect/httpapi/OpenApi/Title", string>;
/**
 * @since 4.0.0
 * @category annotations
 */
export declare class Title extends Title_base {
}
declare const Version_base: Context.ServiceClass<Version, "effect/httpapi/OpenApi/Version", string>;
/**
 * @since 4.0.0
 * @category annotations
 */
export declare class Version extends Version_base {
}
declare const Description_base: Context.ServiceClass<Description, "effect/httpapi/OpenApi/Description", string>;
/**
 * @since 4.0.0
 * @category annotations
 */
export declare class Description extends Description_base {
}
declare const License_base: Context.ServiceClass<License, "effect/httpapi/OpenApi/License", OpenAPISpecLicense>;
/**
 * @since 4.0.0
 * @category annotations
 */
export declare class License extends License_base {
}
declare const ExternalDocs_base: Context.ServiceClass<ExternalDocs, "effect/httpapi/OpenApi/ExternalDocs", OpenAPISpecExternalDocs>;
/**
 * @since 4.0.0
 * @category annotations
 */
export declare class ExternalDocs extends ExternalDocs_base {
}
declare const Servers_base: Context.ServiceClass<Servers, "effect/httpapi/OpenApi/Servers", readonly OpenAPISpecServer[]>;
/**
 * @since 4.0.0
 * @category annotations
 */
export declare class Servers extends Servers_base {
}
declare const Format_base: Context.ServiceClass<Format, "effect/httpapi/OpenApi/Format", string>;
/**
 * @since 4.0.0
 * @category annotations
 */
export declare class Format extends Format_base {
}
declare const Summary_base: Context.ServiceClass<Summary, "effect/httpapi/OpenApi/Summary", string>;
/**
 * @since 4.0.0
 * @category annotations
 */
export declare class Summary extends Summary_base {
}
declare const Deprecated_base: Context.ServiceClass<Deprecated, "effect/httpapi/OpenApi/Deprecated", boolean>;
/**
 * @since 4.0.0
 * @category annotations
 */
export declare class Deprecated extends Deprecated_base {
}
declare const Override_base: Context.ServiceClass<Override, "effect/httpapi/OpenApi/Override", Record<string, unknown>>;
/**
 * @since 4.0.0
 * @category annotations
 */
export declare class Override extends Override_base {
}
/**
 * @since 4.0.0
 * @category annotations
 */
export declare const Exclude: Context.Reference<boolean>;
declare const Transform_base: Context.ServiceClass<Transform, "effect/httpapi/OpenApi/Transform", (openApiSpec: Record<string, any>) => Record<string, any>>;
/**
 * Transforms the generated OpenAPI specification
 *
 * @since 4.0.0
 * @category annotations
 */
export declare class Transform extends Transform_base {
}
/**
 * @since 4.0.0
 * @category annotations
 */
export declare const annotations: (options: {
    readonly identifier?: string | undefined;
    readonly title?: string | undefined;
    readonly version?: string | undefined;
    readonly description?: string | undefined;
    readonly license?: OpenAPISpecLicense | undefined;
    readonly summary?: string | undefined;
    readonly deprecated?: boolean | undefined;
    readonly externalDocs?: OpenAPISpecExternalDocs | undefined;
    readonly servers?: ReadonlyArray<OpenAPISpecServer> | undefined;
    readonly format?: string | undefined;
    readonly override?: Record<string, unknown> | undefined;
    readonly exclude?: boolean | undefined;
    readonly transform?: ((openApiSpec: Record<string, any>) => Record<string, any>) | undefined;
}) => Context.Context<never>;
/**
 * Converts an `HttpApi` instance into an OpenAPI Specification object.
 *
 * **Details**
 *
 * This function takes an `HttpApi` instance, which defines a structured API,
 * and generates an OpenAPI Specification (`OpenAPISpec`). The resulting spec
 * adheres to the OpenAPI 3.1.0 standard and includes detailed metadata such as
 * paths, operations, security schemes, and components. The function processes
 * the API's annotations, middleware, groups, and endpoints to build a complete
 * and accurate representation of the API in OpenAPI format.
 *
 * The function also deduplicates schemas, applies transformations, and
 * integrates annotations like descriptions, summaries, external documentation,
 * and overrides. Cached results are used for better performance when the same
 * `HttpApi` instance is processed multiple times.
 *
 * @category constructors
 * @since 4.0.0
 */
export declare function fromApi<Id extends string, Groups extends HttpApiGroup.Any>(api: HttpApi.HttpApi<Id, Groups>): OpenAPISpec;
/**
 * This model describes the OpenAPI specification (version 3.1.0) returned by
 * {@link fromApi}. It is not intended to describe the entire OpenAPI
 * specification, only the output of `fromApi`.
 *
 * @category models
 * @since 4.0.0
 */
export interface OpenAPISpec {
    openapi: "3.1.0";
    info: OpenAPISpecInfo;
    paths: OpenAPISpecPaths;
    components: OpenAPIComponents;
    security: Array<OpenAPISecurityRequirement>;
    tags: Array<OpenAPISpecTag>;
    servers?: Array<OpenAPISpecServer>;
}
/**
 * @category models
 * @since 4.0.0
 */
export interface OpenAPISpecInfo {
    title: string;
    version: string;
    description?: string;
    license?: OpenAPISpecLicense;
    summary?: string;
}
/**
 * @category models
 * @since 4.0.0
 */
export interface OpenAPISpecTag {
    name: string;
    description?: string;
    externalDocs?: OpenAPISpecExternalDocs;
}
/**
 * @category models
 * @since 4.0.0
 */
export interface OpenAPISpecExternalDocs {
    url: string;
    description?: string;
}
/**
 * @category models
 * @since 4.0.0
 */
export interface OpenAPISpecLicense {
    name: string;
    url?: string;
    [key: string]: unknown;
}
/**
 * @category models
 * @since 4.0.0
 */
export interface OpenAPISpecServer {
    url: string;
    description?: string;
    variables?: Record<string, OpenAPISpecServerVariable>;
}
/**
 * @category models
 * @since 4.0.0
 */
export interface OpenAPISpecServerVariable {
    default: string;
    enum?: NonEmptyArray<string>;
    description?: string;
}
/**
 * @category models
 * @since 4.0.0
 */
export type OpenAPISpecPaths = Record<string, OpenAPISpecPathItem>;
/**
 * @category models
 * @since 4.0.0
 */
export type OpenAPISpecMethodName = "get" | "put" | "post" | "delete" | "options" | "head" | "patch" | "trace";
/**
 * @category models
 * @since 4.0.0
 */
export type OpenAPISpecPathItem = {
    [K in OpenAPISpecMethodName]?: OpenAPISpecOperation;
};
/**
 * @category models
 * @since 4.0.0
 */
export interface OpenAPISpecParameter {
    name: string;
    in: "query" | "header" | "path" | "cookie";
    schema: object;
    required: boolean;
    description?: string;
}
/**
 * @category models
 * @since 4.0.0
 */
export type OpenAPISpecResponses = Record<number, OpenApiSpecResponse>;
/**
 * @category models
 * @since 4.0.0
 */
export type OpenApiSpecContent = {
    [K in string]: OpenApiSpecMediaType;
};
/**
 * @category models
 * @since 4.0.0
 */
export interface OpenApiSpecResponse {
    description: string;
    content?: OpenApiSpecContent;
}
/**
 * @category models
 * @since 4.0.0
 */
export interface OpenApiSpecMediaType {
    schema: JsonSchema.JsonSchema;
}
/**
 * @category models
 * @since 4.0.0
 */
export interface OpenAPISpecRequestBody {
    content: OpenApiSpecContent;
    required: true;
}
/**
 * @category models
 * @since 4.0.0
 */
export interface OpenAPIComponents {
    schemas: JsonSchema.Definitions;
    securitySchemes: Record<string, OpenAPISecurityScheme>;
}
/**
 * @category models
 * @since 4.0.0
 */
export interface OpenAPIHTTPSecurityScheme {
    readonly type: "http";
    scheme: "bearer" | "basic" | string;
    description?: string;
    bearerFormat?: string;
}
/**
 * @category models
 * @since 4.0.0
 */
export interface OpenAPIApiKeySecurityScheme {
    readonly type: "apiKey";
    name: string;
    in: "query" | "header" | "cookie";
    description?: string;
}
/**
 * @category models
 * @since 4.0.0
 */
export type OpenAPISecurityScheme = OpenAPIHTTPSecurityScheme | OpenAPIApiKeySecurityScheme;
/**
 * @category models
 * @since 4.0.0
 */
export type OpenAPISecurityRequirement = Record<string, Array<string>>;
/**
 * @category models
 * @since 4.0.0
 */
export interface OpenAPISpecOperation {
    operationId: string;
    parameters: Array<OpenAPISpecParameter>;
    responses: OpenAPISpecResponses;
    /** Always contains at least the title annotation or the group identifier */
    tags: NonEmptyArray<string>;
    security: Array<OpenAPISecurityRequirement>;
    requestBody?: OpenAPISpecRequestBody;
    description?: string;
    summary?: string;
    deprecated?: boolean;
    externalDocs?: OpenAPISpecExternalDocs;
}
export {};
//# sourceMappingURL=OpenApi.d.ts.map