@@ -127,7 +127,7 @@ extern "C" {
127
127
// Array
128
128
#[ wasm_bindgen]
129
129
extern "C" {
130
- #[ wasm_bindgen( extends = Object , is_type_of = Array :: is_array) ]
130
+ #[ wasm_bindgen( extends = Object , is_type_of = Array :: is_array, typescript_type = "Array<any>" ) ]
131
131
#[ derive( Clone , Debug , PartialEq , Eq ) ]
132
132
pub type Array ;
133
133
@@ -503,7 +503,7 @@ where
503
503
// ArrayBuffer
504
504
#[ wasm_bindgen]
505
505
extern "C" {
506
- #[ wasm_bindgen( extends = Object ) ]
506
+ #[ wasm_bindgen( extends = Object , typescript_type = "ArrayBuffer" ) ]
507
507
#[ derive( Clone , Debug , PartialEq , Eq ) ]
508
508
pub type ArrayBuffer ;
509
509
@@ -553,7 +553,7 @@ extern "C" {
553
553
// SharedArrayBuffer
554
554
#[ wasm_bindgen]
555
555
extern "C" {
556
- #[ wasm_bindgen( extends = Object ) ]
556
+ #[ wasm_bindgen( extends = Object , typescript_type = "SharedArrayBuffer" ) ]
557
557
#[ derive( Clone , Debug ) ]
558
558
pub type SharedArrayBuffer ;
559
559
@@ -769,7 +769,7 @@ pub mod Atomics {
769
769
// Boolean
770
770
#[ wasm_bindgen]
771
771
extern "C" {
772
- #[ wasm_bindgen( extends = Object , is_type_of = |v| v. as_bool( ) . is_some( ) ) ]
772
+ #[ wasm_bindgen( extends = Object , is_type_of = |v| v. as_bool( ) . is_some( ) , typescript_type = "boolean" ) ]
773
773
#[ derive( Clone , PartialEq , Eq ) ]
774
774
pub type Boolean ;
775
775
@@ -817,7 +817,7 @@ impl fmt::Debug for Boolean {
817
817
// DataView
818
818
#[ wasm_bindgen]
819
819
extern "C" {
820
- #[ wasm_bindgen( extends = Object ) ]
820
+ #[ wasm_bindgen( extends = Object , typescript_type = "DataView" ) ]
821
821
#[ derive( Clone , Debug , PartialEq , Eq ) ]
822
822
pub type DataView ;
823
823
@@ -1049,7 +1049,7 @@ extern "C" {
1049
1049
// Error
1050
1050
#[ wasm_bindgen]
1051
1051
extern "C" {
1052
- #[ wasm_bindgen( extends = Object ) ]
1052
+ #[ wasm_bindgen( extends = Object , typescript_type = "Error" ) ]
1053
1053
#[ derive( Clone , Debug , PartialEq , Eq ) ]
1054
1054
pub type Error ;
1055
1055
@@ -1088,7 +1088,7 @@ extern "C" {
1088
1088
// EvalError
1089
1089
#[ wasm_bindgen]
1090
1090
extern "C" {
1091
- #[ wasm_bindgen( extends = Object , extends = Error ) ]
1091
+ #[ wasm_bindgen( extends = Object , extends = Error , typescript_type = "EvalError" ) ]
1092
1092
#[ derive( Clone , Debug , PartialEq , Eq ) ]
1093
1093
pub type EvalError ;
1094
1094
@@ -1104,7 +1104,7 @@ extern "C" {
1104
1104
// Function
1105
1105
#[ wasm_bindgen]
1106
1106
extern "C" {
1107
- #[ wasm_bindgen( extends = Object , is_type_of = JsValue :: is_function) ]
1107
+ #[ wasm_bindgen( extends = Object , is_type_of = JsValue :: is_function, typescript_type = "Function" ) ]
1108
1108
#[ derive( Clone , Debug , PartialEq , Eq ) ]
1109
1109
pub type Function ;
1110
1110
@@ -1253,7 +1253,7 @@ impl Function {
1253
1253
// Generator
1254
1254
#[ wasm_bindgen]
1255
1255
extern "C" {
1256
- #[ wasm_bindgen( extends = Object ) ]
1256
+ #[ wasm_bindgen( extends = Object , typescript_type = "Generator<any, any, any>" ) ]
1257
1257
#[ derive( Clone , Debug , PartialEq , Eq ) ]
1258
1258
pub type Generator ;
1259
1259
@@ -1281,7 +1281,7 @@ extern "C" {
1281
1281
// Map
1282
1282
#[ wasm_bindgen]
1283
1283
extern "C" {
1284
- #[ wasm_bindgen( extends = Object ) ]
1284
+ #[ wasm_bindgen( extends = Object , typescript_type = "Map<any, any>" ) ]
1285
1285
#[ derive( Clone , Debug , PartialEq , Eq ) ]
1286
1286
pub type Map ;
1287
1287
@@ -1374,7 +1374,7 @@ extern "C" {
1374
1374
///
1375
1375
/// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols)
1376
1376
#[ derive( Clone , Debug ) ]
1377
- #[ wasm_bindgen( is_type_of = Iterator :: looks_like_iterator) ]
1377
+ #[ wasm_bindgen( is_type_of = Iterator :: looks_like_iterator, typescript_type = "Iterator<any>" ) ]
1378
1378
pub type Iterator ;
1379
1379
1380
1380
/// The `next()` method always has to return an object with appropriate
@@ -1413,7 +1413,7 @@ extern "C" {
1413
1413
///
1414
1414
/// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for-await...of)
1415
1415
#[ derive( Clone , Debug ) ]
1416
- #[ wasm_bindgen( is_type_of = Iterator :: looks_like_iterator) ]
1416
+ #[ wasm_bindgen( is_type_of = Iterator :: looks_like_iterator, typescript_type = "Iterator<Promise<any>>" ) ]
1417
1417
pub type AsyncIterator ;
1418
1418
1419
1419
/// The `next()` method always has to return a Promise which resolves to an object
@@ -1534,7 +1534,7 @@ extern "C" {
1534
1534
/// The result of calling `next()` on a JS iterator.
1535
1535
///
1536
1536
/// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols)
1537
- #[ wasm_bindgen( extends = Object ) ]
1537
+ #[ wasm_bindgen( extends = Object , typescript_type = "IteratorResult<any>" ) ]
1538
1538
#[ derive( Clone , Debug , PartialEq , Eq ) ]
1539
1539
pub type IteratorNext ;
1540
1540
@@ -1806,7 +1806,7 @@ pub mod Math {
1806
1806
// Number.
1807
1807
#[ wasm_bindgen]
1808
1808
extern "C" {
1809
- #[ wasm_bindgen( extends = Object , is_type_of = |v| v. as_f64( ) . is_some( ) ) ]
1809
+ #[ wasm_bindgen( extends = Object , is_type_of = |v| v. as_f64( ) . is_some( ) , typescript_type = "number" ) ]
1810
1810
#[ derive( Clone ) ]
1811
1811
pub type Number ;
1812
1812
@@ -1974,7 +1974,7 @@ impl fmt::Debug for Number {
1974
1974
// Date.
1975
1975
#[ wasm_bindgen]
1976
1976
extern "C" {
1977
- #[ wasm_bindgen( extends = Object ) ]
1977
+ #[ wasm_bindgen( extends = Object , typescript_type = "Date" ) ]
1978
1978
#[ derive( Clone , Debug , PartialEq , Eq ) ]
1979
1979
pub type Date ;
1980
1980
@@ -2416,6 +2416,7 @@ extern "C" {
2416
2416
// Object.
2417
2417
#[ wasm_bindgen]
2418
2418
extern "C" {
2419
+ #[ wasm_bindgen( typescript_type = "object" ) ]
2419
2420
#[ derive( Clone , Debug ) ]
2420
2421
pub type Object ;
2421
2422
@@ -2683,6 +2684,7 @@ impl Eq for Object {}
2683
2684
// Proxy
2684
2685
#[ wasm_bindgen]
2685
2686
extern "C" {
2687
+ #[ wasm_bindgen( typescript_type = "ProxyConstructor" ) ]
2686
2688
#[ derive( Clone , Debug ) ]
2687
2689
pub type Proxy ;
2688
2690
@@ -2709,7 +2711,7 @@ extern "C" {
2709
2711
/// or range of allowed values.
2710
2712
///
2711
2713
/// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RangeError)
2712
- #[ wasm_bindgen( extends = Error , extends = Object ) ]
2714
+ #[ wasm_bindgen( extends = Error , extends = Object , typescript_type = "RangeError" ) ]
2713
2715
#[ derive( Clone , Debug , PartialEq , Eq ) ]
2714
2716
pub type RangeError ;
2715
2717
@@ -2728,7 +2730,7 @@ extern "C" {
2728
2730
/// variable is referenced.
2729
2731
///
2730
2732
/// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ReferenceError)
2731
- #[ wasm_bindgen( extends = Error , extends = Object ) ]
2733
+ #[ wasm_bindgen( extends = Error , extends = Object , typescript_type = "ReferenceError" ) ]
2732
2734
#[ derive( Clone , Debug , PartialEq , Eq ) ]
2733
2735
pub type ReferenceError ;
2734
2736
@@ -2919,7 +2921,7 @@ pub mod Reflect {
2919
2921
// RegExp
2920
2922
#[ wasm_bindgen]
2921
2923
extern "C" {
2922
- #[ wasm_bindgen( extends = Object ) ]
2924
+ #[ wasm_bindgen( extends = Object , typescript_type = "RegExp" ) ]
2923
2925
#[ derive( Clone , Debug , PartialEq , Eq ) ]
2924
2926
pub type RegExp ;
2925
2927
@@ -3096,7 +3098,7 @@ extern "C" {
3096
3098
// Set
3097
3099
#[ wasm_bindgen]
3098
3100
extern "C" {
3099
- #[ wasm_bindgen( extends = Object ) ]
3101
+ #[ wasm_bindgen( extends = Object , typescript_type = "Set<any>" ) ]
3100
3102
#[ derive( Clone , Debug , PartialEq , Eq ) ]
3101
3103
pub type Set ;
3102
3104
@@ -3186,7 +3188,7 @@ extern "C" {
3186
3188
/// parsing code.
3187
3189
///
3188
3190
/// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SyntaxError)
3189
- #[ wasm_bindgen( extends = Error , extends = Object ) ]
3191
+ #[ wasm_bindgen( extends = Error , extends = Object , typescript_type = "SyntaxError" ) ]
3190
3192
#[ derive( Clone , Debug , PartialEq , Eq ) ]
3191
3193
pub type SyntaxError ;
3192
3194
@@ -3206,7 +3208,7 @@ extern "C" {
3206
3208
/// expected type.
3207
3209
///
3208
3210
/// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypeError)
3209
- #[ wasm_bindgen( extends = Error , extends = Object ) ]
3211
+ #[ wasm_bindgen( extends = Error , extends = Object , typescript_type = "TypeError" ) ]
3210
3212
#[ derive( Clone , Debug , PartialEq , Eq ) ]
3211
3213
pub type TypeError ;
3212
3214
@@ -3225,7 +3227,7 @@ extern "C" {
3225
3227
/// function was used in a wrong way.
3226
3228
///
3227
3229
/// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/URIError)
3228
- #[ wasm_bindgen( extends = Error , extends = Object , js_name = URIError ) ]
3230
+ #[ wasm_bindgen( extends = Error , extends = Object , js_name = URIError , typescript_type = "URIError" ) ]
3229
3231
#[ derive( Clone , Debug , PartialEq , Eq ) ]
3230
3232
pub type UriError ;
3231
3233
@@ -3240,7 +3242,7 @@ extern "C" {
3240
3242
// WeakMap
3241
3243
#[ wasm_bindgen]
3242
3244
extern "C" {
3243
- #[ wasm_bindgen( extends = Object ) ]
3245
+ #[ wasm_bindgen( extends = Object , typescript_type = "WeakMap<object, any>" ) ]
3244
3246
#[ derive( Clone , Debug , PartialEq , Eq ) ]
3245
3247
pub type WeakMap ;
3246
3248
@@ -3284,7 +3286,7 @@ extern "C" {
3284
3286
// WeakSet
3285
3287
#[ wasm_bindgen]
3286
3288
extern "C" {
3287
- #[ wasm_bindgen( extends = Object ) ]
3289
+ #[ wasm_bindgen( extends = Object , typescript_type = "WeakSet<object>" ) ]
3288
3290
#[ derive( Clone , Debug , PartialEq , Eq ) ]
3289
3291
pub type WeakSet ;
3290
3292
@@ -3371,7 +3373,7 @@ pub mod WebAssembly {
3371
3373
/// WebAssembly decoding or validation.
3372
3374
///
3373
3375
/// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/CompileError)
3374
- #[ wasm_bindgen( extends = Error , js_namespace = WebAssembly ) ]
3376
+ #[ wasm_bindgen( extends = Error , js_namespace = WebAssembly , typescript_type = "WebAssembly.CompileError" ) ]
3375
3377
#[ derive( Clone , Debug , PartialEq , Eq ) ]
3376
3378
pub type CompileError ;
3377
3379
@@ -3393,7 +3395,7 @@ pub mod WebAssembly {
3393
3395
/// JavaScript.
3394
3396
///
3395
3397
/// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Instance)
3396
- #[ wasm_bindgen( extends = Object , js_namespace = WebAssembly ) ]
3398
+ #[ wasm_bindgen( extends = Object , js_namespace = WebAssembly , typescript_type = "WebAssembly.Instance" ) ]
3397
3399
#[ derive( Clone , Debug , PartialEq , Eq ) ]
3398
3400
pub type Instance ;
3399
3401
@@ -3424,7 +3426,7 @@ pub mod WebAssembly {
3424
3426
/// instantiation (besides traps from the start function).
3425
3427
///
3426
3428
/// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/LinkError)
3427
- #[ wasm_bindgen( extends = Error , js_namespace = WebAssembly ) ]
3429
+ #[ wasm_bindgen( extends = Error , js_namespace = WebAssembly , typescript_type = "WebAssembly.LinkError" ) ]
3428
3430
#[ derive( Clone , Debug , PartialEq , Eq ) ]
3429
3431
pub type LinkError ;
3430
3432
@@ -3445,7 +3447,7 @@ pub mod WebAssembly {
3445
3447
/// specifies a trap.
3446
3448
///
3447
3449
/// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/RuntimeError)
3448
- #[ wasm_bindgen( extends = Error , js_namespace = WebAssembly ) ]
3450
+ #[ wasm_bindgen( extends = Error , js_namespace = WebAssembly , typescript_type = "WebAssembly.RuntimeError" ) ]
3449
3451
#[ derive( Clone , Debug , PartialEq , Eq ) ]
3450
3452
pub type RuntimeError ;
3451
3453
@@ -3466,7 +3468,7 @@ pub mod WebAssembly {
3466
3468
/// efficiently shared with Workers, and instantiated multiple times.
3467
3469
///
3468
3470
/// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Module)
3469
- #[ wasm_bindgen( js_namespace = WebAssembly , extends = Object ) ]
3471
+ #[ wasm_bindgen( js_namespace = WebAssembly , extends = Object , typescript_type = "WebAssembly.Module" ) ]
3470
3472
#[ derive( Clone , Debug , PartialEq , Eq ) ]
3471
3473
pub type Module ;
3472
3474
@@ -3508,7 +3510,7 @@ pub mod WebAssembly {
3508
3510
/// of the given size and element type.
3509
3511
///
3510
3512
/// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Table)
3511
- #[ wasm_bindgen( js_namespace = WebAssembly , extends = Object ) ]
3513
+ #[ wasm_bindgen( js_namespace = WebAssembly , extends = Object , typescript_type = "WebAssembly.Table" ) ]
3512
3514
#[ derive( Clone , Debug , PartialEq , Eq ) ]
3513
3515
pub type Table ;
3514
3516
@@ -3554,7 +3556,7 @@ pub mod WebAssembly {
3554
3556
#[ wasm_bindgen]
3555
3557
extern "C" {
3556
3558
/// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Memory)
3557
- #[ wasm_bindgen( js_namespace = WebAssembly , extends = Object ) ]
3559
+ #[ wasm_bindgen( js_namespace = WebAssembly , extends = Object , typescript_type = "WebAssembly.Memory" ) ]
3558
3560
#[ derive( Clone , Debug , PartialEq , Eq ) ]
3559
3561
pub type Memory ;
3560
3562
@@ -3659,7 +3661,7 @@ pub mod JSON {
3659
3661
// JsString
3660
3662
#[ wasm_bindgen]
3661
3663
extern "C" {
3662
- #[ wasm_bindgen( js_name = String , extends = Object , is_type_of = JsValue :: is_string) ]
3664
+ #[ wasm_bindgen( js_name = String , extends = Object , is_type_of = JsValue :: is_string, typescript_type = "string" ) ]
3663
3665
#[ derive( Clone , PartialEq , Eq ) ]
3664
3666
pub type JsString ;
3665
3667
@@ -4261,7 +4263,7 @@ impl fmt::Debug for JsString {
4261
4263
// Symbol
4262
4264
#[ wasm_bindgen]
4263
4265
extern "C" {
4264
- #[ wasm_bindgen( is_type_of = JsValue :: is_symbol) ]
4266
+ #[ wasm_bindgen( is_type_of = JsValue :: is_symbol, typescript_type = "Symbol" ) ]
4265
4267
#[ derive( Clone , Debug ) ]
4266
4268
pub type Symbol ;
4267
4269
@@ -4417,7 +4419,7 @@ pub mod Intl {
4417
4419
/// that enable language sensitive string comparison.
4418
4420
///
4419
4421
/// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Collator)
4420
- #[ wasm_bindgen( extends = Object , js_namespace = Intl ) ]
4422
+ #[ wasm_bindgen( extends = Object , js_namespace = Intl , typescript_type = "Intl.Collator" ) ]
4421
4423
#[ derive( Clone , Debug ) ]
4422
4424
pub type Collator ;
4423
4425
@@ -4461,7 +4463,7 @@ pub mod Intl {
4461
4463
/// that enable language-sensitive date and time formatting.
4462
4464
///
4463
4465
/// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat)
4464
- #[ wasm_bindgen( extends = Object , js_namespace = Intl ) ]
4466
+ #[ wasm_bindgen( extends = Object , js_namespace = Intl , typescript_type = "Intl.DateTimeFormat" ) ]
4465
4467
#[ derive( Clone , Debug ) ]
4466
4468
pub type DateTimeFormat ;
4467
4469
@@ -4512,7 +4514,7 @@ pub mod Intl {
4512
4514
/// that enable language sensitive number formatting.
4513
4515
///
4514
4516
/// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/NumberFormat)
4515
- #[ wasm_bindgen( extends = Object , js_namespace = Intl ) ]
4517
+ #[ wasm_bindgen( extends = Object , js_namespace = Intl , typescript_type = "Intl.NumberFormat" ) ]
4516
4518
#[ derive( Clone , Debug ) ]
4517
4519
pub type NumberFormat ;
4518
4520
@@ -4562,7 +4564,7 @@ pub mod Intl {
4562
4564
/// that enable plural sensitive formatting and plural language rules.
4563
4565
///
4564
4566
/// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/PluralRules)
4565
- #[ wasm_bindgen( extends = Object , js_namespace = Intl ) ]
4567
+ #[ wasm_bindgen( extends = Object , js_namespace = Intl , typescript_type = "Intl.PluralRules" ) ]
4566
4568
#[ derive( Clone , Debug ) ]
4567
4569
pub type PluralRules ;
4568
4570
@@ -4606,7 +4608,7 @@ extern "C" {
4606
4608
///
4607
4609
/// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)
4608
4610
#[ must_use]
4609
- #[ wasm_bindgen( extends = Object ) ]
4611
+ #[ wasm_bindgen( extends = Object , typescript_type = "Promise<any>" ) ]
4610
4612
#[ derive( Clone , Debug ) ]
4611
4613
pub type Promise ;
4612
4614
@@ -4784,7 +4786,7 @@ macro_rules! arrays {
4784
4786
( $( #[ doc = $ctor: literal] #[ doc = $mdn: literal] $name: ident: $ty: ident, ) * ) => ( $(
4785
4787
#[ wasm_bindgen]
4786
4788
extern "C" {
4787
- #[ wasm_bindgen( extends = Object ) ]
4789
+ #[ wasm_bindgen( extends = Object , typescript_type = $name ) ]
4788
4790
#[ derive( Clone , Debug ) ]
4789
4791
pub type $name;
4790
4792
0 commit comments