UNPKG

@fly/cdn

Version:
24 lines (23 loc) 931 B
import { ProxyFunction } from "../proxy"; import { RuleInfo } from "./rules"; export declare const CDNConfigKey = "flyCDN"; export interface CdnConfig { backends: { [key: string]: ItemConfig; }; middleware: ItemConfig[]; rules: RuleInfo[]; } export interface ItemConfig { type: string; [prop: string]: unknown; } export declare type BackendProxies = Map<string, ProxyFunction>; export declare function isItemConfig(input: unknown): input is ItemConfig; export declare function isCdnConfig(input: unknown): input is CdnConfig; export declare function buildCdn(config: CdnConfig): ((req: RequestInfo, init?: RequestInit | undefined) => Promise<Response>) & { backends: Map<string, ProxyFunction<unknown>>; }; export declare function buildCdnFromAppConfig(c?: any): ((req: RequestInfo, init?: RequestInit | undefined) => Promise<Response>) & { backends: Map<string, ProxyFunction<unknown>>; };