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

Update ordering of overrides so ReturnType pulls correct typing. #1077

Merged
merged 2 commits into from
Feb 4, 2023
Merged

Update ordering of overrides so ReturnType pulls correct typing. #1077

merged 2 commits into from
Feb 4, 2023

Conversation

dcbartlett
Copy link
Contributor

What's Changing and Why

This updates the ordering of the loadFont overrides so that when ReturnType is used to capture the returned type from typeof Jimp.loadFont it will receive the correct type definitions.

EG:

private FONT_SANS_16_BLACK: Awaited<ReturnType<typeof Jimp.loadFont>>;

Current:

Type 'Font' is not assignable to type 'never'.ts(2322)

Expected:
No Error, Font typed as Font

What else might be affected

Should have no other side-effects

Tasks

  • [ N/A ] Add tests
  • [ N/A ] Update Documentation
  • [ X ] Update jimp.d.ts

This updates the ordering of the loadFont overrides so that when ReturnType is used to capture the returned type from `typeof Jimp.loadFont` it will receive the correct type definitions.

EG:
```ts
private FONT_SANS_16_BLACK: Awaited<ReturnType<typeof Jimp.loadFont>>;
```
Current:
```
Type 'Font' is not assignable to type 'never'.ts(2322)
```
Expected:
No Error, Font typed as `Font`
@dcbartlett
Copy link
Contributor Author

Can someone please re-run https://app.circleci.com/pipelines/github/oliver-moran/jimp/302/workflows/03243568-1f6a-4426-8b55-f31d61380900/jobs/1282. This looks like it failed due to an unrelated timeout. That test might need an adjustment in timeout timing.

@dcbartlett
Copy link
Contributor Author

Anyone maintaining this repository? I'd like to have this merged upstream so I can stop running a custom fork.

# Conflicts:
#	packages/plugin-print/index.d.ts
@hipstersmoothie hipstersmoothie merged commit 2852982 into jimp-dev:master Feb 4, 2023
@hipstersmoothie
Copy link
Collaborator

🚀 PR was released in v0.17.7 🚀

@hipstersmoothie hipstersmoothie added the released This issue/pull request has been released. label Feb 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
released This issue/pull request has been released.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants