import type { APIGatewayProxyEventV2 } from 'aws-lambda';
import { InvokeAction } from '../constants';
export type BufferProxyEvent = {
    httpMethod: string;
    path: string;
    rawUrl?: string;
    headers: {
        [key: string]: string | string[];
    };
    multiValueQueryStringParameters: {
        [key: string]: string[];
    };
    multiValueHeaders: {
        [key: string]: string[];
    };
    body: string;
    isBase64Encoded: boolean;
    requestContext: {
        httpMethod: string;
        resourcePath: string;
        path: string;
        stage: string;
    };
};
export type ConsoleEvent = {
    action: InvokeAction;
};
export type UnknownEvent = APIGatewayProxyEventV2 | BufferProxyEvent | {
    [key: string]: any;
};
export declare function isConsoleEvent(event: UnknownEvent): event is ConsoleEvent;
export declare function isApiGatewayV2Event(event: UnknownEvent): event is APIGatewayProxyEventV2;
export declare function isBufferProxyEvent(event: UnknownEvent): event is BufferProxyEvent;
export declare function methodFromEvent(event: UnknownEvent): any;
export declare function pathFromEvent(event: UnknownEvent): string | undefined;
export declare function searchFromEvent(event: UnknownEvent): string | undefined;
export declare function singleValueHeadersFromEvent(event: UnknownEvent): {
    [key: string]: string;
};
export declare function headerValueFromEvent(event: UnknownEvent, headerName: string): string | undefined;
export declare function cookiesFromEvent(event: UnknownEvent): string[];
export declare function urlFromEvent(event: UnknownEvent): string | undefined;
export declare function requestIdFromEvent(event: UnknownEvent | UnknownEvent): string | undefined;
export declare function invokeSourceFromEvent(event: UnknownEvent): "function-url" | "console" | "buffer-proxy";
export declare function invokeActionFromEvent(event: UnknownEvent): InvokeAction;
/**
 * Removes restricted headers and values from the headers object.
 * For example, all internal "x-amzn-*" headers are removed.
 * These headers are added by AWS into both Function URLs req and res.
 * If these headers are returned in the response,
 * for example because app proxies traffic to itself or another Edgio site,
 * AWS returns 500 status code with InternalFailure description.
 * @param headers Headers object
 */
export declare function sanitizeHeaders(headers: {
    [key: string]: string | string[];
}): {
    [x: string]: string | string[];
};
/**
 * Encodes just characters that are not valid in a URL path and
 * preserves all already encoded characters (to avoid double encoding).
 * @param path Path to encode
 * @returns Encoded path
 * @see https://datatracker.ietf.org/doc/html/rfc3986#section-3.3
 * @example encodePath('/path with spaces') => '/path%20with%20spaces' // encodes unencoded spaces
 * @example encodePath('/path%20with%20spaces') => '/path%20with%20spaces' // preserves encoded spaces
 * @example encodePath('/path%2B') => '/path%2B' // preserves encoded '+'
 * @example encodePath('/path+') => '/path+' // preserves unencoded '+'
 */
export declare function encodePath(path: string): string;
/**
 * Fixes path sent by API Gateway v2.
 * When browser sends request path with '+', Function URL decodes it and gives us ' '.
 * This is not valid behavior. Spaces can be encoded as '+' only in query strings
 * with application/x-www-form-urlencoded but not in paths. In paths, spaces encoded only as '%20'.
 * When browser sends request path with ' ', or '%20', Function URL always decodes it to '%20'.
 * This is valid behavior.
 * We need to correct it here.
 * NOTE: It's a regional bug. I was able to reproduce it only with Function URL in us-east-1 region.
 * The us-east-2 region worked. But it is not just about the region, with dev aws account,
 * it worked in us-east-1 region too.
 */
export declare function fixRawPath(rawPath: string): string;
