/// <reference types="node" />
import { SDK_NAME_HEADER, SDK_VERSION_HEADER } from "../config";
import { EventEmitter } from "events";
import { getRequest } from "../HttpClient";
import { Workspace, WorkspaceFetcher } from "@hackler/sdk-core";
interface WorkspaceFetcherConfig {
    fetchUrl: string;
    updateInterval: number;
    headers: {
        [SDK_NAME_HEADER]: string;
        [SDK_VERSION_HEADER]: string;
    };
}
export default class PollingWorkspaceFetcher implements WorkspaceFetcher {
    private readonly sdkKey;
    private eventEmitter;
    private isStarted;
    private readonly readyPromise;
    private readyPromiseResolver;
    private readyPromiseRejecter;
    private readonly updateInterval;
    private readonly fetchUrl;
    private readonly headers;
    private currentTimeout;
    private errorRetryController;
    private currentRequest;
    private syncOnCurrentRequestComplete;
    private isReadyPromiseSettled;
    private httpGetRequest;
    private workspace;
    constructor(sdkKey: string, httpGetRequest: typeof getRequest, eventEmitter: EventEmitter, config: WorkspaceFetcherConfig);
    onReady(): Promise<void>;
    start(): void;
    stop(): Promise<void>;
    get(): Workspace | null;
    private scheduleNextUpdate;
    private fetch;
    private onRequestComplete;
    private onRequestResolved;
    private onRequestRejected;
    close(): void;
}
export {};
//# sourceMappingURL=PollingWorkspaceFetcher.d.ts.map