Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TS: use proper type for async generator #3009

Merged
merged 2 commits into from Mar 31, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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