Software /
code /
prosody
Comparison
teal-src/util/promise.d.tl @ 12612:588b1d175838
util.promise: Add Teal interface specification file
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sun, 24 Jul 2022 21:25:41 +0200 |
comparison
equal
deleted
inserted
replaced
12611:33b7e7bd83fd | 12612:588b1d175838 |
---|---|
1 | |
2 local record lib | |
3 type resolve_func = function (any) | |
4 type promise_body = function (resolve_func, resolve_func) | |
5 | |
6 record Promise<A, B> | |
7 type on_resolved = function (A) : any | |
8 type on_rejected = function (B) : any | |
9 next : function (Promise, on_resolved, on_rejected) : Promise<any, any> | |
10 end | |
11 | |
12 new : function (promise_body) : Promise | |
13 resolve : function (any) : Promise | |
14 reject : function (any) : Promise | |
15 all : function ({ Promise }) : Promise | |
16 all_settled : function ({ Promise }) : Promise | |
17 race : function ({ Promise }) : Promise | |
18 try : function | |
19 is_promise : function(any) : boolean | |
20 end | |
21 | |
22 return lib |