From 74147523da8853a41b70bf04578125e2d6f84731 Mon Sep 17 00:00:00 2001 From: Ryan Cook Date: Thu, 14 Feb 2019 23:47:04 -0700 Subject: [PATCH] Update README with triple-slash directive example (#776) --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index ab55a9d26..da498a025 100644 --- a/README.md +++ b/README.md @@ -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 +/// +import UntypedJsLib from "untyped_js_lib" +``` + **Tip:** If you _must_ use `files`, enable `--files` flags or set `TS_NODE_FILES=true`. ## Watching and Restarting