/**
 * Bridge functions to derive `RouteSpec` and `EventSpec` from `ActionSpec`.
 *
 * Action specs define the contract (method, input/output, auth, side effects).
 * Bridge functions produce transport-specific specs from them. HTTP-specific
 * concerns (path, handler) come from options.
 *
 * @module
 */
import type { z } from 'zod';
import type { ActionSpec, ActionSideEffects } from './action_spec.js';
import type { RouteSpec, RouteMethod, RouteHandler } from '../http/route_spec.js';
import type { RouteAuth } from '../http/auth_shape.js';
import type { EventSpec } from '../realtime/sse.js';
import type { RouteErrorSchemas } from '../http/error_schemas.js';
/** Options for deriving a `RouteSpec` from an `ActionSpec`. */
export interface ActionRouteOptions {
    path: string;
    handler: RouteHandler;
    /** URL path parameter schema. Use `z.strictObject()` with string fields matching `:param` segments. */
    params?: z.ZodObject;
    /** URL query parameter schema. Use `z.strictObject()` with string fields. */
    query?: z.ZodObject;
    /** Override the default HTTP method (default: `side_effects` → POST, else GET). */
    http_method?: RouteMethod;
    /**
     * Override the route's auth shape — defaults to the action spec's `auth`
     * (the canonical four-axis shape from `http/auth_shape.ts` is shared
     * verbatim between action specs and route specs, so no mapping is needed).
     */
    auth?: RouteAuth;
    /** Handler-specific error schemas (HTTP status code → Zod schema). Transport-specific — not on ActionSpec. */
    errors?: RouteErrorSchemas;
}
/** Options for deriving an `EventSpec` from an `ActionSpec`. */
export interface ActionEventOptions {
    channel?: string;
}
/** Derive the default HTTP method from side effects. */
export declare const derive_http_method: (side_effects: ActionSideEffects) => RouteMethod;
/**
 * Derive a `RouteSpec` from an `ActionSpec` and options.
 *
 * Only `request_response` actions (which require non-null `auth`) can become routes.
 * `remote_notification` actions (auth null) should use `create_action_event_spec`.
 * `local_call` actions are not for HTTP transport.
 *
 * Error schemas are transport-specific (keyed by HTTP status codes) and belong
 * on the options, not the action spec. Action specs define the contract;
 * transport concerns like HTTP error codes are added at the bridge layer.
 *
 * @param spec - the action spec (must have non-null `auth`)
 * @param options - HTTP-specific options (path, handler, optional overrides)
 * @returns a `RouteSpec` ready for `apply_route_specs`
 * @throws Error if `spec.auth` is null (only `request_response` actions can
 *   become routes; notifications and local calls cannot)
 */
export declare const create_action_route_spec: (spec: ActionSpec, options: ActionRouteOptions) => RouteSpec;
/**
 * Derive an `EventSpec` from an `ActionSpec`.
 *
 * Only `remote_notification` actions can become push events.
 *
 * @param spec - the action spec (must have `kind: 'remote_notification'`)
 * @param options - optional event-specific options (channel)
 * @returns an `EventSpec` ready for `create_validated_broadcaster`
 * @throws Error if `spec.kind` is not `'remote_notification'`
 */
export declare const create_action_event_spec: (spec: ActionSpec, options?: ActionEventOptions) => EventSpec;
//# sourceMappingURL=action_bridge.d.ts.map