Skip to content
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

Fix typescript definitions #200

Merged
merged 2 commits into from
Jun 13, 2017
Merged

Conversation

Alexendoo
Copy link
Collaborator

@Alexendoo Alexendoo commented Jun 8, 2017

Fixes errors present in strict mode

Adds getCurrentUrl and route override definitions

Adds a RoutableProps interface consumers can extend to implement a routable component

Fixes the types of RouterProps, Route, Link (closes #133)

Re-enables the typings file in package.json

Alexendoo added 2 commits June 8, 2017 17:44
Fixes errors present in strict mode

Adds getCurrentUrl and route override definitions

Adds a RoutableProps interface consumers can extend to implement a
routable component

Fixes the types of RouterProps, Route, Link (closes preactjs#133)

Re-enables the typings file in package.json
Copy link
Member

@developit developit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure about the route() args, but otherwise this looks good to me (though I'm not a typescript user)

export function route(url: string, replace?: boolean): boolean;
export function route(options: { url: string; replace?: boolean }): boolean;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it allows both formats? Definitely supports route(url, replace).

@developit developit merged commit 3954489 into preactjs:master Jun 13, 2017
@jamesbirtles
Copy link

Any chance of getting this published @developit 😄

@developit
Copy link
Member

Yup yup.

@jamesbirtles
Copy link

ty! 🌮

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Typescript definition missing important properties or has properties that should be optional.
3 participants