@@ -129,18 +129,22 @@ macro_rules! make_bridge {
129129 self . 0 . run( ) . await . map( SessionTerminationInfo ) . map_err( IronError )
130130 }
131131
132+ #[ wasm_bindgen( js_name = desktopSize) ]
132133 pub fn desktop_size( & self ) -> $crate:: DesktopSize {
133134 self . 0 . desktop_size( )
134135 }
135136
137+ #[ wasm_bindgen( js_name = applyInputs) ]
136138 pub fn apply_inputs( & self , transaction: InputTransaction ) -> Result <( ) , IronError > {
137139 self . 0 . apply_inputs( transaction. 0 ) . map_err( IronError )
138140 }
139141
142+ #[ wasm_bindgen( js_name = releaseAllInputs) ]
140143 pub fn release_all_inputs( & self ) -> Result <( ) , IronError > {
141144 self . 0 . release_all_inputs( ) . map_err( IronError )
142145 }
143146
147+ #[ wasm_bindgen( js_name = synchronizeLockKeys) ]
144148 pub fn synchronize_lock_keys(
145149 & self ,
146150 scroll_lock: bool ,
@@ -157,6 +161,7 @@ macro_rules! make_bridge {
157161 self . 0 . shutdown( ) . map_err( IronError )
158162 }
159163
164+ #[ wasm_bindgen( js_name = onClipboardPaste) ]
160165 pub async fn on_clipboard_paste( & self , content: ClipboardData ) -> Result <( ) , IronError > {
161166 self . 0 . on_clipboard_paste( content. 0 ) . await . map_err( IronError )
162167 }
@@ -173,10 +178,12 @@ macro_rules! make_bridge {
173178 . resize( width, height, scale_factor, physical_width, physical_height) ;
174179 }
175180
181+ #[ wasm_bindgen( js_name = supportsUnicodeKeyboardShortcuts) ]
176182 pub fn supports_unicode_keyboard_shortcuts( & self ) -> bool {
177183 self . 0 . supports_unicode_keyboard_shortcuts( )
178184 }
179185
186+ #[ wasm_bindgen( js_name = extensionCall) ]
180187 pub fn extension_call(
181188 ext: $crate:: Extension ,
182189 ) -> Result <$crate:: internal:: wasm_bindgen:: JsValue , IronError > {
@@ -187,8 +194,9 @@ macro_rules! make_bridge {
187194 #[ $crate:: internal:: wasm_bindgen:: prelude:: wasm_bindgen]
188195 #[ doc( hidden) ]
189196 impl SessionBuilder {
190- pub fn init( ) -> Self {
191- Self ( <<$api as $crate:: RemoteDesktopApi >:: SessionBuilder >:: init( ) )
197+ #[ wasm_bindgen( constructor) ]
198+ pub fn create( ) -> Self {
199+ Self ( <<$api as $crate:: RemoteDesktopApi >:: SessionBuilder >:: create( ) )
192200 }
193201
194202 pub fn username( & self , username: String ) -> Self {
@@ -199,6 +207,7 @@ macro_rules! make_bridge {
199207 Self ( self . 0 . destination( destination) )
200208 }
201209
210+ #[ wasm_bindgen( js_name = serverDomain) ]
202211 pub fn server_domain( & self , server_domain: String ) -> Self {
203212 Self ( self . 0 . server_domain( server_domain) )
204213 }
@@ -207,44 +216,53 @@ macro_rules! make_bridge {
207216 Self ( self . 0 . password( password) )
208217 }
209218
219+ #[ wasm_bindgen( js_name = proxyAddress) ]
210220 pub fn proxy_address( & self , address: String ) -> Self {
211221 Self ( self . 0 . proxy_address( address) )
212222 }
213223
224+ #[ wasm_bindgen( js_name = authToken) ]
214225 pub fn auth_token( & self , token: String ) -> Self {
215226 Self ( self . 0 . auth_token( token) )
216227 }
217228
229+ #[ wasm_bindgen( js_name = desktopSize) ]
218230 pub fn desktop_size( & self , desktop_size: $crate:: DesktopSize ) -> Self {
219231 Self ( self . 0 . desktop_size( desktop_size) )
220232 }
221233
234+ #[ wasm_bindgen( js_name = renderCanvas) ]
222235 pub fn render_canvas( & self , canvas: $crate:: internal:: web_sys:: HtmlCanvasElement ) -> Self {
223236 Self ( self . 0 . render_canvas( canvas) )
224237 }
225238
239+ #[ wasm_bindgen( js_name = setCursorStyleCallback) ]
226240 pub fn set_cursor_style_callback( & self , callback: $crate:: internal:: web_sys:: js_sys:: Function ) -> Self {
227241 Self ( self . 0 . set_cursor_style_callback( callback) )
228242 }
229243
244+ #[ wasm_bindgen( js_name = setCursorStyleCallbackContext) ]
230245 pub fn set_cursor_style_callback_context( & self , context: $crate:: internal:: wasm_bindgen:: JsValue ) -> Self {
231246 Self ( self . 0 . set_cursor_style_callback_context( context) )
232247 }
233248
249+ #[ wasm_bindgen( js_name = remoteClipboardChangedCallback) ]
234250 pub fn remote_clipboard_changed_callback(
235251 & self ,
236252 callback: $crate:: internal:: web_sys:: js_sys:: Function ,
237253 ) -> Self {
238254 Self ( self . 0 . remote_clipboard_changed_callback( callback) )
239255 }
240256
257+ #[ wasm_bindgen( js_name = remoteReceivedFormatListCallback) ]
241258 pub fn remote_received_format_list_callback(
242259 & self ,
243260 callback: $crate:: internal:: web_sys:: js_sys:: Function ,
244261 ) -> Self {
245262 Self ( self . 0 . remote_received_format_list_callback( callback) )
246263 }
247264
265+ #[ wasm_bindgen( js_name = forceClipboardUpdateCallback) ]
248266 pub fn force_clipboard_update_callback(
249267 & self ,
250268 callback: $crate:: internal:: web_sys:: js_sys:: Function ,
@@ -272,40 +290,48 @@ macro_rules! make_bridge {
272290 #[ $crate:: internal:: wasm_bindgen:: prelude:: wasm_bindgen]
273291 #[ doc( hidden) ]
274292 impl DeviceEvent {
293+ #[ wasm_bindgen( js_name = mouseButtonPressed) ]
275294 pub fn mouse_button_pressed( button: u8 ) -> Self {
276295 Self ( <<$api as $crate:: RemoteDesktopApi >:: DeviceEvent >:: mouse_button_pressed( button) )
277296 }
278297
298+ #[ wasm_bindgen( js_name = mouseButtonReleased) ]
279299 pub fn mouse_button_released( button: u8 ) -> Self {
280300 Self ( <<$api as $crate:: RemoteDesktopApi >:: DeviceEvent >:: mouse_button_released( button) )
281301 }
282302
303+ #[ wasm_bindgen( js_name = mouseMove) ]
283304 pub fn mouse_move( x: u16 , y: u16 ) -> Self {
284305 Self ( <<$api as $crate:: RemoteDesktopApi >:: DeviceEvent >:: mouse_move(
285306 x, y,
286307 ) )
287308 }
288309
310+ #[ wasm_bindgen( js_name = wheelRotations) ]
289311 pub fn wheel_rotations( vertical: bool , rotation_units: i16 ) -> Self {
290312 Self ( <<$api as $crate:: RemoteDesktopApi >:: DeviceEvent >:: wheel_rotations( vertical, rotation_units) )
291313 }
292314
315+ #[ wasm_bindgen( js_name = keyPressed) ]
293316 pub fn key_pressed( scancode: u16 ) -> Self {
294317 Self ( <<$api as $crate:: RemoteDesktopApi >:: DeviceEvent >:: key_pressed(
295318 scancode,
296319 ) )
297320 }
298321
322+ #[ wasm_bindgen( js_name = keyReleased) ]
299323 pub fn key_released( scancode: u16 ) -> Self {
300324 Self ( <<$api as $crate:: RemoteDesktopApi >:: DeviceEvent >:: key_released(
301325 scancode,
302326 ) )
303327 }
304328
329+ #[ wasm_bindgen( js_name = unicodePressed) ]
305330 pub fn unicode_pressed( unicode: char ) -> Self {
306331 Self ( <<$api as $crate:: RemoteDesktopApi >:: DeviceEvent >:: unicode_pressed( unicode) )
307332 }
308333
334+ #[ wasm_bindgen( js_name = unicodeReleased) ]
309335 pub fn unicode_released( unicode: char ) -> Self {
310336 Self ( <<$api as $crate:: RemoteDesktopApi >:: DeviceEvent >:: unicode_released( unicode) )
311337 }
@@ -314,10 +340,12 @@ macro_rules! make_bridge {
314340 #[ $crate:: internal:: wasm_bindgen:: prelude:: wasm_bindgen]
315341 #[ doc( hidden) ]
316342 impl InputTransaction {
317- pub fn init( ) -> Self {
318- Self ( <<$api as $crate:: RemoteDesktopApi >:: InputTransaction >:: init( ) )
343+ #[ wasm_bindgen( constructor) ]
344+ pub fn create( ) -> Self {
345+ Self ( <<$api as $crate:: RemoteDesktopApi >:: InputTransaction >:: create( ) )
319346 }
320347
348+ #[ wasm_bindgen( js_name = addEvent) ]
321349 pub fn add_event( & mut self , event: DeviceEvent ) {
322350 self . 0 . add_event( event. 0 ) ;
323351 }
@@ -326,14 +354,17 @@ macro_rules! make_bridge {
326354 #[ $crate:: internal:: wasm_bindgen:: prelude:: wasm_bindgen]
327355 #[ doc( hidden) ]
328356 impl ClipboardData {
329- pub fn init( ) -> Self {
330- Self ( <<$api as $crate:: RemoteDesktopApi >:: ClipboardData >:: init( ) )
357+ #[ wasm_bindgen( constructor) ]
358+ pub fn create( ) -> Self {
359+ Self ( <<$api as $crate:: RemoteDesktopApi >:: ClipboardData >:: create( ) )
331360 }
332361
362+ #[ wasm_bindgen( js_name = addText) ]
333363 pub fn add_text( & mut self , mime_type: & str , text: & str ) {
334364 self . 0 . add_text( mime_type, text) ;
335365 }
336366
367+ #[ wasm_bindgen( js_name = addBinary) ]
337368 pub fn add_binary( & mut self , mime_type: & str , binary: & [ u8 ] ) {
338369 self . 0 . add_binary( mime_type, binary) ;
339370 }
@@ -342,6 +373,7 @@ macro_rules! make_bridge {
342373 self . 0 . items( ) . into_iter( ) . cloned( ) . map( ClipboardItem ) . collect( )
343374 }
344375
376+ #[ wasm_bindgen( js_name = isEmpty) ]
345377 pub fn is_empty( & self ) -> bool {
346378 self . 0 . is_empty( )
347379 }
@@ -350,6 +382,7 @@ macro_rules! make_bridge {
350382 #[ $crate:: internal:: wasm_bindgen:: prelude:: wasm_bindgen]
351383 #[ doc( hidden) ]
352384 impl ClipboardItem {
385+ #[ wasm_bindgen( js_name = mimeType) ]
353386 pub fn mime_type( & self ) -> String {
354387 self . 0 . mime_type( ) . to_owned( )
355388 }
0 commit comments