/** * @since 1.0.0 */ import type { Brand } from "effect/Brand"; import * as Effect from "effect/Effect"; import type { LazyArg } from "effect/Function"; import * as Option from "effect/Option"; import * as Schema from "effect/Schema"; import * as AST from "effect/SchemaAST"; import type * as Unify from "effect/Unify"; import type * as FileSystem from "./FileSystem.js"; import type * as Multipart_ from "./Multipart.js"; /** * @since 1.0.0 * @category annotations */ export declare const AnnotationMultipart: unique symbol; /** * @since 1.0.0 * @category annotations */ export declare const AnnotationMultipartStream: unique symbol; /** * @since 1.0.0 * @category annotations */ export declare const AnnotationStatus: unique symbol; /** * @since 1.0.0 * @category annotations */ export declare const AnnotationEmptyDecodeable: unique symbol; /** * @since 1.0.0 * @category annotations */ export declare const AnnotationEncoding: unique symbol; /** * @since 1.0.0 * @category annotations */ export declare const AnnotationParam: unique symbol; /** * @since 1.0.0 * @category annotations */ export declare const extractAnnotations: (ast: AST.Annotations) => AST.Annotations; /** * @since 1.0.0 * @category annotations */ export declare const getStatus: (ast: AST.AST, defaultStatus: number) => number; /** * @since 1.0.0 * @category annotations */ export declare const getEmptyDecodeable: (ast: AST.AST) => boolean; /** * @since 1.0.0 * @category annotations */ export declare const getMultipart: (ast: AST.AST) => Multipart_.withLimits.Options | undefined; /** * @since 1.0.0 * @category annotations */ export declare const getMultipartStream: (ast: AST.AST) => Multipart_.withLimits.Options | undefined; /** * @since 1.0.0 * @category annotations */ export declare const getEncoding: (ast: AST.AST, fallback?: Encoding) => Encoding; /** * @since 1.0.0 * @category annotations */ export declare const getParam: (ast: AST.AST | Schema.PropertySignature.AST) => string | undefined; /** * @since 1.0.0 * @category annotations */ export declare const annotations: (annotations: Schema.Annotations.Schema> & { readonly status?: number | undefined; }) => Schema.Annotations.Schema; /** * @since 1.0.0 * @category reflection */ export declare const isVoid: (ast: AST.AST) => boolean; /** * @since 1.0.0 * @category reflection */ export declare const getStatusSuccessAST: (ast: AST.AST) => number; /** * @since 1.0.0 * @category reflection */ export declare const getStatusSuccess: (self: A) => number; /** * @since 1.0.0 * @category reflection */ export declare const getStatusErrorAST: (ast: AST.AST) => number; /** * @since 1.0.0 * @category reflection */ export declare const getStatusError: (self: A) => number; /** * @since 1.0.0 */ export declare const UnionUnify: (self: A, that: B) => Schema.Schema; type Void$ = typeof Schema.Void; /** * @since 1.0.0 * @category path params */ export interface Param extends Schema.Schema, Schema.Schema.Encoded, Schema.Schema.Context> { readonly [AnnotationParam]: { readonly name: Name; readonly schema: S; }; } /** * @since 1.0.0 * @category path params */ export declare const param: { /** * @since 1.0.0 * @category path params */ (name: Name): (schema: S & ([Schema.Schema.Encoded & {}] extends [string] ? unknown : "Schema must be encodable to a string")) => Param; /** * @since 1.0.0 * @category path params */ (name: Name, schema: S & ([Schema.Schema.Encoded & {}] extends [string] ? unknown : "Schema must be encodable to a string")): Param; }; /** * @since 1.0.0 * @category empty response */ export declare const Empty: (status: number) => typeof Schema.Void; /** * @since 1.0.0 * @category empty response */ export interface asEmpty extends Schema.transform { } /** * @since 1.0.0 * @category empty response */ export declare const asEmpty: { /** * @since 1.0.0 * @category empty response */ (options: { readonly status: number; readonly decode: LazyArg>; }): (self: S) => asEmpty; /** * @since 1.0.0 * @category empty response */ (self: S, options: { readonly status: number; readonly decode: LazyArg>; }): asEmpty; }; /** * @since 1.0.0 * @category empty response */ export interface Created extends Void$ { readonly _: unique symbol; } /** * @since 1.0.0 * @category empty response */ export declare const Created: Created; /** * @since 1.0.0 * @category empty response */ export interface Accepted extends Void$ { readonly _: unique symbol; } /** * @since 1.0.0 * @category empty response */ export declare const Accepted: Accepted; /** * @since 1.0.0 * @category empty response */ export interface NoContent extends Void$ { readonly _: unique symbol; } /** * @since 1.0.0 * @category empty response */ export declare const NoContent: NoContent; /** * @since 1.0.0 * @category multipart */ export declare const MultipartTypeId: unique symbol; /** * @since 1.0.0 * @category multipart */ export type MultipartTypeId = typeof MultipartTypeId; /** * @since 1.0.0 * @category multipart */ export interface Multipart extends Schema.Schema & Brand, Schema.Schema.Encoded, Schema.Schema.Context> { } /** * @since 1.0.0 * @category multipart */ export declare const Multipart: (self: S, options?: { readonly maxParts?: Option.Option | undefined; readonly maxFieldSize?: FileSystem.SizeInput | undefined; readonly maxFileSize?: Option.Option | undefined; readonly maxTotalSize?: Option.Option | undefined; readonly fieldMimeTypes?: ReadonlyArray | undefined; }) => Multipart; /** * @since 1.0.0 * @category multipart */ export declare const MultipartStreamTypeId: unique symbol; /** * @since 1.0.0 * @category multipart */ export type MultipartStreamTypeId = typeof MultipartStreamTypeId; /** * @since 1.0.0 * @category multipart */ export interface MultipartStream extends Schema.Schema & Brand, Schema.Schema.Encoded, Schema.Schema.Context> { } /** * @since 1.0.0 * @category multipart */ export declare const MultipartStream: (self: S, options?: { readonly maxParts?: Option.Option | undefined; readonly maxFieldSize?: FileSystem.SizeInput | undefined; readonly maxFileSize?: Option.Option | undefined; readonly maxTotalSize?: Option.Option | undefined; readonly fieldMimeTypes?: ReadonlyArray | undefined; }) => MultipartStream; /** * @since 1.0.0 * @category encoding */ export interface Encoding { readonly kind: "Json" | "UrlParams" | "Uint8Array" | "Text"; readonly contentType: string; } /** * @since 1.0.0 * @category encoding */ export declare namespace Encoding { /** * @since 1.0.0 * @category encoding */ type Validate = Kind extends "Json" ? {} : Kind extends "UrlParams" ? [A["Encoded"]] extends [Readonly>] ? {} : `'UrlParams' kind can only be encoded to 'Record'` : Kind extends "Uint8Array" ? [ A["Encoded"] ] extends [Uint8Array] ? {} : `'Uint8Array' kind can only be encoded to 'Uint8Array'` : Kind extends "Text" ? [A["Encoded"]] extends [string] ? {} : `'Text' kind can only be encoded to 'string'` : never; } /** * @since 1.0.0 * @category encoding */ export declare const withEncoding: { /** * @since 1.0.0 * @category encoding */ (options: { readonly kind: Kind; readonly contentType?: string | undefined; } & Encoding.Validate): (self: A) => A; /** * @since 1.0.0 * @category encoding */ (self: A, options: { readonly kind: Kind; readonly contentType?: string | undefined; } & Encoding.Validate): A; }; /** * @since 1.0.0 * @category encoding */ export declare const Text: (options?: { readonly contentType?: string; }) => typeof Schema.String; /** * @since 1.0.0 * @category encoding */ export declare const Uint8Array: (options?: { readonly contentType?: string; }) => typeof Schema.Uint8ArrayFromSelf; /** * @since 1.0.0 */ export declare const deunionize: (schemas: Set, schema: Schema.Schema.Any) => void; /** * @since 1.0.0 * @category empty errors */ export interface EmptyError extends Effect.Effect { readonly _tag: Tag; [Unify.typeSymbol]?: unknown; [Unify.unifySymbol]?: EmptyErrorUnify; [Unify.ignoreSymbol]?: EmptyErrorUnifyIgnore; } /** * @category models * @since 1.0.0 */ export interface EmptyErrorUnify extends Effect.EffectUnify { EmptyError?: () => A[Unify.typeSymbol] extends EmptyError | infer _ ? Self : never; } /** * @since 1.0.0 * @category empty errors */ export interface EmptyErrorClass extends Schema.Schema { new (_: void): EmptyError; } /** * @category models * @since 1.0.0 */ export interface EmptyErrorUnifyIgnore extends Effect.EffectUnifyIgnore { Effect?: true; } /** * @since 1.0.0 * @category empty errors */ export declare const EmptyError: () => (options: { readonly tag: Tag; readonly status: number; }) => EmptyErrorClass; export {}; //# sourceMappingURL=HttpApiSchema.d.ts.map