-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add TypeScript ambient type information #66
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a bunch for taking the time to submit this. I appreciate it.
I don't use TypeScript so I can't really comment on this beyond what I can guess from reading the code, but I did have a question.
index.d.ts
Outdated
namespace Ember { | ||
interface Route { | ||
titleToken: string; | ||
title: string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this right? Both titleToken
and title
can be either a string or a function that can return a few different things.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The type information does need to change to accommodate this. Does the function always return a string?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
title
can be
- A string
- A function that returns a string
titleToken
can be
- A string
- A function that returns
- A string
- An array of strings
- And new in the yet to be released version:
- A promise that resolves to a string
- An array of promises that resolves to a string
d413662
to
afafd27
Compare
@kimroen I responded to your feedback. This should be good to go now |
Fixes #65
Because this is an 'extension of ember' kind of addon (often used without being explicitly imported), consumers will need to do one of two things in order to take advantage of this type information.
A. Indicate that this type information is to be included
tsconfig.json
B. Import the entry point for this addon from somewhere in their project
app/app.ts