Skip to content

Upgrade to typescript 2.0.3 #290

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 11, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"progress": "^1.1.8",
"shelljs": "^0.7.0",
"typedoc-default-themes": "^0.4.0",
"typescript": "1.8.10"
"typescript": "2.0.3"
},
"devDependencies": {
"grunt": "^1.0.1",
Expand Down
6 changes: 3 additions & 3 deletions src/lib/converter/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export class Context
/**
* The currently set type parameters.
*/
typeParameters:ts.Map<Type>;
typeParameters:ts.MapLike<Type>;

/**
* The currently set type arguments.
Expand Down Expand Up @@ -360,8 +360,8 @@ export class Context
* @param preserve Should the currently set type parameters of the context be preserved?
* @returns The resulting type mapping.
*/
private extractTypeParameters(parameters:ts.NodeArray<ts.TypeParameterDeclaration>, preserve?:boolean):ts.Map<Type> {
var typeParameters:ts.Map<Type> = {};
private extractTypeParameters(parameters:ts.NodeArray<ts.TypeParameterDeclaration>, preserve?:boolean):ts.MapLike<Type> {
var typeParameters:ts.MapLike<Type> = {};

if (preserve) {
for (var key in this.typeParameters) {
Expand Down
2 changes: 1 addition & 1 deletion src/lib/converter/nodes/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export class ModuleConverter extends ConverterNodeComponent<ts.ModuleDeclaration
context.withScope(reflection, () => {
var opt = context.getCompilerOptions();
if (parent instanceof ProjectReflection && !context.isDeclaration &&
(!opt.module || opt.module == ts.ModuleKind.None)) {
(!module || module.valueOf() === ts.ModuleKind.None.valueOf())) {
reflection.setFlag(ReflectionFlag.Exported);
}

Expand Down
8 changes: 4 additions & 4 deletions src/lib/converter/types/string-literal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {Context} from "../context";


@Component({name:'type:string-literal'})
export class StringLiteralConverter extends ConverterTypeComponent implements ITypeConverter<ts.StringLiteralType, ts.StringLiteral>
export class StringLiteralConverter extends ConverterTypeComponent implements ITypeConverter<ts.LiteralType, ts.StringLiteral>
{
/**
* Test whether this converter can handle the given TypeScript node.
Expand All @@ -19,7 +19,7 @@ export class StringLiteralConverter extends ConverterTypeComponent implements IT
/**
* Test whether this converter can handle the given TypeScript type.
*/
supportsType(context:Context, type:ts.StringLiteralType):boolean {
supportsType(context:Context, type:ts.LiteralType):boolean {
return !!(type.flags & ts.TypeFlags.StringLiteral);
}

Expand All @@ -36,7 +36,7 @@ export class StringLiteralConverter extends ConverterTypeComponent implements IT
* @param node The string literal node that should be converted.
* @returns The type reflection representing the given string literal node.
*/
convertNode(context:Context, node:ts.StringLiteral):StringLiteralType {
convertNode(context:Context, node:ts.StringLiteral):Type {
return new StringLiteralType(node.text);
}

Expand All @@ -53,7 +53,7 @@ export class StringLiteralConverter extends ConverterTypeComponent implements IT
* @param type The intrinsic type that should be converted.
* @returns The type reflection representing the given string literal type.
*/
convertType(context:Context, type:ts.StringLiteralType):StringLiteralType {
convertType(context:Context, type:ts.LiteralType):Type {
return new StringLiteralType(type.text);
}
}
10 changes: 5 additions & 5 deletions src/lib/converter/types/tuple.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {Context} from "../context";


@Component({name:'type:tuple'})
export class TupleConverter extends ConverterTypeComponent implements ITypeConverter<ts.TupleType, ts.TupleTypeNode>
export class TupleConverter extends ConverterTypeComponent implements ITypeConverter<ts.TypeReference, ts.TupleTypeNode>
{
/**
* Test whether this converter can handle the given TypeScript node.
Expand All @@ -19,7 +19,7 @@ export class TupleConverter extends ConverterTypeComponent implements ITypeConve
/**
* Test whether this converter can handle the given TypeScript type.
*/
supportsType(context:Context, type:ts.TupleType):boolean {
supportsType(context:Context, type:ts.TypeReference):boolean {
return !!(type.flags & ts.TypeFlags.Tuple);
}

Expand Down Expand Up @@ -62,10 +62,10 @@ export class TupleConverter extends ConverterTypeComponent implements ITypeConve
* @param type The tuple type that should be converted.
* @returns The type reflection representing the given tuple type.
*/
convertType(context:Context, type:ts.TupleType):TupleType {
convertType(context:Context, type:ts.TypeReference):TupleType {
var elements:Type[];
if (type.elementTypes) {
elements = type.elementTypes.map((t) => this.owner.convertType(context, null, t));
if (type.typeArguments) {
elements = type.typeArguments.map((t) => this.owner.convertType(context, null, t));
} else {
elements = [];
}
Expand Down
5 changes: 5 additions & 0 deletions src/lib/converter/utils/compiler-host.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const ERROR_UNSUPPORTED_FILE_ENCODING = -2147024809;
*/
export class CompilerHost extends ConverterComponent implements ts.CompilerHost
{

/**
* The full path of the current directory. Result cache of [[getCurrentDirectory]].
*/
Expand Down Expand Up @@ -59,6 +60,10 @@ export class CompilerHost extends ConverterComponent implements ts.CompilerHost
return Path.join(path, lib);
}

getDirectories(path: string): string[] {
return ts.sys.getDirectories(path);
}


/**
* Return the full path of the current directory.
Expand Down
12 changes: 3 additions & 9 deletions src/lib/utils/component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export function Component(options:IComponentOptions):ClassDecorator {

var name = options.name;
if (name) {
proto._componentName = name;
proto.componentName = name;
}

var internal = !!options.internal;
Expand Down Expand Up @@ -130,7 +130,7 @@ export abstract class AbstractComponent<O extends IComponentHost> extends EventD
/**
* The name of this component as set by the @Component decorator.
*/
private _componentName:string;
public componentName:string;

/**
* A list of options defined by this component.
Expand Down Expand Up @@ -174,12 +174,6 @@ export abstract class AbstractComponent<O extends IComponentHost> extends EventD
return this._componentOptions ? this._componentOptions.slice() : [];
}


get componentName():string {
return this._componentName;
}


/**
* Return the application / root component instance.
*/
Expand Down Expand Up @@ -250,7 +244,7 @@ export abstract class ChildableComponent<O extends IComponentHost, C extends ICo
}


addComponent<T extends C>(name:string, componentClass:T|IComponentClass<T>):T {
addComponent<T extends C & IComponent>(name:string, componentClass:T|IComponentClass<T>):T {
if (!this._componentChildren) {
this._componentChildren = {};
}
Expand Down
2 changes: 1 addition & 1 deletion src/lib/utils/fs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import * as FS from "fs";
/**
* List of known existent directories. Used to speed up [[directoryExists]].
*/
var existingDirectories:ts.Map<boolean> = {};
var existingDirectories:ts.MapLike<boolean> = {};


/**
Expand Down
Loading