add types

This commit is contained in:
b1ek 2023-03-18 23:10:24 +10:00
parent 6bb2549cfb
commit 17fdd50440
Signed by: blek
GPG Key ID: 14546221E3595D0C
3 changed files with 14 additions and 3 deletions

View File

@ -1,10 +1,9 @@
const Browser = require('which-browser');
// const express = require('express');
/**
*
* @param {express.Request} req
* @param {express.Response} res
* @param {Express.Request} req
* @param {Express.Response} res
* @param {*} next
*/
function handler(req, res, next) {

View File

@ -3,6 +3,7 @@
"version": "1.0.0",
"description": "Detect client's browser in Express.JS",
"main": "index.js",
"types": "types.d.ts",
"author": "b1ek",
"license": "MIT",
"dependencies": {

11
types.d.ts vendored Normal file
View File

@ -0,0 +1,11 @@
import WhichBrowser from "which-browser";
declare module "express-module" {
export default function(req: Express.Request, res: Express.Response, next: any);
}
namespace Express {
interface Request {
browser?: WhichBrowser
}
}