import { type ZodType, type ZodTypeDef } from 'zod';
import { type SchwabApiConfig, type SchwabApiLogger } from './config.js';
export type HttpMethod = 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH' | 'OPTIONS' | 'HEAD';
export interface EndpointMetadata<PType = unknown, // Inferred type for path params
QType = unknown, // Inferred type for query params
BType = unknown, // Inferred type for body
RType = unknown, // Inferred type for response
M extends HttpMethod = HttpMethod, // Allow broader HttpMethod from MCP
ErrorType = unknown> {
    method: M;
    path: string;
    pathSchema?: ZodType<PType, ZodTypeDef, any>;
    querySchema?: ZodType<QType, ZodTypeDef, any>;
    bodySchema?: ZodType<BType, ZodTypeDef, any>;
    responseSchema: ZodType<RType, ZodTypeDef, any>;
    errorSchema?: ZodType<ErrorType, ZodTypeDef, any>;
    description?: string;
}
export interface SchwabFetchRequestOptions<P = unknown, Q = unknown, B = unknown> {
    pathParams?: P;
    queryParams?: Q;
    body?: B;
    headers?: Record<string, string>;
    init?: Omit<RequestInit, 'body' | 'method'>;
}
export interface RequestContext {
    config: SchwabApiConfig;
    fetchFn: (req: Request) => Promise<Response>;
    logger: SchwabApiLogger;
}
/**
 * Create a new request context with the given config and fetch function
 */
export declare function createRequestContext(config?: SchwabApiConfig, fetchFn?: (req: Request) => Promise<Response>): RequestContext;
/**
 * Create an endpoint function using the provided context
 * This is the primary way to create API endpoint functions
 */
export declare function createEndpoint<P, Q, B, R, M extends HttpMethod, E = unknown>(context: RequestContext, meta: EndpointMetadata<P, Q, B, R, M, E>): (options?: SchwabFetchRequestOptions<P, Q, B>) => Promise<R>;
