Skip to content

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

Open
VasylVasylchuk wants to merge 1 commit intonhn:masterfrom
VasylVasylchuk:fix-typescript-import
Open

fixed import to angular app by import Editor, { EditorOptions } from …#3268
VasylVasylchuk wants to merge 1 commit intonhn:masterfrom
VasylVasylchuk:fix-typescript-import

Conversation

@VasylVasylchuk
Copy link
Copy Markdown

@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
Copy Markdown
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