/** * The network gate for remote references. * * Validation and rendering both decide whether a remote reference may load, so * the decision lives here, below both, and the two can never disagree about * what a page's `policy.network` allows. */ import type { NetworkPolicy } from '../ir.js'; /** The capabilities a remote reference can be gated by. */ export type MediaCapability = 'images' | 'media'; export declare function isRemote(reference: string): boolean; export declare function capabilityAllowed(policy: NetworkPolicy, capability: string): boolean; /** * Decide whether a remote reference may be loaded. * * Two gates apply. The capability must be opted into, and when the page declares * a provider allowlist the reference's host must belong to one of those * providers. A block that names a provider itself requires that provider to be * allowlisted, so a spec cannot promote an arbitrary host to trusted by * labelling it "youtube". */ export declare function networkAllows(policy: NetworkPolicy, capability: MediaCapability, reference: string, provider: string): boolean; /** * Why a remote reference was held back. The page may deny the network outright, * leave the capability out, or allow it only for other hosts. */ export declare function blockedReason(policy: NetworkPolicy, capability: MediaCapability): string; /** * True when a still image reference (a poster, for example) may be emitted: a * local path always may, a remote one only through the `images` gate. */ export declare function imageReferenceAllowed(policy: NetworkPolicy, reference: string): boolean; //# sourceMappingURL=network-policy.d.ts.map