Skip to content

Typescript createServer typing not correct #158

Open
@whyisitworking

Description

@whyisitworking

In index.d.ts

function createServer(opts?: WebSocket.ServerOptions, callback?: () => void): Server;

Should become

function createServer(opts?: WebSocket.ServerOptions, callback?: (socket: WebSocketDuplex) => void): Server;

Since the callback is missing the parameter, typescript isn't allowing to pass a handler function

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions