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

Add named export to type definitions #284

Merged
merged 2 commits into from
May 1, 2022

Conversation

wight554
Copy link
Contributor

@wight554 wight554 commented Apr 25, 2022

Checklist

index.js Outdated Show resolved Hide resolved
@wight554 wight554 changed the title Improve TS typings and add named export Add named export to type definitions Apr 26, 2022
@wight554 wight554 requested a review from climba03003 May 1, 2022 06:26
@wight554
Copy link
Contributor Author

wight554 commented May 1, 2022

Main point of having this is that typescript looses typings when using default import of CJS module with tsconfig module: "nodenext" setting from TS 4.7:

import fastifyCookie
Argument of type 'typeof import("/.../node_modules/fastify-cookie/plugin")' is not assignable to parameter of type 'FastifyPluginCallback<any, Server> | FastifyPluginAsync<any, Server> | Promise<{ default: FastifyPluginCallback<any, Server>; }> | Promise<...>'.ts(2345)

More info here: microsoft/TypeScript#48845

Copy link
Member

@climba03003 climba03003 left a comment

Choose a reason for hiding this comment

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

LGTM.

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

lgtm

@mcollina mcollina merged commit 29b449f into fastify:master May 1, 2022
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.

3 participants