import type { Parts } from "../../http/request.js"; import { ANY, MIRROR_REQUEST } from "./support.js"; export type AllowOriginPredicate = (origin: string, parts: Parts) => Promise | boolean; /** * Holds configuration for how to set the `Access-Control-Allow-Origin` header. * * @see [MDN](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Origin) * @see {@link CorsLayer.allowOrigin} */ export declare class AllowOrigin { private readonly inner; private constructor(); static default(): AllowOrigin; static from(like: AllowOriginLike): AllowOrigin; /** * Allows any origin by sending a wildcard (`*`). */ static any(): AllowOrigin; /** * Allows a specific origin. */ static exact(origin: string): AllowOrigin; /** * Allows a list of origins. * * @throws {@link !Error} If the list contains a wildcard (`*`). */ static list(origins: string[]): AllowOrigin; /** * Allows a list of origins, based on a given predicate. */ static predicate(predicate: AllowOriginPredicate): AllowOrigin; /** * Allows any origin, based on a given predicate. */ static mirrorRequest(): AllowOrigin; } export type AllowOriginLike = AllowOrigin | string | string[] | typeof ANY | typeof MIRROR_REQUEST | AllowOriginPredicate;