mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-06-23 01:31:34 +00:00
40
src/js.rs
40
src/js.rs
@ -579,6 +579,46 @@ extern {
|
||||
pub fn value_of(this: &Object) -> Object;
|
||||
}
|
||||
|
||||
// WeakMap
|
||||
#[wasm_bindgen]
|
||||
extern {
|
||||
pub type WeakMap;
|
||||
|
||||
/// The WeakMap object is a collection of key/value pairs in which the keys are weakly referenced.
|
||||
/// The keys must be objects and the values can be arbitrary values.
|
||||
///
|
||||
/// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap
|
||||
#[wasm_bindgen(constructor)]
|
||||
pub fn new() -> WeakMap;
|
||||
|
||||
/// The set() method sets the value for the key in the WeakMap object. Returns
|
||||
/// the WeakMap object.
|
||||
///
|
||||
/// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap/set
|
||||
#[wasm_bindgen(method, js_class="WeakMap")]
|
||||
pub fn set(this: &WeakMap, key: Object, value: JsValue) -> WeakMap;
|
||||
|
||||
/// The get() method returns a specified by key element
|
||||
/// from a WeakMap object.
|
||||
///
|
||||
/// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap/get
|
||||
#[wasm_bindgen(method)]
|
||||
pub fn get(this: &WeakMap, key: Object) -> JsValue;
|
||||
|
||||
/// The has() method returns a boolean indicating whether an element with
|
||||
/// the specified key exists in the WeakMap object or not.
|
||||
///
|
||||
/// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap/has
|
||||
#[wasm_bindgen(method)]
|
||||
pub fn has(this: &WeakMap, key: Object) -> bool;
|
||||
|
||||
/// The delete() method removes the specified element from a WeakMap object.
|
||||
///
|
||||
/// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap/delete
|
||||
#[wasm_bindgen(method)]
|
||||
pub fn delete(this: &WeakMap, key: Object) -> bool;
|
||||
}
|
||||
|
||||
// JsString
|
||||
#[wasm_bindgen]
|
||||
extern {
|
||||
|
Reference in New Issue
Block a user