8 votes

Umbraco 7 TypeScript Definitions

This package provides access to the TypeScript definitions for the backoffice of Umbraco.  It should assist development of property editors, dialogs and custom sections.  It started out as a project for myself but it's really helped me out so much, I thought I'd release it to the community.

How to use it?

Simply install this package or install through NuGet.  I recommend installing angularjs.typescript.definitelytyped nuget package as well.  That will give you full intellisense for both the backoffice of umbraco and now angularjs.

It will provide the following:

  • Intellisense for useful resources and services
  • Provide access to available methods for the specific resource or service
  • Intellisense for parameters
  • Intellisense for the return types (including parameters for the callback)
  • Helps build the required arguments to pass to the methods
You can view the screenshots below for a better idea on what this does.
 
 
How to start out

Install this package or via NuGet :

PM> Install-Package UmbracoTypescriptDefinition

 

Create a new TypeScript file in Visual Studio, and reference the definitions by dragging in the file onto the typescript editor.  Make sure the typed definitions are included in Visual Studio.

Now you should be able to do:

angular.module("umbraco").controller("propertyEditorController",
        ["$scope", "notificationsService",
                function($scope: ng.IScope, notificationsService: umbraco.services.notificationService) {
                        //if I reference notificationsService anywhere, I will get intellisense
                        notificationsService.info("someHeader", "someMessage");
                  }                

]);

Don't forget to also install AngularJS.TypeScript.DefinitelyTyped.

I will be open sourcing this in the next few days ready for any contributions, if you'd like to help out.

 

Update:

1.1 Fixes a problem with iPromise

1.0 Initial release

Screenshots

Package owner

Craig Noble

Craig Noble

Craig has 574 karma points

Package Compatibility

This package is compatible with the following versions as reported by community members who have downloaded this package:
Untested or doesn't work on Umbraco Cloud
8.2.x (untested)
8.1.x (untested)
8.0.x (untested)
7.15.x (untested)
7.14.x (untested)
7.13.x (untested)
7.12.x (untested)
7.11.x (untested)
7.10.x (untested)
7.9.x (untested)
7.8.x (untested)
7.7.x (untested)
7.6.x (untested)
7.5.x (untested)
7.4.x (untested)
7.3.x (untested)
7.2.x (untested)
7.1.x (untested)
7.0.x (untested)
6.1.x (untested)
6.0.x (untested)

You must login before you can report on package compatibility.

Package Information

  • Package owner: Craig Noble
  • Created: 25/07/2015
  • Current version 1.1
  • .net Version 4.0
  • License MIT
  • Downloads: 865