I am wrapping a JS library and an issue i encountered is when a param is left empty in the library, it will automatically fill its values with the default. I have 2 args, x and y, if left blank in JS they center the window, otherwise they offset depending on the x or y value you enter. Both of these are numericLiterals. For strings and booleans I’ve simply been putting true or false or an empty string, by default most if not all things in my library at true if not used. I do not know how to go about this with integers though. My code:
proc createBrowserWindow*(
width,
height: int,
x,
y: int,
show = true,
backgroundColor: cstring = ""
): BrowserWindowType {.importjs: "new BrowserWindow({width: #, height: #, x: #, y: #, show: #, backgroundColor: #})".}
I want to be able to not have to put x or y and just leave them blank as i am unaware of the default value. 0 is not the default value i already tested. Thanks in advance!