Skip to content

Commit 53deacf

Browse files
committed
fix(cloud): async iterators
... with eslint
1 parent 9c251db commit 53deacf

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

types/wx/lib.wx.cloud.d.ts

+8-4
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2020
SOFTWARE.
2121
***************************************************************************** */
2222

23+
/// <reference lib="es2018.asynciterable" />
24+
2325
/**
2426
* Common interfaces and types
2527
*/
@@ -261,7 +263,7 @@ declare namespace ICloud {
261263
sendMessage: (options: ICloudAICallbackOptions & ICloudBotOptions) => Promise<ICloudAIStreamResult>
262264
}
263265

264-
interface ICloudBotOptions { data: any; botId: string; timeout?: number }
266+
interface ICloudBotOptions { data: any, botId: string, timeout?: number }
265267
interface ICloudAIModel {
266268
streamText: (opts: ICloudAIOptions & ICloudAICallbackOptions) => Promise<ICloudAIStreamResult>
267269
generateText: (opts: ICloudAIOptions & ICloudAICallbackOptions) => Promise<string>
@@ -285,10 +287,12 @@ declare namespace ICloud {
285287
data: string
286288
json?: any
287289
}
290+
288291
interface AsyncIterator<T> {
289-
next(value?: any): Promise<IteratorResult<T>>;
290-
return?(value?: any): Promise<IteratorResult<T>>;
291-
throw?(e?: any): Promise<IteratorResult<T>>;
292+
next(value?: any): Promise<IteratorResult<T>>
293+
return?(value?: any): Promise<IteratorResult<T>>
294+
throw?(e?: any): Promise<IteratorResult<T>>
295+
[Symbol.asyncIterator](): AsyncIterableIterator<T>
292296
}
293297
interface ICloudAIStreamResult {
294298
textStream: AsyncIterator<string>

0 commit comments

Comments
 (0)