export interface ParsedDomain { slug: string | null; branch: string | null; environment: "preview" | "development" | "staging" | "production" | null; isVeryfrontDomain: boolean; isDraft: boolean; /** Whether this domain allows iframe embedding (veryfront, localhost, xip.io, zip.io) */ allowIframeEmbed: boolean; } /** * Environment labels that `{slug}.{environment}.veryfront.com` actually routes. * * This is not a naming preference — it is what the hosted platform can serve. * Each label needs a wildcard TLS certificate (`*.{label}.veryfront.com`) and a * rule below that resolves the host to a project. A label with neither is not a * slow environment, it is an unreachable one: TLS fails outright, or the proxy * falls through to the custom-domain lookup and answers * `404 {"error":"No project configured for domain: ..."}`. * * `development` is deliberately absent. It is a valid `ParsedDomain.environment` * for the *local* root (`localhost`), where it means * "running on this machine". No hosted rule produces it, so a hosted * `{slug}.development.veryfront.com` resolves to no project. * * Keep in sync with the hosted rules in `parseProjectDomain`; the lock test in * `domain-parser.test.ts` fails if they drift apart. */ export declare const HOSTED_ENVIRONMENT_NAMES: readonly ["preview", "staging", "production"]; export type HostedEnvironmentName = typeof HOSTED_ENVIRONMENT_NAMES[number]; /** * Whether `{slug}.{name}.veryfront.com` is a host the platform can route. * * Deliberately not a `name is HostedEnvironmentName` predicate. Host labels are * case-insensitive, so the comparison folds case — and a predicate would then * narrow the *unfolded* `"Production"` to a type whose members are all * lowercase, letting a caller feed it to an exhaustive `switch` or a keyed * lookup that misses at runtime. A caller that needs a value of that type must * take the folded label this is built on rather than its own string. */ export declare function isHostedEnvironmentName(name: string): boolean; /** * Extract project slug and branch from domain/host header */ export declare function parseProjectDomain(host: string): ParsedDomain; /** * Whether the host is a hosted veryfront domain (veryfront.com / veryfront.org) * rather than one of the local development domains. * * The two differ in what a project-less host means. Locally it means "no project * chosen yet" and the project chooser answers; hosted it means the domain names * no project at all and nothing can answer. */ export declare function isHostedVeryfrontDomain(host: string): boolean; /** * Check if a domain is a valid veryfront domain (includes localhost for local dev) */ export declare function isVeryfrontDomain(host: string): boolean; /** * Check if a host is a local development host where HMR connections should be allowed. * Recognises localhost, 127.0.0.1, 0.0.0.0, and *.localhost — but excludes explicit * production/staging subdomains ({slug}.production.localhost, * {slug}.staging.localhost) since those are used for testing non-dev behaviour locally. * * `*.localhost` is deliberately NOT a blanket allow. It is classified by the same * `parseProjectDomain` rules, so `{slug}.production.localhost` and unknown namespaces * such as `{slug}.foobar.localhost` stay excluded. `localhost` being a single-label root * must not widen HMR admission relative to the two-label roots it replaced. * * `host` may carry a port; it is stripped before matching, so `app.localhost:3000` * is classified as `app.localhost`. */ export declare function isLocalDevHost(host: string): boolean; /** * Get the effective project slug from request host or config */ export declare function getEffectiveProjectSlug(host: string, configuredSlug: string): { slug: string; fromHost: boolean; }; //# sourceMappingURL=domain-parser.d.ts.map