Skip to content

Commit 9a91a8e

Browse files
authored
Merge pull request #42 from toranb/branches/TsPathDocs
[DOCS]: added ts defs documentation
2 parents e688586 + 0f63a31 commit 9a91a8e

File tree

1 file changed

+23
-4
lines changed

1 file changed

+23
-4
lines changed

README.md

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ example to see the output of the compilation in a separate folder you are
8383
welcome to set and outDir and set noEmit to false. Then VS Code and tsc will
8484
generate files here while the broccoli pipeline will use its own temp folder.
8585

86-
Please see [the wiki] for additional how to tips from other users or to add
86+
Please see [the wiki] for additional how to tips from other users or to add
8787
your own tips. If an use case is frequent enough we can codify in the plugin.
8888

8989
[the wiki]: https://github.com/emberwatch/ember-cli-typescript/wiki/tsconfig-how-to
@@ -125,7 +125,7 @@ Here is the short list of things which do *not* work yet.
125125
```js
126126
export default MyComponent extends Ember.Component {
127127
}
128-
```
128+
```
129129

130130
### Type safety when invoking actions
131131

@@ -135,7 +135,7 @@ actions: {
135135
...
136136
}
137137
}
138-
```
138+
```
139139

140140
```hbs
141141
<!-- TypeScript compiler won't detect this type mismatch -->
@@ -163,5 +163,24 @@ Ember.Object.extend({
163163
this.set('port', 3000);
164164
}
165165
});
166-
```
166+
```
167+
168+
169+
### The TypeDefs I need to reference are not in node_modules/@types
170+
171+
By default `ember-cli-typescript` loads up any type defs found in node_modules/@types. If the type defs you need are not found here you can register a custom `path` in the tsconfig.json file
167172

173+
```json
174+
// tsconfig.json
175+
{
176+
"compilerOptions": {
177+
"paths": {
178+
"welp/*": ["app/*"],
179+
"redux": ["node_modules/redux/index.d.ts"]
180+
}
181+
},
182+
"include": [
183+
"**/*.ts"
184+
]
185+
}
186+
```

0 commit comments

Comments
 (0)