Skip to content

Commit aec51d6

Browse files
committed
refactor(ts'ify): ts’ify mocks, directives and test_lib
Also cleans up global types.
1 parent c599652 commit aec51d6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+609
-670
lines changed
File renamed without changes.

modules/angular2/angular2_sfx.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
library angular2.sfx;
2+
// empty as we don't have a version for Dart

modules/angular2/angular2_sfx.es6

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import * as angular from './angular2';
2-
// the router should have its own SFX bundle
2+
// the router should have its own SFX bundle
33
// But currently the module arithemtic 'angular2/router_sfx - angular2/angular2',
44
// is not support by system builder.
55
import * as router from './router';

modules/angular2/annotations.js renamed to modules/angular2/annotations.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@
33
* @public
44
* @description
55
*
6-
* Annotations provide the additional information that Angular requires in order to run your application. This module
7-
* contains {@link Component}, {@link Directive}, and {@link View} annotations, as well as {@link Parent} and {@link Ancestor} annotations that are
6+
* Annotations provide the additional information that Angular requires in order to run your
7+
* application. This module
8+
* contains {@link Component}, {@link Directive}, and {@link View} annotations, as well as {@link
9+
* Parent} and {@link Ancestor} annotations that are
810
* used by Angular to resolve dependencies.
911
*
1012
*/

modules/angular2/core.js renamed to modules/angular2/core.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,3 @@ export * from './src/core/compiler/dynamic_component_loader';
2323
export {ViewRef, ProtoViewRef} from './src/core/compiler/view_ref';
2424
export {ViewContainerRef} from './src/core/compiler/view_container_ref';
2525
export {ElementRef} from './src/core/compiler/element_ref';
26-

modules/angular2/di_annotations.js renamed to modules/angular2/di_annotations.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,3 @@
44
* @description
55
* Annotations which control how the dependencies are resolved by the {@link Injector}.
66
*/
7-

modules/angular2/di_errors.js renamed to modules/angular2/di_errors.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,3 @@
44
* @description
55
* Errors thrown by the {@link Injector}.
66
*/
7-

modules/angular2/directives.js renamed to modules/angular2/directives.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* Common directives shipped with Angular.
66
*/
77

8-
import {CONST_EXPR} from './src/facade/lang';
8+
import {CONST_EXPR, Type} from './src/facade/lang';
99
import {NgFor} from './src/directives/ng_for';
1010
import {NgIf} from './src/directives/ng_if';
1111
import {NgNonBindable} from './src/directives/ng_non_bindable';
@@ -18,9 +18,11 @@ export * from './src/directives/ng_non_bindable';
1818
export * from './src/directives/ng_switch';
1919

2020
/**
21-
* A collection of the Angular core directives that are likely to be used in each and every Angular application.
21+
* A collection of the Angular core directives that are likely to be used in each and every Angular
22+
* application.
2223
*
23-
* This collection can be used to quickly enumerate all the built-in directives in the `@View` annotation. For example,
24+
* This collection can be used to quickly enumerate all the built-in directives in the `@View`
25+
* annotation. For example,
2426
* instead of writing:
2527
*
2628
* ```
@@ -57,6 +59,5 @@ export * from './src/directives/ng_switch';
5759
* ```
5860
*
5961
*/
60-
export const coreDirectives:List = CONST_EXPR([
61-
NgFor, NgIf, NgNonBindable, NgSwitch, NgSwitchWhen, NgSwitchDefault
62-
]);
62+
export const coreDirectives: List<Type> =
63+
CONST_EXPR([NgFor, NgIf, NgNonBindable, NgSwitch, NgSwitchWhen, NgSwitchDefault]);

modules/angular2/globals.d.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,16 @@
22
* This file contains declarations of global symbols we reference in our code
33
*/
44

5-
/// <reference path="typings/hammerjs/hammerjs"/>
65
/// <reference path="typings/zone/zone.d.ts"/>
76

87
declare var assert: any;
9-
declare var global: Window;
108
declare type int = number;
119

1210
interface List<T> extends Array<T> {}
1311

1412
interface StringMap<K, V> extends Object {}
1513

16-
interface Window {
14+
interface BrowserNodeGlobal {
1715
Object: typeof Object;
1816
Array: typeof Array;
1917
Map: typeof Map;
@@ -22,10 +20,12 @@ interface Window {
2220
RegExp: typeof RegExp;
2321
JSON: typeof JSON;
2422
Math: typeof Math;
25-
assert: typeof assert;
26-
gc(): void;
23+
assert(condition): void;
2724
Reflect: any;
2825
zone: Zone;
29-
Hammer: HammerStatic;
3026
getAngularTestability: Function;
27+
setTimeout: Function;
28+
clearTimeout: Function;
29+
setInterval: Function;
30+
clearInterval: Function;
3131
}
File renamed without changes.

0 commit comments

Comments
 (0)