export interface PatternReference { ref_id: string; url: string; host: string; app?: string; owner: "self" | "third-party"; selector: string; html?: string; html_truncated?: boolean; rect?: { x: number; y: number; width: number; height: number; }; styles: Record; state_styles?: Record>; note?: string; tags: string[]; taxonomy?: string[]; image?: ReferenceImage; captured_at: string; raven_version: string; } export interface ReferenceImage { file: string; width: number; height: number; fidelity: "offline"; } export interface SaveReferenceInput { url: string; app?: string; owner: "self" | "third-party"; selector: string; html?: string; rect?: { x: number; y: number; width: number; height: number; }; styles: Record; state_styles?: Record>; note?: string; tags: string[]; taxonomy?: string[]; } export interface ReferenceFilters { host?: string; owner?: PatternReference["owner"]; tags?: string[]; } export interface SearchReferenceOptions extends ReferenceFilters { query?: string; } export interface ReferenceListResult { references: PatternReference[]; total: number; skipped: string[]; index_unreadable: boolean; } export interface ReferenceSearchResult { results: Array<{ reference: PatternReference; score: number; why: string; }>; total: number; corpus_size: number; skipped: string[]; index_unreadable: boolean; vocabulary?: { taxonomy: string[]; hosts: string[]; tags: string[]; }; } export declare function referenceHome(): string; export declare function saveReference(input: SaveReferenceInput): PatternReference; export declare function getReference(ref_id: string): PatternReference | null; export declare function listReferences(opts?: ReferenceFilters): ReferenceListResult; export declare function searchReferences(opts: SearchReferenceOptions): ReferenceSearchResult; export declare function deleteReference(ref_id: string): boolean; export interface ForgetResult { host: string; removed: string[]; skipped: string[]; failed: Array<{ ref_id: string; reason: string; }>; index_unreadable: boolean; appeared_since_preview: string[]; still_present: string[]; verification_failed?: string; } export declare function canonicalHost(value: string): string; export declare function hostSyntaxProblem(host: string): string | null; export declare function hostMatches(recordHost: string, requested: string): boolean; export declare function referencesForHost(host: string): ForgetResult; export declare function deleteReferencesByHost(host: string, expected_ref_ids?: string[]): ForgetResult; export declare function referenceImagePath(ref_id: string): string; export interface ReferenceAttribution { source_url: string; host: string; owner: "self" | "third-party"; captured_at: string; credit: string; notice?: string; } export declare var TAKEDOWN_URL: string; export declare var THIRD_PARTY_NOTICE: string; export declare function referenceAttribution(reference: PatternReference): ReferenceAttribution; export declare function attachReferenceImage(ref_id: string, png: Uint8Array, size: { width: number; height: number; }): PatternReference;