Repository navigation
EventObj interface is not exported #427
Description
Activity
@heggiG That is odd. I can see that the bundle exports
EventObjand can be imported in this project (after I updated the Angular and TypeScript versions to match yours). What could be the differences?@tiny-ben-tran the problem is likely, that this repo uses typescript 5.4 instead of 5.8 as needed by angular 20. Likely the Compiler just didn't care that we imported that type, but does now.
@heggiG can you provide a replication case on codesandbox.io?
I tried doing that, but I think sandbox doesn't work with angular 20. When I'm back from vacation I'll try to recreate in a minimal repo.
Reacted by tiny-ben-tran@tiny-ben-tran sorry for the delay, I have created this repo which reproduces the error. In
main.tsI try importingEventObjand get a TypeScript error.@heggiG A new version has been released with your fix. Thanks for your contribution.
Hi @tiny-ben-tran, can you explain technically why using the newer
moduleResolution: "bundler"stops the EventObj import working from@tinymce/tinymce-angular/editor/Events? I've seen this a few times over different libraries and I just wondered why this change to the module resolution causes this problem.@nudge-alec-robertson , as far as I understand it is to tell how Typescript resolves modules and their type definitions. It is hard to say without seeing a complete typescript config, as
moduleResolutionworks hand in hand with themoduleoption. FYI it is worth reading modules theory
What is the current behavior?
The
(onInit)output of theEditorComponentwants a method with a parameter of typeEventObj<any>, however theEventObjinterface is not exported and can't be imported.Please provide the steps to reproduce and if possible a minimal demo of the problem via codesandbox.io or similar.
import { EventObj } from '@tinymce/tinymce-angular/editor/Events';What is the expected behavior?
Allow us to import that Interface for correct method parameters
Which versions of TinyMCE/TinyMCE-Angular, and which browser / OS are affected by this issue? Did this work in previous versions of TinyMCE or TinyMCE-Angular?
Using tinymce-angular 9.1.0, Angular 20.1.4 and TypeScript 5.8.0
This worked with Angular 19 and TypeScript 5.5.4