import { Request as FetchRequest, RequestInfo, RequestInit } from 'node-fetch';
/**
 * Firewall that defines the schema for the rules supported by the Cloudflare WAF language.
 *
 * see https://developers.cloudflare.com/firewall/cf-firewall-language/
 */
export declare class Firewall {
    private readonly wirefilter;
    private readonly scheme;
    constructor();
    /**
     * Creates a firewall rule from a WAF language expression.
     *
     * @param rule waf language expression
     */
    createRule(rule: string): FirewallRule;
}
/**
 * The set of extension fields that can't be directly derived from the supplied request, and need to be specified
 * explicitly.
 */
export declare type CfRequestExt = Readonly<{
    'http.request.version'?: number;
    'ip.src'?: string;
    'ip.geoip.asnum'?: number;
    'ip.geoip.continent'?: string;
    'ip.geoip.country'?: string;
    'ip.geoip.subdivision_1_iso_code'?: string;
    'ip.geoip.subdivision_2_iso_code'?: string;
    'ip.geoip.is_in_european_union'?: boolean;
    'http.request.headers.truncated'?: boolean;
    'http.request.body.truncated'?: boolean;
    'cf.bot_management.score'?: number;
    'cf.bot_management.ja3_hash'?: string;
    'cf.bot_management.verified_bot'?: boolean;
    'cf.bot_management.corporate_proxy'?: boolean;
    'cf.client_trust_score'?: number;
    'cf.threat_score'?: number;
    'cf.client.bot'?: boolean;
}>;
/**
 * Cloudflare fields request extension.
 */
export interface CfRequestInit extends RequestInit {
    cf?: CfRequestExt;
}
/**
 * A request potentially augmented with the Cloudflare extension fields.
 */
export declare class Request extends FetchRequest {
    readonly cf: CfRequestExt;
    constructor(input: RequestInfo, init?: CfRequestInit);
}
/**
 * Firewall rule that can be matched against the request.
 */
export interface FirewallRule {
    /**
     * Matches the request against the request.
     *
     * Note, not all of the parameters can be obtained from a request. For instance, thread score, geoip, etc.
     * can't be easily obtained from the request. For such cases, a special cf object can be supplied, e.g. for
     * 'ip.src, cf: {"ip.scr": '1.2.3.4'} can be used.
     *
     * @param req the request which the rule will matched against.
     */
    match(req: Request): boolean;
}
