A single definition .d.ts file for all components

Hi,


Where can I obtain a typescript definition file, a single .d.ts file that contains all of the components definition/declaration?


Due to how I structure my application, which is by including the ej2.min.js from npm's dist folder, inside the main.html in a "script" tag. And I don't want to use import statement in my ts file, but I still wanted to have the type definitions of the component. The ej2.d.ts file did have all the types, but the definition are scattered across multiple files.


For other components/products like one from Bryntum, they provide this file. For Syncfusion, is the definition file available, to accommodate my use case?


6 Replies 1 reply marked as answer

NI Nick April 23, 2025 12:20 PM UTC

Thank you for this interesting information!



DA Deepika Arumugasamy Syncfusion Team April 24, 2025 02:11 PM UTC

Hi Azfar,


Thank you for reaching out.

 

We understand that you're looking for a single TypeScript definition file (.d.ts) that includes all Syncfusion EJ2 components. You can achieve this using the following NPM package:

 NPM Package: @syncfusion/ej2-js-es5

 

Package Structure:

Once downloaded, you can find the JavaScript files in the scripts folder within the package. For example:


node_modules

└── @syncfusion
    └── ej2-js-es5
        └── scripts
            ├── ej2.min.js

            └── ej2.d.ts   



 

The ej2.min.js file in the scripts folder is the compiled and minified file that includes all the required Syncfusion JavaScript functionalities. A comprehensive ej2.d.ts definition file covering all the types used in the bundled script.

 

We hope this information helps. If you need any further assistance reach out to us.



Regards,

Deepika




Marked as answer

AZ Azfar April 25, 2025 02:40 AM UTC

This is exactly what I needed.

Thanks!



KT Kris Trzeciak November 13, 2025 04:53 PM UTC

This is great, but what if I need this for specific version? (not the latest one)?



KT Kris Trzeciak November 13, 2025 06:03 PM UTC

Also, it seems like the ej2.d.ts file is not exactly es5 compatible.


There are hundreds of typescript compiler errors like:

> ej2.d.ts(423862,28): error TS2583: Build:Cannot find name 'Map'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2015' or later


However, I can get rid of them by switching "target" to "es6" in tsconfig.json.



DA Deepika Arumugasamy Syncfusion Team November 17, 2025 01:39 PM UTC

Hi Kris Trzeciak,


Yes, you can use a specific version of the package. Please refer to the NPM link below to check available versions:

https://www.npmjs.com/package/@syncfusion/ej2-js-es5

To install a specific version, you can use:

npm i @syncfusion/[email protected]

Regarding the TypeScript definition file compatibility, since the ej2.d.ts file includes modern type definitions, it is recommended to use ES6 in your tsconfig.json for smooth compilation.

Please let us know if you need any further assistance.

Regards,

Deepika



Loader.
Up arrow icon