-
I have schema that generated from prismabox, and while I using the schema and build d.ts. All type written repetitively instead using @import and cause error How to solve this problem ?
Generated file so big and repetitive
Expected result
|
Beta Was this translation helpful? Give feedback.
Answered by
ehaynes99
Sep 14, 2024
Replies: 1 comment 2 replies
-
I have found solution. We need to write define type by ourself like this
And the result
|
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm sharing literally thousands of schemas between projects in a monorepo that get MUCH larger than those in the definition files, and I've never run into this. The largest
.d.ts
I have is 423k, and there are a lot of complicated unions/intersections. I also don't get it with the sample you supplied. If this is an excerpt from a larger project, are you sure that none of the problematic definitions has recursion in it? It's going to get really tedious double-declaring everything like that.Also, unrelated but there is no need for
additionalProperties: false
with primitive types likeType.String
.