fixed import to angular app by import Editor, { EditorOptions } from … #3268
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
…'@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. 🎉 😘 ✨