import { ParsedUrl } from '@autogram/url-tools'; import { Entity, EntityConstructorOptions, Reference } from './entity.js'; import { SavedFile } from '../index.js'; import { Site } from './site.js'; export interface ResourceConstructorOptions extends EntityConstructorOptions { url?: string | URL; code?: number | string; message?: string; headers?: Record; mime?: string; size?: number; body?: string; cookies?: Record[]; payload?: SavedFile; site?: Reference; } export declare class Resource extends Entity { static offloadBodyHtml?: 'db' | 'file'; static getKeyForUrl(url: string | ParsedUrl, label?: string): string; readonly _collection = "resources"; url: string; code: number; message: string; headers: Record; mime?: string; size?: number; cookies?: Record[]; payload?: SavedFile; site?: string; body?: string; _bodyHash?: string; constructor(data?: ResourceConstructorOptions); get parsed(): ParsedUrl; protected keySeed(): unknown; /** * In certain situations, it's useful to offload storage of body * text to a separate table rather than keeping it in the Resource * proper. * * If you need to work directly with a resource's HTML, call: * `await r.loadBody()` after loading and `await r.saveBody()` just * before persisting it. * * This is wonky. We don't like it. It's only really necessary when * you're offloading the HTML — in other situations, things should work * without it. */ loadBody(): Promise; saveBody(): Promise; } //# sourceMappingURL=resource.d.ts.map