/// <reference types="node" resolution-mode="require"/>
import type { ConstructQuery } from 'sparqljs';
import type Stage from './stage.js';
import type { NamedNode, Quad } from '@rdfjs/types';
import type { Endpoint } from './types.js';
import EventEmitter from 'node:events';
import { BaseQuery } from './sparql.js';
interface Events {
    end: [iterations: number, statements: number, processed: number];
    error: [e: GeneratorError];
    data: [statement: Quad];
}
export default class Generator extends EventEmitter<Events> {
    private readonly stage;
    private readonly index;
    private readonly query;
    private readonly engine;
    private iterationsProcessed;
    private iterationsIncoming;
    private statements;
    private $thisList;
    private readonly endpoint;
    private source?;
    constructor(stage: Stage, index: number);
    run($this: NamedNode): Promise<void>;
    private get batchSize();
    private runBatch;
    private flush;
}
export declare class Query extends BaseQuery {
    protected readonly query: ConstructQuery;
    static from(query: ConstructQuery): Query;
    private constructor();
    withIris(iris: NamedNode[]): Query;
    protected validate(): void;
    /**
     * Because we use pre-binding, the query must follow the rules as specified by https://www.w3.org/TR/shacl/#pre-binding:
     * - SPARQL queries must not contain a MINUS clause
     * - SPARQL queries must not contain a federated query (SERVICE)
     * - SPARQL queries must not contain a VALUES clause
     * - SPARQL queries must not use the syntax form `AS ?var` for any potentially pre-bound variable
     */
    private validatePreBinding;
}
export declare class GeneratorError extends Error {
    readonly context: {
        endpoint: string;
        query: string;
    };
    constructor(args: {
        error: Error;
        endpoint: Endpoint;
        query: Query;
    });
}
export {};
//# sourceMappingURL=generator.d.ts.map