mirror of
https://github.com/microsoft/TypeScript-Node-Starter.git
synced 2025-11-08 16:17:37 +00:00
Merge pull request #71 from peterblazejewicz/types/lusca
Replace Lusca definition file with @types/lusca
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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",
|
||||
|
||||
2
src/types/lusca.d.ts
vendored
2
src/types/lusca.d.ts
vendored
@@ -1,2 +0,0 @@
|
||||
export function xframe(type: string): any;
|
||||
export function xssProtection(enabled: boolean): any;
|
||||
Reference in New Issue
Block a user