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

Feature request: need TypeScript typings for autocomplete #51

Open
alexey2baranov opened this issue Sep 8, 2020 · 1 comment
Open

Comments

@alexey2baranov
Copy link

Pain

  1. In webstorm I can't use autoimport and have to import module manually.
  2. Even after manual import I can't use autocomplete for .middleware, .get and .set
@ghost
Copy link

ghost commented Apr 22, 2021

Hey,

So... those are pretty minimal but they do the job:

import { NextFunction, Request, Response } from 'express'

export declare module 'express-http-context' {
  const middleware: (req: Request, res: Response, next: NextFunction) => void
  const get: <T>(key: string) => T
  const set: <T>(key: string, value: T) => void
}

edit: or here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant