import { Watchable, QueryExecution } from './QueryExecution.js'; import 'apprt-core/Mutable'; type QueryExecutionsConstructorOptions = Partial>; /** * Function to control the execution of queries. */ interface QueryExecutionStrategy { (executions: QueryExecution[]): Promise; } /** * Collection containing several QueryExecution. */ interface QueryExecutions extends Watchable { /** Indicates that the executions are still running. */ readonly running: boolean; /** Indicates that the executions are finished. */ readonly executed: boolean; /** Array of QueryExecution. Should not be changed after executions are started. */ executions: QueryExecution[]; /** Function to start all executions parallel. */ startParallel(): Promise; /** Function start all executions sequentially (one after another). */ startSequential(): Promise; /** Function to start all executions with a custom strategy. */ start(strategy: QueryExecutionStrategy): Promise; /** Helper function to wait for the first, non-failed execution result. */ waitForFirstNonEmptyExecution(): Promise>; /** Helper function to wait until all executions are finished. */ waitForExecution(): Promise; } /** * Creates QueryExecutions. * ``ts * import QueryExecutions from "store-api/QueryExecutions"; * import QueryExecution from "store-api/QueryExecution"; * * new QueryExecutions({ * executions: [new QueryExecution({ source: ... })] * }) * ``` * @param options Options that contain the query executions to add to the collection. */ type QueryExecutionsConstructor = new (options?: QueryExecutionsConstructorOptions) => QueryExecutions; /** * Creates QueryExecutions. */ declare const _default: QueryExecutionsConstructor; export { _default as default }; export type { QueryExecutionStrategy, QueryExecutions, QueryExecutionsConstructor };