mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-06 09:19:08 +00:00
Merge pull request #6174 from angular/2.0.0-alpha.39
angular2-2.0.0-alpha.39
This commit is contained in:
17105
angular2/angular2-2.0.0-alpha.39.d.ts
vendored
Normal file
17105
angular2/angular2-2.0.0-alpha.39.d.ts
vendored
Normal file
File diff suppressed because it is too large
Load Diff
127
angular2/angular2.d.ts
vendored
127
angular2/angular2.d.ts
vendored
@@ -1,4 +1,4 @@
|
||||
// Type definitions for Angular v2.0.0-local_sha.f77234e
|
||||
// Type definitions for Angular v2.0.0-39
|
||||
// Project: http://angular.io/
|
||||
// Definitions by: angular team <https://github.com/angular/>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
@@ -27,7 +27,6 @@
|
||||
|
||||
|
||||
interface Map<K,V> {}
|
||||
interface StringMap<K,V> extends Map<K,V> {}
|
||||
|
||||
|
||||
declare module ng {
|
||||
@@ -463,12 +462,12 @@ declare module ng {
|
||||
outputs?: string[],
|
||||
properties?: string[],
|
||||
events?: string[],
|
||||
host?: StringMap<string, string>,
|
||||
host?: {[key: string]: string},
|
||||
bindings?: any[],
|
||||
exportAs?: string,
|
||||
moduleId?: string,
|
||||
viewBindings?: any[],
|
||||
queries?: StringMap<string, any>,
|
||||
queries?: {[key: string]: any},
|
||||
changeDetection?: ChangeDetectionStrategy,
|
||||
});
|
||||
|
||||
@@ -915,11 +914,11 @@ declare module ng {
|
||||
outputs?: string[],
|
||||
properties?: string[],
|
||||
events?: string[],
|
||||
host?: StringMap<string, string>,
|
||||
host?: {[key: string]: string},
|
||||
bindings?: any[],
|
||||
exportAs?: string,
|
||||
moduleId?: string,
|
||||
queries?: StringMap<string, any>
|
||||
queries?: {[key: string]: any}
|
||||
});
|
||||
|
||||
/**
|
||||
@@ -1169,7 +1168,7 @@ declare module ng {
|
||||
* }
|
||||
* ```
|
||||
*/
|
||||
host: StringMap<string, string>;
|
||||
host: {[key: string]: string};
|
||||
|
||||
/**
|
||||
* Defines the set of injectable objects that are visible to a Directive and its light DOM
|
||||
@@ -1284,7 +1283,7 @@ declare module ng {
|
||||
* }
|
||||
* ```
|
||||
*/
|
||||
queries: StringMap<string, any>;
|
||||
queries: {[key: string]: any};
|
||||
|
||||
}
|
||||
|
||||
@@ -1751,11 +1750,11 @@ declare module ng {
|
||||
outputs?: string[],
|
||||
properties?: string[],
|
||||
events?: string[],
|
||||
host?: StringMap<string, string>,
|
||||
host?: {[key: string]: string},
|
||||
bindings?: any[],
|
||||
exportAs?: string,
|
||||
moduleId?: string,
|
||||
queries?: StringMap<string, any>
|
||||
queries?: {[key: string]: any}
|
||||
}): DirectiveMetadata;
|
||||
|
||||
(obj: {
|
||||
@@ -1764,11 +1763,11 @@ declare module ng {
|
||||
outputs?: string[],
|
||||
properties?: string[],
|
||||
events?: string[],
|
||||
host?: StringMap<string, string>,
|
||||
host?: {[key: string]: string},
|
||||
bindings?: any[],
|
||||
exportAs?: string,
|
||||
moduleId?: string,
|
||||
queries?: StringMap<string, any>
|
||||
queries?: {[key: string]: any}
|
||||
}): DirectiveDecorator;
|
||||
|
||||
}
|
||||
@@ -1825,11 +1824,11 @@ declare module ng {
|
||||
outputs?: string[],
|
||||
properties?: string[],
|
||||
events?: string[],
|
||||
host?: StringMap<string, string>,
|
||||
host?: {[key: string]: string},
|
||||
bindings?: any[],
|
||||
exportAs?: string,
|
||||
moduleId?: string,
|
||||
queries?: StringMap<string, any>,
|
||||
queries?: {[key: string]: any},
|
||||
viewBindings?: any[],
|
||||
changeDetection?: ChangeDetectionStrategy,
|
||||
}): ComponentMetadata;
|
||||
@@ -1840,11 +1839,11 @@ declare module ng {
|
||||
outputs?: string[],
|
||||
properties?: string[],
|
||||
events?: string[],
|
||||
host?: StringMap<string, string>,
|
||||
host?: {[key: string]: string},
|
||||
bindings?: any[],
|
||||
exportAs?: string,
|
||||
moduleId?: string,
|
||||
queries?: StringMap<string, any>,
|
||||
queries?: {[key: string]: any},
|
||||
viewBindings?: any[],
|
||||
changeDetection?: ChangeDetectionStrategy,
|
||||
}): ComponentDecorator;
|
||||
@@ -2358,7 +2357,7 @@ declare module ng {
|
||||
*
|
||||
* See {@link Class} for example of usage.
|
||||
*/
|
||||
constructor: (Function | any[]);
|
||||
constructor: Function | any[];
|
||||
|
||||
}
|
||||
|
||||
@@ -4797,7 +4796,7 @@ declare module ng {
|
||||
*/
|
||||
interface OnChanges {
|
||||
|
||||
onChanges(changes: StringMap<string, SimpleChange>): void;
|
||||
onChanges(changes: {[key: string]: SimpleChange}): void;
|
||||
|
||||
}
|
||||
|
||||
@@ -5880,7 +5879,7 @@ declare module ng {
|
||||
* Once a template is registered it can be referenced via {@link RenderBeginComponentCmd} when
|
||||
* {@link #createProtoView creating Render ProtoView}.
|
||||
*/
|
||||
registerComponentTemplate(templateId: number, commands: RenderTemplateCmd[], styles: string[]): void;
|
||||
registerComponentTemplate(templateId: number, commands: RenderTemplateCmd[], styles: string[], nativeShadow: boolean): void;
|
||||
|
||||
/**
|
||||
* Creates a {@link RenderProtoViewRef} from an array of {@link RenderTemplateCmd}`s.
|
||||
@@ -6489,7 +6488,7 @@ declare module ng {
|
||||
|
||||
valid: boolean;
|
||||
|
||||
errors: StringMap<string, any>;
|
||||
errors: {[key: string]: any};
|
||||
|
||||
pristine: boolean;
|
||||
|
||||
@@ -6578,9 +6577,9 @@ declare module ng {
|
||||
*/
|
||||
class ControlGroup extends AbstractControl {
|
||||
|
||||
constructor(controls: StringMap<string, AbstractControl>, optionals?: StringMap<string, boolean>, validator?: Function);
|
||||
constructor(controls: {[key: string]: AbstractControl}, optionals?: {[key: string]: boolean}, validator?: Function);
|
||||
|
||||
controls: StringMap<string, AbstractControl>;
|
||||
controls: {[key: string]: AbstractControl};
|
||||
|
||||
addControl(name: string, control: AbstractControl): void;
|
||||
|
||||
@@ -6658,7 +6657,7 @@ declare module ng {
|
||||
|
||||
valid: boolean;
|
||||
|
||||
errors: StringMap<string, any>;
|
||||
errors: {[key: string]: any};
|
||||
|
||||
pristine: boolean;
|
||||
|
||||
@@ -6779,7 +6778,7 @@ declare module ng {
|
||||
|
||||
validators: Function[];
|
||||
|
||||
onChanges(changes: StringMap<string, SimpleChange>): void;
|
||||
onChanges(changes: {[key: string]: SimpleChange}): void;
|
||||
|
||||
onDestroy(): void;
|
||||
|
||||
@@ -6859,7 +6858,7 @@ declare module ng {
|
||||
|
||||
validators: Function[];
|
||||
|
||||
onChanges(changes: StringMap<string, SimpleChange>): void;
|
||||
onChanges(changes: {[key: string]: SimpleChange}): void;
|
||||
|
||||
path: string[];
|
||||
|
||||
@@ -6905,7 +6904,7 @@ declare module ng {
|
||||
|
||||
validators: Function[];
|
||||
|
||||
onChanges(changes: StringMap<string, SimpleChange>): void;
|
||||
onChanges(changes: {[key: string]: SimpleChange}): void;
|
||||
|
||||
control: Control;
|
||||
|
||||
@@ -7176,7 +7175,7 @@ declare module ng {
|
||||
|
||||
path: string[];
|
||||
|
||||
controls: StringMap<string, AbstractControl>;
|
||||
controls: {[key: string]: AbstractControl};
|
||||
|
||||
addControl(dir: NgControl): void;
|
||||
|
||||
@@ -7357,15 +7356,15 @@ declare module ng {
|
||||
*/
|
||||
class Validators {
|
||||
|
||||
static required(control:Control): StringMap<string, boolean>;
|
||||
static required(control:Control): {[key: string]: boolean};
|
||||
|
||||
static nullValidator(c: any): StringMap<string, boolean>;
|
||||
static nullValidator(c: any): {[key: string]: boolean};
|
||||
|
||||
static compose(validators: Function[]): Function;
|
||||
|
||||
static group(group:ControlGroup): StringMap<string, boolean>;
|
||||
static group(group:ControlGroup): {[key: string]: any[]};
|
||||
|
||||
static array(array:ControlArray): StringMap<string, boolean>;
|
||||
static array(array:ControlArray): {[key: string]: any[]};
|
||||
|
||||
}
|
||||
|
||||
@@ -7437,7 +7436,7 @@ declare module ng {
|
||||
*/
|
||||
class FormBuilder {
|
||||
|
||||
group(controlsConfig: StringMap<string, any>, extra?: StringMap<string, any>): ControlGroup;
|
||||
group(controlsConfig: {[key: string]: any}, extra?: {[key: string]: any}): ControlGroup;
|
||||
|
||||
control(value: Object, validator?: Function): Control;
|
||||
|
||||
@@ -8342,7 +8341,7 @@ declare module ngWorker {
|
||||
* Once a template is registered it can be referenced via {@link RenderBeginComponentCmd} when
|
||||
* {@link #createProtoView creating Render ProtoView}.
|
||||
*/
|
||||
registerComponentTemplate(templateId: number, commands: RenderTemplateCmd[], styles: string[]): void;
|
||||
registerComponentTemplate(templateId: number, commands: RenderTemplateCmd[], styles: string[], nativeShadow: boolean): void;
|
||||
|
||||
/**
|
||||
* Creates a {@link RenderProtoViewRef} from an array of {@link RenderTemplateCmd}`s.
|
||||
@@ -8933,7 +8932,7 @@ declare module ngWorker {
|
||||
*/
|
||||
interface OnChanges {
|
||||
|
||||
onChanges(changes: StringMap<string, SimpleChange>): void;
|
||||
onChanges(changes: {[key: string]: SimpleChange}): void;
|
||||
|
||||
}
|
||||
|
||||
@@ -9499,12 +9498,12 @@ declare module ngWorker {
|
||||
outputs?: string[],
|
||||
properties?: string[],
|
||||
events?: string[],
|
||||
host?: StringMap<string, string>,
|
||||
host?: {[key: string]: string},
|
||||
bindings?: any[],
|
||||
exportAs?: string,
|
||||
moduleId?: string,
|
||||
viewBindings?: any[],
|
||||
queries?: StringMap<string, any>,
|
||||
queries?: {[key: string]: any},
|
||||
changeDetection?: ChangeDetectionStrategy,
|
||||
});
|
||||
|
||||
@@ -9951,11 +9950,11 @@ declare module ngWorker {
|
||||
outputs?: string[],
|
||||
properties?: string[],
|
||||
events?: string[],
|
||||
host?: StringMap<string, string>,
|
||||
host?: {[key: string]: string},
|
||||
bindings?: any[],
|
||||
exportAs?: string,
|
||||
moduleId?: string,
|
||||
queries?: StringMap<string, any>
|
||||
queries?: {[key: string]: any}
|
||||
});
|
||||
|
||||
/**
|
||||
@@ -10205,7 +10204,7 @@ declare module ngWorker {
|
||||
* }
|
||||
* ```
|
||||
*/
|
||||
host: StringMap<string, string>;
|
||||
host: {[key: string]: string};
|
||||
|
||||
/**
|
||||
* Defines the set of injectable objects that are visible to a Directive and its light DOM
|
||||
@@ -10320,7 +10319,7 @@ declare module ngWorker {
|
||||
* }
|
||||
* ```
|
||||
*/
|
||||
queries: StringMap<string, any>;
|
||||
queries: {[key: string]: any};
|
||||
|
||||
}
|
||||
|
||||
@@ -10787,11 +10786,11 @@ declare module ngWorker {
|
||||
outputs?: string[],
|
||||
properties?: string[],
|
||||
events?: string[],
|
||||
host?: StringMap<string, string>,
|
||||
host?: {[key: string]: string},
|
||||
bindings?: any[],
|
||||
exportAs?: string,
|
||||
moduleId?: string,
|
||||
queries?: StringMap<string, any>
|
||||
queries?: {[key: string]: any}
|
||||
}): DirectiveMetadata;
|
||||
|
||||
(obj: {
|
||||
@@ -10800,11 +10799,11 @@ declare module ngWorker {
|
||||
outputs?: string[],
|
||||
properties?: string[],
|
||||
events?: string[],
|
||||
host?: StringMap<string, string>,
|
||||
host?: {[key: string]: string},
|
||||
bindings?: any[],
|
||||
exportAs?: string,
|
||||
moduleId?: string,
|
||||
queries?: StringMap<string, any>
|
||||
queries?: {[key: string]: any}
|
||||
}): DirectiveDecorator;
|
||||
|
||||
}
|
||||
@@ -10861,11 +10860,11 @@ declare module ngWorker {
|
||||
outputs?: string[],
|
||||
properties?: string[],
|
||||
events?: string[],
|
||||
host?: StringMap<string, string>,
|
||||
host?: {[key: string]: string},
|
||||
bindings?: any[],
|
||||
exportAs?: string,
|
||||
moduleId?: string,
|
||||
queries?: StringMap<string, any>,
|
||||
queries?: {[key: string]: any},
|
||||
viewBindings?: any[],
|
||||
changeDetection?: ChangeDetectionStrategy,
|
||||
}): ComponentMetadata;
|
||||
@@ -10876,11 +10875,11 @@ declare module ngWorker {
|
||||
outputs?: string[],
|
||||
properties?: string[],
|
||||
events?: string[],
|
||||
host?: StringMap<string, string>,
|
||||
host?: {[key: string]: string},
|
||||
bindings?: any[],
|
||||
exportAs?: string,
|
||||
moduleId?: string,
|
||||
queries?: StringMap<string, any>,
|
||||
queries?: {[key: string]: any},
|
||||
viewBindings?: any[],
|
||||
changeDetection?: ChangeDetectionStrategy,
|
||||
}): ComponentDecorator;
|
||||
@@ -11394,7 +11393,7 @@ declare module ngWorker {
|
||||
*
|
||||
* See {@link Class} for example of usage.
|
||||
*/
|
||||
constructor: (Function | any[]);
|
||||
constructor: Function | any[];
|
||||
|
||||
}
|
||||
|
||||
@@ -14641,7 +14640,7 @@ declare module ngWorker {
|
||||
|
||||
valid: boolean;
|
||||
|
||||
errors: StringMap<string, any>;
|
||||
errors: {[key: string]: any};
|
||||
|
||||
pristine: boolean;
|
||||
|
||||
@@ -14730,9 +14729,9 @@ declare module ngWorker {
|
||||
*/
|
||||
class ControlGroup extends AbstractControl {
|
||||
|
||||
constructor(controls: StringMap<string, AbstractControl>, optionals?: StringMap<string, boolean>, validator?: Function);
|
||||
constructor(controls: {[key: string]: AbstractControl}, optionals?: {[key: string]: boolean}, validator?: Function);
|
||||
|
||||
controls: StringMap<string, AbstractControl>;
|
||||
controls: {[key: string]: AbstractControl};
|
||||
|
||||
addControl(name: string, control: AbstractControl): void;
|
||||
|
||||
@@ -14810,7 +14809,7 @@ declare module ngWorker {
|
||||
|
||||
valid: boolean;
|
||||
|
||||
errors: StringMap<string, any>;
|
||||
errors: {[key: string]: any};
|
||||
|
||||
pristine: boolean;
|
||||
|
||||
@@ -14931,7 +14930,7 @@ declare module ngWorker {
|
||||
|
||||
validators: Function[];
|
||||
|
||||
onChanges(changes: StringMap<string, SimpleChange>): void;
|
||||
onChanges(changes: {[key: string]: SimpleChange}): void;
|
||||
|
||||
onDestroy(): void;
|
||||
|
||||
@@ -15011,7 +15010,7 @@ declare module ngWorker {
|
||||
|
||||
validators: Function[];
|
||||
|
||||
onChanges(changes: StringMap<string, SimpleChange>): void;
|
||||
onChanges(changes: {[key: string]: SimpleChange}): void;
|
||||
|
||||
path: string[];
|
||||
|
||||
@@ -15057,7 +15056,7 @@ declare module ngWorker {
|
||||
|
||||
validators: Function[];
|
||||
|
||||
onChanges(changes: StringMap<string, SimpleChange>): void;
|
||||
onChanges(changes: {[key: string]: SimpleChange}): void;
|
||||
|
||||
control: Control;
|
||||
|
||||
@@ -15328,7 +15327,7 @@ declare module ngWorker {
|
||||
|
||||
path: string[];
|
||||
|
||||
controls: StringMap<string, AbstractControl>;
|
||||
controls: {[key: string]: AbstractControl};
|
||||
|
||||
addControl(dir: NgControl): void;
|
||||
|
||||
@@ -15509,15 +15508,15 @@ declare module ngWorker {
|
||||
*/
|
||||
class Validators {
|
||||
|
||||
static required(control:Control): StringMap<string, boolean>;
|
||||
static required(control:Control): {[key: string]: boolean};
|
||||
|
||||
static nullValidator(c: any): StringMap<string, boolean>;
|
||||
static nullValidator(c: any): {[key: string]: boolean};
|
||||
|
||||
static compose(validators: Function[]): Function;
|
||||
|
||||
static group(group:ControlGroup): StringMap<string, boolean>;
|
||||
static group(group:ControlGroup): {[key: string]: any[]};
|
||||
|
||||
static array(array:ControlArray): StringMap<string, boolean>;
|
||||
static array(array:ControlArray): {[key: string]: any[]};
|
||||
|
||||
}
|
||||
|
||||
@@ -15589,7 +15588,7 @@ declare module ngWorker {
|
||||
*/
|
||||
class FormBuilder {
|
||||
|
||||
group(controlsConfig: StringMap<string, any>, extra?: StringMap<string, any>): ControlGroup;
|
||||
group(controlsConfig: {[key: string]: any}, extra?: {[key: string]: any}): ControlGroup;
|
||||
|
||||
control(value: Object, validator?: Function): Control;
|
||||
|
||||
@@ -16537,7 +16536,7 @@ declare module ngWorker {
|
||||
|
||||
class ReceivedMessage {
|
||||
|
||||
constructor(data: StringMap<string, any>);
|
||||
constructor(data: {[key: string]: any});
|
||||
|
||||
method: string;
|
||||
|
||||
@@ -17064,7 +17063,7 @@ declare module ngUi {
|
||||
|
||||
class ReceivedMessage {
|
||||
|
||||
constructor(data: StringMap<string, any>);
|
||||
constructor(data: {[key: string]: any});
|
||||
|
||||
method: string;
|
||||
|
||||
|
||||
1310
angular2/http-2.0.0-alpha.39.d.ts
vendored
Normal file
1310
angular2/http-2.0.0-alpha.39.d.ts
vendored
Normal file
File diff suppressed because it is too large
Load Diff
4
angular2/http.d.ts
vendored
4
angular2/http.d.ts
vendored
@@ -1,4 +1,4 @@
|
||||
// Type definitions for Angular v2.0.0-local_sha.f77234e
|
||||
// Type definitions for Angular v2.0.0-local_sha.7d5c3eb
|
||||
// Project: http://angular.io/
|
||||
// Definitions by: angular team <https://github.com/angular/>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
@@ -911,7 +911,7 @@ declare module ngHttp {
|
||||
*/
|
||||
class Headers {
|
||||
|
||||
constructor(headers?: Headers | StringMap<string, any>);
|
||||
constructor(headers?: Headers | {[key: string]: any});
|
||||
|
||||
/**
|
||||
* Appends a header to existing list of header values for a given header name.
|
||||
|
||||
1330
angular2/router-2.0.0-alpha.39.d.ts
vendored
Normal file
1330
angular2/router-2.0.0-alpha.39.d.ts
vendored
Normal file
File diff suppressed because it is too large
Load Diff
12
angular2/router.d.ts
vendored
12
angular2/router.d.ts
vendored
@@ -1,4 +1,4 @@
|
||||
// Type definitions for Angular v2.0.0-local_sha.f77234e
|
||||
// Type definitions for Angular v2.0.0-39
|
||||
// Project: http://angular.io/
|
||||
// Definitions by: angular team <https://github.com/angular/>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
@@ -299,9 +299,9 @@ declare module ngRouter {
|
||||
*/
|
||||
class RouteParams {
|
||||
|
||||
constructor(params: StringMap<string, string>);
|
||||
constructor(params: {[key: string]: string});
|
||||
|
||||
params: StringMap<string, string>;
|
||||
params: {[key: string]: string};
|
||||
|
||||
get(param: string): string;
|
||||
|
||||
@@ -884,13 +884,13 @@ declare module ngRouter {
|
||||
*/
|
||||
class Instruction {
|
||||
|
||||
constructor(component: ComponentInstruction, child: Instruction, auxInstruction: StringMap<string, Instruction>);
|
||||
constructor(component: ComponentInstruction, child: Instruction, auxInstruction: {[key: string]: Instruction});
|
||||
|
||||
component: ComponentInstruction;
|
||||
|
||||
child: Instruction;
|
||||
|
||||
auxInstruction: StringMap<string, Instruction>;
|
||||
auxInstruction: {[key: string]: Instruction};
|
||||
|
||||
/**
|
||||
* Returns a new instruction that shares the state of the existing instruction, but with
|
||||
@@ -922,7 +922,7 @@ declare module ngRouter {
|
||||
|
||||
urlParams: string[];
|
||||
|
||||
params: StringMap<string, any>;
|
||||
params: {[key: string]: any};
|
||||
|
||||
/**
|
||||
* Returns the component type of the represented route, or `null` if this instruction
|
||||
|
||||
408
angular2/test_lib-2.0.0-alpha.39.d.ts
vendored
Normal file
408
angular2/test_lib-2.0.0-alpha.39.d.ts
vendored
Normal file
@@ -0,0 +1,408 @@
|
||||
// Type definitions for Angular v2.0.0-local_sha.7d5c3eb
|
||||
// Project: http://angular.io/
|
||||
// Definitions by: angular team <https://github.com/angular/>
|
||||
// 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.
|
||||
// ***********************************************************
|
||||
|
||||
// angular2/test_lib depends transitively on these libraries.
|
||||
// If you don't have them installed you can install them using TSD
|
||||
// https://github.com/DefinitelyTyped/tsd
|
||||
|
||||
///<reference path="./angular2.d.ts"/>
|
||||
///<reference path="../jasmine/jasmine.d.ts"/>
|
||||
|
||||
|
||||
|
||||
declare module ngTestLib {
|
||||
/**
|
||||
* Allows injecting dependencies in `beforeEach()` and `it()`.
|
||||
*
|
||||
* Example:
|
||||
*
|
||||
* ```
|
||||
* beforeEach(inject([Dependency, AClass], (dep, object) => {
|
||||
* // some code that uses `dep` and `object`
|
||||
* // ...
|
||||
* }));
|
||||
*
|
||||
* it('...', inject([AClass, AsyncTestCompleter], (object, async) => {
|
||||
* object.doSomething().then(() => {
|
||||
* expect(...);
|
||||
* async.done();
|
||||
* });
|
||||
* })
|
||||
* ```
|
||||
*
|
||||
* Notes:
|
||||
* - injecting an `AsyncTestCompleter` allow completing async tests - this is the equivalent of
|
||||
* adding a `done` parameter in Jasmine,
|
||||
* - inject is currently a function because of some Traceur limitation the syntax should eventually
|
||||
* becomes `it('...', @Inject (object: AClass, async: AsyncTestCompleter) => { ... });`
|
||||
*
|
||||
* @param {Array} tokens
|
||||
* @param {Function} fn
|
||||
* @return {FunctionWithParamTokens}
|
||||
*/
|
||||
function inject(tokens: any[], fn: Function): FunctionWithParamTokens;
|
||||
|
||||
|
||||
|
||||
var proxy: ClassDecorator;
|
||||
|
||||
|
||||
|
||||
var afterEach: Function;
|
||||
|
||||
|
||||
|
||||
type SyncTestFn = () => void
|
||||
|
||||
|
||||
interface NgMatchers extends jasmine.Matchers {
|
||||
|
||||
toBe(expected: any): boolean;
|
||||
|
||||
toEqual(expected: any): boolean;
|
||||
|
||||
toBePromise(): boolean;
|
||||
|
||||
toBeAnInstanceOf(expected: any): boolean;
|
||||
|
||||
toHaveText(expected: any): boolean;
|
||||
|
||||
toHaveCssClass(expected: any): boolean;
|
||||
|
||||
toImplement(expected: any): boolean;
|
||||
|
||||
toContainError(expected: any): boolean;
|
||||
|
||||
toThrowErrorWith(expectedMessage: any): boolean;
|
||||
|
||||
not: NgMatchers;
|
||||
|
||||
}
|
||||
|
||||
|
||||
var expect: (actual: any) => NgMatchers;
|
||||
|
||||
|
||||
|
||||
class AsyncTestCompleter {
|
||||
|
||||
constructor(_done: Function);
|
||||
|
||||
done(): void;
|
||||
|
||||
}
|
||||
|
||||
|
||||
function describe(...args: any[]): void;
|
||||
|
||||
|
||||
|
||||
function ddescribe(...args: any[]): void;
|
||||
|
||||
|
||||
|
||||
function xdescribe(...args: any[]): void;
|
||||
|
||||
|
||||
|
||||
function beforeEach(fn: FunctionWithParamTokens | SyncTestFn): void;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Allows overriding default bindings defined in test_injector.js.
|
||||
*
|
||||
* The given function must return a list of DI bindings.
|
||||
*
|
||||
* Example:
|
||||
*
|
||||
* beforeEachBindings(() => [
|
||||
* bind(Compiler).toClass(MockCompiler),
|
||||
* bind(SomeToken).toValue(myValue),
|
||||
* ]);
|
||||
*/
|
||||
function beforeEachBindings(fn: any): void;
|
||||
|
||||
|
||||
|
||||
function it(name: any, fn: any, timeOut?: any): void;
|
||||
|
||||
|
||||
|
||||
function xit(name: any, fn: any, timeOut?: any): void;
|
||||
|
||||
|
||||
|
||||
function iit(name: any, fn: any, timeOut?: any): void;
|
||||
|
||||
|
||||
|
||||
interface GuinessCompatibleSpy extends jasmine.Spy {
|
||||
|
||||
/**
|
||||
* By chaining the spy with and.returnValue, all calls to the function will return a specific
|
||||
* value.
|
||||
*/
|
||||
andReturn(val: any): void;
|
||||
|
||||
/**
|
||||
* By chaining the spy with and.callFake, all calls to the spy will delegate to the supplied
|
||||
* function.
|
||||
*/
|
||||
andCallFake(fn: Function): GuinessCompatibleSpy;
|
||||
|
||||
/**
|
||||
* removes all recorded calls
|
||||
*/
|
||||
reset(): void;
|
||||
|
||||
}
|
||||
|
||||
|
||||
class SpyObject {
|
||||
|
||||
constructor(type?: any);
|
||||
|
||||
static stub(object?: any, config?: any, overrides?: any): void;
|
||||
|
||||
noSuchMethod(args: any): void;
|
||||
|
||||
spy(name: any): void;
|
||||
|
||||
prop(name: any, value: any): void;
|
||||
|
||||
}
|
||||
|
||||
|
||||
function isInInnerZone(): boolean;
|
||||
|
||||
|
||||
|
||||
interface RootTestComponent {
|
||||
|
||||
debugElement: ng.DebugElement;
|
||||
|
||||
detectChanges(): void;
|
||||
|
||||
destroy(): void;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Builds a RootTestComponent for use in component level tests.
|
||||
*/
|
||||
class TestComponentBuilder {
|
||||
|
||||
constructor(_injector: ng.Injector);
|
||||
|
||||
/**
|
||||
* Overrides only the html of a {@link ComponentMetadata}.
|
||||
* All the other properties of the component's {@link ng.ViewMetadata} are preserved.
|
||||
*
|
||||
* @param {ng.Type} component
|
||||
* @param {string} html
|
||||
*
|
||||
* @return {TestComponentBuilder}
|
||||
*/
|
||||
overrideTemplate(componentType: ng.Type, template: string): TestComponentBuilder;
|
||||
|
||||
/**
|
||||
* Overrides a component's {@link ng.ViewMetadata}.
|
||||
*
|
||||
* @param {ng.Type} component
|
||||
* @param {view} View
|
||||
*
|
||||
* @return {TestComponentBuilder}
|
||||
*/
|
||||
overrideView(componentType: ng.Type, view: ng.ViewMetadata): TestComponentBuilder;
|
||||
|
||||
/**
|
||||
* Overrides the directives from the component {@link ng.ViewMetadata}.
|
||||
*
|
||||
* @param {ng.Type} component
|
||||
* @param {ng.Type} from
|
||||
* @param {ng.Type} to
|
||||
*
|
||||
* @return {TestComponentBuilder}
|
||||
*/
|
||||
overrideDirective(componentType: ng.Type, from: ng.Type, to: ng.Type): TestComponentBuilder;
|
||||
|
||||
/**
|
||||
* Overrides one or more injectables configured via `bindings` metadata property of a directive or
|
||||
* component.
|
||||
* Very useful when certain bindings need to be mocked out.
|
||||
*
|
||||
* The bindings specified via this method are appended to the existing `bindings` causing the
|
||||
* duplicated bindings to
|
||||
* be overridden.
|
||||
*
|
||||
* @param {ng.Type} component
|
||||
* @param {any[]} bindings
|
||||
*
|
||||
* @return {TestComponentBuilder}
|
||||
*/
|
||||
overrideBindings(type: ng.Type, bindings: any[]): TestComponentBuilder;
|
||||
|
||||
/**
|
||||
* Overrides one or more injectables configured via `bindings` metadata property of a directive or
|
||||
* component.
|
||||
* Very useful when certain bindings need to be mocked out.
|
||||
*
|
||||
* The bindings specified via this method are appended to the existing `bindings` causing the
|
||||
* duplicated bindings to
|
||||
* be overridden.
|
||||
*
|
||||
* @param {ng.Type} component
|
||||
* @param {any[]} bindings
|
||||
*
|
||||
* @return {TestComponentBuilder}
|
||||
*/
|
||||
overrideViewBindings(type: ng.Type, bindings: any[]): TestComponentBuilder;
|
||||
|
||||
/**
|
||||
* Builds and returns a RootTestComponent.
|
||||
*
|
||||
* @return {Promise<RootTestComponent>}
|
||||
*/
|
||||
createAsync(rootComponentType: ng.Type): Promise<RootTestComponent>;
|
||||
|
||||
}
|
||||
|
||||
|
||||
function createTestInjector(bindings: Array<ng.Type | ng.Binding | any[]>): ng.Injector;
|
||||
|
||||
|
||||
|
||||
class FunctionWithParamTokens {
|
||||
|
||||
constructor(_tokens: any[], _fn: Function);
|
||||
|
||||
/**
|
||||
* Returns the value of the executed function.
|
||||
*/
|
||||
execute(injector: ng.Injector): any;
|
||||
|
||||
hasToken(token: any): boolean;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Wraps a function to be executed in the fakeAsync zone:
|
||||
* - microtasks are manually executed by calling `flushMicrotasks()`,
|
||||
* - timers are synchronous, `tick()` simulates the asynchronous passage of time.
|
||||
*
|
||||
* If there are any pending timers at the end of the function, an exception will be thrown.
|
||||
*
|
||||
* @param fn
|
||||
* @returns {Function} The function wrapped to be executed in the fakeAsync zone
|
||||
*/
|
||||
function fakeAsync(fn: Function): Function;
|
||||
|
||||
|
||||
|
||||
function clearPendingTimers(): void;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Simulates the asynchronous passage of time for the timers in the fakeAsync zone.
|
||||
*
|
||||
* The microtasks queue is drained at the very start of this function and after any timer callback
|
||||
* has been executed.
|
||||
*
|
||||
* @param {number} millis Number of millisecond, defaults to 0
|
||||
*/
|
||||
function tick(millis?: number): void;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Flush any pending microtasks.
|
||||
*/
|
||||
function flushMicrotasks(): void;
|
||||
|
||||
|
||||
|
||||
class Log {
|
||||
|
||||
constructor();
|
||||
|
||||
add(value: any): void;
|
||||
|
||||
fn(value: any): void;
|
||||
|
||||
clear(): void;
|
||||
|
||||
result(): string;
|
||||
|
||||
}
|
||||
|
||||
|
||||
class BrowserDetection {
|
||||
|
||||
constructor(ua: string);
|
||||
|
||||
isFirefox: boolean;
|
||||
|
||||
isAndroid: boolean;
|
||||
|
||||
isEdge: boolean;
|
||||
|
||||
isIE: boolean;
|
||||
|
||||
isWebkit: boolean;
|
||||
|
||||
isIOS7: boolean;
|
||||
|
||||
isSlow: boolean;
|
||||
|
||||
supportsIntlApi: boolean;
|
||||
|
||||
}
|
||||
|
||||
|
||||
var browserDetection: BrowserDetection;
|
||||
|
||||
|
||||
|
||||
function dispatchEvent(element: any, eventType: any): void;
|
||||
|
||||
|
||||
|
||||
function el(html: string): HTMLElement;
|
||||
|
||||
|
||||
|
||||
function containsRegexp(input: string): RegExp;
|
||||
|
||||
|
||||
|
||||
function normalizeCSS(css: string): string;
|
||||
|
||||
|
||||
|
||||
function stringifyElement(el: any): string;
|
||||
|
||||
|
||||
|
||||
var RootTestComponent: ng.InjectableReference;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
declare module "angular2/test_lib" {
|
||||
export = ngTestLib;
|
||||
}
|
||||
|
||||
|
||||
2
angular2/test_lib.d.ts
vendored
2
angular2/test_lib.d.ts
vendored
@@ -1,4 +1,4 @@
|
||||
// Type definitions for Angular v2.0.0-local_sha.f77234e
|
||||
// Type definitions for Angular v2.0.0-local_sha.7d5c3eb
|
||||
// Project: http://angular.io/
|
||||
// Definitions by: angular team <https://github.com/angular/>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
Reference in New Issue
Block a user