@@ -70,8 +70,8 @@ extern {
70
70
extern {
71
71
pub type Array ;
72
72
73
- /// The copyWithin() method shallow copies part of an array to another location in the same
74
- /// array and returns it, without modifying its size.
73
+ /// The copyWithin() method shallow copies part of an array to another
74
+ /// location in the same array and returns it, without modifying its size.
75
75
///
76
76
/// http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/copyWithin
77
77
#[ wasm_bindgen( method, js_name = copyWithin) ]
@@ -84,29 +84,31 @@ extern {
84
84
#[ wasm_bindgen( method) ]
85
85
pub fn concat ( this : & Array , array : & Array ) -> Array ;
86
86
87
- /// The fill() method fills all the elements of an array from a start index to an
88
- /// end index with a static value. The end index is not included.
87
+ /// The fill() method fills all the elements of an array from a start index
88
+ /// to an end index with a static value. The end index is not included.
89
89
///
90
90
/// http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/fill
91
91
#[ wasm_bindgen( method) ]
92
92
pub fn fill ( this : & Array , value : JsValue , start : u32 , end : u32 ) -> Array ;
93
93
94
- /// The length property of an object which is an instance of type Array sets or returns the number of elements in that array.
95
- /// The value is an unsigned, 32-bit integer that is always numerically greater than the highest index in the array.
94
+ /// The length property of an object which is an instance of type Array
95
+ /// sets or returns the number of elements in that array. The value is an
96
+ /// unsigned, 32-bit integer that is always numerically greater than the
97
+ /// highest index in the array.
96
98
///
97
99
/// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/length
98
100
#[ wasm_bindgen( method, getter, structural) ]
99
101
pub fn length ( this : & Array ) -> u32 ;
100
102
101
- /// The indexOf() method returns the first index at which a given element can be
102
- /// found in the array, or -1 if it is not present.
103
+ /// The indexOf() method returns the first index at which a given element
104
+ /// can be found in the array, or -1 if it is not present.
103
105
///
104
106
/// http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf
105
107
#[ wasm_bindgen( method, js_name = indexOf) ]
106
108
pub fn index_of ( this : & Array , value : JsValue , from_index : i32 ) -> i32 ;
107
109
108
- /// The includes() method determines whether an array includes a certain element,
109
- /// returning true or false as appropriate.
110
+ /// The includes() method determines whether an array includes a certain
111
+ /// element, returning true or false as appropriate.
110
112
///
111
113
/// http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/includes
112
114
#[ wasm_bindgen( method) ]
@@ -119,45 +121,45 @@ extern {
119
121
#[ wasm_bindgen( method) ]
120
122
pub fn join ( this : & Array , delimiter : & str ) -> JsString ;
121
123
122
- /// The lastIndexOf() method returns the last index at which a given element can
123
- /// be found in the array, or -1 if it is not present. The array is searched
124
- /// backwards, starting at fromIndex.
124
+ /// The lastIndexOf() method returns the last index at which a given element
125
+ /// can be found in the array, or -1 if it is not present. The array is
126
+ /// searched backwards, starting at fromIndex.
125
127
///
126
128
/// http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/lastIndexOf
127
129
#[ wasm_bindgen( method, js_name = lastIndexOf) ]
128
130
pub fn last_index_of ( this : & Array , value : JsValue , from_index : i32 ) -> i32 ;
129
131
130
- /// The pop() method removes the last element from an array and returns that element.
131
- /// This method changes the length of the array.
132
+ /// The pop() method removes the last element from an array and returns that
133
+ /// element. This method changes the length of the array.
132
134
///
133
135
/// http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/pop
134
136
#[ wasm_bindgen( method) ]
135
137
pub fn pop ( this : & Array ) -> JsValue ;
136
138
137
- /// The push() method adds one or more elements to the end of an array and returns
138
- /// the new length of the array.
139
+ /// The push() method adds one or more elements to the end of an array and
140
+ /// returns the new length of the array.
139
141
///
140
142
/// http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/push
141
143
#[ wasm_bindgen( method) ]
142
144
pub fn push ( this : & Array , value : JsValue ) -> u32 ;
143
145
144
- /// The reverse() method reverses an array in place.
145
- /// The first array element becomes the last, and the last array element becomes the first.
146
+ /// The reverse() method reverses an array in place. The first array
147
+ /// element becomes the last, and the last array element becomes the first.
146
148
///
147
149
/// http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reverse
148
150
#[ wasm_bindgen( method) ]
149
151
pub fn reverse ( this : & Array ) -> Array ;
150
152
151
- /// The slice() method returns a shallow copy of a portion of an array into a new array
152
- /// object selected from begin to end (end not included).
153
+ /// The slice() method returns a shallow copy of a portion of an array into
154
+ /// a new array object selected from begin to end (end not included).
153
155
/// The original array will not be modified.
154
156
///
155
157
/// http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice
156
158
#[ wasm_bindgen( method) ]
157
159
pub fn slice ( this : & Array , start : u32 , end : u32 ) -> Array ;
158
160
159
- /// The shift() method removes the first element from an array and returns that removed element.
160
- /// This method changes the length of the array.
161
+ /// The shift() method removes the first element from an array and returns
162
+ /// that removed element. This method changes the length of the array.
161
163
///
162
164
/// http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/shift
163
165
#[ wasm_bindgen( method) ]
@@ -174,14 +176,15 @@ extern {
174
176
#[ wasm_bindgen( method) ]
175
177
pub fn sort ( this : & Array ) -> Array ;
176
178
177
- /// The toString() method returns a string representing the specified array and its elements.
179
+ /// The toString() method returns a string representing the specified array
180
+ /// and its elements.
178
181
///
179
182
/// http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toString
180
183
#[ wasm_bindgen( method, js_name = toString) ]
181
184
pub fn to_string ( this : & Array ) -> JsString ;
182
185
183
- /// The unshift() method adds one or more elements to the beginning of an array
184
- /// and returns the new length of the array.
186
+ /// The unshift() method adds one or more elements to the beginning of an
187
+ /// array and returns the new length of the array.
185
188
///
186
189
/// http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/unshift
187
190
#[ wasm_bindgen( method) ]
@@ -193,13 +196,15 @@ extern {
193
196
extern {
194
197
pub type ArrayIterator ;
195
198
196
- /// The keys() method returns a new Array Iterator object that contains the keys for each index in the array.
199
+ /// The keys() method returns a new Array Iterator object that contains the
200
+ /// keys for each index in the array.
197
201
///
198
202
/// http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/keys
199
203
#[ wasm_bindgen( method) ]
200
204
pub fn keys ( this : & Array ) -> ArrayIterator ;
201
205
202
- /// The entries() method returns a new Array Iterator object that contains the key/value pairs for each index in the array.
206
+ /// The entries() method returns a new Array Iterator object that contains
207
+ /// the key/value pairs for each index in the array.
203
208
///
204
209
/// http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/entries
205
210
#[ wasm_bindgen( method) ]
@@ -217,14 +222,101 @@ extern {
217
222
#[ wasm_bindgen( method, getter, structural) ]
218
223
pub fn length ( this : & JsFunction ) -> u32 ;
219
224
220
- /// A Function object's read-only name property indicates the function's name as specified when it was created
221
- /// or "anonymous" for functions created anonymously.
225
+ /// A Function object's read-only name property indicates the function's
226
+ /// name as specified when it was created or "anonymous" for functions
227
+ /// created anonymously.
222
228
///
223
229
/// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/name
224
230
#[ wasm_bindgen( method, getter, structural) ]
225
231
pub fn name ( this : & JsFunction ) -> JsString ;
226
232
}
227
233
234
+ // Math
235
+ #[ wasm_bindgen]
236
+ extern {
237
+ pub type Math ;
238
+ /// The Math.abs() function returns the absolute value of a number, that is
239
+ /// Math.abs(x) = |x|
240
+ ///
241
+ /// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/abs
242
+ #[ wasm_bindgen( static_method_of = Math ) ]
243
+ pub fn abs ( number : i32 ) -> Number ;
244
+
245
+ /// The Math.acos() function returns the arccosine (in radians) of a
246
+ /// number, that is ∀x∊[-1;1]
247
+ /// Math.acos(x) = arccos(x) = the unique y∊[0;π] such that cos(y)=x
248
+ ///
249
+ /// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/acos
250
+ #[ wasm_bindgen( static_method_of = Math ) ]
251
+ pub fn acos ( adjacent : i32 , hypotenuse : i32 ) -> Number ;
252
+
253
+ /// The Math.acosh() function returns the hyperbolic arc-cosine of a
254
+ /// number, that is ∀x ≥ 1
255
+ /// Math.acosh(x) = arcosh(x) = the unique y ≥ 0 such that cosh(y) = x
256
+ ///
257
+ /// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/acosh
258
+ #[ wasm_bindgen( static_method_of = Math ) ]
259
+ pub fn acosh ( number : i32 ) -> Number ;
260
+
261
+ /// The Math.asin() function returns the arcsine (in radians) of a
262
+ /// number, that is ∀x ∊ [-1;1]
263
+ /// Math.asin(x) = arcsin(x) = the unique y∊[-π2;π2] such that sin(y) = x
264
+ ///
265
+ /// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/asin
266
+ #[ wasm_bindgen( static_method_of = Math ) ]
267
+ pub fn asin ( number : i32 ) -> Number ;
268
+
269
+ /// The Math.asinh() function returns the hyperbolic arcsine of a
270
+ /// number, that is Math.asinh(x) = arsinh(x) = the unique y such that sinh(y) = x
271
+ ///
272
+ /// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/asinh
273
+ #[ wasm_bindgen( static_method_of = Math ) ]
274
+ pub fn asinh ( number : i32 ) -> Number ;
275
+
276
+ /// The Math.atan() function returns the arctangent (in radians) of a
277
+ /// number, that is Math.atan(x) = arctan(x) = the unique y ∊ [-π2;π2]such that
278
+ /// tan(y) = x
279
+ #[ wasm_bindgen( static_method_of = Math ) ]
280
+ pub fn atan ( number : i32 ) -> Number ;
281
+
282
+ /// The Math.atan2() function returns the arctangent of the quotient of
283
+ /// its arguments.
284
+ ///
285
+ /// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/atan2
286
+ #[ wasm_bindgen( static_method_of = Math ) ]
287
+ pub fn atan2 ( y : i32 , x : i32 ) -> Number ;
288
+
289
+ /// The Math.atanh() function returns the hyperbolic arctangent of a number,
290
+ /// that is ∀x ∊ (-1,1), Math.atanh(x) = arctanh(x) = the unique y such that
291
+ /// tanh(y) = x
292
+ ///
293
+ /// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/atanh
294
+ #[ wasm_bindgen( static_method_of = Math ) ]
295
+ pub fn atanh ( x : i32 ) -> Number ;
296
+
297
+
298
+ /// The Math.cbrt() function returns the cube root of a number, that is
299
+ /// Math.cbrt(x) = x^3 = the unique y such that y^3 = x
300
+ ///
301
+ /// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/cbrt
302
+ #[ wasm_bindgen( static_method_of = Math ) ]
303
+ pub fn cbrt ( x : i32 ) -> Number ;
304
+
305
+ /// The Math.ceil() function returns the smallest integer greater than
306
+ /// or equal to a given number.
307
+ ///
308
+ /// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/ceil
309
+ #[ wasm_bindgen( static_method_of = Math ) ]
310
+ pub fn ceil ( x : f32 ) -> Number ;
311
+
312
+ /// The Math.clz32() function returns the number of leading zero bits in
313
+ /// the 32-bit binary representation of a number.
314
+ ///
315
+ /// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/clz32
316
+ #[ wasm_bindgen( static_method_of = Math ) ]
317
+ pub fn clz32 ( x : i32 ) -> Number ;
318
+ }
319
+
228
320
// Number.
229
321
#[ wasm_bindgen]
230
322
extern {
@@ -314,8 +406,8 @@ extern {
314
406
pub fn property_is_enumerable ( this : & Object , property : & JsValue ) -> bool ;
315
407
316
408
/// The toLocaleString() method returns a string representing the object.
317
- /// This method is meant to be overridden by derived objects for locale-specific
318
- /// purposes.
409
+ /// This method is meant to be overridden by derived objects for
410
+ /// locale-specific purposes.
319
411
///
320
412
/// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/toLocaleString
321
413
#[ wasm_bindgen( method, js_name = toLocaleString) ]
0 commit comments