Skip to content

Commit

Permalink
Merge pull request #39 from yosuke-furukawa/add_types
Browse files Browse the repository at this point in the history
feat: add types
  • Loading branch information
yosuke-furukawa committed Feb 18, 2020
2 parents 9e07b77 + abcb722 commit a63af95
Show file tree
Hide file tree
Showing 3 changed files with 77 additions and 0 deletions.
14 changes: 14 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
declare module "server-timing" {
import * as e from "express";
type Options = {
total?: boolean;
enabled?: boolean;
autoEnd?: boolean;
};
export default (opts?: Options) => e.RequestHandler;
type Response = {
startTime: (name: string, desc: string) => void;
endTime: (name: string) => void;
};
export type SeverTimingResponse = e.Response & Response;
}
60 changes: 60 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "3.0.0",
"description": "This module can add `ServerTiming` Header to http response, and be able to use express middleware",
"main": "index.js",
"types": "index.d.ts",
"scripts": {
"test": "eater --require .loader.js",
"lint": "standard",
Expand All @@ -26,6 +27,8 @@
},
"homepage": "https://github.com/yosuke-furukawa/server-timing#readme",
"dependencies": {
"@types/express": "^4.17.2",
"@types/node": "^12.12.18",
"on-headers": "^1.0.1"
},
"devDependencies": {
Expand Down

0 comments on commit a63af95

Please sign in to comment.