Skip to content

Commit

Permalink
Update README with triple-slash directive example (#776)
Browse files Browse the repository at this point in the history
  • Loading branch information
cookrn authored and blakeembrey committed Feb 15, 2019
1 parent efaf67a commit 7414752
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,13 @@ For module definitions, you can use [`paths`](https://www.typescriptlang.org/doc
}
```

An alternative approach for definitions of third-party libraries are [triple-slash directives](https://www.typescriptlang.org/docs/handbook/triple-slash-directives.html). This may be helpful if you prefer not to change your TypeScript `compilerOptions` or structure your custom type definitions when using `typeRoots`. Below is an example of the triple-slash directive as a relative path within your project:

```typescript
/// <reference types="./types/untyped_js_lib" />
import UntypedJsLib from "untyped_js_lib"
```

**Tip:** If you _must_ use `files`, enable `--files` flags or set `TS_NODE_FILES=true`.

## Watching and Restarting
Expand Down

0 comments on commit 7414752

Please sign in to comment.