Skip to content

Export Pattern types in package.json#292

Merged
gvergnaud merged 3 commits intogvergnaud:mainfrom
GGomez99:ggomez99/export-pattern-type
Oct 3, 2024
Merged

Export Pattern types in package.json#292
gvergnaud merged 3 commits intogvergnaud:mainfrom
GGomez99:ggomez99/export-pattern-type

Conversation

@GGomez99
Copy link
Contributor

@GGomez99 GGomez99 commented Oct 3, 2024

Fix issue: #291

Changes

Export Pattern.d.ts in the package.json to solve the issue. They are now available at ts-pattern/types.

QA

Doing the same changes from this PR in this playground fixes the TS error

Comment on lines +20 to +27
"./types": {
"require": {
"types": "./dist/types/Pattern.d.cts"
},
"import": {
"types": "./dist/types/Pattern.d.ts"
}
},
Copy link
Owner

Choose a reason for hiding this comment

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

Could you create a types/index.ts file that exports the types we need from Pattern.ts? This should make it easier to export type from other files if necessary in the future

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.

2 participants