Skip to content

EventObj interface is not exported #427

Description

@heggiG

What is the current behavior?

The (onInit) output of the EditorComponent wants a method with a parameter of type EventObj<any>, however the EventObj interface 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

Activity

  1. tiny-ben-tran commented on Sep 1, 2025

    @tiny-ben-tran
    Contributor

    @heggiG That is odd. I can see that the bundle exports EventObj and can be imported in this project (after I updated the Angular and TypeScript versions to match yours). What could be the differences?

  2. heggiG commented on Sep 2, 2025

    @heggiG
    ContributorAuthor

    @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.

  3. tiny-ben-tran commented on Sep 2, 2025

    @tiny-ben-tran
    Contributor

    @heggiG can you provide a replication case on codesandbox.io?

  4. heggiG commented on Sep 6, 2025

    @heggiG
    ContributorAuthor

    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.

  5. heggiG commented on Sep 30, 2025

    @heggiG
    ContributorAuthor

    @tiny-ben-tran sorry for the delay, I have created this repo which reproduces the error. In main.ts I try importing EventObj and get a TypeScript error.

  6. tiny-ben-tran commented on Oct 14, 2025

    @tiny-ben-tran
    Contributor

    @heggiG the difference between the two repos is how Typescript is configured. Setting moduleResolution: "node" should allow you to import EventObj from @tinymce/tinymce-angular/editor/Events.

    Re your PR #429 , you will need to sign a CLA for us to accept it.

  7. tiny-ben-tran commented on Nov 2, 2025

    @tiny-ben-tran
    Contributor

    @heggiG A new version has been released with your fix. Thanks for your contribution.

  8. nudge-alec-robertson commented on Dec 4, 2025

    @nudge-alec-robertson

    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.

  9. tiny-ben-tran commented on Dec 18, 2025

    @tiny-ben-tran
    Contributor

    @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 moduleResolution works hand in hand with the module option. FYI it is worth reading modules theory

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions