import { RdfDereferencer } from "rdf-dereference"; import { RdfStore } from "rdf-stores"; import type { Condition } from "../condition/index.js"; import type { Notifier } from "./modulator.js"; import type { FoundRelation } from "./relation.js"; /** * target: url to fetch * expected: relations that can be found, and should be ignored * examples are the originating url */ export type Node = { target: string; expected: Set; }; export type FetchedPage = { url: string; data: RdfStore; immutable: boolean; memberCount: number; created?: Date; updated?: Date; }; export type LongPromise = { waiting: Promise; callback: () => void; }; export declare function longPromise(): LongPromise; export declare function resetPromise(promise: LongPromise): void; export declare function statelessPageFetch(location: string, dereferencer: RdfDereferencer, fetch_f?: typeof fetch): Promise; export type FetchEvent = { relationsFound: { from: Node; target: FoundRelation; }[]; pageFetched: FetchedPage; scheduleFetch: Node; error: unknown; }; export type Cache = { immutable?: boolean; maxAge?: number; }; export declare class Fetcher { private dereferencer; private loose; private fetch_f?; private condition; private defaultTimezone; private includeMetadata; private closed; private logger; constructor(dereferencer: RdfDereferencer, loose: boolean, condition: Condition, defaultTimezone: string, includeMetadata: boolean, fetch_f?: typeof fetch); close(): void; fetch(node: Node, state: S, notifier: Notifier): Promise; }