CoolFace
Apppublic

Pinsave/counterstrike

sourceHugging Faceupdated 3mo agoView on Hugging Face
1likes
lib.es2018.asyncgenerator.d.ts78 linesDownload Raw Back to lib
1/*! *****************************************************************************2Copyright (c) Microsoft Corporation. All rights reserved.3Licensed under the Apache License, Version 2.0 (the "License"); you may not use4this file except in compliance with the License. You may obtain a copy of the5License at http://www.apache.org/licenses/LICENSE-2.06 7THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY8KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED9WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,10MERCHANTABLITY OR NON-INFRINGEMENT.11 12See the Apache Version 2.0 License for specific language governing permissions13and limitations under the License.14***************************************************************************** */15 16 17/// <reference no-default-lib="true"/>18 19/// <reference lib="es2018.asynciterable" />20 21interface AsyncGenerator<T = unknown, TReturn = any, TNext = any> extends AsyncIteratorObject<T, TReturn, TNext> {22    // NOTE: 'next' is defined using a tuple to ensure we report the correct assignability errors in all places.23    next(...[value]: [] | [TNext]): Promise<IteratorResult<T, TReturn>>;24    return(value: TReturn | PromiseLike<TReturn>): Promise<IteratorResult<T, TReturn>>;25    throw(e: any): Promise<IteratorResult<T, TReturn>>;26    [Symbol.asyncIterator](): AsyncGenerator<T, TReturn, TNext>;27}28 29interface AsyncGeneratorFunction {30    /**31     * Creates a new AsyncGenerator object.32     * @param args A list of arguments the function accepts.33     */34    new (...args: any[]): AsyncGenerator;35    /**36     * Creates a new AsyncGenerator object.37     * @param args A list of arguments the function accepts.38     */39    (...args: any[]): AsyncGenerator;40    /**41     * The length of the arguments.42     */43    readonly length: number;44    /**45     * Returns the name of the function.46     */47    readonly name: string;48    /**49     * A reference to the prototype.50     */51    readonly prototype: AsyncGenerator;52}53 54interface AsyncGeneratorFunctionConstructor {55    /**56     * Creates a new AsyncGenerator function.57     * @param args A list of arguments the function accepts.58     */59    new (...args: string[]): AsyncGeneratorFunction;60    /**61     * Creates a new AsyncGenerator function.62     * @param args A list of arguments the function accepts.63     */64    (...args: string[]): AsyncGeneratorFunction;65    /**66     * The length of the arguments.67     */68    readonly length: number;69    /**70     * Returns the name of the function.71     */72    readonly name: string;73    /**74     * A reference to the prototype.75     */76    readonly prototype: AsyncGeneratorFunction;77}78