import { APIClient } from "@mailwoman/core/api"; import { type PathBuilderLike } from "path-ts"; import { type VlaanderenHarvest } from "#be/adapters/vlaanderen/adapter"; import type { BaseFetchOptions, FetchSummary } from "#tools/fetch/download"; /** * The service this module harvests. */ export declare const VLAANDEREN_AD_WFS = "https://geo.api.vlaanderen.be/ad/wfs"; /** * The largest page the service will serve. * * A `count=50000` request answers with 10,000 features, so asking for more costs * a request and returns the same body. */ export declare const MAX_PAGE_SIZE = 10000; /** * One `GetFeature` response, with what its root element states about itself. */ export interface FeaturePageBody { body: string; /** * The `numberReturned` the root states, or `null` where it states none. */ numberReturned: number | null; /** * The `numberMatched` the root states, or `null` where it answers `unknown`. * * Every results page of this service answers `unknown`, so only a `resultType=hits` * request past index 0 yields a number. */ numberMatched: number | null; } /** * Issues one `GetFeature` against the service. * * `#tools/fetch/wfs-harvest` owns the request, the exception check and the counts. * Every markup-serving WFS in this directory shares them. * This states the service and its context. * * @throws When the service answers an OGC exception report, so a 400 carrying * `ows:ExceptionCode/NoApplicableCode` raises rather than being written into the harvest as a page. */ export declare function readVlaanderenPage(client: Pick, params: Readonly>): Promise; /** * The number of features a type holds, asked past index 0. * * @throws When the service states no count, so a missing count never reads as zero features. */ export declare function readVlaanderenFeatureCount(client: Pick, typeName: string): Promise; export interface HarvestVlaanderenOptions { /** * Where the harvest is written. * The adapter reads this same directory. */ outputDir: PathBuilderLike; /** * Stop after this number of address pages, for a probe rather than a full harvest. */ maxPages?: number; /** * Features per address page, capped at {@link MAX_PAGE_SIZE}. * * This sizes the address pages only. * A probe lowers it to take a small page without also splitting `ad:ThoroughfareName` * into 167,218 / `pageSize` requests. */ pageSize?: number; /** * Features per component page, capped at {@link MAX_PAGE_SIZE} and defaulting to it. * * Only a test lowers this. * A component type is always taken whole, so a smaller page yields only more requests. */ componentPageSize?: number; signal?: AbortSignal; } export declare function harvestVlaanderenAD(client: Pick, options: HarvestVlaanderenOptions): Promise; /** * The directory `#be/adapters/vlaanderen/adapter` reads, given the root a fetch wrote under. * * The adapter reads the directory rather than one file, because a harvest writes the addresses * and each component type as separate documents beside `harvest.json`. */ export declare function vlaanderenInputPath(outRoot: BaseFetchOptions["outRoot"]): PathBuilderLike; /** * Per-invocation options for the registry entry. */ export interface FetchVlaanderenOptions extends BaseFetchOptions { maxPages?: number; pageSize?: number; componentPageSize?: number; signal?: AbortSignal; } /** * The registry entry. * * `harvestVlaanderenAD` takes a client so a test can drive it against stubbed bodies. * This supplies the client the registry's callers expect, and reports the harvest as a * {@linkcode FetchSummary}: one harvest is one fetched unit whatever the page count, * because the adapter reads the directory rather than any single page. */ export declare function fetchVlaanderenAD(options: FetchVlaanderenOptions, report?: (line: string) => void): Promise; //# sourceMappingURL=vlaanderen-ad.d.ts.map