Skip to content

Commit

Permalink
chore: add TypeScript definition file
Browse files Browse the repository at this point in the history
Related: #5
  • Loading branch information
darrachequesne committed Nov 1, 2022
1 parent a124d0b commit bab550b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
10 changes: 10 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/// <reference types="node" />
import { Server as HttpServer } from "http";
import { Server } from "socket.io";

interface Options {
loadBalancingMethod?: "random" | "round-robin" | "least-connection";
}

export declare function setupMaster(httpServer: HttpServer, opts?: Options): void;
export declare function setupWorker(io: Server): void;
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@
"version": "1.0.1",
"description": "An alternative to the sticky-session package (https://github.com/indutny/sticky-session)",
"main": "index.js",
"types": "index.d.ts",
"scripts": {
"format:check": "prettier --check \"index.js\" \"test/**/*.js\"",
"format:fix": "prettier --write \"index.js\" \"test/**/*.js\"",
"test": "npm run format:check && nyc mocha --timeout 5000"
},
"files": [
"index.js"
"index.js",
"index.d.ts"
],
"author": "Damien Arrachequesne <[email protected]>",
"license": "MIT",
Expand Down

0 comments on commit bab550b

Please sign in to comment.