import { IGenerator } from "./_types/IGenerator"; import { Field, IDataHook } from "model-react"; /** * A class used to extract items from a (custom) generator */ export declare class GeneratorExtractor { protected generator: IGenerator; protected started: Field; protected stopped: Field; protected itemCallback: null | ((item: T | undefined) => void); protected sentStopSignal: boolean; protected pausedItem: T | null; protected continueExtraction: ((stopped: boolean) => void) | null; protected generatorResult: Promise; /** * Creates a new generator extractor which extract a continuous stream of items * @param generator The generator to extract the items from * @param itemCallback The callback to forward the extracted items to */ constructor(generator: IGenerator); /** * Extracts the next item of */ next(): Promise; /** * Stops item extraction, which can't be continued later */ stop(): void; /** * Retrieves whether the item extraction has started * @param hook The hook to subscribe to changes * @returns Whether started */ hasStarted(hook?: IDataHook): boolean; /** * Retrieves whether all items were extracted from the generator * @param hook The hook to subscribe to changes * @returns Whether the generator extracted all items, or the extractor was stopped */ hasFinished(hook?: IDataHook): boolean; } //# sourceMappingURL=GeneratorExtractor.d.ts.map