/** * @grove-dev/ui — sort primitive (V1, typed against `IndexRecord`). * * V0 worked on `DirectoryRecord` (which no longer exists in V1). V1 * sorts `IndexRecord` — the discriminated union exported by * `@grove-dev/core` — and only applies project-specific sort keys * (stars, pushedAt, score-like signals) when the record is a * `IndexProjectRecord`. Resources and entities fall back to a stable * secondary key (kind order, name) so the sort is deterministic * across the whole directory. * * This module re-uses the V1 openapps/astro `search.ts` semantics * so the framework adapters can swap the implementation for the * local one without behavior drift. */ import type { IndexRecord } from "@grove-dev/core"; import { type SortValue } from "./constants.js"; /** * Sort `IndexRecord[]` according to the supplied sort order. Returns * a new array — input is not mutated. Stable for ties. * * Records missing the sort key (e.g. no stars) sink to the bottom * rather than vanishing. */ export declare function sortRecords(records: IndexRecord[], sort?: SortValue): IndexRecord[]; export type { IndexRecord }; //# sourceMappingURL=sort.d.ts.map