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 584 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
Version 8.18.x (untested)

You must login before you can report on package compatibility.

Previously reported to work on versions:

Package Information

  • Package owner: Craig Noble
  • Created: 25/07/2015
  • Current version 1.1
  • .NET version 4.0
  • License MIT
  • Downloads on Our: 707