Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed import to angular app by import Editor, { EditorOptions } from … #3268

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

VasylVasylchuk
Copy link

@VasylVasylchuk VasylVasylchuk commented Sep 27, 2024

…'@toast-ui/editor';

Fixed import to TS project

Could not find a declaration file for module '@toast-ui/editor'. '/Users/v.petrov/Desktop/projects/ats/admin-frontend/node_modules/@toast-ui/editor/dist/esm/index.js' implicitly has an 'any' type.
There are types at '/Users/v.petrov/Desktop/projects/ats/admin-frontend/node_modules/@toast-ui/editor/types/index.d.ts', but this result could not be resolved when respecting package.json "exports". The '@toast-ui/editor' library may need to update its package.json or typings

Description

fixed import like that ts cannot find index.d.ts in types because try find in dist/esm/index.js
So I add "types": "./types/index.d.ts", to exports
import Editor from '@toast-ui/editor';

{ "exports": { ".": { "types": "./types/index.d.ts", "import": "./dist/esm/index.js", "require": "./dist/toastui-editor.js" }, ... }, ... }

another way use import with out fix:
import Editor from 'node_modules/@toast-ui/editor';
then TS automaticly try search in some standart folders like types but when testing component/module, testing-lib cant find lib so failed


Thank you for your contribution to TOAST UI product. 🎉 😘 ✨

@VasylVasylchuk
Copy link
Author

Please review this is important for me because I wanna use in my project if this don't be quick I should search another library for rich text with markdown format...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant