1
0
mirror of https://github.com/microsoft/TypeScript-Node-Starter.git synced 2025-11-08 16:17:37 +00:00

Replace Lusca definition file with @types/lusca

Thanks!
This commit is contained in:
Peter Blazejewicz
2018-01-04 22:01:27 +01:00
parent 351b1ce677
commit fd523e3033
3 changed files with 3 additions and 4 deletions

View File

@@ -197,9 +197,9 @@ In the `tsconfig.json` for this project you'll see the following:
This tells the TypeScript compiler that in addition to looking in `node_modules/@types` for every import (`*`) also look in our own `.d.ts` file location `<baseUrl>` + `src/types/*`.
So when we write something like:
```ts
import * as lusca from "lusca";
import * as flash from "express-flash";
```
First the compiler will look for a `d.ts` file in `node_modules/@types` and then when it doesn't find one look in `src/types` and find our file `lusca.d.ts`.
First the compiler will look for a `d.ts` file in `node_modules/@types` and then when it doesn't find one look in `src/types` and find our file `express-flash.d.ts`.
#### Using `dts-gen`
Unless you are familiar with `.d.ts` files, I strongly recommend trying to use the tool [dts-gen](https://github.com/Microsoft/dts-gen) first.

View File

@@ -64,6 +64,7 @@
"@types/jest": "^21.1.8",
"@types/jquery": "^3.2.17",
"@types/lodash": "^4.14.91",
"@types/lusca": "^1.5.0",
"@types/mongodb": "^2.2.17",
"@types/mongoose": "^4.7.29",
"@types/morgan": "^1.7.32",

View File

@@ -1,2 +0,0 @@
export function xframe(type: string): any;
export function xssProtection(enabled: boolean): any;