Skip to content

Commit

Permalink
Introduce ambient type definitions
Browse files Browse the repository at this point in the history
Ultimately we'd like to convert the package to TS, but this unblocks
wider ecosystem adoption of the stable/preview Ember types. This PR can
also serve as a model for other packages which want to publish types in
a similar way.

This will also work just fine with the `@types` packages from
DefinitelyTyped once [a key PR][pr] lands there, but that is not the
path we will recommend, so this only includes the `ember-source` peer
dependency.

[pr]: DefinitelyTyped/DefinitelyTyped#63589
  • Loading branch information
chriskrycho committed Dec 12, 2022
1 parent 09e931f commit 3907d48
Show file tree
Hide file tree
Showing 5 changed files with 1,306 additions and 625 deletions.
2 changes: 2 additions & 0 deletions addon/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import { Resolver as ResolverContract } from "@ember/owner";
export default interface Resolver extends Required<ResolverContract> {}
9 changes: 9 additions & 0 deletions addon/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"bugs": {
"url": "https://github.com/ember-cli/ember-resolver/issues"
},
"types": "index.d.ts",
"repository": {
"type": "git",
"url": "git+https://github.com/ember-cli/ember-resolver.git"
Expand All @@ -25,6 +26,14 @@
"ember-cli-babel": "^7.26.11"
},
"devDependencies": {},
"peerDependencies": {
"ember-source": "^4.8.3"
},
"peerDependenciesMeta": {
"ember-source": {
"optional": true
}
},
"engines": {
"node": "14.* || 16.* || >= 18"
},
Expand Down

0 comments on commit 3907d48

Please sign in to comment.