Skip to content

Typescript createServer typing not correct #158

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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