chore(typescript): updated angular2 files

This commit is contained in:
vsavkin
2015-08-31 16:14:18 -07:00
parent 04cf218909
commit 410dcba2f1
4 changed files with 6851 additions and 97 deletions
+231 -86
View File
@@ -1,4 +1,4 @@
// Type definitions for Angular v2.0.0-alpha.35
// Type definitions for Angular v2.0.0-alpha.36
// Project: http://angular.io/
// Definitions by: angular team <https://github.com/angular/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
@@ -1158,9 +1158,9 @@ declare module ng {
descendants: boolean;
isViewQuery: void;
isViewQuery: any;
selector: void;
selector: any;
isVarBindingQuery: boolean;
@@ -1200,7 +1200,7 @@ declare module ng {
attributeName: string;
token: void;
token: any;
toString(): string;
}
@@ -1250,7 +1250,7 @@ declare module ng {
* };
*
* MyComponent.annotations = [
* new ng.Component({...})
* new ng.Component({...}),
* new ng.View({...})
* ]
* MyComponent.parameters = [
@@ -1335,7 +1335,7 @@ declare module ng {
* };
*
* MyComponent.annotations = [
* new ng.Component({...})
* new ng.Component({...}),
* new ng.View({...})
* ]
* ```
@@ -1512,7 +1512,7 @@ declare module ng {
* };
*
* MyComponent.annotations = [
* new ng.Component({...})
* new ng.Component({...}),
* new ng.View({...})
* ]
* ```
@@ -1585,7 +1585,7 @@ declare module ng {
* };
*
* MyComponent.annotations = [
* new ng.Component({...})
* new ng.Component({...}),
* new ng.View({...})
* ]
* MyComponent.parameters = [
@@ -1604,7 +1604,7 @@ declare module ng {
/**
* {@link ViewQueryMetadata} factory function.
* {@link di/ViewQueryMetadata} factory function.
*/
var ViewQuery : QueryFactory ;
@@ -2020,6 +2020,8 @@ declare module ng {
*/
class WrappedValue {
static wrap(value: any): WrappedValue;
wrapped: any;
}
@@ -2075,6 +2077,30 @@ declare module ng {
*/
class IterableDiffers {
static create(factories: IterableDifferFactory[], parent?: IterableDiffers): IterableDiffers;
/**
* Takes an array of {@link IterableDifferFactory} and returns a binding used to extend the
* inherited {@link IterableDiffers} instance with the provided factories and return a new
* {@link IterableDiffers} instance.
*
* The following example shows how to extend an existing list of factories,
* which will only be applied to the injector for this component and its children.
* This step is all that's required to make a new {@link IterableDiffer} available.
*
* # Example
*
* ```
* @Component({
* viewBindings: [
* IterableDiffers.extend([new ImmutableListDiffer()])
* ]
* })
* ```
*/
static extend(factories: IterableDifferFactory[]): Binding;
factories: IterableDifferFactory[];
find(iterable: Object): IterableDifferFactory;
@@ -2104,6 +2130,30 @@ declare module ng {
*/
class KeyValueDiffers {
static create(factories: KeyValueDifferFactory[], parent?: KeyValueDiffers): KeyValueDiffers;
/**
* Takes an array of {@link KeyValueDifferFactory} and returns a binding used to extend the
* inherited {@link KeyValueDiffers} instance with the provided factories and return a new
* {@link KeyValueDiffers} instance.
*
* The following example shows how to extend an existing list of factories,
* which will only be applied to the injector for this component and its children.
* This step is all that's required to make a new {@link KeyValueDiffer} available.
*
* # Example
*
* ```
* @Component({
* viewBindings: [
* KeyValueDiffers.extend([new ImmutableMapDiffer()])
* ]
* })
* ```
*/
static extend(factories: KeyValueDifferFactory[]): Binding;
factories: KeyValueDifferFactory[];
find(kv: Object): KeyValueDifferFactory;
@@ -2147,41 +2197,6 @@ declare module ng {
const APP_COMPONENT : OpaqueToken ;
/**
* Represents a Angular's representation of an Application.
*
* `ApplicationRef` represents a running application instance. Use it to retrieve the host
* component, injector,
* or dispose of an application.
*/
interface ApplicationRef {
/**
* Returns the current {@link ComponentMetadata} type.
*/
hostComponentType: Type;
/**
* Returns the current {@link ComponentMetadata} instance.
*/
hostComponent: any;
/**
* Dispose (un-load) the application.
*/
dispose(): void;
/**
* Returns the root application {@link Injector}.
*/
injector: Injector;
}
/**
* Bootstrapping for Angular applications.
*
@@ -2323,6 +2338,41 @@ declare module ng {
}
/**
* Represents a Angular's representation of an Application.
*
* `ApplicationRef` represents a running application instance. Use it to retrieve the host
* component, injector,
* or dispose of an application.
*/
interface ApplicationRef {
/**
* Returns the current {@link ComponentMetadata} type.
*/
hostComponentType: Type;
/**
* Returns the current {@link ComponentMetadata} instance.
*/
hostComponent: any;
/**
* Dispose (un-load) the application.
*/
dispose(): void;
/**
* Returns the root application {@link Injector}.
*/
injector: Injector;
}
/**
* Specifies app root url for the application.
*
@@ -2338,7 +2388,7 @@ declare module ng {
/**
* Returns the base URL of the currently running application.
*/
value: void;
value: any;
}
@@ -3031,9 +3081,10 @@ declare module ng {
* A reference to an Angular ProtoView.
*
* A ProtoView is a reference to a template for easy creation of views.
* (See {@link AppViewManager#createViewInContainer} and {@link AppViewManager#createRootHostView}).
* (See {@link AppViewManager#createViewInContainer `AppViewManager#createViewInContainer`} and
* {@link AppViewManager#createRootHostView `AppViewManager#createRootHostView`}).
*
* A `ProtoView` is a foctary for creating `View`s.
* A `ProtoView` is a factory for creating `View`s.
*
* ## Example
*
@@ -3303,7 +3354,7 @@ declare module ng {
*/
class InjectMetadata {
token: void;
token: any;
toString(): string;
}
@@ -3458,7 +3509,7 @@ declare module ng {
*/
class DependencyMetadata {
token: void;
token: any;
}
@@ -3544,6 +3595,52 @@ declare module ng {
class Injector {
/**
* Turns a list of binding definitions into an internal resolved list of resolved bindings.
*
* A resolution is a process of flattening multiple nested lists and converting individual
* bindings into a list of {@link ResolvedBinding}s. The resolution can be cached by `resolve`
* for the {@link Injector} for performance-sensitive code.
*
* @param `bindings` can be a list of `Type`, {@link Binding}, {@link ResolvedBinding}, or a
* recursive list of more bindings.
*
* The returned list is sparse, indexed by `id` for the {@link Key}. It is generally not useful to
* application code
* other than for passing it to {@link Injector} functions that require resolved binding lists,
* such as
* `fromResolvedBindings` and `createChildFromResolved`.
*/
static resolve(bindings: List<Type | Binding | List<any>>): List<ResolvedBinding>;
/**
* Resolves bindings and creates an injector based on those bindings. This function is slower than
* the corresponding `fromResolvedBindings` because it needs to resolve bindings first. See
* `resolve`
* for the {@link Injector}.
*
* Prefer `fromResolvedBindings` in performance-critical code that creates lots of injectors.
*
* @param `bindings` can be a list of `Type`, {@link Binding}, {@link ResolvedBinding}, or a
* recursive list of more
* bindings.
* @param `depProvider`
*/
static resolveAndCreate(bindings: List<Type | Binding | List<any>>, depProvider?: DependencyProvider): Injector;
/**
* Creates an injector from previously resolved bindings. This bypasses resolution and flattening.
* This API is the recommended way to construct injectors in performance-sensitive parts.
*
* @param `bindings` A sparse list of {@link ResolvedBinding}s. See `resolve` for the
* {@link Injector}.
* @param `depProvider`
*/
static fromResolvedBindings(bindings: List<ResolvedBinding>, depProvider?: DependencyProvider): Injector;
/**
* Returns debug information about the injector.
*
@@ -3699,7 +3796,7 @@ declare module ng {
/**
* Token used when retrieving this binding. Usually the `Type`.
*/
token: void;
token: any;
/**
@@ -3748,7 +3845,7 @@ declare module ng {
* expect(injector.get(String)).toEqual('Hello');
* ```
*/
toValue: void;
toValue: any;
/**
@@ -3784,7 +3881,7 @@ declare module ng {
* expect(injectorClass.get(Vehicle) instanceof Car).toBe(true);
* ```
*/
toAlias: void;
toAlias: any;
/**
@@ -3841,7 +3938,7 @@ declare module ng {
*/
class BindingBuilder {
token: void;
token: any;
/**
@@ -3982,6 +4079,8 @@ declare module ng {
*/
class Dependency {
static fromKey(key: Key): Dependency;
key: Key;
optional: boolean;
@@ -4019,7 +4118,19 @@ declare module ng {
* Keys are used internally by the {@link Injector} because their system-wide unique `id`s allow the
* injector to index in arrays rather than looking up items in maps.
*/
interface Key {
class Key {
/**
* Retrieves a `Key` for a token.
*/
static get(token: Object): Key;
/**
* @returns the number of keys registered in the system.
*/
static numberOfKeys: number;
token: Object;
@@ -4075,7 +4186,7 @@ declare module ng {
addKey(injector: Injector, key: Key): void;
context: void;
context: any;
toString(): string;
}
@@ -4280,7 +4391,7 @@ declare module ng {
* instead of writing:
*
* ```
* import {If, NgFor, NgSwitch, NgSwitchWhen, NgSwitchDefault} from 'angular2/angular2';
* import {NgClass, NgIf, NgFor, NgSwitch, NgSwitchWhen, NgSwitchDefault} from 'angular2/angular2';
* import {OtherDirective} from 'myDirectives';
*
* @Component({
@@ -4288,16 +4399,16 @@ declare module ng {
* })
* @View({
* templateUrl: 'myComponent.html',
* directives: [If, NgFor, NgSwitch, NgSwitchWhen, NgSwitchDefault, OtherDirective]
* directives: [NgClass, NgIf, NgFor, NgSwitch, NgSwitchWhen, NgSwitchDefault, OtherDirective]
* })
* export class MyComponent {
* ...
* }
* ```
* one could enumerate all the core directives at once:
* one could import all the core directives at once:
*
* ```
* import {coreDirectives} from 'angular2/angular2';
* import {CORE_DIRECTIVES} from 'angular2/angular2';
* import {OtherDirective} from 'myDirectives';
*
* @Component({
@@ -4305,7 +4416,7 @@ declare module ng {
* })
* @View({
* templateUrl: 'myComponent.html',
* directives: [coreDirectives, OtherDirective]
* directives: [CORE_DIRECTIVES, OtherDirective]
* })
* export class MyComponent {
* ...
@@ -4337,9 +4448,9 @@ declare module ng {
*/
class NgClass {
initialClasses: void;
initialClasses: any;
rawClass: void;
rawClass: any;
onCheck(): void;
@@ -4379,6 +4490,10 @@ declare module ng {
*/
class NgFor {
static bulkRemove(tuples: List<RecordViewTuple>, viewContainer: ViewContainerRef): List<RecordViewTuple>;
static bulkInsert(tuples: List<RecordViewTuple>, viewContainer: ViewContainerRef, templateRef: TemplateRef): List<RecordViewTuple>;
viewContainer: ViewContainerRef;
templateRef: TemplateRef;
@@ -4387,7 +4502,7 @@ declare module ng {
cdr: ChangeDetectorRef;
ngForOf: void;
ngForOf: any;
onCheck(): void;
}
@@ -4424,7 +4539,7 @@ declare module ng {
*/
class NgIf {
ngIf: void;
ngIf: any;
}
@@ -4455,20 +4570,20 @@ declare module ng {
* # Example:
*
* ```
* <div ng-style="{'text-align': alignEpr}"></div>
* <div [ng-style]="{'text-align': alignExp}"></div>
* ```
*
* In the above example the `text-align` style will be updated based on the `alignEpr` value
* In the above example the `text-align` style will be updated based on the `alignExp` value
* changes.
*
* # Syntax
*
* - `<div ng-style="{'text-align': alignEpr}"></div>`
* - `<div ng-style="styleExp"></div>`
* - `<div [ng-style]="{'text-align': alignExp}"></div>`
* - `<div [ng-style]="styleExp"></div>`
*/
class NgStyle {
rawStyle: void;
rawStyle: any;
onCheck(): void;
}
@@ -4508,7 +4623,7 @@ declare module ng {
*/
class NgSwitch {
ngSwitch: void;
ngSwitch: any;
}
@@ -4529,7 +4644,7 @@ declare module ng {
*/
class NgSwitchWhen {
ngSwitchWhen: void;
ngSwitchWhen: any;
}
@@ -4782,7 +4897,7 @@ declare module ng {
*/
class NgControlName extends NgControl {
update: void;
update: any;
model: any;
@@ -4855,7 +4970,7 @@ declare module ng {
form: Control;
update: void;
update: any;
model: any;
@@ -4893,7 +5008,7 @@ declare module ng {
*/
class NgModel extends NgControl {
update: void;
update: any;
model: any;
@@ -5055,7 +5170,7 @@ declare module ng {
directives: List<NgControl>;
ngSubmit: void;
ngSubmit: any;
onChange(_: any): void;
@@ -5119,7 +5234,7 @@ declare module ng {
form: ControlGroup;
ngSubmit: void;
ngSubmit: any;
formDirective: Form;
@@ -5175,9 +5290,9 @@ declare module ng {
cd: NgControl;
onChange: void;
onChange: any;
onTouched: void;
onTouched: any;
renderer: Renderer;
@@ -5215,9 +5330,9 @@ declare module ng {
cd: NgControl;
onChange: void;
onChange: any;
onTouched: void;
onTouched: any;
renderer: Renderer;
@@ -5267,9 +5382,9 @@ declare module ng {
value: string;
onChange: void;
onChange: any;
onTouched: void;
onTouched: any;
renderer: Renderer;
@@ -5313,6 +5428,16 @@ declare module ng {
* ```
*/
class Validators {
static required(c:Control): StringMap<string, boolean>;
static nullValidator(c: any): StringMap<string, boolean>;
static compose(validators: List<Function>): Function;
static group(c:ControlGroup): StringMap<string, boolean>;
static array(c:ControlArray): StringMap<string, boolean>;
}
class NgValidator {
@@ -5403,6 +5528,30 @@ declare module ng {
class RenderDirectiveMetadata {
static DIRECTIVE_TYPE: any;
static COMPONENT_TYPE: any;
static create({id, selector, compileChildren, events, host, properties, readAttributes, type,
callOnDestroy, callOnChange, callOnCheck, callOnInit, callOnAllChangesDone,
changeDetection, exportAs}: {
id?: string,
selector?: string,
compileChildren?: boolean,
events?: List<string>,
host?: Map<string, string>,
properties?: List<string>,
readAttributes?: List<string>,
type?: number,
callOnDestroy?: boolean,
callOnChange?: boolean,
callOnCheck?: boolean,
callOnInit?: boolean,
callOnAllChangesDone?: boolean,
changeDetection?: string,
exportAs?: string
}): RenderDirectiveMetadata;
id: any;
selector: string;
@@ -5668,8 +5817,6 @@ declare module ng {
*/
const APP_ID : OpaqueToken ;
const DOM_REFLECT_PROPERTIES_AS_ATTRIBUTES : OpaqueToken ;
/**
* Defines when a compiled template should be stored as a string
@@ -5764,8 +5911,6 @@ declare module ng {
var ComponentRef: InjectableReference;
var Key: InjectableReference;
}
declare module "angular2/angular2" {