import { EventSpecResponse, EventSpecCoordinates } from "./AvoEventSpecFetchTypes"; /** * `notFound` is true when a null result is the endpoint's 404 (no spec for these keys), * false for any other failure (status, timeout, network error, unparseable body). */ type FetchCallback = (result: EventSpecResponse | null, notFound?: boolean) => void; export declare class AvoEventSpecFetcher { private apiKey; private protocol; private hostname; private port; private origin; private inFlight; private agent; private requests; private static specEndpoint; private static fetchTimeoutMs; private static socketWaitTimeoutMs; /** `mockEndpoint`: a valid override URL (AvoNetworkCallsHandler.mockEndpoint), or null. */ constructor(apiKey: string, mockEndpoint?: string | null); /** * `coordinates`: the event's gateway coordinates. Each non-blank one is sent as a query * parameter and is part of the dedupe key; without any, the request and key are those of * a plain source fetch. */ fetch(eventName: string, streamId: string, callback: FetchCallback, coordinates?: EventSpecCoordinates): void; private send; private resolveCallbacks; /** * Parse the wire format from /trackingPlan/eventSpec into our internal types. * * Wire format: * { events: [{ b, id, vids, p: { "PropName": { t, r, l?, p?, v?, rx?, minmax?, children? } } }], * metadata: { schemaId, branchId, latestActionId, sourceId } } * where p, v, rx and minmax each map a constraint key to the event IDs that require it. * * Internal format: * { eventSpec: { eventName, events: [{ branchId, baseEventId, variantIds, props }] } | null, * metadata: { schemaId, branchId, latestActionId, sourceId } } */ static parseWireResponse(wire: any, eventName: string): EventSpecResponse; private static parseEventEntry; private static parseConstraintsByName; private static parseConstraints; /** Aborts this instance's in-flight requests; the shared agent stays usable. */ destroy(): void; } export {};