Skip to content

Commit

Permalink
TS: use proper type for async generator (#3009)
Browse files Browse the repository at this point in the history
  • Loading branch information
saihaj committed Mar 31, 2021
1 parent 9531486 commit ecf732f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion integrationTests/ts/tsconfig.json
@@ -1,7 +1,7 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": ["es6", "esnext.asynciterable"],
"lib": ["es2019", "es2020.string"],
"strict": true,
"noEmit": true,
"types": []
Expand Down
4 changes: 2 additions & 2 deletions src/subscription/mapAsyncIterator.d.ts
Expand Up @@ -5,7 +5,7 @@ import { PromiseOrValue } from '../jsutils/PromiseOrValue';
* which produces values mapped via calling the callback function.
*/
export function mapAsyncIterator<T, U>(
iterable: AsyncIterable<T>,
iterable: AsyncIterable<T> | AsyncGenerator<T, void, void>,
callback: (arg: T) => PromiseOrValue<U>,
rejectCallback?: (arg: any) => PromiseOrValue<U>,
): any; // TS_SPECIFIC: AsyncGenerator requires typescript@3.6
): AsyncGenerator<U, void, void>;
2 changes: 1 addition & 1 deletion src/subscription/subscribe.d.ts
Expand Up @@ -39,7 +39,7 @@ export interface SubscriptionArgs {
*/
export function subscribe(
args: SubscriptionArgs,
): Promise<AsyncIterableIterator<ExecutionResult> | ExecutionResult>;
): Promise<AsyncGenerator<ExecutionResult, void, void> | ExecutionResult>;

/**
* Implements the "CreateSourceEventStream" algorithm described in the
Expand Down

0 comments on commit ecf732f

Please sign in to comment.