From b11fc030d80bd028d0b5fba091ba2b3cbbd9b25d Mon Sep 17 00:00:00 2001 From: Alvaro Dias Date: Sun, 12 May 2019 23:26:05 -0700 Subject: [PATCH] support for bigint data type --- out/src/typedocs.js | 1 + package.json | 2 +- src/typedocs.ts | 1 + test/testcases/testvariables.d.ts | 9 +++++++-- test/variables.ts | 14 ++++++++++++-- 5 files changed, 22 insertions(+), 5 deletions(-) diff --git a/out/src/typedocs.js b/out/src/typedocs.js index e73b467..fc8314f 100644 --- a/out/src/typedocs.js +++ b/out/src/typedocs.js @@ -100,6 +100,7 @@ var Main; break; case ts.SyntaxKind.AnyKeyword: case ts.SyntaxKind.ArrayType: + case ts.SyntaxKind.BigIntKeyword: case ts.SyntaxKind.BooleanKeyword: case ts.SyntaxKind.ConstructorType: case ts.SyntaxKind.ExpressionWithTypeArguments: diff --git a/package.json b/package.json index d0cf218..08be5c6 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ }, "dependencies": { "marked": "0.6.2", - "typescript": "3.0.3" + "typescript": "3.2.4" }, "devDependencies": { "@types/marked": "^0.6.5", diff --git a/src/typedocs.ts b/src/typedocs.ts index d4210e9..b036e30 100644 --- a/src/typedocs.ts +++ b/src/typedocs.ts @@ -159,6 +159,7 @@ module Main { break; case ts.SyntaxKind.AnyKeyword: case ts.SyntaxKind.ArrayType: + case ts.SyntaxKind.BigIntKeyword: case ts.SyntaxKind.BooleanKeyword: case ts.SyntaxKind.ConstructorType: case ts.SyntaxKind.ExpressionWithTypeArguments: diff --git a/test/testcases/testvariables.d.ts b/test/testcases/testvariables.d.ts index f1716a4..b0b3c48 100644 --- a/test/testcases/testvariables.d.ts +++ b/test/testcases/testvariables.d.ts @@ -2,10 +2,15 @@ declare module "ModuleWithVariables" { /** * Defines an exported constant. */ - const exportedConstant: string; + const exportedConstant: number; /** - * Defines an exported variable. + * Defines an exported let. */ let modifiableVariable: string; + + /** + * Defines an exported variable. + */ + var bigintVar: bigint; } diff --git a/test/variables.ts b/test/variables.ts index 6185934..58eaa2c 100644 --- a/test/variables.ts +++ b/test/variables.ts @@ -19,13 +19,23 @@ describe("Variables", function () { it("should generate documentation for exported constant correctly", function () { const exportedConstant = (elements[0]).members[0]; assert.equal(exportedConstant.name, "exportedConstant", "name of constant is correct"); + assert.equal(exportedConstant.type, "number", "type of constant is correct"); assert.equal(exportedConstant.documentation, "Defines an exported constant.", "documentation of constant is correct"); assert.equal(exportedConstant.isConst, true, `isConst flag should be set to true. Actual: ${JSON.stringify(exportedConstant)}`); }); + it("should generate documentation for exported let correctly", function () { + const exportedLet = (elements[0]).members[1]; + assert.equal(exportedLet.name, "modifiableVariable", `name of let is correct.`); + assert.equal(exportedLet.type, "string", "type of let is correct"); + assert.equal(exportedLet.documentation, "Defines an exported let.", "documentation of constant is correct"); + assert.equal(exportedLet.isConst, false, `isConst flag should be set to false. Actual: ${JSON.stringify(exportedLet)}`); + }); + it("should generate documentation for exported variable correctly", function () { - const exportedVariable = (elements[0]).members[1]; - assert.equal(exportedVariable.name, "modifiableVariable", `name of variable is correct.`); + const exportedVariable = (elements[0]).members[2]; + assert.equal(exportedVariable.name, "bigintVar", `name of variable is correct.`); + assert.equal(exportedVariable.type, "bigint", "type of let is correct"); assert.equal(exportedVariable.documentation, "Defines an exported variable.", "documentation of constant is correct"); assert.equal(exportedVariable.isConst, false, `isConst flag should be set to false. Actual: ${JSON.stringify(exportedVariable)}`); });