Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

move types to dev deps #3

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,4 @@ jspm_packages
.yarn-integrity

# Build
dist/
# dist/
16 changes: 16 additions & 0 deletions dist/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/**
* Created by championswimmer on 05/01/17.
*/
import { Request, RequestHandler } from 'express';
export interface ReqToUserId {
(req: Request): string;
}
interface ExpressGAParams {
uaCode: string;
cookieName?: string;
reqToUserId?: ReqToUserId;
autoTrackPages?: boolean;
}
declare function ExpressGA(uaCode: string): RequestHandler;
declare function ExpressGA(params: ExpressGAParams): RequestHandler;
export default ExpressGA;
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@
},
"homepage": "https://github.com/championswimmer/express-universal-analytics#readme",
"dependencies": {
"universal-analytics": "^0.4.20",
"@types/express": "^4.17.3",
"@types/express-session": "^1.17.0",
"@types/universal-analytics": "^0.4.4"
"universal-analytics": "^0.4.20"
},
"devDependencies": {
"@types/node": "10",
"@types/express": "^4.17.3",
"@types/express-session": "^1.17.0",
"@types/universal-analytics": "^0.4.4",
"express": "^4.17.1",
"express-session": "^1.17.0",
"typescript": "^3.8.3"
Expand Down
6 changes: 3 additions & 3 deletions types/express.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as ua from "universal-analytics";

declare module 'express-serve-static-core' {
interface Request {
visitor: ua.Visitor & { setUid: (uid?: string) => void }
declare module 'express' {
export interface Request {
visitor?: ua.Visitor & { setUid: (uid?: string) => void }
}
}