import type { EffectHandler } from "./types.js"; /** * Adapts an Effect-producing callback to a native SvelteKit server handler. * SvelteKit continues to select the handler by its exported binding name, such * as `GET`, `PUT`, or `load`. * * @example A `+server.ts` request handler: * ```ts * import { Handler } from "svelte-effect-runtime/server"; * import type { RequestHandler } from "./$types"; * * export const GET = Handler(function* ({ params }) { * const post = yield* Posts.get(params.slug); * * return Response.json(post); * }); * ``` * * @example A `+page.server.ts` load function: * ```ts * import { Handler } from "svelte-effect-runtime/server"; * import type { PageServerLoad } from "./$types"; * * export const load = Handler(function* ({ locals }) { * const profile = yield* Profiles.get(locals.user.id); * * return { profile }; * }); * ``` * * @since 4.0.0 * @param handler - Effect-producing callback whose parameters and successful * result match the native SvelteKit handler type. * @returns A native handler that runs the callback through the configured * {@link ServerRuntime} with the current {@link RequestEvent} available. */ export declare function Handler unknown>(handler: EffectHandler): NativeHandler;