import { type OpenhandsOptions } from '../openhands'; export type OpenhandsEnv = { Sandbox: { get(id: { toString(): string; }): { fetch(input: string | Request, init?: RequestInit): Promise; }; }; }; /** * Options for OpenHands route handler */ export interface OpenhandsHandlerOptions extends OpenhandsOptions { /** Base path for OpenHands routes (default: '') */ basePath?: string; /** Custom sandbox name resolver */ getSandboxName?: (request: Request) => string | null; } /** * Creates a middleware function that handles OpenHands routes. * Returns null if the request doesn't match OpenHands routes (allows chaining). * * @param options - Configuration options * @returns Middleware function */ export declare function createOpenhandsHandler(options?: OpenhandsHandlerOptions): (request: Request, env: Env) => Promise; /** * Attaches OpenHands routes to an existing fetch handler. * This wraps your handler with OpenHands route handling and preview URL proxying. * * @param fetchHandler - Your existing fetch handler * @param options - Configuration options * @returns Wrapped fetch handler * * @example * ```typescript * import { attachOpenhandsRoutes } from 'openhands-sdk/routes'; * * export default attachOpenhandsRoutes(async (request, env) => { * // Your custom routes here * return new Response('Not found', { status: 404 }); * }, { * port: 8001, * exposePort: true, * hostname: 'yourdomain.com' * }); * ``` */ export declare function attachOpenhandsRoutes(fetchHandler: (request: Request, env: Env) => Response | Promise, options?: OpenhandsHandlerOptions): { fetch: (request: Request, env: Env) => Promise; }; //# sourceMappingURL=handler.d.ts.map