1 | import { ExecutionRequest, ExecutionResult } from './Interfaces.js';
|
2 | export type MaybePromise<T> = PromiseLike<T> | T;
|
3 | export type MaybeAsyncIterable<T> = AsyncIterable<T> | T;
|
4 | export type AsyncExecutor<TBaseContext = Record<string, any>, TBaseExtensions = Record<string, any>> = <TReturn = any, TArgs extends Record<string, any> = Record<string, any>, TContext extends TBaseContext = TBaseContext, TRoot = any, TExtensions extends TBaseExtensions = TBaseExtensions>(request: ExecutionRequest<TArgs, TContext, TRoot, TExtensions, TReturn>) => Promise<MaybeAsyncIterable<ExecutionResult<TReturn>>>;
|
5 | export type SyncExecutor<TBaseContext = Record<string, any>, TBaseExtensions = Record<string, any>> = <TReturn = any, TArgs extends Record<string, any> = Record<string, any>, TContext extends TBaseContext = TBaseContext, TRoot = any, TExtensions extends TBaseExtensions = TBaseExtensions>(request: ExecutionRequest<TArgs, TContext, TRoot, TExtensions, TReturn>) => ExecutionResult<TReturn>;
|
6 | export type Executor<TBaseContext = Record<string, any>, TBaseExtensions = Record<string, any>> = <TReturn = any, TArgs extends Record<string, any> = Record<string, any>, TContext extends TBaseContext = TBaseContext, TRoot = any, TExtensions extends TBaseExtensions = TBaseExtensions>(request: ExecutionRequest<TArgs, TContext, TRoot, TExtensions, TReturn>) => MaybePromise<MaybeAsyncIterable<ExecutionResult<TReturn>>>;
|
7 | export type DisposableSyncExecutor<TBaseContext = Record<string, any>, TBaseExtensions = Record<string, any>> = SyncExecutor<TBaseContext, TBaseExtensions> & {
|
8 | [Symbol.dispose]: () => void;
|
9 | };
|
10 | export type DisposableAsyncExecutor<TBaseContext = Record<string, any>, TBaseExtensions = Record<string, any>> = AsyncExecutor<TBaseContext, TBaseExtensions> & {
|
11 | [Symbol.asyncDispose]: () => PromiseLike<void>;
|
12 | };
|
13 | export type DisposableExecutor<TBaseContext = Record<string, any>, TBaseExtensions = Record<string, any>> = DisposableSyncExecutor<TBaseContext, TBaseExtensions> | DisposableAsyncExecutor<TBaseContext, TBaseExtensions>;
|