# Interface AsyncGenerator<T, TReturn, TNext>

interface AsyncGenerator<T, TReturn, TNext> {
[asyncIterator](): AsyncGenerator<T, TReturn, TNext>;
next(...args): Promise<IteratorResult<T, TReturn>>;
return(value): Promise<IteratorResult<T, TReturn>>;
throw(e): Promise<IteratorResult<T, TReturn>>;
}

#### Type Parameters

- T = unknown
- TReturn = any
- TNext = unknown

#### Hierarchy (view full)

- AsyncIterator<T, TReturn, TNext>
  - AsyncGenerator

- Defined in node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts:21

#####
Index

### Methods

[asyncIterator]
next
return
throw

## Methods

### [asyncIterator]

- [asyncIterator](): AsyncGenerator<T, TReturn, TNext>

- #### Returns AsyncGenerator<T, TReturn, TNext>

  - Defined in node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts:26

### next

- next(...args): Promise<IteratorResult<T, TReturn>>

- #### Parameters

  - `Rest` ...args: [] | [TNext]

  #### Returns Promise<IteratorResult<T, TReturn>>

  Overrides AsyncIterator.next

  - Defined in node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts:23

### return

- return(value): Promise<IteratorResult<T, TReturn>>

- #### Parameters

  - value: TReturn | PromiseLike<TReturn>

  #### Returns Promise<IteratorResult<T, TReturn>>

  Overrides AsyncIterator.return

  - Defined in node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts:24

### throw

- throw(e): Promise<IteratorResult<T, TReturn>>

- #### Parameters

  - e: any

  #### Returns Promise<IteratorResult<T, TReturn>>

  Overrides AsyncIterator.throw

  - Defined in node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts:25