diff --git a/angular-material/angular-material-0.9.0.d.ts b/angular-material/angular-material-0.9.0.d.ts index 06c1ecf25f..1383b0beb5 100644 --- a/angular-material/angular-material-0.9.0.d.ts +++ b/angular-material/angular-material-0.9.0.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-material/angular-material.d.ts b/angular-material/angular-material.d.ts index 17f8328e12..aba83a86f8 100644 --- a/angular-material/angular-material.d.ts +++ b/angular-material/angular-material.d.ts @@ -144,7 +144,7 @@ declare module angular.material { interface IToastService { show(optionsOrPreset: IToastOptions|IToastPreset): angular.IPromise; - showSimple(): angular.IPromise; + showSimple(content: string): angular.IPromise; simple(): ISimpleToastPreset; build(): IToastPreset; updateContent(): void; diff --git a/angular-ui-router/angular-ui-router.d.ts b/angular-ui-router/angular-ui-router.d.ts index acc9342d92..ed2f36ccfc 100644 --- a/angular-ui-router/angular-ui-router.d.ts +++ b/angular-ui-router/angular-ui-router.d.ts @@ -20,7 +20,7 @@ declare module angular.ui { /** * Function, returns HTML content string */ - templateProvider?: Function; + templateProvider?: Function | Array; /** * A controller paired to the state. Function OR name as String */ @@ -41,7 +41,7 @@ declare module angular.ui { /** * 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. */ - url?: string; + url?: string | IUrlMatcher; /** * A map which optionally configures parameters declared in the url, or defines additional non-url parameters. Only use this within a state if you are not using url. Otherwise you can specify your parameters within the url. When a state is navigated or transitioned to, the $stateParams service will be populated with any parameters that were passed. */ @@ -88,6 +88,9 @@ declare module angular.ui { compile(pattern: string): IUrlMatcher; isMatcher(o: any): boolean; type(name: string, definition: any, definitionFn?: any): any; + caseInsensitive(value: boolean): void; + defaultSquashPolicy(value: string): void; + strictMode(value: boolean): void; } interface IUrlRouterProvider extends angular.IServiceProvider { diff --git a/angular.throttle/angular.throttle-tests.ts b/angular.throttle/angular.throttle-tests.ts new file mode 100644 index 0000000000..2234adbc37 --- /dev/null +++ b/angular.throttle/angular.throttle-tests.ts @@ -0,0 +1,8 @@ +/// +/// + +var throttledFn = angular.throttle(function (someArg:any) { + return someArg; +}, 100); + +var result = throttledFn(10); diff --git a/angular.throttle/angular.throttle.d.ts b/angular.throttle/angular.throttle.d.ts new file mode 100644 index 0000000000..0a3033e67a --- /dev/null +++ b/angular.throttle/angular.throttle.d.ts @@ -0,0 +1,12 @@ +// Type definitions for angular.throttle +// Project: https://github.com/BaggersIO/angular.throttle +// Definitions by: Stefan Steinhart +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module angular { + interface IAngularStatic { + throttle:( fn:Function, throttle:number, options?:{leading?:boolean; trailing?:boolean;} ) => Function; + } +} diff --git a/angular2/angular2-2.0.0-alpha.30.d.ts b/angular2/angular2-2.0.0-alpha.30.d.ts new file mode 100644 index 0000000000..ecbcae245c --- /dev/null +++ b/angular2/angular2-2.0.0-alpha.30.d.ts @@ -0,0 +1,6875 @@ +// Type definitions for Angular v2.0.0-alpha.30 +// Project: http://angular.io/ +// Definitions by: angular team +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +// *********************************************************** +// 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 extends Map {} + +declare module ng { + type SetterFn = typeof Function; + type int = number; + interface Type extends Function { + // new (...args); + } + + // See https://github.com/Microsoft/TypeScript/issues/1168 + class BaseException /* extends Error */ { + message: string; + stack: string; + toString(): string; + } +} + + + +declare module ng { + + /** + * `DependencyAnnotation` is used by the framework to extend DI. + * + * Only annotations implementing `DependencyAnnotation` are added to the list of dependency + * properties. + * + * For example: + * + * ``` + * class Parent extends DependencyAnnotation {} + * class NotDependencyProperty {} + * + * class AComponent { + * constructor(@Parent @NotDependencyProperty aService:AService) {} + * } + * ``` + * + * will create the following dependency: + * + * ``` + * new Dependency(Key.get(AService), [new Parent()]) + * ``` + * + * The framework can use `new Parent()` to handle the `aService` dependency + * in a specific way. + * + * @exportedAs angular2/di_annotations + */ + class DependencyAnnotation { + + token: void; + } + + + /** + * Lifecycle events are guaranteed to be called in the following order: + * - `onChange` (optional if any bindings have changed), + * - `onInit` (optional after the first check only), + * - `onCheck`, + * - `onAllChangesDone` + */ + class LifecycleEvent { + + name: string; + } + + + /** + * An interface that NgFormModel and NgForm implement. + * + * Only used by the forms module. + */ + interface Form { + + addControl(dir: NgControl): void; + + removeControl(dir: NgControl): void; + + getControl(dir: NgControl): Control; + + addControlGroup(dir: NgControlGroup): void; + + removeControlGroup(dir: NgControlGroup): void; + + updateModel(dir: NgControl, value: any): void; + } + + + /** + * An interface implemented by all Angular type decorators, which allows them to be used as ES7 + * decorators as well as + * Angular DSL syntax. + * + * DSL syntax: + * + * ``` + * var MyClass = ng + * .Component({...}) + * .View({...}) + * .Class({...}); + * ``` + * + * ES7 syntax: + * + * ``` + * @ng.Component({...}) + * @ng.View({...}) + * class MyClass {...} + * ``` + */ + interface TypeDecorator { + + + /** + * Invoke as ES7 decorator. + */ + (type: T): T; + + + + /** + * Storage for the accumulated annotations so far used by the DSL syntax. + * + * Used by Class to annotate the generated class. + */ + annotations: Array; + + + /** + * Generate a class from the definition and annotate it with TypeDecorator. + */ + Class(obj: ClassDefinition): Type; + } + + + /** + * Declares the interface to be used with Class. + */ + interface ClassDefinition { + + + /** + * Optional argument for specifying the superclass. + */ + extends?: Type; + + + /** + * Required constructor function for a class. + * + * The function may be optionall wrapped in an `Array`, in which case additional parameter + * annotations may be + * specified. The number of arguments and the number of paramater annotations must match. + * + * See Class for example of usage. + */ + constructor: (Function | Array); + } + + + /** + * Specifies that a QueryList should be injected. + * + * See QueryList for usage and example. + * + * @exportedAs angular2/annotations + */ + class Query extends DependencyAnnotation { + + descendants: boolean; + + selector: void; + + isVarBindingQuery: boolean; + + varBindings: List; + + toString(): string; + } + + + /** + * A directive that contains a group of [NgControl]. + * + * Only used by the forms module. + */ + class ControlContainer { + + name: string; + + formDirective: Form; + + 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 { + + visibility: Visibility; + } + + + /** + * Specifies how injector should resolve a dependency. + * + * See Self, Parent, Ancestor, Unbounded. + * + * @exportedAs angular2/di_annotations + */ + class Visibility { + + depth: number; + + crossBoundaries: boolean; + + includeSelf: boolean; + + toString(): string; + } + + + /** + * 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 { + + reset(newList: any): void; + + add(obj: any): void; + + fireCallbacks(): void; + + onChange(callback: any): void; + + removeCallback(callback: any): void; + + length: void; + + first: void; + + last: void; + } + + class AppProtoView { + + elementBinders: List; + + protoLocals: Map; + + render: RenderProtoViewRef; + + protoChangeDetector: ProtoChangeDetector; + + variableBindings: Map; + + variableLocations: Map; + + 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; + } + + + /** + * Cost of making objects: http://jsperf.com/instantiate-size-of-object + */ + class AppView implements ChangeDispatcher, EventDispatcher { + + render: RenderViewRef; + + rootElementInjectors: List; + + elementInjectors: List; + + changeDetector: ChangeDetector; + + componentChildViews: List; + + viewContainers: List; + + preBuiltObjects: List; + + elementRefs: List; + + ref: ViewRef; + + + /** + * The context against which data-binding expressions in this view are evaluated against. + * This is always a component instance. + */ + context: any; + + + /** + * Variables, local to this view, that can be used in binding expressions (in addition to the + * context). This is used for thing like `