/**
 * A type-safe representation of an API route.
 */
export type ApiRoute<Config extends {
    path: `/${string}`;
    method: 'GET' | 'POST';
    /**
     * GET - query params
     * POST - body
     */
    input?: Record<string, unknown>;
    /**
     * Response body
     * Can be a string if the response is a plain text message or html
     * Otherwise, it should be a JSON object
     */
    output?: Record<string, unknown> | string;
}> = {
    path: Config['path'];
    method: Config['method'];
    input?: Config['input'];
    output?: Config['output'];
};
/**
 * Creates a URL for a specific API route with typed query parameters
 * @example
 * ```ts
 * createUrlForRoute({
 *   path: '/api/users',
 *   queryParams: { id: '123' },
 *   origin: 'https://example.com'
 * })
 * // => URL('https://example.com/api/users?id=123')
 */
export declare function createUrlForRoute<Route extends ApiRoute<any>>({ 
/** API route path */
path, 
/** Typed query parameters matching the route's input type */
queryParams, 
/** Base URL for relative paths */
origin, }: {
    path: Route['path'];
    queryParams: Route['input'] extends Record<string, unknown> ? Route['input'] : undefined;
    origin?: string;
}): URL;
/**
 * Converts URLSearchParams into a typed object
 * @example
 * ```ts
 * const params = new URLSearchParams('foo=bar&count=42');
 * getParams(params)
 * // => { foo: 'bar', count: '42' }
 */
export declare function getParams<Params extends Record<string, string>>(
/** URLSearchParams object to convert */
params: URLSearchParams): Params;
/**
 * Converts URLSearchParams into a typed object matching an API route's input type
 * @example
 * ```ts
 * const params = new URLSearchParams('userId=123&action=update');
 * getParamsForRoute<UserRoute>(params)
 * // => { userId: '123', action: 'update' }
 */
export declare function getParamsForRoute<Route extends ApiRoute<any>>(
/** URLSearchParams object to convert */
params: URLSearchParams): Route['input'];
//# sourceMappingURL=api-routes.d.ts.map