3

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({

There is an error saying that:

The property modal does not exist on value of type 'JQueryStatic'

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

Fenton
  • 241,084
  • 71
  • 387
  • 401

1 Answers1

4

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

interface JQueryStatic {
  modal( options );
}
rekna
  • 5,313
  • 7
  • 45
  • 54