@@ -3005,6 +3005,44 @@ pub mod WebAssembly {
3005
3005
#[ wasm_bindgen( method, getter, js_namespace = WebAssembly ) ]
3006
3006
pub fn length ( this : & Table ) -> u32 ;
3007
3007
}
3008
+
3009
+ // WebAssembly.Memory
3010
+ #[ wasm_bindgen]
3011
+ extern "C" {
3012
+ /// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Memory
3013
+ #[ wasm_bindgen( js_namespace = WebAssembly , extends = Object ) ]
3014
+ #[ derive( Clone , Debug ) ]
3015
+ pub type Memory ;
3016
+
3017
+ /// The `WebAssembly.Memory()` constructor creates a new `Memory` object
3018
+ /// which is a resizable `ArrayBuffer` that holds the raw bytes of
3019
+ /// memory accessed by a WebAssembly `Instance`.
3020
+ ///
3021
+ /// A memory created by JavaScript or in WebAssembly code will be
3022
+ /// accessible and mutable from both JavaScript and WebAssembly.
3023
+ ///
3024
+ /// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Memory
3025
+ #[ wasm_bindgen( constructor, js_namespace = WebAssembly , catch) ]
3026
+ pub fn new ( descriptor : & Object ) -> Result < Memory , JsValue > ;
3027
+
3028
+ /// An accessor property that returns the buffer contained in the
3029
+ /// memory.
3030
+ ///
3031
+ /// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Memory/buffer
3032
+ #[ wasm_bindgen( method, getter, js_namespace = WebAssembly ) ]
3033
+ pub fn buffer ( this : & Memory ) -> JsValue ;
3034
+
3035
+ /// The `grow()` protoype method of the `Memory` object increases the
3036
+ /// size of the memory instance by a specified number of WebAssembly
3037
+ /// pages.
3038
+ ///
3039
+ /// Takes the number of pages to grow (64KiB in size) and returns the
3040
+ /// previous size of memory, in pages.
3041
+ ///
3042
+ /// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Memory/grow
3043
+ #[ wasm_bindgen( method, js_namespace = WebAssembly ) ]
3044
+ pub fn grow ( this : & Memory , pages : u32 ) -> u32 ;
3045
+ }
3008
3046
}
3009
3047
3010
3048
// JSON
0 commit comments