How to create a template for a TypeScript file?

I have the following:

(function ($) { /** * Opens a new modal window * @param object options an object with any of the following options * @return object the jQuery object of the new window */ $.modal = function (options) { var settings = $.extend({}, $.modal.defaults, options), root = getModalDiv(), 

In my code, I have:

 ///<reference path='jquery.d.ts' /> function alertWin(title, message) { $.modal({ 

An error has occurred:

The modal property does not exist with a value of type 'JQueryStatic'

To solve this problem, I need to create some kind of template file, and if so, how to do it?

+3
javascript typescript
source share
1 answer

Just extend the JQueryStatic interface, can be done in any file, typescript combines them

 interface JQueryStatic { modal( options ); } 
+4
source share

All Articles