/**
 * Shared pure helpers for schema introspection and middleware matching.
 *
 * Used by both `http/route_spec.ts` (input validation) and `http/surface.ts`
 * (attack surface generation). Extracted to avoid circular dependencies
 * between routes and middleware.
 *
 * @module
 */
import { z } from 'zod';
import type { RouteAuth } from './auth_shape.js';
import { type RateLimitKey, type RouteErrorSchemas } from './error_schemas.js';
/**
 * Check if a schema is exactly `z.null()`.
 *
 * Uses `instanceof` rather than runtime parsing to avoid false positives
 * from `z.nullable(z.string())` or similar schemas that accept null
 * but also accept other values.
 */
export declare const is_null_schema: (schema: z.ZodType) => boolean;
/**
 * Check if a schema is exactly `z.void()`.
 *
 * RPC action specs use `z.void()` to declare a parameterless method —
 * JSON-RPC 2.0 forbids `params: null` (params must be omitted or be a
 * Structured value), so `z.void()` is the correct schema for "no params"
 * and the dispatcher maps absent params to `undefined` for these specs.
 */
export declare const is_void_schema: (schema: z.ZodType) => boolean;
/**
 * Check if a schema is a strict object (`z.strictObject()`).
 *
 * Strict objects set `catchall` to `ZodNever` to reject unknown keys.
 * Regular `z.object()` has `catchall: undefined` (strips unknown keys in Zod 4).
 */
export declare const is_strict_object_schema: (schema: z.ZodType) => boolean;
/**
 * Convert a Zod schema to a JSON-serializable representation for the surface.
 *
 * Returns `null` for null schemas, JSON Schema for object schemas.
 */
export declare const schema_to_surface: (schema: z.ZodType) => unknown;
/**
 * Check if a middleware path pattern applies to a route path.
 *
 * Supports Hono-style patterns:
 * - `/api/*` matches `/api/anything`
 * - `/api/zap/*` matches `/api/zap/runs` but not `/api/account/login`
 * - Exact match: `/health` matches `/health`
 */
export declare const middleware_applies: (mw_path: string, route_path: string) => boolean;
/**
 * Merge auto-derived, middleware, and explicit error schemas for a route spec.
 *
 * Merge order: derived -> middleware -> explicit route errors.
 * Later layers override earlier ones for the same status code.
 *
 * @param spec - the route spec (needs `auth`, `input`, `params`, `rate_limit`, `errors`)
 * @param middleware_errors - errors contributed by middleware whose path matches the route
 * @returns merged error schemas, or `null` if empty
 */
export declare const merge_error_schemas: (spec: {
    auth: RouteAuth;
    input: z.ZodType;
    params?: z.ZodObject;
    query?: z.ZodObject;
    rate_limit?: RateLimitKey;
    errors?: RouteErrorSchemas;
}, middleware_errors?: RouteErrorSchemas | null) => RouteErrorSchemas | null;
//# sourceMappingURL=schema_helpers.d.ts.map