@types/regenerator-runtime
- Version 0.13.8
- Published
- 9.56 kB
- No dependencies
- MIT license
Install
npm i @types/regenerator-runtime
yarn add @types/regenerator-runtime
pnpm add @types/regenerator-runtime
Overview
TypeScript definitions for regenerator-runtime
Index
Functions
Classes
Interfaces
Type Aliases
Functions
function async
async: { <T = undefined, TYield = unknown, TReturn = unknown>( innerFn: InnerFunction<T, TYield, TReturn>, outerFn: GeneratorFunction, self?: T, tryLocsList?: TryLocationsList, PromiseImpl?: ResolvablePromiseConstructorLike ): AsyncIterator< TYield extends PromiseLike<infer Await> ? Await : Exclude<TYield, awrap<unknown>>, TReturn extends PromiseLike<infer Await> ? Await : Exclude<TReturn, awrap<unknown>>, unknown >; <T = undefined, TReturn = unknown>( innerFn: InnerFunction<T, unknown, TReturn, unknown>, outerFn?: Function, self?: T, tryLocsList?: TryLocationsList, PromiseImpl?: ResolvablePromiseConstructorLike ): Promise<TReturn extends PromiseLike<infer Await> ? Await : TReturn>;};
function awrap
awrap: typeof awrap;
function isGeneratorFunction
isGeneratorFunction: (func: unknown) => func is GeneratorFunction;
function keys
keys: (object: {}) => () => IteratorResult<string, undefined>;
function mark
mark: <F extends Function>(genFun: F) => F & GeneratorFunction;
function values
values: { <I extends Iterator<unknown, unknown, unknown>>(iterable: { [Symbol.iterator](): I; }): I; <T>(iterableOrArrayLike: Iterable<T> | ArrayLike<T>): Iterator< T, unknown, unknown >;};
function wrap
wrap: <T = undefined, TYield = unknown, TReturn = unknown, TNext = unknown>( innerFn: InnerFunction<T, TYield, TReturn, TNext>, outerFn?: Function | null, self?: T, tryLocsList?: TryLocationsList) => Generator<TYield, TReturn, TNext>;
Classes
class AsyncIterator
class AsyncIterator<TYield = unknown, TReturn = unknown, TNext = unknown> implements globalThis.AsyncIterator<TYield, TReturn, TNext> {}
constructor
constructor( generator: Generator< TYield | awrap<unknown> | PromiseLike<TYield>, TReturn | awrap<unknown> | PromiseLike<TReturn>, unknown >, PromiseImpl: ResolvablePromiseConstructorLike);
method [Symbol.asyncIterator]
[Symbol.asyncIterator]: () => this;
method next
next: (...args: [] | [TNext]) => Promise<IteratorResult<TYield, TReturn>>;
method return
return: ( value: TReturn | PromiseLike<TReturn>) => Promise<IteratorResult<TYield, TReturn>>;
method throw
throw: (e: any) => Promise<IteratorResult<TYield, TReturn>>;
class awrap
class awrap<V> {}
constructor
constructor(arg: {});
Interfaces
interface CompletionRecord
interface CompletionRecord {}
interface Context
interface Context<TYield = unknown, TReturn = unknown, TNext = unknown> {}
property arg
arg: unknown;
The argument passed to the generator method.
property delegate
delegate: DelegatedIterator | undefined;
If truthy, then it contains information about the currently
yield*
delegated iterator.
property done
done: boolean;
Whether the generator has finished.
property method
method: 'next' | 'return' | 'throw';
The generator method.
property next
next: number | 'end';
The label of the next location, is set to
'end'
when the generator needs to close abruptly.
property prev
prev: unknown;
The label of the previous location, needs to be set to
next
at the start of user code.
property rval
rval: TReturn;
The return value, set by
abrupt("return")
.
property sent
sent: TNext;
The value passed to
next()
.
property tryEntries
readonly tryEntries: readonly [ { readonly tryLoc: 'root' } & Omit<TryEntry, 'tryLoc'>, ...TryEntry[]];
method abrupt
abrupt: { (type: 'return', rval?: TReturn): unknown; (type: 'throw', exception?: unknown): never; (type: 'break' | 'continue', nextLoc: number): unknown; (type: CompletionType, arg?: unknown): unknown;};
Parameter type
The completion type.
Parameter rval
The return value.
Parameter type
The completion type.
Parameter exception
The exception to throw.
Parameter type
The completion type.
Parameter nextLoc
The location label to resume iteration at.
Parameter type
The completion type.
Parameter arg
The [[Value]] or [[Target]] of the completion record.
method catch
catch: (tryLoc: number) => unknown;
Used to obtain the exception that was thrown in the associated try block.
Parameter tryLoc
The label of the beginning of the try block.
method complete
complete: ( record: Readonly<CompletionRecord>, afterLoc?: ContextLocation) => unknown;
Parameter record
The completion record.
Parameter afterLoc
The location to resume the generator at, only used by normal completions.
method delegateYield
delegateYield: ( iterable: { [Symbol.iterator](): Iterator<TYield, unknown, unknown> }, resultName: string, nextLoc: ContextLocation) => unknown;
Parameter iterable
The iterable to delegate to.
Parameter resultName
The name of the property to assign to on this context.
Parameter nextLoc
The label of the location where to resume iteration.
method dispatchException
dispatchException: (exception: unknown) => boolean;
Dispatches an exception to
innerFn
Parameter exception
The exception to dispatch.
method finish
finish: (finallyLoc: number) => unknown;
Used to signify the end of a finally block.
Parameter finallyLoc
The label of the beginning of the finally block.
method reset
reset: (skipTempReset?: boolean) => void;
method stop
stop: () => TReturn;
Ends the iteration.
index signature
[ /** * Expects properties to match `/^t[+-]?\d*(?:(?<=\d)\.\d*|\.\d+)?(?:e[+-]?\d+)?$/`. */ temp: string]: any;
interface DelegatedIterator
interface DelegatedIterator {}
property iterator
iterator: Iterator<unknown, unknown, unknown>;
interface ResolvablePromiseConstructorLike
interface ResolvablePromiseConstructorLike extends PromiseConstructorLike {}
method resolve
resolve: <T = void>(value?: T) => PromiseLike<T>;
interface TryEntry
interface TryEntry {}
property afterLoc
readonly afterLoc?: ContextLocation | undefined;
property catchLoc
readonly catchLoc?: number | undefined;
property completion
completion?: CompletionRecord | undefined;
property finallyLoc
readonly finallyLoc?: number | undefined;
property tryLoc
readonly tryLoc: number;
Type Aliases
type CompletionType
type CompletionType = 'normal' | 'return' | 'throw' | 'break' | 'continue';
type ContextLocation
type ContextLocation = number | 'end';
type InnerFunction
type InnerFunction< T = undefined, TYield = unknown, TReturn = unknown, TNext = unknown> = (this: T, context: Context<TYield, TReturn, TNext>) => unknown;
The implementation of the generator.
type TryLocationsList
type TryLocationsList = ReadonlyArray< | readonly [number, number] | readonly [number, number | undefined, number, ContextLocation]>;
Package Files (1)
Dependencies (0)
No dependencies.
Dev Dependencies (0)
No dev dependencies.
Peer Dependencies (0)
No peer dependencies.
Badge
To add a badge like this oneto your package's README, use the codes available below.
You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@types/regenerator-runtime
.
- Markdown[![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/@types/regenerator-runtime)
- HTML<a href="https://www.jsdocs.io/package/@types/regenerator-runtime"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>
- Updated .
Package analyzed in 1605 ms. - Missing or incorrect documentation? Open an issue for this package.