import { Request } from 'express'; import { z } from 'zod'; import { LoggerConfig } from './config-type'; import { MiddlewareDefinition } from './middleware'; export declare type FlatObject = Record; declare type ObjectSchema = z.AnyZodObject; declare type Extractable = 'shape' | '_unknownKeys' | '_catchall' | '_output' | '_input'; declare type UnionSchema = z.ZodUnion<[ObjectSchema, ...ObjectSchema[]]>; declare type IntersectionSchema = z.ZodIntersection; export declare type IOSchema = ObjectSchema | UnionSchema | IntersectionSchema; export declare type ArrayElement = T extends readonly (infer K)[] ? K : never; declare type UnionResult = ArrayElement[F]; declare type IntersectionResult = T['_def']['left'][F] & T['_def']['right'][F]; declare type IOExtract = T extends ObjectSchema ? T[F] : T extends UnionSchema ? UnionResult : T extends IntersectionSchema ? IntersectionResult : unknown; export declare type Merge = z.ZodObject & IOExtract, IOExtract, IOExtract, IOExtract & IOExtract, IOExtract & IOExtract>; export declare type OutputMarker = IOSchema & { _typeGuard: 'OutputMarker'; }; export declare const markOutput: (output: IOSchema) => OutputMarker; export declare type ReplaceMarkerInShape = { [K in keyof S]: S[K] extends OutputMarker ? OUT : S[K]; }; export declare function extractObjectSchema(subject: IOSchema): ObjectSchema; export declare function combineEndpointAndMiddlewareInputSchemas(input: IN, middlewares: MiddlewareDefinition[]): Merge; export declare function getInitialInput(request: Request): any; export declare function isLoggerConfig(logger: any): logger is LoggerConfig; export declare function getMessageFromError(error: Error): string; export declare function getStatusCodeFromError(error: Error): number; export declare type ApiResponse = { schema: A; mimeTypes: string[]; }; export declare const createApiResponse: (schema: S, mimeTypes?: string | string[]) => ApiResponse; export {};