This article explains how to obtain and add the TypeScript definitions available for the Telerik® UI for ASP.NET Ajax suite.
As of Q3 2014, TypeScript definitions are available for the Telerik® UI for ASP.NET Ajax suite. They are located in the TypeScriptDefinitions folder in the installation directory (e.g.,C:\Program Files (x86)\Telerik\UI for ASP.NET AJAX QX YYYY\TypeScriptDefinitions).
The folder contains the Telerik.Web.UI.d.ts file which holds the definitions for our objects and the microsoft.ajax.d.ts file for the MS AJAX framework objects. You can alternatively obtain the latter from the Internet in case Microsoft release an updated version.
The following steps will guide you adding the TypeScript definitions in the application’s project:
Copy the TypeScript definitions from the TypeScriptDefinitions installation folder to your project.
Add a TypeScript file to your project. You can easily find it by using the Search Installed Templates textbox in the top right hand corner:
Unload the project (right click on the solution and select Unload Project).
Go to the project folder and open the
<projectName>.csproj / <projectName>.vbprojfile with a text editor.
Add the following Import directive if you do not see it already.
<import project="$(VSToolsPath)\TypeScript\Microsoft.TypeScript.targets" condition="Exists('$(VSToolsPath)\TypeScript\Microsoft.TypeScript.targets')" />
When you create a Web Application with the help of the Telerik Creation and Configuration Wizard, you can add the TypeScript definitions needed with a single click of a checkbox.