/** * Pure, framework-free "similar posts" ranking. Given a post and the full set of posts, it * scores every other post by content similarity and returns the closest ones - the data * behind the `BlogPage` sidebar's "Similar pages" list. Kept fs-free so the frontend can use * it too, though the `Blog` instance method is the usual entry point. * * The signal today is the post metadata only (`keywords`, `title`, `description`); there is * no `tags` field yet. When one is added, fold it into {@link vectorFor} at the top weight. */ import type { PostMeta } from "./types.js"; /** * Ranks the posts most similar to `current` by weighted-term cosine similarity. * * The current post is excluded, posts sharing no significant terms (score `0`) are dropped, * results are ordered by score descending and then by `date` descending (newest first) as a * tie-break, and at most `limit` posts are returned. * * @param current - the post to find neighbours for. * @param all - the full set of posts to rank (typically `Blog.getAllPosts()`). * @param limit - the maximum number of similar posts to return. Defaults to `3`. * @returns the closest posts' metadata; empty when `current` has no significant terms or * nothing else overlaps. */ export declare function similarPosts(current: PostMeta, all: PostMeta[], limit?: number): PostMeta[];