FIameCaster / prism-code-editor

Lightweight, extensible code editor component for the web using Prism
https://prism-code-editor.netlify.app
MIT License
43 stars 6 forks source link

Missing types for `prism-code-editor/setups` import #1

Closed dan-lee closed 1 year ago

dan-lee commented 1 year ago

Hey @FIameCaster,

Excellent library, precisely what I needed! I am getting some type errors when importing from the editor setups:

CleanShot 2023-08-09 at 11 21 26@2x

TS7016: Could not find a declaration file for module 'prism-code-editor/setups'. '.../prism-code-editor@0.0.3/node_modules/prism-code-editor/dist/setups.js' implicitly has an 'any' type.

If the 'prism-code-editor' package actually exposes this module, try adding a new declaration (.d.ts) file containing declare module 'prism-code-editor/setups';

FIameCaster commented 1 year ago

Hey, glad you liked my library!

The issue seems to be that setups is imported from dist/setups.js while the declaration is located at dist/setups/index.d.ts. Moving the setups to dist/setups/index.js should solve the problem.

dan-lee commented 1 year ago

Thanks a lot! Keep up the good work :)