diff --git a/package.json b/package.json index efd732e78..91a6971b0 100644 --- a/package.json +++ b/package.json @@ -46,7 +46,7 @@ "progress": "^2.0.0", "shelljs": "^0.8.1", "typedoc-default-themes": "^0.5.0", - "typescript": "2.7.2" + "typescript": "^3.1.0-dev.20180802" }, "devDependencies": { "@types/mocha": "2.2.48", diff --git a/src/lib/converter/factories/declaration.ts b/src/lib/converter/factories/declaration.ts index 690ed0194..687094254 100644 --- a/src/lib/converter/factories/declaration.ts +++ b/src/lib/converter/factories/declaration.ts @@ -24,7 +24,7 @@ const nonStaticKinds = [ * @param name The desired name of the reflection. * @returns The resulting reflection. */ -export function createDeclaration(context: Context, node: ts.Node, kind: ReflectionKind, name?: string): DeclarationReflection { +export function createDeclaration(context: Context, node: ts.Declaration, kind: ReflectionKind, name?: string): DeclarationReflection { const container = context.scope; if (!(container instanceof ContainerReflection)) { throw new Error('Expected container reflection.'); @@ -54,7 +54,7 @@ export function createDeclaration(context: Context, node: ts.Node, kind: Reflect if (kind === ReflectionKind.ExternalModule) { isExported = true; // Always mark external modules as exported } else if (node.parent && node.parent.kind === ts.SyntaxKind.VariableDeclarationList) { - const parentModifiers = ts.getCombinedModifierFlags(node.parent.parent); + const parentModifiers = ts.getCombinedModifierFlags(node.parent.parent as ts.Declaration); isExported = isExported || !!(parentModifiers & ts.ModifierFlags.Export); } else { isExported = isExported || !!(modifiers & ts.ModifierFlags.Export); @@ -127,7 +127,7 @@ export function createDeclaration(context: Context, node: ts.Node, kind: Reflect * @param node The TypeScript node whose properties should be applies to the given reflection. * @returns The reflection populated with the values of the given node. */ -function setupDeclaration(context: Context, reflection: DeclarationReflection, node: ts.Node) { +function setupDeclaration(context: Context, reflection: DeclarationReflection, node: ts.Declaration) { const modifiers = ts.getCombinedModifierFlags(node); reflection.setFlag(ReflectionFlag.External, context.isExternal); diff --git a/src/lib/converter/nodes/class.ts b/src/lib/converter/nodes/class.ts index 41b05d6e6..b30f30d4a 100644 --- a/src/lib/converter/nodes/class.ts +++ b/src/lib/converter/nodes/class.ts @@ -50,7 +50,7 @@ export class ClassConverter extends ConverterNodeComponent }); } - const baseType = _ts.getClassExtendsHeritageClauseElement(node); + const baseType = _ts.getEffectiveBaseTypeNode(node); if (baseType) { const type = context.getTypeAtLocation(baseType); if (!context.isInherit) { diff --git a/src/lib/converter/nodes/function.ts b/src/lib/converter/nodes/function.ts index e651c35d1..8e4706d74 100644 --- a/src/lib/converter/nodes/function.ts +++ b/src/lib/converter/nodes/function.ts @@ -28,7 +28,7 @@ export class FunctionConverter extends ConverterNodeComponent node, kind); + const method = createDeclaration(context, node, kind); if (method // child inheriting will return null on createDeclaration && kind & ReflectionKind.Method diff --git a/src/lib/ts-internal.ts b/src/lib/ts-internal.ts index eb9d54c0c..39c33cab6 100644 --- a/src/lib/ts-internal.ts +++ b/src/lib/ts-internal.ts @@ -96,9 +96,9 @@ export function isBindingPattern(node: ts.Node): node is ts.BindingPattern { return tsany.isBindingPattern.apply(this, arguments); } -// https://github.com/Microsoft/TypeScript/blob/v2.1.4/src/compiler/utilities.ts#L1729 -export function getClassExtendsHeritageClauseElement(node: ts.ClassLikeDeclaration | ts.InterfaceDeclaration) { - return tsany.getClassExtendsHeritageClauseElement.apply(this, arguments); +// https://github.com/Microsoft/TypeScript/blob/v3.0.1/src/compiler/utilities.ts#L2408 +export function getEffectiveBaseTypeNode(node: ts.ClassLikeDeclaration | ts.InterfaceDeclaration) { + return tsany.getEffectiveBaseTypeNode.apply(this, arguments); } // https://github.com/Microsoft/TypeScript/blob/v2.1.4/src/compiler/utilities.ts#L1734