@@ -261,7 +261,8 @@ module Socket = {
261261 [@ bs . get ] external destroyed : subtype (' w , ' r , ' ty ) => bool = "destroyed" ;
262262 [@ bs . send ]
263263 external destroy :
264- (subtype (' w , ' r , ' ty ), ~exn : Js . Exn . t =?, unit ) => subtype (' w , ' r , ' ty ) =
264+ (subtype (' w , ' r , ' ty ), ~error : option (Js . Exn . t )) =>
265+ subtype (' w , ' r , ' ty ) =
265266 "destroy" ;
266267 [@ bs . get ]
267268 external localAddress : subtype (' w , ' r , ' ty ) => string = "localAddress" ;
@@ -292,7 +293,7 @@ module Socket = {
292293 (
293294 subtype (' w , ' r , ' ty ),
294295 int ,
295- ~callback : [@ bs . this ] (subtype (' w , ' r , ' ty ) => unit )=?
296+ ~callback : [@ bs . this ] (subtype (' w , ' r , ' ty ) => unit )
296297 ) =>
297298 subtype (' w , ' r , ' ty ) =
298299 "setTimeout" ;
@@ -303,7 +304,7 @@ module Socket = {
303304 (
304305 subtype (' w , ' r , [ > kind (' w , ' r ) | icp ] ) as ' icpSocket ,
305306 ~path : string ,
306- unit => unit
307+ [ @ bs . uncurry ] ( unit => unit )
307308 ) =>
308309 ' icpSocket =
309310 "connect" ;
@@ -313,7 +314,7 @@ module Socket = {
313314 subtype (' w , ' r , [ > kind (' w , ' r ) | tcp ] ) as ' tcpSocket ,
314315 ~port : int ,
315316 ~host : string ,
316- unit => unit
317+ [ @ bs . uncurry ] ( unit => unit )
317318 ) =>
318319 ' tcpSocket =
319320 "connect" ;
@@ -343,7 +344,12 @@ module TcpSocket = {
343344 include Events ;
344345 [@ bs . send ]
345346 external connect :
346- (subtype (' w , ' r , ' ty ), ~port : int , ~host : string , unit => unit ) =>
347+ (
348+ subtype (' w , ' r , ' ty ),
349+ ~port : int ,
350+ ~host : string ,
351+ [@ bs . uncurry ] (unit => unit )
352+ ) =>
347353 subtype (' w , ' r , ' ty ) =
348354 "connect" ;
349355 };
@@ -363,7 +369,7 @@ module IcpSocket = {
363369 include Socket . Impl ;
364370 [@ bs . send ]
365371 external connect :
366- (subtype (' w , ' r , ' ty ), ~path : string , unit => unit ) =>
372+ (subtype (' w , ' r , ' ty ), ~path : string , [ @ bs . uncurry ] ( unit => unit ) ) =>
367373 subtype (' w , ' r , ' ty ) =
368374 "connect" ;
369375 };
@@ -462,7 +468,8 @@ module Server = {
462468 (subtype (' ty ), (Js . nullable (Js . Exn . t ), int ) => unit ) => subtype (' ty ) =
463469 "getConnections" ;
464470 [@ bs . set ]
465- external setMaxConnections : (subtype (' ty ), int ) => unit = "maxConnections" ;
471+ external setMaxConnections : (subtype (' ty ), int ) => unit =
472+ "maxConnections" ;
466473 [@ bs . get ] external maxConnections : subtype (' ty ) => int = "maxConnections" ;
467474 [@ bs . send ] external ref : subtype (' ty ) => subtype (' ty ) = "ref" ;
468475 [@ bs . send ] external unref : subtype (' ty ) => subtype (' ty ) = "unref" ;
@@ -555,15 +562,16 @@ module TcpServer = {
555562 include Events ;
556563 [@ bs . send ]
557564 external close :
558- (subtype (' ty ), ~callback : Js . nullable (Js . Exn . t ) => unit =? , unit ) =>
565+ (subtype (' ty ), ~callback : Js . nullable (Js . Exn . t ) => unit ) =>
559566 subtype (' ty ) =
560567 "close" ;
561568 [@ bs . send ]
562569 external getConnections :
563570 (subtype (' ty ), (Js . nullable (Js . Exn . t ), int ) => unit ) => subtype (' ty ) =
564571 "getConnections" ;
565572 [@ bs . set ]
566- external setMaxConnections : (subtype (' ty ), int ) => unit = "maxConnections" ;
573+ external setMaxConnections : (subtype (' ty ), int ) => unit =
574+ "maxConnections" ;
567575 [@ bs . get ] external maxConnections : subtype (' ty ) => int = "maxConnections" ;
568576 [@ bs . send ] external ref : subtype (' ty ) => subtype (' ty ) = "ref" ;
569577 [@ bs . send ] external unref : subtype (' ty ) => subtype (' ty ) = "unref" ;
@@ -584,11 +592,10 @@ module TcpServer = {
584592 listenOptions ;
585593 [@ bs . module "net" ] [@ bs . new ] external make : unit => t = "Server" ;
586594 [@ bs . send ]
587- external listen :
588- (t , ~port : int , ~host : string , ~callback : unit => unit =?, unit ) => t =
595+ external listen : (t , ~port : int , ~host : string , ~callback : unit => unit ) => t =
589596 "listen" ;
590597 [@ bs . send ]
591- external listenWith : (t , listenOptions , ~callback : unit => unit =? , unit ) => t =
598+ external listenWithOptions : (t , listenOptions , ~callback : unit => unit ) => t =
592599 "listen" ;
593600};
594601
@@ -675,15 +682,16 @@ module IcpServer = {
675682 include Events ;
676683 [@ bs . send ]
677684 external close :
678- (subtype (' ty ), ~callback : Js . nullable (Js . Exn . t ) => unit =? , unit ) =>
685+ (subtype (' ty ), ~callback : Js . nullable (Js . Exn . t ) => unit ) =>
679686 subtype (' ty ) =
680687 "close" ;
681688 [@ bs . send ]
682689 external getConnections :
683690 (subtype (' ty ), (Js . nullable (Js . Exn . t ), int ) => unit ) => subtype (' ty ) =
684691 "getConnections" ;
685692 [@ bs . set ]
686- external setMaxConnections : (subtype (' ty ), int ) => unit = "maxConnections" ;
693+ external setMaxConnections : (subtype (' ty ), int ) => unit =
694+ "maxConnections" ;
687695 [@ bs . get ] external maxConnections : subtype (' ty ) => int = "maxConnections" ;
688696 [@ bs . send ] external ref : subtype (' ty ) => subtype (' ty ) = "ref" ;
689697 [@ bs . send ] external unref : subtype (' ty ) => subtype (' ty ) = "unref" ;
@@ -704,14 +712,13 @@ module IcpServer = {
704712 ) =>
705713 listenOptions ;
706714 [@ bs . send ]
707- external listen : (t , ~path : string , ~callback : unit => unit =?, unit ) => t =
708- "listen" ;
715+ external listen : (t , ~path : string , ~callback : unit => unit ) => t = "listen" ;
709716 [@ bs . send ]
710- external listenWith :
711- (t , ~options : listenOptions , ~callback : unit => unit =? , unit ) => t =
717+ external listenWithOptions :
718+ (t , ~options : listenOptions , ~callback : unit => unit ) => t =
712719 "listen" ;
713720};
714721
715722[@ bs . module "net" ] [@ bs . val ] external isIP : string => bool = "isIP" ;
716723[@ bs . module "net" ] [@ bs . val ] external isIPv4 : string => bool = "isIPv4" ;
717- [@ bs . module "net" ] [@ bs . val ] external isIPv6 : string => bool = "isIPv6" ;
724+ [@ bs . module "net" ] [@ bs . val ] external isIPv6 : string => bool = "isIPv6" ;
0 commit comments