uNetworking / uWebSockets.js

μWebSockets for Node.js back-ends :metal:
Apache License 2.0
7.76k stars 563 forks source link

add .listen_unix() to TypeScript definition file #902

Closed endel closed 1 year ago

endel commented 1 year ago

https://github.com/uNetworking/uWebSockets.js/issues/815

uNetworkingAB commented 1 year ago

It has to be like this

    listen_unix(options: ListenOptions, cb: (listenSocket: us_listen_socket | false) => void | Promise<void>, path: RecognizedString) : TemplatedApp;
endel commented 1 year ago

Hi @uNetworkingAB, maybe we need 2 overloads for listen_unix, then?

Correct me if I'm wrong but by reading the source I don't see ListenOptions, I could only notice:

Perhaps we can have the signature I proposed + another with options as the second argument?

// 2 args
listen_unix(cb: (listenSocket: us_listen_socket) => void | Promise<void>, path: RecognizedString) : TemplatedApp;
// 3 args
listen_unix(cb: (listenSocket: us_listen_socket) => void | Promise<void>, options: ListenOptions, path: RecognizedString) : TemplatedApp;

Cheers

uNetworkingAB commented 1 year ago

Ah