A collection of TypeScript Definition files for SharePoint 2013 et al.

I’ve been doing a lot of work recently with TypeScript and have created a few definition files for stuff that I use often such as:

I’m planning to maintain these on GitHub as I add to them. Hopefully they’ll come in useful. You can find them here:  https://github.com/chaholl/TypeScriptDefinitions/

This entry was posted in Development, JavaScript, JQuery, SharePoint 2013, TypeScript. Bookmark the permalink.
  • johnnliu

    How do you resolve the self = this reference in event handlers?

    • chaholl

      I find that using delegates in TypeScript generally does the job. For example:
      type: “GET”,
      url: this.getUrl(“GetStatus”),
      dataType: “json”,
      cache: false,
      async: false,
      error: function (ex, status, error) {
      alert(“Unable to check status: ” + error);
      success: (response: MyResponseClass) => { this.processResponse(response);} });

      This will call the processResponse method via an enclosure that sets ‘this’ to the defining object as opposed to the originator of the event.

  • http://www.facebook.com/gandjustas Стас Выщепан