Closed Joaovsa7 closed 2 years ago
Hey @Joaovsa7, thanks for your contribution and glad you're using types!
We try to have types being emitted by their responsible package, usually it goes like this:
@prismicio/types
(e.g. ResolvedApi
would be in @prismicio/types
)said-package
(e.g. LinkResolver
would be @prismicio/helpers
(formerly prismic-dom
))With that in mind, this only concerns new kits (@prismicio/client@6
, @prismicio/helpers@2
, etc.) and that's why older kits like @prismicio/client@5
were containing some types they weren't responsible for (e.g. LinkResolver
in @prismicio/client@5
)
To learn more about these new kits:
@prismicio/client
migration guide & references: https://prismic.io/docs/technologies/prismic-client-v6-migration-guide / https://prismic.io/docs/technical-reference/prismicio-client@prismicio/helpers
(prismic-dom
replacement) migration guide & references: https://prismic.io/docs/technologies/prismic-helpers-v2-migration-guide / https://prismic.io/docs/technical-reference/prismicio-helpersWhere are the new types?
Here's to help you where you can find replacements (and overall more complete) types that you're looking for (OldType > Equivalent using new kits
):
LinkResolver
> import { LinkResolverFunction } from "@prismicio/helpers";
ResolvedApi
> import { Repository } from "@prismicio/types";
ApiSearchRespons
> import { Query } from "@prismicio/types";
QueryOptions
> import { BuildQueryURLArgs } from "@prismicio/client";
Let us know if that answers your question, if not feel free to reopen ☺️
Hey @Joaovsa7, thanks for your contribution and glad you're using types!
We try to have types being emitted by their responsible package, usually it goes like this:
- Something from the API? >
@prismicio/types
(e.g.ResolvedApi
would be in@prismicio/types
)- Something introduced by a package? >
said-package
(e.g.LinkResolver
would be@prismicio/helpers
(formerlyprismic-dom
))With that in mind, this only concerns new kits (
@prismicio/client@6
,@prismicio/helpers@2
, etc.) and that's why older kits like@prismicio/client@5
were containing some types they weren't responsible for (e.g.LinkResolver
in@prismicio/client@5
)To learn more about these new kits:
- Blog post: https://prismic.io/blog/updated-javascript-client-and-helpers
@prismicio/client
migration guide & references: https://prismic.io/docs/technologies/prismic-client-v6-migration-guide / https://prismic.io/docs/technical-reference/prismicio-client@prismicio/helpers
(prismic-dom
replacement) migration guide & references: https://prismic.io/docs/technologies/prismic-helpers-v2-migration-guide / https://prismic.io/docs/technical-reference/prismicio-helpersWhere are the new types?
Here's to help you where you can find replacements (and overall more complete) types that you're looking for (
OldType > Equivalent using new kits
):
LinkResolver
>import { LinkResolverFunction } from "@prismicio/helpers";
ResolvedApi
>import { Repository } from "@prismicio/types";
ApiSearchRespons
>import { Query } from "@prismicio/types";
QueryOptions
>import { BuildQueryURLArgs } from "@prismicio/client";
Let us know if that answers your question, if not feel free to reopen ☺️
Hey @lihbr,
Thank you soooo much for your reply & help!
The prismicio/types
is a awesome package and it save a lot of time on my team, bc we don't need to write all of prismic types.
Thank you so much :)
Is your feature request related to a problem? Please describe.
Hey people, i wish you all well.
I have a internal package on company to make some queries that isn't available on
@prismicio/client
and other queries that are used by a lot of projects. We created this package to unify the code on a unique place.So, i updated the
@prismicio/client
tov6
and added@prismicio/types
and i realized that some types had gone.Some of them:
Describe the solution you'd like
I would like to know why these types were removed on v6 because i
Describe alternatives you've considered
Open a issue on this repository ;)