import { type LinkResolver, type SignedEvent } from '@estiva-app/protocol'; import { type LinkReader } from './links.js'; import type { QueryFn } from './projection.js'; /** One message that mentions the file, as its latest words say. */ export interface MentionedIn { /** The message as sent: a `kind:1111` comment or a `kind:9` message. Where it was said, its thread, its author. */ event: SignedEvent; /** Its latest words: the latest edit's, or its own. */ body: string; /** The latest edit, when there is one: its files and cards replace the message's (§6.8). */ edit?: SignedEvent; } /** Enough for a list that is scanned, not read; the oldest pointers are what a cap drops. */ export declare const MENTIONED_IN_LIMIT = 200; /** * How many links one Mentioned-in read asks about in all, newest messages * first. Each asked link is a relay query, and {@link MENTIONED_IN_LIMIT} * candidates at {@link MAX_LINKS_ASKED} each would be 4,800 of them for one * panel (PEEKM-7's review). A link left over stays unanswered, so a message * pointing at the file keeps its row; a later read asks the next ones. */ export declare const MAX_MENTIONED_IN_LINKS_ASKED = 64; /** The filter for the candidates pointing at the file by its address: every message, comment and edit with its `a`. */ export declare function mentionedInFilter(address: string, limit?: number): Record; /** * Every filter for the candidates: {@link mentionedInFilter}, and the one * asking by the file's id, since a mention names a file by `o` alone once its * type's apps name it by id (§6.4). One request either way. */ export declare function mentionedInFilters(address: string, limit?: number): Record[]; /** * The messages among `events` that list under the file, newest first. * * `events` holds the candidates ({@link mentionedInFilter}), the messages their * edits edit, and every edit of each message; `resolveLink` what the app links * in their words name. `commentKinds` is the file's owner's comment kinds * (`isCommentOn`): a message on the file itself is not a mention of it. * `unanswered` says which links could not be asked about: a message whose * latest version points at the file and holds one keeps its row until the * link can be read, rather than lose it to a failed read. */ export declare function mentionedInOf(events: readonly SignedEvent[], address: string, resolveLink?: LinkResolver, commentKinds?: readonly number[], unanswered?: (url: string) => boolean): MentionedIn[]; /** * {@link mentionedInOf} as the viewer: the candidates, then the messages their * edits edit and every edit of each message, then what the links in their * latest words name, asked through `links` and waited for at most `waitMs`. * Throws when a read is refused, so an unreadable relay and a file nobody * mentions are not the same empty list. */ export declare function readMentionedIn(query: QueryFn, address: string, options?: { links?: LinkReader; limit?: number; waitMs?: number; commentKinds?: readonly number[]; }): Promise; //# sourceMappingURL=mentions.d.ts.map