mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-01 09:01:45 +08:00
declare namespace ExpressUseragent (#8918)
* declare namespace ExpressUseragent - declare namespace ExpressUseragent - fix error Import declaration conflicts with local declaration of 'express' * Update express-useragent.d.ts * Update express-useragent.d.ts
This commit is contained in:
committed by
Masahiro Wakame
parent
85701ac79c
commit
94ce78cb01
21
express-useragent/express-useragent.d.ts
vendored
21
express-useragent/express-useragent.d.ts
vendored
@@ -6,7 +6,16 @@
|
||||
/// <reference path="../express/express.d.ts" />
|
||||
|
||||
declare namespace Express {
|
||||
interface ExpressUserAgent {
|
||||
|
||||
interface Request {
|
||||
useragent?: ExpressUseragent.UserAgent;
|
||||
}
|
||||
}
|
||||
|
||||
declare namespace ExpressUseragent {
|
||||
import express = Express;
|
||||
|
||||
interface UserAgent {
|
||||
isMobile: boolean;
|
||||
isTablet: boolean;
|
||||
isiPad: boolean;
|
||||
@@ -55,14 +64,10 @@ declare namespace Express {
|
||||
source: string;
|
||||
}
|
||||
|
||||
interface Request {
|
||||
useragent?: ExpressUserAgent;
|
||||
}
|
||||
function parse(source: string): UserAgent;
|
||||
function express(): (req: express.Request, res: express.Response, next?: Function) => void;
|
||||
}
|
||||
|
||||
declare module "express-useragent" {
|
||||
import express = require("express");
|
||||
|
||||
export function parse(source: string): Express.ExpressUserAgent;
|
||||
export function express(): (req: express.Request, res: express.Response, next?: Function) => void;
|
||||
export = ExpressUseragent;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user