import { Review } from '@internetarchive/iaux-item-metadata'; import { Aggregation } from '../models/aggregation'; import { CollectionExtraInfo } from './collection-extra-info'; /** * The structure of the response body `hits` object returned from the PPS endpoint. */ export interface SearchResponseHits { total: number; returned: number; hits: Record[]; } export declare type FederatedServiceName = 'service___fts' | 'service___tvs' | 'service___rcs' | 'service___whisper'; export declare type FederatedMediatypeName = 'metadata___mediatype___texts' | 'metadata___mediatype___movies' | 'metadata___mediatype___audio' | 'metadata___mediatype___software' | 'metadata___mediatype___image' | 'metadata___mediatype___etree'; export declare type FederatedPageElementName = FederatedServiceName | FederatedMediatypeName; /** * Valid page element names recognized & returned by the PPS */ export declare type PageElementName = 'uploads' | 'favorites' | 'reviews' | 'collections' | 'lending' | 'web_archives' | 'forum_posts' | FederatedPageElementName; /** * A basic page element returning hits and/or aggregations */ interface HitsAggregationsPageElement { hits?: SearchResponseHits; aggregations?: Record; collection_extra_info?: CollectionExtraInfo; } /** * A single entry in a user's web archives, representing one or more captures for * a given URL. */ export interface WebArchiveEntry { url: string; captures: string[]; } /** * An object representing a single forum post */ export interface ForumPost { id: number; subject: string; subject_href: string; poster: string; poster_href: string; forum: string; forum_href: string; replies: number; date: string; } export declare type ReviewerAccountStatus = 'ok' | 'locked' | 'unknown'; export declare class SearchReview extends Review { get reviewer_account_status(): ReviewerAccountStatus | undefined; get reviewer_account_status_reason(): string | undefined; get __href__(): string | undefined; /** * Parses the raw reviewer_account_status string into a structured object * * Examples of raw strings: * - "ok" * - "locked__darked" * - "unknown__account_not_found__by_itemname" */ private get account_status(); } export declare type UploadsPageElement = HitsAggregationsPageElement; export declare type FavoritesPageElement = HitsAggregationsPageElement; export declare type ReviewsPageElement = HitsAggregationsPageElement; export declare type CollectionsPageElement = HitsAggregationsPageElement; export declare type FederatedPageElement = HitsAggregationsPageElement; export declare const LENDING_SUB_ELEMENTS: readonly ["loans", "waitlist", "loan_history"]; export declare type LendingSubElement = typeof LENDING_SUB_ELEMENTS[number]; export declare type LendingPageElement = Record[]>; export declare type WebArchivesPageElement = WebArchiveEntry[]; export declare type ForumPostsPageElement = ForumPost[]; export declare type PageElement = UploadsPageElement | FavoritesPageElement | ReviewsPageElement | CollectionsPageElement | LendingPageElement | WebArchivesPageElement | ForumPostsPageElement | FederatedPageElement; /** * A map containing one or more page elements returned by the PPS, keyed by the * name of the element. */ export interface PageElementMap extends Partial> { uploads?: UploadsPageElement; favorites?: FavoritesPageElement; reviews?: ReviewsPageElement; collections?: CollectionsPageElement; lending?: LendingPageElement; web_archives?: WebArchivesPageElement; forum_posts?: ForumPostsPageElement; service___fts?: FederatedPageElement; service___tvs?: FederatedPageElement; service___rcs?: FederatedPageElement; service___whisper?: FederatedPageElement; metadata___mediatype___texts?: FederatedPageElement; metadata___mediatype___movies?: FederatedPageElement; metadata___mediatype___audio?: FederatedPageElement; metadata___mediatype___software?: FederatedPageElement; metadata___mediatype___image?: FederatedPageElement; metadata___mediatype___etree?: FederatedPageElement; } /** * Converts an array of web archive entries to an array of objects compatible with the search hit constructors */ export declare function convertWebArchivesToSearchHits(pageElement: WebArchivesPageElement): Record[]; export {};