/** * Module Request Classification * * Classifies incoming module request URLs into a discriminated union, moving * the four URL-pattern regexes out of `serveModule` and providing a single * pure function that callers can switch on. * * @module modules/server/classify */ /** Prefix for dev-module URLs; exported for path stripping in module-server. */ export declare const DEV_MODULE_PREFIX: RegExp; /** URL does not start with any module prefix — not a module request. */ export interface NotModuleKind { kind: "not-module"; } /** A request entered a framework-owned namespace but did not match its grammar. */ export interface InvalidModuleKind { kind: "invalid-module"; namespace: "cross-project" | "snippet"; } /** A compiled snippet module identified by its content hash. */ export interface SnippetKind { kind: "snippet"; /** Hex hash of the snippet source. */ hash: string; } /** A cross-project import pinned to a specific semver / range version. */ export interface CrossProjectVersionedKind { kind: "cross-project-versioned"; slug: string; version: string; path: string; } /** A cross-project import resolved to the latest published version. */ export interface CrossProjectLatestKind { kind: "cross-project-latest"; slug: string; path: string; } /** A regular project dev-module (including framework modules). */ export interface DevModuleKind { kind: "dev-module"; } /** * Discriminated union of all recognised module URL shapes. * * Switch on `kind` to dispatch to the appropriate handler. */ export type ModuleRequestKind = NotModuleKind | InvalidModuleKind | SnippetKind | CrossProjectVersionedKind | CrossProjectLatestKind | DevModuleKind; /** * Classify a module request URL into one of the known module kinds. * * This is a pure function — it performs no I/O and has no side-effects. * * @param url - The parsed request URL. * @returns A `ModuleRequestKind` discriminated union. */ export declare function classifyModuleRequest(url: URL): ModuleRequestKind; //# sourceMappingURL=classify.d.ts.map