import { URL } from 'node:url'; import { NormalizedUrl, UrlMutators } from '@autogram/url-tools'; import { Entity, EntityConstructorOptions } from './entity.js'; export interface UniqueUrlConstructorOptions extends EntityConstructorOptions { /** * The URL to be saved. If the URL is a string, it will be parsed and normalized * using the specified normalizer function, or the global one if none is passed in. * If a full NormalizedUrl object is passed in, no additional normalization will * be performed. * * @type {?(string | NormalizedUrl)} */ url?: string | NormalizedUrl; /** * If a relative URL string is passed in, this value will be used to construct * an absolute URL during parsing. */ base?: string | URL; /** * An optional URL normalizer that can override the project-wide default. * Be aware that changing normalizers mid-project may result in duplicate * data. */ normalizer?: UrlMutators.UrlMutator; /** * The location of the page where this URL was found; it may be used during * crawl processes to create a more realistic HTTP request. */ referer?: string; /** * The crawl depth the URL was found at. if a sitemap was used to pre-populate * the crawl request queue, this value will be less useful. */ depth?: number; /** * Optional enum indicating the origin of this URL. Was it found while crawling, * imported from a third-party data source, extrapolated from the existence of * other URLs, etc. * * @type {?UrlSource} */ source?: UrlSource; /** * An optional hint that will be passed on to the crawler as a Request Label, * which ultimately controls the handler function that will process the URL's * response. * * By default, Spidergram will correctly handle the following values: * * - status * - page * - download * - robotsxml * - sitemap * * @type {?string} */ handler?: string; } export declare enum UrlSource { Page = "page", Sitemap = "sitemap", Import = "import", Path = "path" } export declare class UniqueUrl extends Entity { readonly _collection = "unique_urls"; url: string; parsed?: NormalizedUrl; referer?: string; source?: UrlSource; handler?: string; depth: number; protected keySeed(): unknown; get parsable(): boolean; constructor(data?: UniqueUrlConstructorOptions); } //# sourceMappingURL=unique-url.d.ts.map