import { WorkersSDK } from '@highlight-run/opentelemetry-sdk-workers';
import { HighlightEnv as HighlightEnv$1 } from '@highlight-run/cloudflare';
import { ExecutionContext } from '@cloudflare/workers-types';
import { ResourceAttributes } from '@opentelemetry/resources/build/src/types';
import { NextRequest, NextFetchEvent } from 'next/server';

type HighlightEnv = HighlightEnv$1;
type EdgeHandler = (request: NextRequest, event: NextFetchEvent) => Promise<Response>;
type ExtendedExecutionContext = ExecutionContext & {
    __waitUntilTimer?: ReturnType<typeof setInterval>;
    __waitUntilPromises?: Promise<void>[];
};
interface HighlightInterface {
    init: (request: Request, env: HighlightEnv, ctx: ExtendedExecutionContext) => WorkersSDK;
    consumeError: (error: Error) => void;
    sendResponse: (response: Response) => void;
    setAttributes: (attributes: ResourceAttributes) => void;
}
declare const H: HighlightInterface;
declare function Highlight(env: HighlightEnv): (handler: EdgeHandler) => (request: NextRequest, event: NextFetchEvent) => Promise<Response>;

export { H, Highlight, HighlightEnv };
