/**
 * Attaches HTTP API metadata to Effect Schema values.
 *
 * This module is the schema-side bridge for HttpApi endpoint builders,
 * generated clients, and OpenAPI support. It does not define routes or perform
 * IO. Instead, the helpers annotate schemas so the surrounding HTTP API tooling
 * can choose response status codes, content types, body codecs, multipart
 * handling, and no-body response behavior.
 *
 * **Mental model**
 *
 * Keep the `Schema` as the source of validation and transformation, then add
 * HTTP-specific annotations with helpers such as {@link status}, {@link asJson},
 * {@link asMultipart}, and {@link asNoContent}. The same annotated schema can be
 * read later by server builders, clients, and OpenAPI generation.
 *
 * **Common tasks**
 *
 * Use {@link status}, {@link NoContent}, {@link Created}, {@link Accepted}, or
 * {@link Empty} to describe response statuses. Use {@link asFormUrlEncoded},
 * {@link asText}, {@link asUint8Array}, or {@link asJson} to override the
 * default JSON encoding. Use {@link asMultipart} or
 * {@link asMultipartStream} for multipart request payloads. Use
 * {@link asNoContent} when the wire response has no body but the client should
 * decode a useful value.
 *
 * **Gotchas**
 *
 * {@link status} only stores an annotation: unannotated success responses
 * default to `200`, and unannotated error responses default to `500` when the
 * surrounding HttpApi context interprets them. Missing body and response
 * encodings default to JSON, while payload schemas for methods without request
 * bodies fall back to form-url-encoded metadata. Multipart encodings are
 * payload-only, and response multipart is rejected when response encoding is
 * resolved.
 *
 * **See also**
 *
 * `HttpApiEndpoint` for route contracts that consume these annotations and
 * `HttpApi` for reflection over status and encoding metadata.
 *
 * @since 4.0.0
 */
import { type LazyArg } from "../../Function.ts";
import * as Schema from "../../Schema.ts";
import * as AST from "../../SchemaAST.ts";
import type * as Multipart_ from "../http/Multipart.ts";
declare module "../../Schema.ts" {
    namespace Annotations {
        interface Augment {
            readonly httpApiStatus?: number | undefined;
        }
    }
}
declare const statusCodeByLiteral: {
    readonly Continue: 100;
    readonly SwitchingProtocols: 101;
    readonly Processing: 102;
    readonly EarlyHints: 103;
    readonly OK: 200;
    readonly Ok: 200;
    readonly Created: 201;
    readonly Accepted: 202;
    readonly NonAuthoritativeInformation: 203;
    readonly NoContent: 204;
    readonly ResetContent: 205;
    readonly PartialContent: 206;
    readonly MultiStatus: 207;
    readonly AlreadyReported: 208;
    readonly ImUsed: 226;
    readonly MultipleChoices: 300;
    readonly MovedPermanently: 301;
    readonly Found: 302;
    readonly SeeOther: 303;
    readonly NotModified: 304;
    readonly TemporaryRedirect: 307;
    readonly PermanentRedirect: 308;
    readonly BadRequest: 400;
    readonly Unauthorized: 401;
    readonly PaymentRequired: 402;
    readonly Forbidden: 403;
    readonly NotFound: 404;
    readonly MethodNotAllowed: 405;
    readonly NotAcceptable: 406;
    readonly ProxyAuthenticationRequired: 407;
    readonly RequestTimeout: 408;
    readonly Conflict: 409;
    readonly Gone: 410;
    readonly LengthRequired: 411;
    readonly PreconditionFailed: 412;
    readonly PayloadTooLarge: 413;
    readonly UriTooLong: 414;
    readonly UnsupportedMediaType: 415;
    readonly RangeNotSatisfiable: 416;
    readonly ExpectationFailed: 417;
    readonly ImATeapot: 418;
    readonly MisdirectedRequest: 421;
    readonly UnprocessableEntity: 422;
    readonly Locked: 423;
    readonly FailedDependency: 424;
    readonly TooEarly: 425;
    readonly UpgradeRequired: 426;
    readonly PreconditionRequired: 428;
    readonly TooManyRequests: 429;
    readonly RequestHeaderFieldsTooLarge: 431;
    readonly UnavailableForLegalReasons: 451;
    readonly InternalServerError: 500;
    readonly NotImplemented: 501;
    readonly BadGateway: 502;
    readonly ServiceUnavailable: 503;
    readonly GatewayTimeout: 504;
    readonly HttpVersionNotSupported: 505;
    readonly VariantAlsoNegotiates: 506;
    readonly InsufficientStorage: 507;
    readonly LoopDetected: 508;
    readonly NotExtended: 510;
    readonly NetworkAuthenticationRequired: 511;
};
/**
 * Common HTTP status code literals accepted by {@link status}.
 *
 * @category status
 * @since 4.0.0
 */
export type StatusLiteral = keyof typeof statusCodeByLiteral;
/**
 * Sets the HTTP status code of a schema.
 *
 * **Details**
 *
 * This is equivalent to calling `.annotate({ httpApiStatus: code })` on the
 * schema. You can pass either a numeric status code (for example, `201`) or a
 * common literal name (for example, `"Created"`).
 *
 * @category status
 * @since 4.0.0
 */
export declare function status(code: number): <S extends Schema.Top>(self: S) => S["Rebuild"];
export declare function status(code: StatusLiteral): <S extends Schema.Top>(self: S) => S["Rebuild"];
/**
 * Creates a void schema with the given HTTP status code.
 * This is used to represent empty responses with a specific status code.
 *
 * @see {@link NoContent} for the predefined 204 no content schema.
 *
 * @category Empty
 * @since 4.0.0
 */
export declare const Empty: (code: number) => Schema.Void;
/**
 * Type of the `NoContent` schema, a void schema annotated with HTTP status code 204.
 *
 * @category models
 * @since 4.0.0
 */
export interface NoContent extends Schema.Void {
}
/**
 * Schema for empty HTTP responses with status code 204.
 *
 * @category Empty
 * @since 4.0.0
 */
export declare const NoContent: NoContent;
/**
 * Type of the `Created` schema, a void schema annotated with HTTP status code 201.
 *
 * @category models
 * @since 4.0.0
 */
export interface Created extends Schema.Void {
}
/**
 * Schema for empty HTTP responses with status code 201.
 *
 * @category Empty
 * @since 4.0.0
 */
export declare const Created: Created;
/**
 * Type of the `Accepted` schema, a void schema annotated with HTTP status code 202.
 *
 * @category models
 * @since 4.0.0
 */
export interface Accepted extends Schema.Void {
}
/**
 * Schema for empty HTTP responses with status code 202.
 *
 * @category Empty
 * @since 4.0.0
 */
export declare const Accepted: Accepted;
/**
 * Schema type returned by `asNoContent`, encoding as `void` while decoding to the original schema type.
 *
 * @category schemas
 * @since 4.0.0
 */
export interface asNoContent<S extends Schema.Top> extends Schema.decodeTo<Schema.toType<S>, Schema.Void> {
}
/**
 * Marks a schema as a no-content response while preserving a decoded client value.
 *
 * **Details**
 *
 * The server encodes the response as `void`; generated clients call `decode` to
 * produce the schema's decoded value when the response has no body.
 *
 * @see {@link NoContent} for a void schema with the status code 204.
 * @see {@link Empty} for creating a void schema with a specific status code.
 *
 * @category encoding
 * @since 4.0.0
 */
export declare function asNoContent<S extends Schema.Top>(options: {
    readonly decode: LazyArg<S["Type"]>;
}): (self: S) => asNoContent<S>;
/**
 * Runtime brand key used to mark schemas as buffered multipart payloads.
 *
 * @category type IDs
 * @since 4.0.0
 */
export declare const MultipartTypeId = "~effect/httpapi/HttpApiSchema/Multipart";
/**
 * Type-level brand identifier used by `asMultipart`.
 *
 * @category type IDs
 * @since 4.0.0
 */
export type MultipartTypeId = typeof MultipartTypeId;
/**
 * Schema type returned by `asMultipart` for buffered multipart payloads.
 *
 * @category schemas
 * @since 4.0.0
 */
export interface asMultipart<S extends Schema.Top> extends Schema.brand<S["Rebuild"], MultipartTypeId> {
}
/**
 * Marks a schema as a multipart payload.
 *
 * @see {@link asMultipartStream} for a multipart stream payload.
 *
 * @category encoding
 * @since 4.0.0
 */
export declare function asMultipart(options?: Multipart_.withLimits.Options): <S extends Schema.Top>(self: S) => asMultipart<S>;
/**
 * Runtime brand key used to mark schemas as streaming multipart payloads.
 *
 * @category type IDs
 * @since 4.0.0
 */
export declare const MultipartStreamTypeId = "~effect/httpapi/HttpApiSchema/MultipartStream";
/**
 * Type-level brand identifier used by `asMultipartStream`.
 *
 * @category type IDs
 * @since 4.0.0
 */
export type MultipartStreamTypeId = typeof MultipartStreamTypeId;
/**
 * Schema type returned by `asMultipartStream` for streaming multipart payloads.
 *
 * @category schemas
 * @since 4.0.0
 */
export interface asMultipartStream<S extends Schema.Top> extends Schema.brand<S["Rebuild"], MultipartStreamTypeId> {
}
/**
 * Marks a schema as a multipart stream payload.
 *
 * @see {@link asMultipart} for a buffered multipart payload.
 *
 * @category encoding
 * @since 4.0.0
 */
export declare function asMultipartStream(options?: Multipart_.withLimits.Options): <S extends Schema.Top>(self: S) => asMultipartStream<S>;
/**
 * Marks a schema as a JSON payload / response.
 *
 * @category encoding
 * @since 4.0.0
 */
export declare function asJson(options?: {
    readonly contentType?: string;
}): <S extends Schema.Top>(self: S) => S["Rebuild"];
/**
 * Marks a schema as an `application/x-www-form-urlencoded` payload or response.
 *
 * **Details**
 *
 * The schema's encoded side must be a record of strings.
 *
 * @category encoding
 * @since 4.0.0
 */
export declare function asFormUrlEncoded(options?: {
    readonly contentType?: string;
}): <S extends Schema.Top>(self: S) => S["Rebuild"];
/**
 * Marks a schema as a text payload / response.
 *
 * **Details**
 *
 * The schema encoded side must be a string.
 *
 * @category encoding
 * @since 4.0.0
 */
export declare function asText(options?: {
    readonly contentType?: string;
}): <S extends Schema.Top & {
    readonly Encoded: string;
}>(self: S) => S["Rebuild"];
/**
 * Marks a schema as a binary payload / response.
 *
 * **Details**
 *
 * The schema encoded side must be a `Uint8Array`.
 *
 * @category encoding
 * @since 4.0.0
 */
export declare function asUint8Array(options?: {
    readonly contentType?: string;
}): <S extends Schema.Top & {
    readonly Encoded: Uint8Array;
}>(self: S) => S["Rebuild"];
/**
 * Returns `true` when a schema AST represents a no-content response.
 *
 * **Details**
 *
 * The check succeeds for direct `void` schemas and schemas whose encoded or
 * transformation target is `void`.
 *
 * @category predicates
 * @since 4.0.0
 */
export declare const isNoContent: (ast: AST.AST) => boolean;
export {};
//# sourceMappingURL=HttpApiSchema.d.ts.map