@Priyanka I have done that, but when I push an update on slice machine, it's prismicio.d.ts
that is created, not prismicio-types.d.ts and I get the error
./prismicio.ts:67:25
Type error: Property 'previewData' does not exist on type '{}'.
65 | prismicNext.enableAutoPreviews({
66 | client,
> 67 | previewData: config.previewData,
| ^
68 | req: config.req
69 | })
So I had to create manually a type before the createClient:
/**
* Creates a Prismic client for the project's repository. The client is used to
* query content from the Prismic API.
*
* @param config {prismicNext.CreateClientConfig} - Configuration for the Prismic client.
*/
interface CreateClientConfig extends prismic.ClientConfig {
previewData?: any
req?: any
}
export const createClient = (config: CreateClientConfig = {}) => {
const client = prismic.createClient(sm.apiEndpoint, {
routes,
...config
})
prismicNext.enableAutoPreviews({
client,
previewData: config.previewData,
req: config.req
})
return client
}
Is that normal? Is this behavior expected with the slicemachine update?