8000 Update ordering of overrides so ReturnType pulls correct typing. by dcbartlett · Pull Request #1077 · jimp-dev/jimp · GitHub
[go: up one dir, main page]

Skip to content

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

Merged
hipstersmoothie merged 2 commits into
jimp-dev:masterfrom
dcbartlett:patch-1
Feb 4, 2023
Merged

hipstersmoothie merged 2 commits into
jimp-dev:masterfrom
dcbartlett:patch-1

Conversation

@dcbartlett
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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

0