/** * The single facet registry. * * `browse.facets` in grove.config.ts decides WHICH browse dimensions a * site exposes and in WHAT ORDER; this module owns everything else a * facet id means — its filter dimension, display label, URL parameter, * and selection mode. Consumers (schema validation, view models, the * filter UI, the submission form) all read from here so the id list * can't drift into parallel alias tables. */ /** Canonical facet ids accepted by `browse.facets` (validated by zod). */ export declare const FACET_IDS: readonly ["category", "stack", "platform", "tags", "license"]; export type FacetId = (typeof FACET_IDS)[number]; /** Keys of the `buildFacets()` result / `IndexFilters` dimensions. */ export type FacetDimension = "categories" | "stacks" | "platforms" | "tags" | "licenses"; export interface FacetDef { id: FacetId; /** Key into `buildFacets()` output and `IndexFilters`. */ dimension: FacetDimension; /** Filter-group display label. */ label: string; /** Query parameter (mirrors `KEYS` in directory-search). */ urlParam: string; /** Single-select facets render radios and navigate on change. */ single: boolean; } export declare const FACET_DEFS: Record; /** Default facet set when `browse.facets` is not configured. */ export declare const DEFAULT_FACETS: readonly FacetId[]; /** * Normalize a facet spelling to its canonical id. The config schema * only accepts canonical ids; this alias map keeps runtime consumers * tolerant of the historical singular/plural spellings that may still * exist in generated artifacts. */ export declare function canonicalFacetId(value: string): FacetId | undefined; /** * Resolve a configured facet list into ordered, deduped definitions. * ORDER IS THE CONTRACT: the array order in `browse.facets` is the * order filter groups render in. Unknown ids resolve to nothing here — * the config schema already rejects them at parse time. */ export declare function configuredFacetDefs(facets?: readonly string[]): FacetDef[]; //# sourceMappingURL=directory-facets.d.ts.map