/** * Curated lenses for the list page. * * Two flavors: * - "label-based": maps to a single `labels` value (e.g. hot / mature). * No extra curation needed — every item already has a label. * - "curator-assigned": maps to a `lenses` value on the item. The 5 anchor * items get these populated. Other items will simply not match. * * The lens id is what shows up in the URL as `?lens=...`. For * label-based lenses, the lens id is the same as the label. * * The curated lenses in `PRIMARY_LENSES` are rendered as top-row tabs. The rest * remain in the union type for URL deep-linking and future use, but are * not shown in the UI by default. */ export type LensId = "all" | "recently-updated" | "new" | "hot" | "mature" | "good-to-learn" | "production-like" | "beginner-friendly" | "contribution-ready" | "launches" | "actively-developed" | "needs-maintainer"; export interface LensDef { id: LensId; label: string; /** Short blurb shown when the lens is active. */ description?: string; /** What URL state this lens implies. Empty means no filter. */ toParams: () => Record; } export declare const LENSES: LensDef[]; /** * The curated lenses shown as top-row tabs on /items. * * These three are ordering views over the WHOLE directory, not filters: * every item stays reachable from every tab, so a visitor can never land * on an empty list. They answer the two questions a directory visitor * actually has — "what's alive?" and "what's new?" — and they mirror the * homepage's two record sections one-to-one. * * The label-based (`hot`, `mature`) and curator-assigned * (`production-like`, `good-to-learn`) lenses stay in `LENSES` for URL * deep-linking, but are no longer tabbed: they filter rather than order, * so they can and do render empty on directories that never populate * `curation.labels` / `curation.lenses`. */ export declare const PRIMARY_LENSES: LensId[]; export declare function lensById(id: string | null | undefined): LensDef | undefined; /** * Check whether the current URL search params match a given lens's * implied filter state. Used to highlight the active tab when a * deep-link uses the underlying filter key (e.g. ?label=hot) rather * than the abstract lens id (?lens=hot). */ export declare function isLensActive(lensId: LensId, sp: URLSearchParams): boolean; export declare function isPrimaryLens(id: string | null | undefined): boolean; /** * Turn a lens's `toParams()` output into a URLSearchParams string * (with the existing query preserved, then lens params merged on top). */ export declare function lensToQuery(id: LensId | null | undefined, current: URLSearchParams): string; /** * Read a `?lens=...` value from URL search params. */ export declare function lensFromSearchParams(sp: URLSearchParams): LensId | null; /** * Build a `href` for a lens tab. Per the single-select-view rule, * clicking a lens resets the "view" params (lens, label, status, sort, * page) and applies only the chosen lens's params. The refinement * filters — q/stack/platform/category/license/tag — are preserved, so * switching view keeps whatever the visitor narrowed down to. * * `sort` is reset because lenses own the ordering: a stale * `?sort=recently-added` left over from another tab would otherwise * keep that tab active alongside the one just clicked. */ export declare function hrefForLens(lensId: LensId | null | undefined, current: URLSearchParams, pathPrefix?: string): string; //# sourceMappingURL=directory-lenses.d.ts.map