/** * Reference entry construction for source-sync. * * Owns: URL path decoding, display name / manifest-entry derivation, and the * indexed-reference catalog entry builder. Depends only on fetching.ts URL * helpers and the external reference-source-harvester. */ import type { AssetCatalogEntry, SourceDefinition } from "../../../types.js"; import type { IndexedReferenceOptions, SourceSyncContext } from "./types.js"; /** Minimum path segment count required to form an owner/repo pair (e.g. Swift). */ export declare const MIN_OWNER_REPO_PATH_SEGMENTS = 2; /** * Splits a URL pathname into decoded, non-empty path segments. */ export declare function decodePathSegments(pathname: string): string[]; /** * Derives a human-readable display name from the last non-empty URL path segment. * Falls back to the hostname when the path is empty. */ export declare function buildDisplayNameFromUrl(url: URL): string; /** * Derives a slash-joined manifest entry string from the non-empty URL path * segments. Returns undefined when the path has no meaningful segments. */ export declare function buildManifestEntryFromUrl(url: URL): string | undefined; /** * Extracts the PyPI package name from a URL of the form `/project//`. * Returns undefined when the path does not start with `/project/`. */ export declare function extractPypiPackageNameFromUrl(url: URL): string | undefined; /** * Extracts the `owner/repo` package name from a Swift Package Index URL. * Returns undefined when the path has fewer than two segments. */ export declare function extractSwiftPackageNameFromUrl(url: URL): string | undefined; /** * Builds an indexed catalog entry for a reference source item discovered via * URL (sitemap, HTML page link, marketplace API, etc.). */ export declare function buildIndexedReferenceItem(source: SourceDefinition, context: SourceSyncContext, url: URL, options: IndexedReferenceOptions): AssetCatalogEntry;