Recently, I created my very first npm package using TypeScript. However, when I tried to use this package in another project, I realized that I wasn't getting the expected code completion and it was challenging to work with it without proper support.
I believe the solution lies in creating a declaration file (.d.ts) and including it in the package, but I am struggling to do it correctly.
Even after searching online resources and tutorials, I haven't been able to resolve this issue effectively.
The current state of my 'typings.d.ts' file is as follows:
export declare function Slider(props: SliderProps): void;
The module properties are stored in a separate 'types.ts' file, which is distinct from the main module itself.
Any assistance or guidance on how to rectify this problem would be greatly appreciated.
Here is a snippet from my package.json file:
{
"main": "node_modules/expo/AppEntry.js",
"name": "react-native-range-slider-expo",
"description": "range slider",
"license": "MIT",
...
}
And here is an excerpt from my tsconfig.json file:
{
"compilerOptions": {
"allowSyntheticDefaultImports": true,
"jsx": "react-native",
"lib": [
"dom",
"esnext"
],
...
}