deno_bindgen icon indicating copy to clipboard operation
deno_bindgen copied to clipboard

Conditional field attributes do not work

Open littledivy opened this issue 2 years ago • 0 comments

use deno_bindgen::deno_bindgen;

#[deno_bindgen]
pub struct UsbDevice {
  // Not supposed to be serialized or included in typings.
  #[cfg(not(feature = "deno_ffi"))]
  non_serializable_handle: Device,
}

Output:

type UsbDevice = {
  non_serializable_handle: Device, // <-- should not be included
};

Expected output:

type UsbDevice = {};

littledivy avatar Feb 18 '22 13:02 littledivy