This type represents the expression+type arguments you can get in a class or interface heritage clause section. For class-implements clauses, or interface-extends clauses, these expressions can only be identifiers or dotted names. For class extends clauses, these could be any expressions in the future. However, for now, we only support identifiers and dotted names.
80 lines
2.6 KiB
Text
80 lines
2.6 KiB
Text
=== tests/cases/compiler/extendingClassFromAliasAndUsageInIndexer_main.ts ===
|
|
import Backbone = require("extendingClassFromAliasAndUsageInIndexer_backbone");
|
|
>Backbone : typeof Backbone
|
|
|
|
import moduleA = require("extendingClassFromAliasAndUsageInIndexer_moduleA");
|
|
>moduleA : typeof moduleA
|
|
|
|
import moduleB = require("extendingClassFromAliasAndUsageInIndexer_moduleB");
|
|
>moduleB : typeof moduleB
|
|
|
|
interface IHasVisualizationModel {
|
|
>IHasVisualizationModel : IHasVisualizationModel
|
|
|
|
VisualizationModel: typeof Backbone.Model;
|
|
>VisualizationModel : typeof Backbone.Model
|
|
>Backbone : typeof Backbone
|
|
>Model : typeof Backbone.Model
|
|
}
|
|
var moduleATyped: IHasVisualizationModel = moduleA;
|
|
>moduleATyped : IHasVisualizationModel
|
|
>IHasVisualizationModel : IHasVisualizationModel
|
|
>moduleA : typeof moduleA
|
|
|
|
var moduleMap: { [key: string]: IHasVisualizationModel } = {
|
|
>moduleMap : { [key: string]: IHasVisualizationModel; }
|
|
>key : string
|
|
>IHasVisualizationModel : IHasVisualizationModel
|
|
>{ "moduleA": moduleA, "moduleB": moduleB} : { [x: string]: typeof moduleA; "moduleA": typeof moduleA; "moduleB": typeof moduleB; }
|
|
|
|
"moduleA": moduleA,
|
|
>moduleA : typeof moduleA
|
|
|
|
"moduleB": moduleB
|
|
>moduleB : typeof moduleB
|
|
|
|
};
|
|
var moduleName: string;
|
|
>moduleName : string
|
|
|
|
var visModel = new moduleMap[moduleName].VisualizationModel();
|
|
>visModel : Backbone.Model
|
|
>new moduleMap[moduleName].VisualizationModel() : Backbone.Model
|
|
>moduleMap[moduleName].VisualizationModel : typeof Backbone.Model
|
|
>moduleMap[moduleName] : IHasVisualizationModel
|
|
>moduleMap : { [key: string]: IHasVisualizationModel; }
|
|
>moduleName : string
|
|
>VisualizationModel : typeof Backbone.Model
|
|
|
|
=== tests/cases/compiler/extendingClassFromAliasAndUsageInIndexer_backbone.ts ===
|
|
export class Model {
|
|
>Model : Model
|
|
|
|
public someData: string;
|
|
>someData : string
|
|
}
|
|
|
|
=== tests/cases/compiler/extendingClassFromAliasAndUsageInIndexer_moduleA.ts ===
|
|
import Backbone = require("extendingClassFromAliasAndUsageInIndexer_backbone");
|
|
>Backbone : typeof Backbone
|
|
|
|
export class VisualizationModel extends Backbone.Model {
|
|
>VisualizationModel : VisualizationModel
|
|
>Backbone : typeof Backbone
|
|
>Model : Backbone.Model
|
|
|
|
// interesting stuff here
|
|
}
|
|
|
|
=== tests/cases/compiler/extendingClassFromAliasAndUsageInIndexer_moduleB.ts ===
|
|
import Backbone = require("extendingClassFromAliasAndUsageInIndexer_backbone");
|
|
>Backbone : typeof Backbone
|
|
|
|
export class VisualizationModel extends Backbone.Model {
|
|
>VisualizationModel : VisualizationModel
|
|
>Backbone : typeof Backbone
|
|
>Model : Backbone.Model
|
|
|
|
// different interesting stuff here
|
|
}
|
|
|