import { AtUriString } from '@atproto/syntax'; export declare const SITE_STANDARD_NSID_PREFIX = "site.standard."; /** * Composes a stable map key from an `(uri, cid)` pair. A single hydration * batch can pull more than one version of the same SS record URI (different * posts pinning different cids), so the composite is needed for O(1) * version-exact lookups. */ export declare const siteStandardRecordKey: (uri: string, cid: string) => string; export declare const parseSiteStandardRecordKey: (key: string) => { uri: AtUriString; cid: string; }; /** * Confirm that the supplied SS records actually back `assumedUrl`. The * record-side URL is built by concatenating the publication URL (or the * loose-doc site) with the document's `path` field, then both sides are * canonicalized for equality: lowercase host, query/fragment dropped, * trailing slash stripped. * * Path concatenation is `base + '/' + path` semantics — a leading `/` on * `path` does NOT swallow the base's pathname (the way * `new URL(path, base)` would). So * `'https://atproto.com/blog' + '/indexing-standard-site'` resolves to * `https://atproto.com/blog/indexing-standard-site` regardless of which * side carries the slash. * * Structural validation of the doc/pub pair (matching `site` ↔ pub URI, * no orphan docs that claim a missing publication) happens upstream in * `getSiteStandardRecordsFromHydrationMapsByRefs` / * `…ByDocumentUri` (see `hydration/external.ts`); by the time this * function runs the pair is already known to be structurally consistent, * so we only check whether the records back the URL. * * Cases: * - Document + publication: `publication.url + document.path` must * canonicalize to `assumedUrl`. * - Loose document (web-URL `site`): `document.site + document.path` * must canonicalize to `assumedUrl`. (Doc with at-uri `site` but no * publication can't reach this function — the lookups reject it.) * - Publication only: `publication.url` must canonicalize to * `assumedUrl`. * - Neither: vacuously valid; the caller short-circuits before we get * here. */ export declare const validateStandardSiteForUrl: (document: { ref: { uri: string; }; info: { record: { site: string; path?: string; }; }; } | undefined, publication: { ref: { uri: string; }; info: { record: { url: string; }; }; } | undefined, assumedUrl: string) => boolean; /** * Estimate reading time in minutes from a plaintext document body. Returns * `undefined` when the input has no countable words. Uses a coarse * `WORDS_PER_MINUTE` heuristic; swap in a more accurate library here if * needed (e.g. `reading-time`). */ export declare const estimateReadingTimeMinutes: (text: string) => number | undefined; //# sourceMappingURL=standard-site.d.ts.map