Description
The contentstack package provides subpath exports like contentstack/react-native, contentstack/web,
and contentstack/nativescript, but does not include corresponding TypeScript declaration files (.d.ts).
Environment
- contentstack version: 3.24.1 (also affects latest 3.27.0)
- TypeScript version: 5.x
- Package managers: npm/yarn
Steps to Reproduce
- Install
contentstack in a TypeScript project:
- Import the React Native entry point:
import Contentstack from 'contentstack/react-native';
- TypeScript error:
Could not find a declaration file for module 'contentstack/react-native'.
'/path/to/node_modules/contentstack/react-native.js' implicitly has an 'any' type.
Try npm i --save-dev @types/contentstack if it exists or add a new declaration
(.d.ts) file containing declare module 'contentstack/react-native';
Current Behavior
- The package provides index.d.ts for the main entry point
- Subpath exports (react-native.js, web.js, nativescript.js) have no corresponding .d.ts files
- TypeScript cannot infer types for these imports
Expected Behavior
TypeScript should pick up types for all provided entry points.
Suggested Solutions
either add react-native.d.ts, web.d.ts, and nativescript.d.ts that re-export the root types or use package.json exports field
Description
The
contentstackpackage provides subpath exports likecontentstack/react-native,contentstack/web,and
contentstack/nativescript, but does not include corresponding TypeScript declaration files (.d.ts).Environment
Steps to Reproduce
contentstackin a TypeScript project:import Contentstack from 'contentstack/react-native';
Could not find a declaration file for module 'contentstack/react-native'.
'/path/to/node_modules/contentstack/react-native.js' implicitly has an 'any' type.
Try
npm i --save-dev @types/contentstackif it exists or add a new declaration(.d.ts) file containing
declare module 'contentstack/react-native';Current Behavior
Expected Behavior
TypeScript should pick up types for all provided entry points.
Suggested Solutions
either add react-native.d.ts, web.d.ts, and nativescript.d.ts that re-export the root types or use package.json exports field