import type { RequestEvent } from '@sveltejs/kit'; /** The subset of Cloudflare's `ExecutionContext` the SDK relies on. */ export type MinimalCloudflareExecutionContext = { waitUntil(promise: Promise): void; }; type CloudflareExecutionContextProvider = () => MinimalCloudflareExecutionContext | undefined; /** * Registers where to get the execution context from when `platform` doesn't carry one. * * Since `8.0.0-next.7`, `@sveltejs/adapter-cloudflare` no longer passes a `platform` object to * SvelteKit at all; `waitUntil` is imported from `cloudflare:workers` instead. That module only * resolves under the `workerd` export condition, so the entry point for that condition registers it * here instead of the shared worker code importing it directly. * * @see https://github.com/sveltejs/kit/pull/16754 */ export declare function setCloudflareExecutionContextFallback(provider: CloudflareExecutionContextProvider | undefined): void; /** * Reads the Cloudflare execution context off a SvelteKit `platform` object, falling back to the * provider registered via `setCloudflareExecutionContextFallback`. * * The property name differs by adapter version: * - `@sveltejs/adapter-cloudflare` <= 7 exposes it as `platform.context` * - `@sveltejs/adapter-cloudflare` 8 renamed it to `platform.ctx`, and later prereleases dropped * `platform` altogether (see the fallback) * * We read all of them so that request isolation and `waitUntil`-based flushing keep working across * the adapter versions our peer range allows. Every access fails silently when the shape changes, * so dropping any of them costs us events without surfacing an error. * * @see https://github.com/sveltejs/kit/pull/16668 */ export declare function getCloudflareExecutionContext(platform: unknown): MinimalCloudflareExecutionContext | undefined; /** * Takes a request event and extracts traceparent and DSC data * from the `sentry-trace` and `baggage` DSC headers. * * Sets propagation context as a side effect. */ export declare function getTracePropagationData(event: RequestEvent): { sentryTrace: string; baggage: string | null; }; /** * Extracts a server-side sveltekit error, filters a couple of known errors we don't want to capture * and captures the error via `captureException`. * * @param e error * * @returns an objectified version of @param e */ export declare function sendErrorToSentry(e: unknown, handlerFn: 'handle' | 'load' | 'server_route'): object; export {}; //# sourceMappingURL=utils.d.ts.map