@fly/cdn
Version:
Fly's TypeScript CDN
18 lines (17 loc) • 688 B
TypeScript
import { BackendProxies } from "./index";
export interface RuleInfo {
actionType: "redirect" | "rewrite";
backendKey?: string;
matchScheme?: string;
hostname?: string;
pathMatchMode?: "prefix" | "full";
httpHeaderKey?: string;
httpHeaderValue?: RegExp | string;
pathPattern?: RegExp | string;
pathReplacementPattern?: string;
redirectURLPattern?: string;
redirectStatus?: number;
responseReplacements?: [string, string][];
}
export declare function validateRule(r: any): r is RuleInfo;
export declare function buildRules(backends: BackendProxies, rules: RuleInfo[]): (req: RequestInfo, init?: RequestInit | undefined) => Promise<Response>;