diff --git a/angular-material/angular-material.d.ts b/angular-material/angular-material.d.ts index 06c1ecf25f..1383b0beb5 100644 --- a/angular-material/angular-material.d.ts +++ b/angular-material/angular-material.d.ts @@ -150,8 +150,8 @@ declare module angular.material { A400?: string; A700?: string; contrastDefaultColor?: string; - contrastDarkColors?: string; - contrastStrongLightColors?: string; + contrastDarkColors?: string|string[]; + contrastLightColors?: string|string[]; } interface MDThemeHues { diff --git a/angular-ui-router/angular-ui-router-tests.ts b/angular-ui-router/angular-ui-router-tests.ts index c31bb16889..a43f9e9bca 100644 --- a/angular-ui-router/angular-ui-router-tests.ts +++ b/angular-ui-router/angular-ui-router-tests.ts @@ -64,7 +64,16 @@ myApp.config(( controller: function ($scope: MyAppScope) { $scope.things = ["A", "Set", "Of", "Things"]; } - }).state('index', { + }) + .state('list', { + parent: 'state3', + url: "/list", + templateUrl: "partials/state3.list.html", + controller: function ($scope: MyAppScope) { + $scope.things = ["A", "Set", "Of", "Things"]; + } + }) + .state('index', { url: "", views: { "viewA": { template: "index.viewA" }, diff --git a/angular-ui-router/angular-ui-router.d.ts b/angular-ui-router/angular-ui-router.d.ts index bfec95156e..acc9342d92 100644 --- a/angular-ui-router/angular-ui-router.d.ts +++ b/angular-ui-router/angular-ui-router.d.ts @@ -30,6 +30,13 @@ declare module angular.ui { * Function (injectable), returns the actual controller function or string. */ controllerProvider?: Function; + + /** + * Specifies the parent state of this state + */ + parent?: string | IState + + resolve?: {}; /** * A url with optional parameters. When a state is navigated or transitioned to, the $stateParams service will be populated with any parameters that were passed. diff --git a/angular2/angular2-tests.ts b/angular2/angular2-tests.ts index bdd2628e56..3cadc3b9a4 100644 --- a/angular2/angular2-tests.ts +++ b/angular2/angular2-tests.ts @@ -2,7 +2,6 @@ // Use Typescript 1.4 style imports import ng = require("angular2/angular2"); -import di = require("angular2/di"); class Service { @@ -17,11 +16,21 @@ class Cmp { Cmp.annotations = [ ng.Component({ selector: 'cmp', - injectables: [Service, di.bind(Service2).toValue(null)] + injectables: [Service, ng.bind(Service2).toValue(null)] }), ng.View({ template: '{{greeting}} world!', - directives: [ng.For, ng.If] + directives: [ng.NgFor, ng.NgIf] + }), + ng.Directive({ + selector: '[tooltip]', + properties: [ + 'text: tooltip' + ], + hostListeners: { + 'onmouseenter': 'onMouseEnter()', + 'onmouseleave': 'onMouseLeave()' + } }) ]; diff --git a/angular2/angular2.d.ts b/angular2/angular2.d.ts index fa3cc77889..a4af962024 100644 --- a/angular2/angular2.d.ts +++ b/angular2/angular2.d.ts @@ -1,299 +1,1104 @@ -// Type definitions for Angular v2.0.0-alpha.22 +// Type definitions for Angular v2.0.0-alpha.26 // Project: http://angular.io/ // Definitions by: angular team // Definitions: https://github.com/borisyankov/DefinitelyTyped -/****************** - * This is a minimal type definition for the Angular2 quickstart. - * We plan to publish a complete definition soon. - ******************/ +// *********************************************************** +// This file is generated by the Angular build process. +// Please do not create manual edits or send pull requests +// modifying this file. +// *********************************************************** + +// Angular depends transitively on these libraries. +// If you don't have them installed you can run +// $ tsd query es6-promise rx rx-lite --action install --save +/// +/// interface List extends Array {} +interface Map {} +interface StringMap {} interface Type {} -interface _ComponentArg { +declare module "angular2/angular2" { + type SetterFn = typeof Function; + type int = number; + + // See https://github.com/Microsoft/TypeScript/issues/1168 + class BaseException /* extends Error */ { + message: any; + stack: any; + toString(): string; + } +} + + +declare module "angular2/angular2" { + class AbstractChangeDetector extends ChangeDetector { + addChild(cd: ChangeDetector): any; + addShadowDomChild(cd: ChangeDetector): any; + callOnAllChangesDone(): any; + checkNoChanges(): any; + detectChanges(): any; + detectChangesInRecords(throwOnChange: boolean): any; + lightDomChildren: List; + markAsCheckOnce(): any; + markPathToRootAsCheckOnce(): any; + mode: string; + parent: ChangeDetector; + ref: ChangeDetectorRef; + remove(): any; + removeChild(cd: ChangeDetector): any; + removeShadowDomChild(cd: ChangeDetector): any; + shadowDomChildren: List; + } + + class ProtoRecord { + args: List; + bindingRecord: BindingRecord; + contextIndex: number; + directiveIndex: DirectiveIndex; + expressionAsString: string; + fixedArgs: List; + funcOrValue: any; + isLifeCycleRecord(): boolean; + isPipeRecord(): boolean; + isPureFunction(): boolean; + lastInBinding: boolean; + lastInDirective: boolean; + mode: number; + name: string; + selfIndex: number; + } + + class LifecycleEvent { + name: string; + } + + interface FormDirective { + addControl(dir: ControlDirective): void; + addControlGroup(dir: ControlGroupDirective): void; + getControl(dir: ControlDirective): Control; + removeControl(dir: ControlDirective): void; + removeControlGroup(dir: ControlGroupDirective): void; + updateModel(dir: ControlDirective, value: any): void; + } + + /** - * The CSS selector that triggers the instantiation of a directive. + * A directive that contains a group of [ControlDirective]. + * + * @exportedAs angular2/forms + */ + class ControlContainerDirective { + formDirective: FormDirective; + name: string; + path: List; + } + + + /** + * A marker annotation that marks a class as available to `Injector` for creation. Used by tooling + * for generating constructor stubs. + * + * ``` + * class NeedsService { + * constructor(svc:UsefulService) {} + * } + * + * @Injectable + * class UsefulService {} + * ``` + * @exportedAs angular2/di_annotations + */ + class Injectable { + } + + + /** + * Injectable Objects that contains a live list of child directives in the light Dom of a directive. + * The directives are kept in depth-first pre-order traversal of the DOM. + * + * In the future this class will implement an Observable interface. + * For now it uses a plain list of observable callbacks. + * + * @exportedAs angular2/view + */ + class BaseQueryList { + add(obj: any): any; + fireCallbacks(): any; + onChange(callback: any): any; + removeCallback(callback: any): any; + reset(newList: any): any; + } + + class AppProtoView { + bindElement(parent: ElementBinder, distanceToParent: int, protoElementInjector: ProtoElementInjector, componentDirective?: DirectiveBinding): ElementBinder; + + /** + * Adds an event binding for the last created ElementBinder via bindElement. + * + * If the directive index is a positive integer, the event is evaluated in the context of + * the given directive. + * + * If the directive index is -1, the event is evaluated in the context of the enclosing view. + * + * @param {string} eventName + * @param {AST} expression + * @param {int} directiveIndex The directive index in the binder or -1 when the event is not bound + * to a directive + */ + bindEvent(eventBindings: List, boundElementIndex: number, directiveIndex?: int): void; + elementBinders: List; + protoChangeDetector: ProtoChangeDetector; + protoLocals: Map; + render: RenderProtoViewRef; + variableBindings: Map; + } + + + /** + * Const of making objects: http://jsperf.com/instantiate-size-of-object + */ + class AppView implements ChangeDispatcher, EventDispatcher { + callAction(elementIndex: number, actionExpression: string, action: Object): any; + changeDetector: ChangeDetector; + componentChildViews: List; + + /** + * The context against which data-binding expressions in this view are evaluated against. + * This is always a component instance. + */ + context: any; + dispatchEvent(elementIndex: number, eventName: string, locals: Map): boolean; + elementInjectors: List; + freeHostViews: List; + getDetectorFor(directive: DirectiveIndex): any; + getDirectiveFor(directive: DirectiveIndex): any; + hydrated(): boolean; + init(changeDetector: ChangeDetector, elementInjectors: List, rootElementInjectors: List, preBuiltObjects: List, componentChildViews: List): any; + + /** + * Variables, local to this view, that can be used in binding expressions (in addition to the + * context). This is used for thing like `