Using typings from TypeScript

Hey all, we are trying to upgrade our contentful, contentful-cli, and contentful-management package dependencies from our TypeScript code, and it seems like we have to move the typings from:
import { Entry } from 'contentful-management/typings/entry';
to
import { Entry } from 'contentful-management/dist/typings/entities/entry';

We have these dependencies in almost every single .ts file, so this is a big piece of work.
This seems like an awkward way to go, since we as users should not need to know the full path of the underlying types, but should have access to them transparently.

Is there a better way to include typings? Or what does Contentful recommend?

Hej @aldub,

you’re right, that’s not as nice as it could be.

I started a discussion here: https://github.com/contentful/contentful-management.js/pull/558

Feel free to chime in with your preferred way of importing our types.

Best,
Stephan

Thanks for joining in the PR, we now have released contentful-mangement@v7.1.0 (https://github.com/contentful/contentful-management.js/releases/tag/v7.1.0) where you can do the following:

import { Space, EntryProps } from 'contentful-management/types'

Thanks for raising this, we do agree it behaves better now.

Best,
Stephan

2 Likes