Including types from angular-ui-router

This change to the module definition allows both classic CommonJS imports
as well as new ES6 style imports, e.g. import { IState } from 'angular-ui-router';
This commit is contained in:
Michael Tiller
2015-12-03 08:29:49 -05:00
parent 0dd29bf825
commit 60caa355e5
+20 -3
View File
@@ -5,10 +5,27 @@
/// <reference path="../angularjs/angular.d.ts" />
// Support for AMD require
// Support for AMD require and CommonJS
declare module 'angular-ui-router' {
var _: string;
export = _;
// Since angular-ui-router adds providers for a bunch of
// injectable dependencies, it doesn't really return any
// actual data except the plain string 'ui.router'.
//
// As such, I don't think anybody will ever use the actual
// default value of the module. So I've only included the
// the types. (@xogeny)
export type IState = angular.ui.IState;
export type IStateProvider = angular.ui.IStateProvider;
export type IUrlMatcher = angular.ui.IUrlMatcher;
export type IUrlRouterProvider = angular.ui.IUrlRouterProvider;
export type IStateOptions = angular.ui.IStateOptions;
export type IHrefOptions = angular.ui.IHrefOptions;
export type IStateService = angular.ui.IStateService;
export type IResolvedState = angular.ui.IResolvedState;
export type IStateParamsService = angular.ui.IStateParamsService;
export type IUrlRouterService = angular.ui.IUrlRouterService;
export type IUiViewScrollProvider = angular.ui.IUiViewScrollProvider;
export type IType = angular.ui.IType;
}
declare module angular.ui {