Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using ExtJS in TypeScript

Today I started with TypeScript after reading the blogpost from @blorkfish

I downloaded the VS plugin from typescriptlang.org and the lastest ExtJS definitions via nuget

PM> Install-Package extjs.TypeScript.DefinitelyTyped

OK, lets start with writing a basic MVC app as described in the blockpost:

Compile time type-casting

The only way to utilize the powerful TypeScript benefits (i.e. type safety) is to manually type-cast these configuration blocks to the correct type by using compile time type casting as follows:

Ext.application(
    <Ext_app_Application>{ 
        // Ext.application config block
        // now has intellisense and type casting
    } 
);

which ended

enter image description here

The error says that there is no definition for Ext_app_Application

like image 739
JJR Avatar asked Jul 17 '26 05:07

JJR


1 Answers

Just a additional information:

Have you tried <Ext.app.IApplication> cause that is valid for the latest version of the ExtJS TypeScript definition. Note that there are differents between the definition used in the blog and the one you get via nuget.

dev comment:

Cast configuration blocks to the appropriate interface to enable code hinting.

like image 188
sra Avatar answered Jul 18 '26 18:07

sra



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!