Skip to content

Commit 5458036

Browse files
alexeaglevsavkin
authored andcommitted
fix(typings): update test.typings for abstract superclasses
1 parent 6075509 commit 5458036

File tree

34 files changed

+122
-71
lines changed

34 files changed

+122
-71
lines changed

docs/typescript-definition-package/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ module.exports = new Package('angular-v2-docs', [jsdocPackage, nunjucksPackage,
7474
references: ['./angular2.d.ts', '../jasmine/jasmine.d.ts'],
7575
remapTypes: { Type: 'ng.Type', Binding: 'ng.Binding', ViewMetadata: 'ng.ViewMetadata', Injector: 'ng.Injector',
7676
Predicate: 'ng.Predicate', ElementRef: 'ng.ElementRef', DebugElement: 'ng.DebugElement',
77-
InjectableReference: 'ng.InjectableReference' },
77+
InjectableReference: 'ng.InjectableReference', ComponentRef: 'ng.ComponentRef' },
7878
modules: {'angular2/test_lib': {namespace: 'ngTestLib', id: 'angular2/test_lib'}}
7979
}
8080
];

docs/typescript-definition-package/processors/code_gen.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@ DtsSerializer.prototype = {
5959
},
6060

6161
interfaceOrClass: function(buffer, ast, isInterface) {
62+
if (ast.abstract) {
63+
buffer.push('abstract ');
64+
}
65+
6266
buffer.push(isInterface ? 'interface ' : 'class ');
6367
buffer.push(ast.name);
6468
buffer.push(ast.typeParams);

docs/typescript-package/processors/readTypeScriptModules.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,9 @@ module.exports = function readTypeScriptModules(tsParser, modules, getFileInfo,
223223
if (exportSymbol.flags & ts.SymbolFlags.TypeAlias) {
224224
exportDoc.typeDefinition = typeDefinition;
225225
}
226+
if (isAbstract(exportSymbol)) {
227+
exportDoc.abstract = true;
228+
}
226229

227230
// Compute the original module name from the relative file path
228231
exportDoc.originalModule = exportDoc.fileInfo.relativePath
@@ -345,6 +348,10 @@ module.exports = function readTypeScriptModules(tsParser, modules, getFileInfo,
345348
}
346349
}
347350

351+
function isAbstract(symbol) {
352+
var declaration = symbol.valueDeclaration || symbol.declarations[0];
353+
return declaration.flags & ts.NodeFlags.Abstract;
354+
}
348355

349356
function expandSourceFiles(sourceFiles, basePath) {
350357
var filePaths = [];

modules/angular2/src/core/application_ref.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ import {ViewResolver} from './linker/view_resolver';
3939
import {DirectiveResolver} from './linker/directive_resolver';
4040
import {PipeResolver} from './linker/pipe_resolver';
4141
import {Compiler} from 'angular2/src/core/linker/compiler';
42+
import {DynamicComponentLoader_} from "./linker/dynamic_component_loader";
43+
import {AppViewManager_} from "./linker/view_manager";
44+
import {Compiler_} from "./linker/compiler";
4245

4346
/**
4447
* Constructs the set of bindings meant for use at the platform level.
@@ -71,7 +74,7 @@ function _componentBindings(appComponentType: Type): Array<Type | Binding | any[
7174
return componentRef;
7275
});
7376
},
74-
[DynamicComponentLoader, Injector]),
77+
[bind(DynamicComponentLoader).toClass(DynamicComponentLoader_), Injector]),
7578

7679
bind(appComponentType)
7780
.toFactory((p: Promise<any>) => p.then(ref => ref.instance), [APP_COMPONENT_REF_PROMISE]),
@@ -84,11 +87,12 @@ function _componentBindings(appComponentType: Type): Array<Type | Binding | any[
8487
*/
8588
export function applicationCommonBindings(): Array<Type | Binding | any[]> {
8689
return [
87-
Compiler,
90+
bind(Compiler)
91+
.toClass(Compiler_),
8892
APP_ID_RANDOM_BINDING,
8993
AppViewPool,
9094
bind(APP_VIEW_POOL_CAPACITY).toValue(10000),
91-
AppViewManager,
95+
bind(AppViewManager).toClass(AppViewManager_),
9296
AppViewManagerUtils,
9397
AppViewListener,
9498
ProtoViewFactory,
@@ -98,7 +102,7 @@ export function applicationCommonBindings(): Array<Type | Binding | any[]> {
98102
bind(KeyValueDiffers).toValue(defaultKeyValueDiffers),
99103
DirectiveResolver,
100104
PipeResolver,
101-
DynamicComponentLoader,
105+
bind(DynamicComponentLoader).toClass(DynamicComponentLoader_),
102106
bind(LifeCycle).toFactory((exceptionHandler) => new LifeCycle_(null, assertionsEnabled()),
103107
[ExceptionHandler]),
104108
];

modules/angular2/src/core/compiler/compiler.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import {RuntimeCompiler_} from "./runtime_compiler";
12
export {TemplateCompiler} from './template_compiler';
23
export {
34
CompileDirectiveMetadata,
@@ -43,7 +44,7 @@ export function compilerBindings(): Array<Type | Binding | any[]> {
4344
.toValue(
4445
new ChangeDetectorGenConfig(assertionsEnabled(), assertionsEnabled(), false, true)),
4546
TemplateCompiler,
46-
RuntimeCompiler,
47+
bind(RuntimeCompiler).toClass(RuntimeCompiler_),
4748
bind(Compiler).toAlias(RuntimeCompiler),
4849
DomElementSchemaRegistry,
4950
bind(ElementSchemaRegistry).toAlias(DomElementSchemaRegistry),

modules/angular2/src/core/debug.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
export * from './debug/debug_element';
1+
export {DebugElement, asNativeElements, By, Scope, inspectElement} from './debug/debug_element';
22
export {inspectNativeElement, ELEMENT_PROBE_BINDINGS} from './debug/debug_element_view_listener';

modules/angular2/src/core/directives/ng_class.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export class NgClass implements DoCheck, OnDestroy {
4040
private _rawClass;
4141

4242
constructor(private _iterableDiffers: IterableDiffers, private _keyValueDiffers: KeyValueDiffers,
43-
private _ngEl: ElementRef_, private _renderer: Renderer) {}
43+
private _ngEl: ElementRef, private _renderer: Renderer) {}
4444

4545
set initialClasses(v) {
4646
this._applyInitialClasses(true);

modules/angular2/src/core/directives/ng_style.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export class NgStyle implements DoCheck {
6666
_rawStyle;
6767
_differ: KeyValueDiffer;
6868

69-
constructor(private _differs: KeyValueDiffers, private _ngEl: ElementRef_,
69+
constructor(private _differs: KeyValueDiffers, private _ngEl: ElementRef,
7070
private _renderer: Renderer) {}
7171

7272
set rawStyle(v) {
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Public API for Facade
2-
export {Type} from './facade/lang';
2+
export {ConcreteType, Type} from './facade/lang';
33
export {Observable, EventEmitter} from './facade/async';
44
export {Predicate} from './facade/collection';
5-
export {WrappedException} from './facade/exceptions';
5+
export {WrappedException} from './facade/exceptions';

modules/angular2/src/core/linker/view.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,7 @@ import {ElementRef} from './element_ref';
3333
import {ProtoPipes} from 'angular2/src/core/pipes/pipes';
3434
import {camelCaseToDashCase} from 'angular2/src/core/render/dom/util';
3535
import {TemplateCmd} from './template_commands';
36-
import {ViewRef_} from "./view_ref";
37-
import {ProtoViewRef_} from "./view_ref";
36+
import {ViewRef_, ProtoViewRef_} from "./view_ref";
3837

3938
export {DebugContext} from 'angular2/src/core/change_detection/interfaces';
4039

0 commit comments

Comments
 (0)