Skip to content

Use assertion functions in our type definition #2330

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

Closed
novemberborn opened this issue Jan 2, 2020 · 3 comments
Closed

Use assertion functions in our type definition #2330

novemberborn opened this issue Jan 2, 2020 · 3 comments
Labels
breaking requires a SemVer major release enhancement new functionality help wanted scope:typescript
Milestone

Comments

@novemberborn
Copy link
Member

We should update our TypeScript definition so that our assertions are typed as such, see https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-7.html#assertion-functions.

That said, I haven't checked whether and how we can make this work for which assertions.

@novemberborn novemberborn added enhancement new functionality help wanted breaking requires a SemVer major release scope:typescript labels Jan 2, 2020
@novemberborn novemberborn added this to the v3 milestone Jan 2, 2020
@novemberborn
Copy link
Member Author

As per microsoft/TypeScript#34596 I don't think this will work for us. But I don't really understand any of the discussion. Let's see what happens in future TypeScript versions.

@sindresorhus
Copy link
Member

Maybe relevant: microsoft/TypeScript#36067

@novemberborn
Copy link
Member Author

Best I understand that issue, it'd still end up being useless for our use cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking requires a SemVer major release enhancement new functionality help wanted scope:typescript
Projects
None yet
Development

No branches or pull requests

2 participants