@@ -1227,15 +1227,15 @@ class Window {
12271227 )
12281228 }
12291229
1230+ const value = { } as Record < string , unknown >
1231+ value [ `${ size . type } ` ] = {
1232+ width : size . width ,
1233+ height : size . height
1234+ }
1235+
12301236 return invoke ( 'plugin:window|set_size' , {
12311237 label : this . label ,
1232- value : {
1233- type : size . type ,
1234- data : {
1235- width : size . width ,
1236- height : size . height
1237- }
1238- }
1238+ value
12391239 } )
12401240 }
12411241
@@ -1259,17 +1259,18 @@ class Window {
12591259 )
12601260 }
12611261
1262+ let value = null as Record < string , unknown > | null
1263+ if ( size ) {
1264+ value = { }
1265+ value [ `${ size . type } ` ] = {
1266+ width : size . width ,
1267+ height : size . height
1268+ }
1269+ }
1270+
12621271 return invoke ( 'plugin:window|set_min_size' , {
12631272 label : this . label ,
1264- value : size
1265- ? {
1266- type : size . type ,
1267- data : {
1268- width : size . width ,
1269- height : size . height
1270- }
1271- }
1272- : null
1273+ value
12731274 } )
12741275 }
12751276
@@ -1293,17 +1294,18 @@ class Window {
12931294 )
12941295 }
12951296
1297+ let value = null as Record < string , unknown > | null
1298+ if ( size ) {
1299+ value = { }
1300+ value [ `${ size . type } ` ] = {
1301+ width : size . width ,
1302+ height : size . height
1303+ }
1304+ }
1305+
12961306 return invoke ( 'plugin:window|set_max_size' , {
12971307 label : this . label ,
1298- value : size
1299- ? {
1300- type : size . type ,
1301- data : {
1302- width : size . width ,
1303- height : size . height
1304- }
1305- }
1306- : null
1308+ value
13071309 } )
13081310 }
13091311
@@ -1330,15 +1332,15 @@ class Window {
13301332 )
13311333 }
13321334
1335+ const value = { } as Record < string , unknown >
1336+ value [ `${ position . type } ` ] = {
1337+ x : position . x ,
1338+ y : position . y
1339+ }
1340+
13331341 return invoke ( 'plugin:window|set_position' , {
13341342 label : this . label ,
1335- value : {
1336- type : position . type ,
1337- data : {
1338- x : position . x ,
1339- y : position . y
1340- }
1341- }
1343+ value
13421344 } )
13431345 }
13441346
@@ -1516,15 +1518,15 @@ class Window {
15161518 )
15171519 }
15181520
1521+ const value = { } as Record < string , unknown >
1522+ value [ `${ position . type } ` ] = {
1523+ x : position . x ,
1524+ y : position . y
1525+ }
1526+
15191527 return invoke ( 'plugin:window|set_cursor_position' , {
15201528 label : this . label ,
1521- value : {
1522- type : position . type ,
1523- data : {
1524- x : position . x ,
1525- y : position . y
1526- }
1527- }
1529+ value
15281530 } )
15291531 }
15301532
0 commit comments