Skip to content

Commit 81a87fc

Browse files
authored
Merge branch 'master' into bump-version-checker
2 parents fb3550d + d62296d commit 81a87fc

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ Use TypeScript in your Ember 2.x and 3.x apps!
1919
* [Service and controller injections](#service-and-controller-injections)
2020
* [Ember Data lookups](#ember-data-lookups)
2121
* [Opt-in unsafety](#opt-in-unsafety)
22+
* [Fixing the Ember Data `error TS2344` problem](#fixing-the-ember-data-error-ts2344-problem)
2223
* [Type definitions outside `node_modules/@types`](#type-definitions-outside-node_modulestypes)
2324
* [ember-browserify](#ember-browserify)
2425
* ["TypeScript is complaining about multiple copies of the same types"](#typescript-is-complaining-about-multiple-copies-of-the-same-types)
@@ -371,7 +372,7 @@ node_modules/@types/ember-data/index.d.ts(920,56): error TS2344: Type 'any' does
371372

372373
This happens because the types for Ember's _test_ tooling includes the types for Ember Data because the `this` value in several of Ember's test types can include a reference to `DS.Store`.
373374

374-
**The fix:** add a declaration like this in your `types` directory:
375+
**The fix:** add a declaration like this in a new file named `ember-data.d.ts` in your `types` directory:
375376

376377
```ts
377378
declare module 'ember-data' {
@@ -381,7 +382,9 @@ declare module 'ember-data' {
381382
}
382383
```
383384

384-
(If you're developing an addon and concerned that this might affect consumers, it won't. Your types directory will never be referenced by consumers at all!)
385+
This works because (a) we include things in your types directory automatically and (b) TypeScript will merge this module and interface declaration with the main definitions for Ember Data from DefinitelyTyped behind the scenes.
386+
387+
If you're developing an addon and concerned that this might affect consumers, it won't. Your types directory will never be referenced by consumers at all!
385388

386389
### Type definitions outside `node_modules/@types`
387390

0 commit comments

Comments
 (0)