From 4b881d917aa96e75deae7f8ae33a661d067b3d7f Mon Sep 17 00:00:00 2001 From: Pete Gonzalez <4673363+octogonz@users.noreply.github.com> Date: Sun, 8 Sep 2019 13:08:15 -0700 Subject: [PATCH 1/3] Add a unit test for typeof applied to a function --- .../config/build-config.json | 1 + .../typeOf2/api-extractor-scenarios.api.json | 133 ++++++++++++++++++ .../typeOf2/api-extractor-scenarios.api.md | 18 +++ .../etc/test-outputs/typeOf2/rollup.d.ts | 10 ++ .../src/typeOf2/index.ts | 12 ++ 5 files changed, 174 insertions(+) create mode 100644 build-tests/api-extractor-scenarios/etc/test-outputs/typeOf2/api-extractor-scenarios.api.json create mode 100644 build-tests/api-extractor-scenarios/etc/test-outputs/typeOf2/api-extractor-scenarios.api.md create mode 100644 build-tests/api-extractor-scenarios/etc/test-outputs/typeOf2/rollup.d.ts create mode 100644 build-tests/api-extractor-scenarios/src/typeOf2/index.ts diff --git a/build-tests/api-extractor-scenarios/config/build-config.json b/build-tests/api-extractor-scenarios/config/build-config.json index d2e0069eba4..4c0f15f3299 100644 --- a/build-tests/api-extractor-scenarios/config/build-config.json +++ b/build-tests/api-extractor-scenarios/config/build-config.json @@ -22,6 +22,7 @@ "inconsistentReleaseTags", "preapproved", "typeOf", + "typeOf2", "typeParameters" ] } diff --git a/build-tests/api-extractor-scenarios/etc/test-outputs/typeOf2/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/test-outputs/typeOf2/api-extractor-scenarios.api.json new file mode 100644 index 00000000000..643190bc47f --- /dev/null +++ b/build-tests/api-extractor-scenarios/etc/test-outputs/typeOf2/api-extractor-scenarios.api.json @@ -0,0 +1,133 @@ +{ + "metadata": { + "toolPackage": "@microsoft/api-extractor", + "toolVersion": "[test mode]", + "schemaVersion": 1003, + "oldestForwardsCompatibleVersion": 1001 + }, + "kind": "Package", + "canonicalReference": "api-extractor-scenarios!", + "docComment": "", + "name": "api-extractor-scenarios", + "members": [ + { + "kind": "EntryPoint", + "canonicalReference": "api-extractor-scenarios!", + "name": "", + "members": [ + { + "kind": "Function", + "canonicalReference": "api-extractor-scenarios!f:function(1)", + "docComment": "/**\n * @public\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "export declare function " + }, + { + "kind": "Reference", + "text": "f" + }, + { + "kind": "Content", + "text": "(): " + }, + { + "kind": "Content", + "text": "{\n " + }, + { + "kind": "Reference", + "text": "a" + }, + { + "kind": "Content", + "text": ": number;\n}" + }, + { + "kind": "Content", + "text": ";" + } + ], + "returnTypeTokenRange": { + "startIndex": 3, + "endIndex": 6 + }, + "releaseTag": "Public", + "overloadIndex": 1, + "parameters": [], + "name": "f" + }, + { + "kind": "Function", + "canonicalReference": "api-extractor-scenarios!g:function(1)", + "docComment": "/**\n * @public\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "export declare function " + }, + { + "kind": "Reference", + "text": "g" + }, + { + "kind": "Content", + "text": "(" + }, + { + "kind": "Reference", + "text": "callback" + }, + { + "kind": "Content", + "text": ": " + }, + { + "kind": "Content", + "text": "typeof " + }, + { + "kind": "Reference", + "text": "f", + "canonicalReference": "api-extractor-scenarios!f:function" + }, + { + "kind": "Content", + "text": "): " + }, + { + "kind": "Content", + "text": "typeof " + }, + { + "kind": "Reference", + "text": "f", + "canonicalReference": "api-extractor-scenarios!f:function" + }, + { + "kind": "Content", + "text": ";" + } + ], + "returnTypeTokenRange": { + "startIndex": 8, + "endIndex": 10 + }, + "releaseTag": "Public", + "overloadIndex": 1, + "parameters": [ + { + "parameterName": "callback", + "parameterTypeTokenRange": { + "startIndex": 5, + "endIndex": 7 + } + } + ], + "name": "g" + } + ] + } + ] +} diff --git a/build-tests/api-extractor-scenarios/etc/test-outputs/typeOf2/api-extractor-scenarios.api.md b/build-tests/api-extractor-scenarios/etc/test-outputs/typeOf2/api-extractor-scenarios.api.md new file mode 100644 index 00000000000..26384c3e2a4 --- /dev/null +++ b/build-tests/api-extractor-scenarios/etc/test-outputs/typeOf2/api-extractor-scenarios.api.md @@ -0,0 +1,18 @@ +## API Report File for "api-extractor-scenarios" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +// @public (undocumented) +export function f(): { + a: number; +}; + +// @public (undocumented) +export function g(callback: typeof f): typeof f; + + +// (No @packageDocumentation comment for this package) + +``` diff --git a/build-tests/api-extractor-scenarios/etc/test-outputs/typeOf2/rollup.d.ts b/build-tests/api-extractor-scenarios/etc/test-outputs/typeOf2/rollup.d.ts new file mode 100644 index 00000000000..32b7b7dbf14 --- /dev/null +++ b/build-tests/api-extractor-scenarios/etc/test-outputs/typeOf2/rollup.d.ts @@ -0,0 +1,10 @@ + +/** @public */ +export declare function f(): { + a: number; +}; + +/** @public */ +export declare function g(callback: typeof f): typeof f; + +export { } diff --git a/build-tests/api-extractor-scenarios/src/typeOf2/index.ts b/build-tests/api-extractor-scenarios/src/typeOf2/index.ts new file mode 100644 index 00000000000..07728912e65 --- /dev/null +++ b/build-tests/api-extractor-scenarios/src/typeOf2/index.ts @@ -0,0 +1,12 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. +// See LICENSE in the project root for license information. + +/** @public */ +export function f(): { a: number } { + return { a: 1}; +} + +/** @public */ +export function g(callback: typeof f): typeof f { + return callback; +} From a2e45837f7971fef351acf943afebab77b48b3f6 Mon Sep 17 00:00:00 2001 From: Pete Gonzalez <4673363+octogonz@users.noreply.github.com> Date: Sun, 8 Sep 2019 13:14:40 -0700 Subject: [PATCH 2/3] Create a ExcerptTokenKind.Reference node /only/ if the canonicalReference exists --- apps/api-extractor/src/generators/ExcerptBuilder.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/apps/api-extractor/src/generators/ExcerptBuilder.ts b/apps/api-extractor/src/generators/ExcerptBuilder.ts index ce71e902a8f..2ce3784cdcd 100644 --- a/apps/api-extractor/src/generators/ExcerptBuilder.ts +++ b/apps/api-extractor/src/generators/ExcerptBuilder.ts @@ -117,11 +117,16 @@ export class ExcerptBuilder { } if (span.prefix) { + let canonicalReference: DeclarationReference | undefined = undefined; + if (span.kind === ts.SyntaxKind.Identifier) { const name: ts.Identifier = span.node as ts.Identifier; - const canonicalReference: DeclarationReference | undefined = isDeclarationName(name) - ? undefined - : state.referenceGenerator.getDeclarationReferenceForIdentifier(name); + if (!isDeclarationName(name)) { + canonicalReference = state.referenceGenerator.getDeclarationReferenceForIdentifier(name); + } + } + + if (canonicalReference) { ExcerptBuilder._appendToken(excerptTokens, ExcerptTokenKind.Reference, span.prefix, state, canonicalReference); } else { From 585184975a21435ca9a88410f7b03b05e64ab097 Mon Sep 17 00:00:00 2001 From: Pete Gonzalez <4673363+octogonz@users.noreply.github.com> Date: Sun, 8 Sep 2019 13:14:49 -0700 Subject: [PATCH 3/3] rush build --- .../etc/api-documenter-test.api.json | 704 ++++-------------- .../api-extractor-scenarios.api.json | 40 +- .../api-extractor-scenarios.api.json | 264 ++----- .../api-extractor-scenarios.api.json | 50 +- .../api-extractor-scenarios.api.json | 70 +- .../api-extractor-scenarios.api.json | 10 +- .../api-extractor-scenarios.api.json | 10 +- .../api-extractor-scenarios.api.json | 14 +- .../api-extractor-scenarios.api.json | 10 +- .../api-extractor-scenarios.api.json | 98 +-- .../api-extractor-scenarios.api.json | 90 +-- .../api-extractor-scenarios.api.json | 92 +-- .../api-extractor-scenarios.api.json | 10 +- .../api-extractor-scenarios.api.json | 20 +- .../api-extractor-scenarios.api.json | 30 +- .../api-extractor-scenarios.api.json | 10 +- .../api-extractor-scenarios.api.json | 10 +- .../api-extractor-scenarios.api.json | 18 +- .../api-extractor-scenarios.api.json | 34 +- .../typeOf/api-extractor-scenarios.api.json | 28 +- .../typeOf2/api-extractor-scenarios.api.json | 50 +- .../api-extractor-scenarios.api.json | 200 +---- 22 files changed, 373 insertions(+), 1489 deletions(-) diff --git a/build-tests/api-documenter-test/etc/api-documenter-test.api.json b/build-tests/api-documenter-test/etc/api-documenter-test.api.json index e31fdfaec9a..f90d0628ef4 100644 --- a/build-tests/api-documenter-test/etc/api-documenter-test.api.json +++ b/build-tests/api-documenter-test/etc/api-documenter-test.api.json @@ -20,13 +20,9 @@ "canonicalReference": "api-documenter-test!constVariable:var", "docComment": "/**\n * An exported variable declaration.\n *\n * @public\n */\n", "excerptTokens": [ - { - "kind": "Reference", - "text": "constVariable" - }, { "kind": "Content", - "text": ": " + "text": "constVariable: " }, { "kind": "Content", @@ -36,8 +32,8 @@ "releaseTag": "Public", "name": "constVariable", "variableTypeTokenRange": { - "startIndex": 2, - "endIndex": 3 + "startIndex": 1, + "endIndex": 2 } }, { @@ -47,15 +43,7 @@ "excerptTokens": [ { "kind": "Content", - "text": "export declare class " - }, - { - "kind": "Reference", - "text": "DocBaseClass" - }, - { - "kind": "Content", - "text": " " + "text": "export declare class DocBaseClass " } ], "releaseTag": "Public", @@ -82,15 +70,7 @@ "excerptTokens": [ { "kind": "Content", - "text": "constructor(" - }, - { - "kind": "Reference", - "text": "x" - }, - { - "kind": "Content", - "text": ": " + "text": "constructor(x: " }, { "kind": "Content", @@ -107,8 +87,8 @@ { "parameterName": "x", "parameterTypeTokenRange": { - "startIndex": 3, - "endIndex": 4 + "startIndex": 1, + "endIndex": 2 } } ] @@ -123,15 +103,7 @@ "excerptTokens": [ { "kind": "Content", - "text": "export declare class " - }, - { - "kind": "Reference", - "text": "DocClass1" - }, - { - "kind": "Content", - "text": " extends " + "text": "export declare class DocClass1 extends " }, { "kind": "Reference", @@ -173,13 +145,9 @@ "canonicalReference": "api-documenter-test!DocClass1#deprecatedExample:member(1)", "docComment": "/**\n * @deprecated\n *\n * Use `otherThing()` instead.\n */\n", "excerptTokens": [ - { - "kind": "Reference", - "text": "deprecatedExample" - }, { "kind": "Content", - "text": "(): " + "text": "deprecatedExample(): " }, { "kind": "Content", @@ -192,8 +160,8 @@ ], "isStatic": false, "returnTypeTokenRange": { - "startIndex": 2, - "endIndex": 3 + "startIndex": 1, + "endIndex": 2 }, "releaseTag": "Public", "overloadIndex": 1, @@ -205,21 +173,9 @@ "canonicalReference": "api-documenter-test!DocClass1#exampleFunction:member(1)", "docComment": "/**\n * This is an overloaded function.\n *\n * @param a - the first string\n *\n * @param b - the second string\n */\n", "excerptTokens": [ - { - "kind": "Reference", - "text": "exampleFunction" - }, - { - "kind": "Content", - "text": "(" - }, - { - "kind": "Reference", - "text": "a" - }, { "kind": "Content", - "text": ": " + "text": "exampleFunction(a: " }, { "kind": "Content", @@ -227,15 +183,7 @@ }, { "kind": "Content", - "text": ", " - }, - { - "kind": "Reference", - "text": "b" - }, - { - "kind": "Content", - "text": ": " + "text": ", b: " }, { "kind": "Content", @@ -256,8 +204,8 @@ ], "isStatic": false, "returnTypeTokenRange": { - "startIndex": 10, - "endIndex": 11 + "startIndex": 5, + "endIndex": 6 }, "releaseTag": "Public", "overloadIndex": 1, @@ -265,15 +213,15 @@ { "parameterName": "a", "parameterTypeTokenRange": { - "startIndex": 4, - "endIndex": 5 + "startIndex": 1, + "endIndex": 2 } }, { "parameterName": "b", "parameterTypeTokenRange": { - "startIndex": 8, - "endIndex": 9 + "startIndex": 3, + "endIndex": 4 } } ], @@ -284,21 +232,9 @@ "canonicalReference": "api-documenter-test!DocClass1#exampleFunction:member(2)", "docComment": "/**\n * This is also an overloaded function.\n *\n * @param x - the number\n */\n", "excerptTokens": [ - { - "kind": "Reference", - "text": "exampleFunction" - }, - { - "kind": "Content", - "text": "(" - }, - { - "kind": "Reference", - "text": "x" - }, { "kind": "Content", - "text": ": " + "text": "exampleFunction(x: " }, { "kind": "Content", @@ -319,8 +255,8 @@ ], "isStatic": false, "returnTypeTokenRange": { - "startIndex": 6, - "endIndex": 7 + "startIndex": 3, + "endIndex": 4 }, "releaseTag": "Public", "overloadIndex": 2, @@ -328,8 +264,8 @@ { "parameterName": "x", "parameterTypeTokenRange": { - "startIndex": 4, - "endIndex": 5 + "startIndex": 1, + "endIndex": 2 } } ], @@ -340,13 +276,9 @@ "canonicalReference": "api-documenter-test!DocClass1#interestingEdgeCases:member(1)", "docComment": "/**\n * Example: \"\\{ \\\\\"maxItemsToShow\\\\\": 123 \\}\"\n *\n * The regular expression used to validate the constraints is /^[a-zA-Z0-9\\\\-_]+$/\n */\n", "excerptTokens": [ - { - "kind": "Reference", - "text": "interestingEdgeCases" - }, { "kind": "Content", - "text": "(): " + "text": "interestingEdgeCases(): " }, { "kind": "Content", @@ -359,8 +291,8 @@ ], "isStatic": false, "returnTypeTokenRange": { - "startIndex": 2, - "endIndex": 3 + "startIndex": 1, + "endIndex": 2 }, "releaseTag": "Public", "overloadIndex": 1, @@ -372,13 +304,9 @@ "canonicalReference": "api-documenter-test!DocClass1#malformedEvent:member", "docComment": "/**\n * This event should have been marked as readonly.\n *\n * @eventProperty\n */\n", "excerptTokens": [ - { - "kind": "Reference", - "text": "malformedEvent" - }, { "kind": "Content", - "text": ": " + "text": "malformedEvent: " }, { "kind": "Reference", @@ -393,8 +321,8 @@ "releaseTag": "Public", "name": "malformedEvent", "propertyTypeTokenRange": { - "startIndex": 2, - "endIndex": 3 + "startIndex": 1, + "endIndex": 2 }, "isStatic": false }, @@ -405,15 +333,7 @@ "excerptTokens": [ { "kind": "Content", - "text": "readonly " - }, - { - "kind": "Reference", - "text": "modifiedEvent" - }, - { - "kind": "Content", - "text": ": " + "text": "readonly modifiedEvent: " }, { "kind": "Reference", @@ -428,8 +348,8 @@ "releaseTag": "Public", "name": "modifiedEvent", "propertyTypeTokenRange": { - "startIndex": 3, - "endIndex": 4 + "startIndex": 1, + "endIndex": 2 }, "isStatic": false }, @@ -438,13 +358,9 @@ "canonicalReference": "api-documenter-test!DocClass1#regularProperty:member", "docComment": "/**\n * This is a regular property that happens to use the SystemEvent type.\n */\n", "excerptTokens": [ - { - "kind": "Reference", - "text": "regularProperty" - }, { "kind": "Content", - "text": ": " + "text": "regularProperty: " }, { "kind": "Reference", @@ -459,8 +375,8 @@ "releaseTag": "Public", "name": "regularProperty", "propertyTypeTokenRange": { - "startIndex": 2, - "endIndex": 3 + "startIndex": 1, + "endIndex": 2 }, "isStatic": false }, @@ -471,23 +387,7 @@ "excerptTokens": [ { "kind": "Content", - "text": "static " - }, - { - "kind": "Reference", - "text": "sumWithExample" - }, - { - "kind": "Content", - "text": "(" - }, - { - "kind": "Reference", - "text": "x" - }, - { - "kind": "Content", - "text": ": " + "text": "static sumWithExample(x: " }, { "kind": "Content", @@ -495,15 +395,7 @@ }, { "kind": "Content", - "text": ", " - }, - { - "kind": "Reference", - "text": "y" - }, - { - "kind": "Content", - "text": ": " + "text": ", y: " }, { "kind": "Content", @@ -524,8 +416,8 @@ ], "isStatic": true, "returnTypeTokenRange": { - "startIndex": 11, - "endIndex": 12 + "startIndex": 5, + "endIndex": 6 }, "releaseTag": "Public", "overloadIndex": 1, @@ -533,15 +425,15 @@ { "parameterName": "x", "parameterTypeTokenRange": { - "startIndex": 5, - "endIndex": 6 + "startIndex": 1, + "endIndex": 2 } }, { "parameterName": "y", "parameterTypeTokenRange": { - "startIndex": 9, - "endIndex": 10 + "startIndex": 3, + "endIndex": 4 } } ], @@ -552,13 +444,9 @@ "canonicalReference": "api-documenter-test!DocClass1#tableExample:member(1)", "docComment": "/**\n * An example with tables:\n *\n * @remarks\n *\n *
John Doe
\n */\n", "excerptTokens": [ - { - "kind": "Reference", - "text": "tableExample" - }, { "kind": "Content", - "text": "(): " + "text": "tableExample(): " }, { "kind": "Content", @@ -571,8 +459,8 @@ ], "isStatic": false, "returnTypeTokenRange": { - "startIndex": 2, - "endIndex": 3 + "startIndex": 1, + "endIndex": 2 }, "releaseTag": "Public", "overloadIndex": 1, @@ -581,17 +469,17 @@ } ], "extendsTokenRange": { - "startIndex": 3, - "endIndex": 5 + "startIndex": 1, + "endIndex": 3 }, "implementsTokenRanges": [ { - "startIndex": 6, - "endIndex": 7 + "startIndex": 4, + "endIndex": 5 }, { - "startIndex": 8, - "endIndex": 10 + "startIndex": 6, + "endIndex": 8 } ] }, @@ -602,15 +490,7 @@ "excerptTokens": [ { "kind": "Content", - "text": "export declare enum " - }, - { - "kind": "Reference", - "text": "DocEnum" - }, - { - "kind": "Content", - "text": " " + "text": "export declare enum DocEnum " } ], "releaseTag": "Public", @@ -621,13 +501,9 @@ "canonicalReference": "api-documenter-test!DocEnum.One:member", "docComment": "/**\n * These are some docs for One\n */\n", "excerptTokens": [ - { - "kind": "Reference", - "text": "One" - }, { "kind": "Content", - "text": " = " + "text": "One = " }, { "kind": "Content", @@ -637,8 +513,8 @@ "releaseTag": "Public", "name": "One", "initializerTokenRange": { - "startIndex": 2, - "endIndex": 3 + "startIndex": 1, + "endIndex": 2 } }, { @@ -646,13 +522,9 @@ "canonicalReference": "api-documenter-test!DocEnum.Two:member", "docComment": "/**\n * These are some docs for Two\n */\n", "excerptTokens": [ - { - "kind": "Reference", - "text": "Two" - }, { "kind": "Content", - "text": " = " + "text": "Two = " }, { "kind": "Content", @@ -662,8 +534,8 @@ "releaseTag": "Public", "name": "Two", "initializerTokenRange": { - "startIndex": 2, - "endIndex": 3 + "startIndex": 1, + "endIndex": 2 } }, { @@ -671,13 +543,9 @@ "canonicalReference": "api-documenter-test!DocEnum.Zero:member", "docComment": "/**\n * These are some docs for Zero\n */\n", "excerptTokens": [ - { - "kind": "Reference", - "text": "Zero" - }, { "kind": "Content", - "text": " = " + "text": "Zero = " }, { "kind": "Content", @@ -687,8 +555,8 @@ "releaseTag": "Public", "name": "Zero", "initializerTokenRange": { - "startIndex": 2, - "endIndex": 3 + "startIndex": 1, + "endIndex": 2 } } ] @@ -700,15 +568,7 @@ "excerptTokens": [ { "kind": "Content", - "text": "export declare namespace " - }, - { - "kind": "Reference", - "text": "EcmaSmbols" - }, - { - "kind": "Content", - "text": " " + "text": "export declare namespace EcmaSmbols " } ], "releaseTag": "Public", @@ -719,13 +579,9 @@ "canonicalReference": "api-documenter-test!EcmaSmbols.example:var", "docComment": "/**\n * An ECMAScript symbol\n */\n", "excerptTokens": [ - { - "kind": "Reference", - "text": "example" - }, { "kind": "Content", - "text": ": " + "text": "example: " }, { "kind": "Content", @@ -735,8 +591,8 @@ "releaseTag": "Public", "name": "example", "variableTypeTokenRange": { - "startIndex": 2, - "endIndex": 3 + "startIndex": 1, + "endIndex": 2 } } ] @@ -748,15 +604,7 @@ "excerptTokens": [ { "kind": "Content", - "text": "export declare type " - }, - { - "kind": "Reference", - "text": "ExampleTypeAlias" - }, - { - "kind": "Content", - "text": " = " + "text": "export declare type ExampleTypeAlias = " }, { "kind": "Reference", @@ -775,8 +623,8 @@ "releaseTag": "Public", "name": "ExampleTypeAlias", "typeTokenRange": { - "startIndex": 3, - "endIndex": 5 + "startIndex": 1, + "endIndex": 3 } }, { @@ -786,23 +634,7 @@ "excerptTokens": [ { "kind": "Content", - "text": "export declare class " - }, - { - "kind": "Reference", - "text": "Generic" - }, - { - "kind": "Content", - "text": "<" - }, - { - "kind": "Reference", - "text": "T" - }, - { - "kind": "Content", - "text": "> " + "text": "export declare class Generic " } ], "releaseTag": "Public", @@ -830,23 +662,7 @@ "excerptTokens": [ { "kind": "Content", - "text": "export declare function " - }, - { - "kind": "Reference", - "text": "globalFunction" - }, - { - "kind": "Content", - "text": "(" - }, - { - "kind": "Reference", - "text": "x" - }, - { - "kind": "Content", - "text": ": " + "text": "export declare function globalFunction(x: " }, { "kind": "Content", @@ -866,8 +682,8 @@ } ], "returnTypeTokenRange": { - "startIndex": 7, - "endIndex": 8 + "startIndex": 3, + "endIndex": 4 }, "releaseTag": "Public", "overloadIndex": 1, @@ -875,8 +691,8 @@ { "parameterName": "x", "parameterTypeTokenRange": { - "startIndex": 5, - "endIndex": 6 + "startIndex": 1, + "endIndex": 2 } } ], @@ -889,15 +705,7 @@ "excerptTokens": [ { "kind": "Content", - "text": "export interface " - }, - { - "kind": "Reference", - "text": "IDocInterface1" - }, - { - "kind": "Content", - "text": " " + "text": "export interface IDocInterface1 " } ], "releaseTag": "Public", @@ -908,13 +716,9 @@ "canonicalReference": "api-documenter-test!IDocInterface1#regularProperty:member", "docComment": "/**\n * Does something\n */\n", "excerptTokens": [ - { - "kind": "Reference", - "text": "regularProperty" - }, { "kind": "Content", - "text": ": " + "text": "regularProperty: " }, { "kind": "Reference", @@ -929,8 +733,8 @@ "releaseTag": "Public", "name": "regularProperty", "propertyTypeTokenRange": { - "startIndex": 2, - "endIndex": 3 + "startIndex": 1, + "endIndex": 2 } } ], @@ -943,15 +747,7 @@ "excerptTokens": [ { "kind": "Content", - "text": "export interface " - }, - { - "kind": "Reference", - "text": "IDocInterface2" - }, - { - "kind": "Content", - "text": " extends " + "text": "export interface IDocInterface2 extends " }, { "kind": "Reference", @@ -971,13 +767,9 @@ "canonicalReference": "api-documenter-test!IDocInterface2#deprecatedExample:member(1)", "docComment": "/**\n * @deprecated\n *\n * Use `otherThing()` instead.\n */\n", "excerptTokens": [ - { - "kind": "Reference", - "text": "deprecatedExample" - }, { "kind": "Content", - "text": "(): " + "text": "deprecatedExample(): " }, { "kind": "Content", @@ -989,8 +781,8 @@ } ], "returnTypeTokenRange": { - "startIndex": 2, - "endIndex": 3 + "startIndex": 1, + "endIndex": 2 }, "releaseTag": "Public", "overloadIndex": 1, @@ -1000,8 +792,8 @@ ], "extendsTokenRanges": [ { - "startIndex": 3, - "endIndex": 5 + "startIndex": 1, + "endIndex": 3 } ] }, @@ -1012,15 +804,7 @@ "excerptTokens": [ { "kind": "Content", - "text": "export interface " - }, - { - "kind": "Reference", - "text": "IDocInterface3" - }, - { - "kind": "Content", - "text": " " + "text": "export interface IDocInterface3 " } ], "releaseTag": "Public", @@ -1092,15 +876,7 @@ "excerptTokens": [ { "kind": "Content", - "text": "(" - }, - { - "kind": "Reference", - "text": "x" - }, - { - "kind": "Content", - "text": ": " + "text": "(x: " }, { "kind": "Content", @@ -1120,8 +896,8 @@ } ], "returnTypeTokenRange": { - "startIndex": 5, - "endIndex": 6 + "startIndex": 3, + "endIndex": 4 }, "releaseTag": "Public", "overloadIndex": 1, @@ -1129,8 +905,8 @@ { "parameterName": "x", "parameterTypeTokenRange": { - "startIndex": 3, - "endIndex": 4 + "startIndex": 1, + "endIndex": 2 } } ] @@ -1169,15 +945,7 @@ "excerptTokens": [ { "kind": "Content", - "text": "[" - }, - { - "kind": "Reference", - "text": "x" - }, - { - "kind": "Content", - "text": ": " + "text": "[x: " }, { "kind": "Content", @@ -1197,8 +965,8 @@ } ], "returnTypeTokenRange": { - "startIndex": 5, - "endIndex": 6 + "startIndex": 3, + "endIndex": 4 }, "releaseTag": "Public", "overloadIndex": 1, @@ -1206,8 +974,8 @@ { "parameterName": "x", "parameterTypeTokenRange": { - "startIndex": 3, - "endIndex": 4 + "startIndex": 1, + "endIndex": 2 } } ] @@ -1247,15 +1015,7 @@ "excerptTokens": [ { "kind": "Content", - "text": "export interface " - }, - { - "kind": "Reference", - "text": "IDocInterface4" - }, - { - "kind": "Content", - "text": " " + "text": "export interface IDocInterface4 " } ], "releaseTag": "Public", @@ -1266,33 +1026,13 @@ "canonicalReference": "api-documenter-test!IDocInterface4#Context:member", "docComment": "/**\n * Test newline rendering when code blocks are used in tables\n */\n", "excerptTokens": [ - { - "kind": "Reference", - "text": "Context" - }, - { - "kind": "Content", - "text": ": " - }, - { - "kind": "Content", - "text": "({ " - }, - { - "kind": "Reference", - "text": "children" - }, { "kind": "Content", - "text": " }: {\n " - }, - { - "kind": "Reference", - "text": "children" + "text": "Context: " }, { "kind": "Content", - "text": ": string;\n }) => boolean" + "text": "({ children }: {\n children: string;\n }) => boolean" }, { "kind": "Content", @@ -1302,8 +1042,8 @@ "releaseTag": "Public", "name": "Context", "propertyTypeTokenRange": { - "startIndex": 2, - "endIndex": 7 + "startIndex": 1, + "endIndex": 2 } }, { @@ -1311,13 +1051,9 @@ "canonicalReference": "api-documenter-test!IDocInterface4#generic:member", "docComment": "/**\n * make sure html entities are escaped in tables.\n */\n", "excerptTokens": [ - { - "kind": "Reference", - "text": "generic" - }, { "kind": "Content", - "text": ": " + "text": "generic: " }, { "kind": "Reference", @@ -1336,8 +1072,8 @@ "releaseTag": "Public", "name": "generic", "propertyTypeTokenRange": { - "startIndex": 2, - "endIndex": 4 + "startIndex": 1, + "endIndex": 3 } }, { @@ -1345,13 +1081,9 @@ "canonicalReference": "api-documenter-test!IDocInterface4#numberOrFunction:member", "docComment": "/**\n * a union type with a function\n */\n", "excerptTokens": [ - { - "kind": "Reference", - "text": "numberOrFunction" - }, { "kind": "Content", - "text": ": " + "text": "numberOrFunction: " }, { "kind": "Content", @@ -1365,8 +1097,8 @@ "releaseTag": "Public", "name": "numberOrFunction", "propertyTypeTokenRange": { - "startIndex": 2, - "endIndex": 3 + "startIndex": 1, + "endIndex": 2 } }, { @@ -1374,13 +1106,9 @@ "canonicalReference": "api-documenter-test!IDocInterface4#stringOrNumber:member", "docComment": "/**\n * a union type\n */\n", "excerptTokens": [ - { - "kind": "Reference", - "text": "stringOrNumber" - }, { "kind": "Content", - "text": ": " + "text": "stringOrNumber: " }, { "kind": "Content", @@ -1394,8 +1122,8 @@ "releaseTag": "Public", "name": "stringOrNumber", "propertyTypeTokenRange": { - "startIndex": 2, - "endIndex": 3 + "startIndex": 1, + "endIndex": 2 } } ], @@ -1408,15 +1136,7 @@ "excerptTokens": [ { "kind": "Content", - "text": "export interface " - }, - { - "kind": "Reference", - "text": "IDocInterface5" - }, - { - "kind": "Content", - "text": " " + "text": "export interface IDocInterface5 " } ], "releaseTag": "Public", @@ -1427,13 +1147,9 @@ "canonicalReference": "api-documenter-test!IDocInterface5#regularProperty:member", "docComment": "/**\n * Property of type string that does something\n */\n", "excerptTokens": [ - { - "kind": "Reference", - "text": "regularProperty" - }, { "kind": "Content", - "text": ": " + "text": "regularProperty: " }, { "kind": "Content", @@ -1447,8 +1163,8 @@ "releaseTag": "Public", "name": "regularProperty", "propertyTypeTokenRange": { - "startIndex": 2, - "endIndex": 3 + "startIndex": 1, + "endIndex": 2 } } ], @@ -1461,15 +1177,7 @@ "excerptTokens": [ { "kind": "Content", - "text": "export interface " - }, - { - "kind": "Reference", - "text": "IDocInterface6" - }, - { - "kind": "Content", - "text": " " + "text": "export interface IDocInterface6 " } ], "releaseTag": "Public", @@ -1480,13 +1188,9 @@ "canonicalReference": "api-documenter-test!IDocInterface6#arrayProperty:member", "docComment": "", "excerptTokens": [ - { - "kind": "Reference", - "text": "arrayProperty" - }, { "kind": "Content", - "text": ": " + "text": "arrayProperty: " }, { "kind": "Reference", @@ -1505,8 +1209,8 @@ "releaseTag": "Public", "name": "arrayProperty", "propertyTypeTokenRange": { - "startIndex": 2, - "endIndex": 4 + "startIndex": 1, + "endIndex": 3 } }, { @@ -1514,32 +1218,12 @@ "canonicalReference": "api-documenter-test!IDocInterface6#genericReferenceMethod:member(1)", "docComment": "", "excerptTokens": [ - { - "kind": "Reference", - "text": "genericReferenceMethod" - }, { "kind": "Content", - "text": "<" - }, - { - "kind": "Reference", - "text": "T" - }, - { - "kind": "Content", - "text": ">(" - }, - { - "kind": "Reference", - "text": "x" + "text": "genericReferenceMethod(x: " }, { "kind": "Content", - "text": ": " - }, - { - "kind": "Reference", "text": "T" }, { @@ -1547,7 +1231,7 @@ "text": "): " }, { - "kind": "Reference", + "kind": "Content", "text": "T" }, { @@ -1556,8 +1240,8 @@ } ], "returnTypeTokenRange": { - "startIndex": 8, - "endIndex": 9 + "startIndex": 3, + "endIndex": 4 }, "releaseTag": "Public", "overloadIndex": 1, @@ -1565,8 +1249,8 @@ { "parameterName": "x", "parameterTypeTokenRange": { - "startIndex": 6, - "endIndex": 7 + "startIndex": 1, + "endIndex": 2 } } ], @@ -1590,13 +1274,9 @@ "canonicalReference": "api-documenter-test!IDocInterface6#intersectionProperty:member", "docComment": "", "excerptTokens": [ - { - "kind": "Reference", - "text": "intersectionProperty" - }, { "kind": "Content", - "text": ": " + "text": "intersectionProperty: " }, { "kind": "Reference", @@ -1620,8 +1300,8 @@ "releaseTag": "Public", "name": "intersectionProperty", "propertyTypeTokenRange": { - "startIndex": 2, - "endIndex": 5 + "startIndex": 1, + "endIndex": 4 } }, { @@ -1629,13 +1309,9 @@ "canonicalReference": "api-documenter-test!IDocInterface6#regularProperty:member", "docComment": "/**\n * Property of type number that does something\n */\n", "excerptTokens": [ - { - "kind": "Reference", - "text": "regularProperty" - }, { "kind": "Content", - "text": ": " + "text": "regularProperty: " }, { "kind": "Content", @@ -1649,8 +1325,8 @@ "releaseTag": "Public", "name": "regularProperty", "propertyTypeTokenRange": { - "startIndex": 2, - "endIndex": 3 + "startIndex": 1, + "endIndex": 2 } }, { @@ -1658,13 +1334,9 @@ "canonicalReference": "api-documenter-test!IDocInterface6#tupleProperty:member", "docComment": "", "excerptTokens": [ - { - "kind": "Reference", - "text": "tupleProperty" - }, { "kind": "Content", - "text": ": " + "text": "tupleProperty: " }, { "kind": "Content", @@ -1696,8 +1368,8 @@ "releaseTag": "Public", "name": "tupleProperty", "propertyTypeTokenRange": { - "startIndex": 2, - "endIndex": 7 + "startIndex": 1, + "endIndex": 6 } }, { @@ -1705,13 +1377,9 @@ "canonicalReference": "api-documenter-test!IDocInterface6#typeReferenceProperty:member", "docComment": "", "excerptTokens": [ - { - "kind": "Reference", - "text": "typeReferenceProperty" - }, { "kind": "Content", - "text": ": " + "text": "typeReferenceProperty: " }, { "kind": "Reference", @@ -1739,8 +1407,8 @@ "releaseTag": "Public", "name": "typeReferenceProperty", "propertyTypeTokenRange": { - "startIndex": 2, - "endIndex": 6 + "startIndex": 1, + "endIndex": 5 } }, { @@ -1748,13 +1416,9 @@ "canonicalReference": "api-documenter-test!IDocInterface6#unionProperty:member", "docComment": "", "excerptTokens": [ - { - "kind": "Reference", - "text": "unionProperty" - }, { "kind": "Content", - "text": ": " + "text": "unionProperty: " }, { "kind": "Reference", @@ -1778,8 +1442,8 @@ "releaseTag": "Public", "name": "unionProperty", "propertyTypeTokenRange": { - "startIndex": 2, - "endIndex": 5 + "startIndex": 1, + "endIndex": 4 } } ], @@ -1792,15 +1456,7 @@ "excerptTokens": [ { "kind": "Content", - "text": "export declare namespace " - }, - { - "kind": "Reference", - "text": "OuterNamespace" - }, - { - "kind": "Content", - "text": " " + "text": "export declare namespace OuterNamespace " } ], "releaseTag": "Public", @@ -1813,15 +1469,7 @@ "excerptTokens": [ { "kind": "Content", - "text": "namespace " - }, - { - "kind": "Reference", - "text": "InnerNamespace" - }, - { - "kind": "Content", - "text": " " + "text": "namespace InnerNamespace " } ], "releaseTag": "Public", @@ -1834,23 +1482,7 @@ "excerptTokens": [ { "kind": "Content", - "text": "function " - }, - { - "kind": "Reference", - "text": "nestedFunction" - }, - { - "kind": "Content", - "text": "(" - }, - { - "kind": "Reference", - "text": "x" - }, - { - "kind": "Content", - "text": ": " + "text": "function nestedFunction(x: " }, { "kind": "Content", @@ -1870,8 +1502,8 @@ } ], "returnTypeTokenRange": { - "startIndex": 7, - "endIndex": 8 + "startIndex": 3, + "endIndex": 4 }, "releaseTag": "Public", "overloadIndex": 1, @@ -1879,8 +1511,8 @@ { "parameterName": "x", "parameterTypeTokenRange": { - "startIndex": 5, - "endIndex": 6 + "startIndex": 1, + "endIndex": 2 } } ], @@ -1893,13 +1525,9 @@ "canonicalReference": "api-documenter-test!OuterNamespace.nestedVariable:var", "docComment": "/**\n * A variable exported from within a namespace.\n */\n", "excerptTokens": [ - { - "kind": "Reference", - "text": "nestedVariable" - }, { "kind": "Content", - "text": ": " + "text": "nestedVariable: " }, { "kind": "Content", @@ -1909,8 +1537,8 @@ "releaseTag": "Public", "name": "nestedVariable", "variableTypeTokenRange": { - "startIndex": 2, - "endIndex": 3 + "startIndex": 1, + "endIndex": 2 } } ] @@ -1922,15 +1550,7 @@ "excerptTokens": [ { "kind": "Content", - "text": "export declare class " - }, - { - "kind": "Reference", - "text": "SystemEvent" - }, - { - "kind": "Content", - "text": " " + "text": "export declare class SystemEvent " } ], "releaseTag": "Public", @@ -1941,21 +1561,9 @@ "canonicalReference": "api-documenter-test!SystemEvent#addHandler:member(1)", "docComment": "/**\n * Adds an handler for the event.\n */\n", "excerptTokens": [ - { - "kind": "Reference", - "text": "addHandler" - }, { "kind": "Content", - "text": "(" - }, - { - "kind": "Reference", - "text": "handler" - }, - { - "kind": "Content", - "text": ": " + "text": "addHandler(handler: " }, { "kind": "Content", @@ -1976,8 +1584,8 @@ ], "isStatic": false, "returnTypeTokenRange": { - "startIndex": 6, - "endIndex": 7 + "startIndex": 3, + "endIndex": 4 }, "releaseTag": "Public", "overloadIndex": 1, @@ -1985,8 +1593,8 @@ { "parameterName": "handler", "parameterTypeTokenRange": { - "startIndex": 4, - "endIndex": 5 + "startIndex": 1, + "endIndex": 2 } } ], diff --git a/build-tests/api-extractor-scenarios/etc/test-outputs/ambientNameConflict/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/test-outputs/ambientNameConflict/api-extractor-scenarios.api.json index a74b19ed394..655d30ae318 100644 --- a/build-tests/api-extractor-scenarios/etc/test-outputs/ambientNameConflict/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/test-outputs/ambientNameConflict/api-extractor-scenarios.api.json @@ -22,23 +22,7 @@ "excerptTokens": [ { "kind": "Content", - "text": "export declare function " - }, - { - "kind": "Reference", - "text": "ambientNameConflict" - }, - { - "kind": "Content", - "text": "(" - }, - { - "kind": "Reference", - "text": "p1" - }, - { - "kind": "Content", - "text": ": " + "text": "export declare function ambientNameConflict(p1: " }, { "kind": "Reference", @@ -51,15 +35,7 @@ }, { "kind": "Content", - "text": ", " - }, - { - "kind": "Reference", - "text": "p2" - }, - { - "kind": "Content", - "text": ": " + "text": ", p2: " }, { "kind": "Reference", @@ -84,8 +60,8 @@ } ], "returnTypeTokenRange": { - "startIndex": 13, - "endIndex": 14 + "startIndex": 7, + "endIndex": 8 }, "releaseTag": "Public", "overloadIndex": 1, @@ -93,15 +69,15 @@ { "parameterName": "p1", "parameterTypeTokenRange": { - "startIndex": 5, - "endIndex": 7 + "startIndex": 1, + "endIndex": 3 } }, { "parameterName": "p2", "parameterTypeTokenRange": { - "startIndex": 10, - "endIndex": 12 + "startIndex": 4, + "endIndex": 6 } } ], diff --git a/build-tests/api-extractor-scenarios/etc/test-outputs/apiItemKinds/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/test-outputs/apiItemKinds/api-extractor-scenarios.api.json index 017fc128235..46c907a96ab 100644 --- a/build-tests/api-extractor-scenarios/etc/test-outputs/apiItemKinds/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/test-outputs/apiItemKinds/api-extractor-scenarios.api.json @@ -22,15 +22,7 @@ "excerptTokens": [ { "kind": "Content", - "text": "export declare abstract class " - }, - { - "kind": "Reference", - "text": "AbstractClass" - }, - { - "kind": "Content", - "text": " " + "text": "export declare abstract class AbstractClass " } ], "releaseTag": "Public", @@ -43,15 +35,7 @@ "excerptTokens": [ { "kind": "Content", - "text": "abstract " - }, - { - "kind": "Reference", - "text": "member" - }, - { - "kind": "Content", - "text": "(): " + "text": "abstract member(): " }, { "kind": "Content", @@ -64,8 +48,8 @@ ], "isStatic": false, "returnTypeTokenRange": { - "startIndex": 3, - "endIndex": 4 + "startIndex": 1, + "endIndex": 2 }, "releaseTag": "Public", "overloadIndex": 1, @@ -82,15 +66,7 @@ "excerptTokens": [ { "kind": "Content", - "text": "export declare class " - }, - { - "kind": "Reference", - "text": "ClassWithTypeLiterals" - }, - { - "kind": "Content", - "text": " " + "text": "export declare class ClassWithTypeLiterals " } ], "releaseTag": "Public", @@ -101,41 +77,13 @@ "canonicalReference": "api-extractor-scenarios!ClassWithTypeLiterals#method1:member(1)", "docComment": "/**\n * type literal in\n */\n", "excerptTokens": [ - { - "kind": "Reference", - "text": "method1" - }, { "kind": "Content", - "text": "(" - }, - { - "kind": "Reference", - "text": "vector" + "text": "method1(vector: " }, { "kind": "Content", - "text": ": " - }, - { - "kind": "Content", - "text": "{\n " - }, - { - "kind": "Reference", - "text": "x" - }, - { - "kind": "Content", - "text": ": number;\n " - }, - { - "kind": "Reference", - "text": "y" - }, - { - "kind": "Content", - "text": ": number;\n }" + "text": "{\n x: number;\n y: number;\n }" }, { "kind": "Content", @@ -152,8 +100,8 @@ ], "isStatic": false, "returnTypeTokenRange": { - "startIndex": 10, - "endIndex": 11 + "startIndex": 3, + "endIndex": 4 }, "releaseTag": "Public", "overloadIndex": 1, @@ -161,8 +109,8 @@ { "parameterName": "vector", "parameterTypeTokenRange": { - "startIndex": 4, - "endIndex": 9 + "startIndex": 1, + "endIndex": 2 } } ], @@ -173,25 +121,13 @@ "canonicalReference": "api-extractor-scenarios!ClassWithTypeLiterals#method2:member(1)", "docComment": "/**\n * type literal output\n */\n", "excerptTokens": [ - { - "kind": "Reference", - "text": "method2" - }, - { - "kind": "Content", - "text": "(): " - }, { "kind": "Content", - "text": "{\n " - }, - { - "kind": "Reference", - "text": "classValue" + "text": "method2(): " }, { "kind": "Content", - "text": ": " + "text": "{\n classValue: " }, { "kind": "Reference", @@ -200,15 +136,7 @@ }, { "kind": "Content", - "text": ";\n " - }, - { - "kind": "Reference", - "text": "callback" - }, - { - "kind": "Content", - "text": ": () => number;\n } | undefined" + "text": ";\n callback: () => number;\n } | undefined" }, { "kind": "Content", @@ -217,8 +145,8 @@ ], "isStatic": false, "returnTypeTokenRange": { - "startIndex": 2, - "endIndex": 9 + "startIndex": 1, + "endIndex": 4 }, "releaseTag": "Public", "overloadIndex": 1, @@ -235,15 +163,7 @@ "excerptTokens": [ { "kind": "Content", - "text": "export declare const enum " - }, - { - "kind": "Reference", - "text": "ConstEnum" - }, - { - "kind": "Content", - "text": " " + "text": "export declare const enum ConstEnum " } ], "releaseTag": "Public", @@ -254,13 +174,9 @@ "canonicalReference": "api-extractor-scenarios!ConstEnum.One:member", "docComment": "", "excerptTokens": [ - { - "kind": "Reference", - "text": "One" - }, { "kind": "Content", - "text": " = " + "text": "One = " }, { "kind": "Content", @@ -270,8 +186,8 @@ "releaseTag": "Public", "name": "One", "initializerTokenRange": { - "startIndex": 2, - "endIndex": 3 + "startIndex": 1, + "endIndex": 2 } }, { @@ -279,13 +195,9 @@ "canonicalReference": "api-extractor-scenarios!ConstEnum.Two:member", "docComment": "", "excerptTokens": [ - { - "kind": "Reference", - "text": "Two" - }, { "kind": "Content", - "text": " = " + "text": "Two = " }, { "kind": "Content", @@ -295,8 +207,8 @@ "releaseTag": "Public", "name": "Two", "initializerTokenRange": { - "startIndex": 2, - "endIndex": 3 + "startIndex": 1, + "endIndex": 2 } }, { @@ -304,13 +216,9 @@ "canonicalReference": "api-extractor-scenarios!ConstEnum.Zero:member", "docComment": "", "excerptTokens": [ - { - "kind": "Reference", - "text": "Zero" - }, { "kind": "Content", - "text": " = " + "text": "Zero = " }, { "kind": "Content", @@ -320,8 +228,8 @@ "releaseTag": "Public", "name": "Zero", "initializerTokenRange": { - "startIndex": 2, - "endIndex": 3 + "startIndex": 1, + "endIndex": 2 } } ] @@ -333,15 +241,7 @@ "excerptTokens": [ { "kind": "Content", - "text": "export interface " - }, - { - "kind": "Reference", - "text": "IInterface" - }, - { - "kind": "Content", - "text": " " + "text": "export interface IInterface " } ], "releaseTag": "Public", @@ -352,13 +252,9 @@ "canonicalReference": "api-extractor-scenarios!IInterface#member:member", "docComment": "", "excerptTokens": [ - { - "kind": "Reference", - "text": "member" - }, { "kind": "Content", - "text": ": " + "text": "member: " }, { "kind": "Content", @@ -372,8 +268,8 @@ "releaseTag": "Public", "name": "member", "propertyTypeTokenRange": { - "startIndex": 2, - "endIndex": 3 + "startIndex": 1, + "endIndex": 2 } } ], @@ -386,15 +282,7 @@ "excerptTokens": [ { "kind": "Content", - "text": "export declare namespace " - }, - { - "kind": "Reference", - "text": "NamespaceContainingVariable" - }, - { - "kind": "Content", - "text": " " + "text": "export declare namespace NamespaceContainingVariable " } ], "releaseTag": "Public", @@ -405,13 +293,9 @@ "canonicalReference": "api-extractor-scenarios!NamespaceContainingVariable.constVariable:var", "docComment": "", "excerptTokens": [ - { - "kind": "Reference", - "text": "constVariable" - }, { "kind": "Content", - "text": ": " + "text": "constVariable: " }, { "kind": "Content", @@ -421,8 +305,8 @@ "releaseTag": "Public", "name": "constVariable", "variableTypeTokenRange": { - "startIndex": 2, - "endIndex": 3 + "startIndex": 1, + "endIndex": 2 } }, { @@ -430,13 +314,9 @@ "canonicalReference": "api-extractor-scenarios!NamespaceContainingVariable.variable:var", "docComment": "", "excerptTokens": [ - { - "kind": "Reference", - "text": "variable" - }, { "kind": "Content", - "text": ": " + "text": "variable: " }, { "kind": "Content", @@ -446,8 +326,8 @@ "releaseTag": "Public", "name": "variable", "variableTypeTokenRange": { - "startIndex": 2, - "endIndex": 3 + "startIndex": 1, + "endIndex": 2 } } ] @@ -459,15 +339,7 @@ "excerptTokens": [ { "kind": "Content", - "text": "export declare enum " - }, - { - "kind": "Reference", - "text": "RegularEnum" - }, - { - "kind": "Content", - "text": " " + "text": "export declare enum RegularEnum " } ], "releaseTag": "Public", @@ -478,13 +350,9 @@ "canonicalReference": "api-extractor-scenarios!RegularEnum.One:member", "docComment": "/**\n * These are some docs for One\n */\n", "excerptTokens": [ - { - "kind": "Reference", - "text": "One" - }, { "kind": "Content", - "text": " = " + "text": "One = " }, { "kind": "Content", @@ -494,8 +362,8 @@ "releaseTag": "Public", "name": "One", "initializerTokenRange": { - "startIndex": 2, - "endIndex": 3 + "startIndex": 1, + "endIndex": 2 } }, { @@ -503,13 +371,9 @@ "canonicalReference": "api-extractor-scenarios!RegularEnum.Two:member", "docComment": "/**\n * These are some docs for Two\n */\n", "excerptTokens": [ - { - "kind": "Reference", - "text": "Two" - }, { "kind": "Content", - "text": " = " + "text": "Two = " }, { "kind": "Content", @@ -519,8 +383,8 @@ "releaseTag": "Public", "name": "Two", "initializerTokenRange": { - "startIndex": 2, - "endIndex": 3 + "startIndex": 1, + "endIndex": 2 } }, { @@ -528,13 +392,9 @@ "canonicalReference": "api-extractor-scenarios!RegularEnum.Zero:member", "docComment": "/**\n * These are some docs for Zero\n */\n", "excerptTokens": [ - { - "kind": "Reference", - "text": "Zero" - }, { "kind": "Content", - "text": " = " + "text": "Zero = " }, { "kind": "Content", @@ -544,8 +404,8 @@ "releaseTag": "Public", "name": "Zero", "initializerTokenRange": { - "startIndex": 2, - "endIndex": 3 + "startIndex": 1, + "endIndex": 2 } } ] @@ -557,15 +417,7 @@ "excerptTokens": [ { "kind": "Content", - "text": "export declare class " - }, - { - "kind": "Reference", - "text": "SimpleClass" - }, - { - "kind": "Content", - "text": " " + "text": "export declare class SimpleClass " } ], "releaseTag": "Public", @@ -576,13 +428,9 @@ "canonicalReference": "api-extractor-scenarios!SimpleClass#member:member(1)", "docComment": "", "excerptTokens": [ - { - "kind": "Reference", - "text": "member" - }, { "kind": "Content", - "text": "(): " + "text": "member(): " }, { "kind": "Content", @@ -595,8 +443,8 @@ ], "isStatic": false, "returnTypeTokenRange": { - "startIndex": 2, - "endIndex": 3 + "startIndex": 1, + "endIndex": 2 }, "releaseTag": "Public", "overloadIndex": 1, @@ -611,13 +459,9 @@ "canonicalReference": "api-extractor-scenarios!VARIABLE:var", "docComment": "/**\n * @public\n */\n", "excerptTokens": [ - { - "kind": "Reference", - "text": "VARIABLE" - }, { "kind": "Content", - "text": ": " + "text": "VARIABLE: " }, { "kind": "Content", @@ -627,8 +471,8 @@ "releaseTag": "Public", "name": "VARIABLE", "variableTypeTokenRange": { - "startIndex": 2, - "endIndex": 3 + "startIndex": 1, + "endIndex": 2 } } ] diff --git a/build-tests/api-extractor-scenarios/etc/test-outputs/circularImport/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/test-outputs/circularImport/api-extractor-scenarios.api.json index d78684206ae..dca6d2b0978 100644 --- a/build-tests/api-extractor-scenarios/etc/test-outputs/circularImport/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/test-outputs/circularImport/api-extractor-scenarios.api.json @@ -22,15 +22,7 @@ "excerptTokens": [ { "kind": "Content", - "text": "export declare class " - }, - { - "kind": "Reference", - "text": "IFile" - }, - { - "kind": "Content", - "text": " " + "text": "export declare class IFile " } ], "releaseTag": "Public", @@ -41,13 +33,9 @@ "canonicalReference": "api-extractor-scenarios!IFile#containingFolder:member", "docComment": "", "excerptTokens": [ - { - "kind": "Reference", - "text": "containingFolder" - }, { "kind": "Content", - "text": ": " + "text": "containingFolder: " }, { "kind": "Reference", @@ -62,8 +50,8 @@ "releaseTag": "Public", "name": "containingFolder", "propertyTypeTokenRange": { - "startIndex": 2, - "endIndex": 3 + "startIndex": 1, + "endIndex": 2 }, "isStatic": false } @@ -77,15 +65,7 @@ "excerptTokens": [ { "kind": "Content", - "text": "export declare class " - }, - { - "kind": "Reference", - "text": "IFolder" - }, - { - "kind": "Content", - "text": " " + "text": "export declare class IFolder " } ], "releaseTag": "Public", @@ -96,13 +76,9 @@ "canonicalReference": "api-extractor-scenarios!IFolder#containingFolder:member", "docComment": "", "excerptTokens": [ - { - "kind": "Reference", - "text": "containingFolder" - }, { "kind": "Content", - "text": ": " + "text": "containingFolder: " }, { "kind": "Reference", @@ -121,8 +97,8 @@ "releaseTag": "Public", "name": "containingFolder", "propertyTypeTokenRange": { - "startIndex": 2, - "endIndex": 4 + "startIndex": 1, + "endIndex": 3 }, "isStatic": false }, @@ -131,13 +107,9 @@ "canonicalReference": "api-extractor-scenarios!IFolder#files:member", "docComment": "", "excerptTokens": [ - { - "kind": "Reference", - "text": "files" - }, { "kind": "Content", - "text": ": " + "text": "files: " }, { "kind": "Reference", @@ -156,8 +128,8 @@ "releaseTag": "Public", "name": "files", "propertyTypeTokenRange": { - "startIndex": 2, - "endIndex": 4 + "startIndex": 1, + "endIndex": 3 }, "isStatic": false } diff --git a/build-tests/api-extractor-scenarios/etc/test-outputs/circularImport2/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/test-outputs/circularImport2/api-extractor-scenarios.api.json index 08c03f40115..0acf135f11c 100644 --- a/build-tests/api-extractor-scenarios/etc/test-outputs/circularImport2/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/test-outputs/circularImport2/api-extractor-scenarios.api.json @@ -22,15 +22,7 @@ "excerptTokens": [ { "kind": "Content", - "text": "export declare class " - }, - { - "kind": "Reference", - "text": "A" - }, - { - "kind": "Content", - "text": " " + "text": "export declare class A " } ], "releaseTag": "Public", @@ -45,15 +37,7 @@ "excerptTokens": [ { "kind": "Content", - "text": "export declare class " - }, - { - "kind": "Reference", - "text": "B" - }, - { - "kind": "Content", - "text": " " + "text": "export declare class B " } ], "releaseTag": "Public", @@ -68,15 +52,7 @@ "excerptTokens": [ { "kind": "Content", - "text": "export declare class " - }, - { - "kind": "Reference", - "text": "IFile" - }, - { - "kind": "Content", - "text": " " + "text": "export declare class IFile " } ], "releaseTag": "Public", @@ -87,13 +63,9 @@ "canonicalReference": "api-extractor-scenarios!IFile#containingFolder:member", "docComment": "", "excerptTokens": [ - { - "kind": "Reference", - "text": "containingFolder" - }, { "kind": "Content", - "text": ": " + "text": "containingFolder: " }, { "kind": "Reference", @@ -108,8 +80,8 @@ "releaseTag": "Public", "name": "containingFolder", "propertyTypeTokenRange": { - "startIndex": 2, - "endIndex": 3 + "startIndex": 1, + "endIndex": 2 }, "isStatic": false } @@ -123,15 +95,7 @@ "excerptTokens": [ { "kind": "Content", - "text": "export declare class " - }, - { - "kind": "Reference", - "text": "IFolder" - }, - { - "kind": "Content", - "text": " " + "text": "export declare class IFolder " } ], "releaseTag": "Public", @@ -142,13 +106,9 @@ "canonicalReference": "api-extractor-scenarios!IFolder#containingFolder:member", "docComment": "", "excerptTokens": [ - { - "kind": "Reference", - "text": "containingFolder" - }, { "kind": "Content", - "text": ": " + "text": "containingFolder: " }, { "kind": "Reference", @@ -167,8 +127,8 @@ "releaseTag": "Public", "name": "containingFolder", "propertyTypeTokenRange": { - "startIndex": 2, - "endIndex": 4 + "startIndex": 1, + "endIndex": 3 }, "isStatic": false }, @@ -177,13 +137,9 @@ "canonicalReference": "api-extractor-scenarios!IFolder#files:member", "docComment": "", "excerptTokens": [ - { - "kind": "Reference", - "text": "files" - }, { "kind": "Content", - "text": ": " + "text": "files: " }, { "kind": "Reference", @@ -202,8 +158,8 @@ "releaseTag": "Public", "name": "files", "propertyTypeTokenRange": { - "startIndex": 2, - "endIndex": 4 + "startIndex": 1, + "endIndex": 3 }, "isStatic": false } diff --git a/build-tests/api-extractor-scenarios/etc/test-outputs/defaultExportOfEntryPoint/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/test-outputs/defaultExportOfEntryPoint/api-extractor-scenarios.api.json index ba722a2ba78..7a6e617b407 100644 --- a/build-tests/api-extractor-scenarios/etc/test-outputs/defaultExportOfEntryPoint/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/test-outputs/defaultExportOfEntryPoint/api-extractor-scenarios.api.json @@ -22,15 +22,7 @@ "excerptTokens": [ { "kind": "Content", - "text": "export default class " - }, - { - "kind": "Reference", - "text": "DefaultClass" - }, - { - "kind": "Content", - "text": " " + "text": "export default class DefaultClass " } ], "releaseTag": "Public", diff --git a/build-tests/api-extractor-scenarios/etc/test-outputs/defaultExportOfEntryPoint2/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/test-outputs/defaultExportOfEntryPoint2/api-extractor-scenarios.api.json index c3ead7e6e28..ee0930c3383 100644 --- a/build-tests/api-extractor-scenarios/etc/test-outputs/defaultExportOfEntryPoint2/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/test-outputs/defaultExportOfEntryPoint2/api-extractor-scenarios.api.json @@ -20,13 +20,9 @@ "canonicalReference": "api-extractor-scenarios!defaultFunctionStatement:var", "docComment": "/**\n * @public\n */\n", "excerptTokens": [ - { - "kind": "Reference", - "text": "defaultFunctionStatement" - }, { "kind": "Content", - "text": ": " + "text": "defaultFunctionStatement: " }, { "kind": "Content", @@ -36,8 +32,8 @@ "releaseTag": "Public", "name": "defaultFunctionStatement", "variableTypeTokenRange": { - "startIndex": 2, - "endIndex": 3 + "startIndex": 1, + "endIndex": 2 } } ] diff --git a/build-tests/api-extractor-scenarios/etc/test-outputs/defaultExportOfEntryPoint3/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/test-outputs/defaultExportOfEntryPoint3/api-extractor-scenarios.api.json index 6a0c7a1c392..f77ec75f57e 100644 --- a/build-tests/api-extractor-scenarios/etc/test-outputs/defaultExportOfEntryPoint3/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/test-outputs/defaultExportOfEntryPoint3/api-extractor-scenarios.api.json @@ -22,15 +22,7 @@ "excerptTokens": [ { "kind": "Content", - "text": "export default function " - }, - { - "kind": "Reference", - "text": "defaultFunctionDeclaration" - }, - { - "kind": "Content", - "text": "(): " + "text": "export default function defaultFunctionDeclaration(): " }, { "kind": "Content", @@ -42,8 +34,8 @@ } ], "returnTypeTokenRange": { - "startIndex": 3, - "endIndex": 4 + "startIndex": 1, + "endIndex": 2 }, "releaseTag": "Public", "overloadIndex": 1, diff --git a/build-tests/api-extractor-scenarios/etc/test-outputs/defaultExportOfEntryPoint4/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/test-outputs/defaultExportOfEntryPoint4/api-extractor-scenarios.api.json index 1726fd0e68e..4354fcdc45c 100644 --- a/build-tests/api-extractor-scenarios/etc/test-outputs/defaultExportOfEntryPoint4/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/test-outputs/defaultExportOfEntryPoint4/api-extractor-scenarios.api.json @@ -20,13 +20,9 @@ "canonicalReference": "api-extractor-scenarios!_default:var", "docComment": "", "excerptTokens": [ - { - "kind": "Reference", - "text": "_default" - }, { "kind": "Content", - "text": ": " + "text": "_default: " }, { "kind": "Content", @@ -36,8 +32,8 @@ "releaseTag": "Public", "name": "_default", "variableTypeTokenRange": { - "startIndex": 2, - "endIndex": 3 + "startIndex": 1, + "endIndex": 2 } } ] diff --git a/build-tests/api-extractor-scenarios/etc/test-outputs/docReferences/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/test-outputs/docReferences/api-extractor-scenarios.api.json index e33f3429525..a6462604260 100644 --- a/build-tests/api-extractor-scenarios/etc/test-outputs/docReferences/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/test-outputs/docReferences/api-extractor-scenarios.api.json @@ -22,15 +22,7 @@ "excerptTokens": [ { "kind": "Content", - "text": "export declare function " - }, - { - "kind": "Reference", - "text": "failWithBrokenLink" - }, - { - "kind": "Content", - "text": "(): " + "text": "export declare function failWithBrokenLink(): " }, { "kind": "Content", @@ -42,8 +34,8 @@ } ], "returnTypeTokenRange": { - "startIndex": 3, - "endIndex": 4 + "startIndex": 1, + "endIndex": 2 }, "releaseTag": "Public", "overloadIndex": 1, @@ -57,15 +49,7 @@ "excerptTokens": [ { "kind": "Content", - "text": "export declare function " - }, - { - "kind": "Reference", - "text": "failWithMissingReference" - }, - { - "kind": "Content", - "text": "(): " + "text": "export declare function failWithMissingReference(): " }, { "kind": "Content", @@ -77,8 +61,8 @@ } ], "returnTypeTokenRange": { - "startIndex": 3, - "endIndex": 4 + "startIndex": 1, + "endIndex": 2 }, "releaseTag": "Public", "overloadIndex": 1, @@ -92,15 +76,7 @@ "excerptTokens": [ { "kind": "Content", - "text": "export declare namespace " - }, - { - "kind": "Reference", - "text": "MyNamespace" - }, - { - "kind": "Content", - "text": " " + "text": "export declare namespace MyNamespace " } ], "releaseTag": "Public", @@ -113,15 +89,7 @@ "excerptTokens": [ { "kind": "Content", - "text": "class " - }, - { - "kind": "Reference", - "text": "MyClass" - }, - { - "kind": "Content", - "text": " " + "text": "class MyClass " } ], "releaseTag": "Public", @@ -132,21 +100,9 @@ "canonicalReference": "api-extractor-scenarios!MyNamespace.MyClass#myMethod:member(1)", "docComment": "/**\n * Summary for myMethod\n *\n * @remarks\n *\n * Remarks for myMethod\n *\n * @param x - the parameter\n *\n * @returns a number\n *\n * @beta\n */\n", "excerptTokens": [ - { - "kind": "Reference", - "text": "myMethod" - }, { "kind": "Content", - "text": "(" - }, - { - "kind": "Reference", - "text": "x" - }, - { - "kind": "Content", - "text": ": " + "text": "myMethod(x: " }, { "kind": "Content", @@ -167,8 +123,8 @@ ], "isStatic": false, "returnTypeTokenRange": { - "startIndex": 6, - "endIndex": 7 + "startIndex": 3, + "endIndex": 4 }, "releaseTag": "Beta", "overloadIndex": 1, @@ -176,8 +132,8 @@ { "parameterName": "x", "parameterTypeTokenRange": { - "startIndex": 4, - "endIndex": 5 + "startIndex": 1, + "endIndex": 2 } } ], @@ -195,15 +151,7 @@ "excerptTokens": [ { "kind": "Content", - "text": "export declare function " - }, - { - "kind": "Reference", - "text": "succeedForNow" - }, - { - "kind": "Content", - "text": "(): " + "text": "export declare function succeedForNow(): " }, { "kind": "Content", @@ -215,8 +163,8 @@ } ], "returnTypeTokenRange": { - "startIndex": 3, - "endIndex": 4 + "startIndex": 1, + "endIndex": 2 }, "releaseTag": "Public", "overloadIndex": 1, @@ -230,15 +178,7 @@ "excerptTokens": [ { "kind": "Content", - "text": "export declare function " - }, - { - "kind": "Reference", - "text": "testSimple" - }, - { - "kind": "Content", - "text": "(): " + "text": "export declare function testSimple(): " }, { "kind": "Content", @@ -250,8 +190,8 @@ } ], "returnTypeTokenRange": { - "startIndex": 3, - "endIndex": 4 + "startIndex": 1, + "endIndex": 2 }, "releaseTag": "Public", "overloadIndex": 1, diff --git a/build-tests/api-extractor-scenarios/etc/test-outputs/docReferences2/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/test-outputs/docReferences2/api-extractor-scenarios.api.json index 9bfdc56a54f..86d8e196460 100644 --- a/build-tests/api-extractor-scenarios/etc/test-outputs/docReferences2/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/test-outputs/docReferences2/api-extractor-scenarios.api.json @@ -22,15 +22,7 @@ "excerptTokens": [ { "kind": "Content", - "text": "export declare class " - }, - { - "kind": "Reference", - "text": "CyclicA" - }, - { - "kind": "Content", - "text": " " + "text": "export declare class CyclicA " } ], "releaseTag": "Public", @@ -41,13 +33,9 @@ "canonicalReference": "api-extractor-scenarios!CyclicA#methodA1:member(1)", "docComment": "/**\n * THE COMMENT\n */\n", "excerptTokens": [ - { - "kind": "Reference", - "text": "methodA1" - }, { "kind": "Content", - "text": "(): " + "text": "methodA1(): " }, { "kind": "Content", @@ -60,8 +48,8 @@ ], "isStatic": false, "returnTypeTokenRange": { - "startIndex": 2, - "endIndex": 3 + "startIndex": 1, + "endIndex": 2 }, "releaseTag": "Public", "overloadIndex": 1, @@ -73,13 +61,9 @@ "canonicalReference": "api-extractor-scenarios!CyclicA#methodA3:member(1)", "docComment": "/**\n * THE COMMENT\n */\n", "excerptTokens": [ - { - "kind": "Reference", - "text": "methodA3" - }, { "kind": "Content", - "text": "(): " + "text": "methodA3(): " }, { "kind": "Content", @@ -92,8 +76,8 @@ ], "isStatic": false, "returnTypeTokenRange": { - "startIndex": 2, - "endIndex": 3 + "startIndex": 1, + "endIndex": 2 }, "releaseTag": "Public", "overloadIndex": 1, @@ -110,15 +94,7 @@ "excerptTokens": [ { "kind": "Content", - "text": "export declare class " - }, - { - "kind": "Reference", - "text": "CyclicB" - }, - { - "kind": "Content", - "text": " " + "text": "export declare class CyclicB " } ], "releaseTag": "Public", @@ -129,13 +105,9 @@ "canonicalReference": "api-extractor-scenarios!CyclicB#methodB2:member(1)", "docComment": "/**\n * THE COMMENT\n */\n", "excerptTokens": [ - { - "kind": "Reference", - "text": "methodB2" - }, { "kind": "Content", - "text": "(): " + "text": "methodB2(): " }, { "kind": "Content", @@ -148,8 +120,8 @@ ], "isStatic": false, "returnTypeTokenRange": { - "startIndex": 2, - "endIndex": 3 + "startIndex": 1, + "endIndex": 2 }, "releaseTag": "Public", "overloadIndex": 1, @@ -161,13 +133,9 @@ "canonicalReference": "api-extractor-scenarios!CyclicB#methodB4:member(1)", "docComment": "/**\n * THE COMMENT\n */\n", "excerptTokens": [ - { - "kind": "Reference", - "text": "methodB4" - }, { "kind": "Content", - "text": "(): " + "text": "methodB4(): " }, { "kind": "Content", @@ -180,8 +148,8 @@ ], "isStatic": false, "returnTypeTokenRange": { - "startIndex": 2, - "endIndex": 3 + "startIndex": 1, + "endIndex": 2 }, "releaseTag": "Public", "overloadIndex": 1, @@ -198,15 +166,7 @@ "excerptTokens": [ { "kind": "Content", - "text": "export declare class " - }, - { - "kind": "Reference", - "text": "FailWithSelfReference" - }, - { - "kind": "Content", - "text": " " + "text": "export declare class FailWithSelfReference " } ], "releaseTag": "Public", @@ -217,13 +177,9 @@ "canonicalReference": "api-extractor-scenarios!FailWithSelfReference#method1:member(1)", "docComment": "", "excerptTokens": [ - { - "kind": "Reference", - "text": "method1" - }, { "kind": "Content", - "text": "(): " + "text": "method1(): " }, { "kind": "Content", @@ -236,8 +192,8 @@ ], "isStatic": false, "returnTypeTokenRange": { - "startIndex": 2, - "endIndex": 3 + "startIndex": 1, + "endIndex": 2 }, "releaseTag": "Public", "overloadIndex": 1, @@ -249,13 +205,9 @@ "canonicalReference": "api-extractor-scenarios!FailWithSelfReference#method2:member(1)", "docComment": "", "excerptTokens": [ - { - "kind": "Reference", - "text": "method2" - }, { "kind": "Content", - "text": "(): " + "text": "method2(): " }, { "kind": "Content", @@ -268,8 +220,8 @@ ], "isStatic": false, "returnTypeTokenRange": { - "startIndex": 2, - "endIndex": 3 + "startIndex": 1, + "endIndex": 2 }, "releaseTag": "Public", "overloadIndex": 1, diff --git a/build-tests/api-extractor-scenarios/etc/test-outputs/docReferences3/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/test-outputs/docReferences3/api-extractor-scenarios.api.json index 1fe99068e90..66ec4456e3e 100644 --- a/build-tests/api-extractor-scenarios/etc/test-outputs/docReferences3/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/test-outputs/docReferences3/api-extractor-scenarios.api.json @@ -22,15 +22,7 @@ "excerptTokens": [ { "kind": "Content", - "text": "export interface " - }, - { - "kind": "Reference", - "text": "A" - }, - { - "kind": "Content", - "text": " " + "text": "export interface A " } ], "releaseTag": "Public", @@ -41,13 +33,9 @@ "canonicalReference": "api-extractor-scenarios!A#myProperty:member", "docComment": "", "excerptTokens": [ - { - "kind": "Reference", - "text": "myProperty" - }, { "kind": "Content", - "text": ": " + "text": "myProperty: " }, { "kind": "Content", @@ -61,8 +49,8 @@ "releaseTag": "Public", "name": "myProperty", "propertyTypeTokenRange": { - "startIndex": 2, - "endIndex": 3 + "startIndex": 1, + "endIndex": 2 } } ], @@ -75,15 +63,7 @@ "excerptTokens": [ { "kind": "Content", - "text": "export declare namespace " - }, - { - "kind": "Reference", - "text": "A" - }, - { - "kind": "Content", - "text": " " + "text": "export declare namespace A " } ], "releaseTag": "Public", @@ -96,15 +76,7 @@ "excerptTokens": [ { "kind": "Content", - "text": "class " - }, - { - "kind": "Reference", - "text": "B" - }, - { - "kind": "Content", - "text": " " + "text": "class B " } ], "releaseTag": "Public", @@ -115,13 +87,9 @@ "canonicalReference": "api-extractor-scenarios!A.B#myMethod:member(1)", "docComment": "", "excerptTokens": [ - { - "kind": "Reference", - "text": "myMethod" - }, { "kind": "Content", - "text": "(): " + "text": "myMethod(): " }, { "kind": "Content", @@ -134,8 +102,8 @@ ], "isStatic": false, "returnTypeTokenRange": { - "startIndex": 2, - "endIndex": 3 + "startIndex": 1, + "endIndex": 2 }, "releaseTag": "Public", "overloadIndex": 1, @@ -154,15 +122,7 @@ "excerptTokens": [ { "kind": "Content", - "text": "export declare function " - }, - { - "kind": "Reference", - "text": "failWithAmbiguity" - }, - { - "kind": "Content", - "text": "(): " + "text": "export declare function failWithAmbiguity(): " }, { "kind": "Content", @@ -174,8 +134,8 @@ } ], "returnTypeTokenRange": { - "startIndex": 3, - "endIndex": 4 + "startIndex": 1, + "endIndex": 2 }, "releaseTag": "Public", "overloadIndex": 1, @@ -189,15 +149,7 @@ "excerptTokens": [ { "kind": "Content", - "text": "export declare function " - }, - { - "kind": "Reference", - "text": "succeedWithExternalReference" - }, - { - "kind": "Content", - "text": "(): " + "text": "export declare function succeedWithExternalReference(): " }, { "kind": "Content", @@ -209,8 +161,8 @@ } ], "returnTypeTokenRange": { - "startIndex": 3, - "endIndex": 4 + "startIndex": 1, + "endIndex": 2 }, "releaseTag": "Public", "overloadIndex": 1, @@ -224,15 +176,7 @@ "excerptTokens": [ { "kind": "Content", - "text": "export declare function " - }, - { - "kind": "Reference", - "text": "succeedWithSelector" - }, - { - "kind": "Content", - "text": "(): " + "text": "export declare function succeedWithSelector(): " }, { "kind": "Content", @@ -244,8 +188,8 @@ } ], "returnTypeTokenRange": { - "startIndex": 3, - "endIndex": 4 + "startIndex": 1, + "endIndex": 2 }, "releaseTag": "Public", "overloadIndex": 1, diff --git a/build-tests/api-extractor-scenarios/etc/test-outputs/exportDuplicate/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/test-outputs/exportDuplicate/api-extractor-scenarios.api.json index 17c76287b83..c729a0ebc98 100644 --- a/build-tests/api-extractor-scenarios/etc/test-outputs/exportDuplicate/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/test-outputs/exportDuplicate/api-extractor-scenarios.api.json @@ -22,15 +22,7 @@ "excerptTokens": [ { "kind": "Content", - "text": "export declare class " - }, - { - "kind": "Reference", - "text": "X" - }, - { - "kind": "Content", - "text": " " + "text": "export declare class X " } ], "releaseTag": "Public", diff --git a/build-tests/api-extractor-scenarios/etc/test-outputs/exportEquals/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/test-outputs/exportEquals/api-extractor-scenarios.api.json index 824e025a995..b8eee943395 100644 --- a/build-tests/api-extractor-scenarios/etc/test-outputs/exportEquals/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/test-outputs/exportEquals/api-extractor-scenarios.api.json @@ -22,15 +22,7 @@ "excerptTokens": [ { "kind": "Content", - "text": "export interface " - }, - { - "kind": "Reference", - "text": "ITeamsContext" - }, - { - "kind": "Content", - "text": " " + "text": "export interface ITeamsContext " } ], "releaseTag": "Public", @@ -41,13 +33,9 @@ "canonicalReference": "api-extractor-scenarios!ITeamsContext#context:member", "docComment": "", "excerptTokens": [ - { - "kind": "Reference", - "text": "context" - }, { "kind": "Content", - "text": ": " + "text": "context: " }, { "kind": "Reference", @@ -62,8 +50,8 @@ "releaseTag": "Public", "name": "context", "propertyTypeTokenRange": { - "startIndex": 2, - "endIndex": 3 + "startIndex": 1, + "endIndex": 2 } } ], diff --git a/build-tests/api-extractor-scenarios/etc/test-outputs/exportStar/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/test-outputs/exportStar/api-extractor-scenarios.api.json index 87418952aa6..3b7acb4d56b 100644 --- a/build-tests/api-extractor-scenarios/etc/test-outputs/exportStar/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/test-outputs/exportStar/api-extractor-scenarios.api.json @@ -22,15 +22,7 @@ "excerptTokens": [ { "kind": "Content", - "text": "export declare class " - }, - { - "kind": "Reference", - "text": "A" - }, - { - "kind": "Content", - "text": " " + "text": "export declare class A " } ], "releaseTag": "Public", @@ -45,15 +37,7 @@ "excerptTokens": [ { "kind": "Content", - "text": "export declare class " - }, - { - "kind": "Reference", - "text": "B" - }, - { - "kind": "Content", - "text": " " + "text": "export declare class B " } ], "releaseTag": "Public", @@ -68,15 +52,7 @@ "excerptTokens": [ { "kind": "Content", - "text": "export declare class " - }, - { - "kind": "Reference", - "text": "C" - }, - { - "kind": "Content", - "text": " " + "text": "export declare class C " } ], "releaseTag": "Public", diff --git a/build-tests/api-extractor-scenarios/etc/test-outputs/exportStar2/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/test-outputs/exportStar2/api-extractor-scenarios.api.json index bbc59f0821e..97166819e35 100644 --- a/build-tests/api-extractor-scenarios/etc/test-outputs/exportStar2/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/test-outputs/exportStar2/api-extractor-scenarios.api.json @@ -22,15 +22,7 @@ "excerptTokens": [ { "kind": "Content", - "text": "export declare class " - }, - { - "kind": "Reference", - "text": "A" - }, - { - "kind": "Content", - "text": " " + "text": "export declare class A " } ], "releaseTag": "Public", diff --git a/build-tests/api-extractor-scenarios/etc/test-outputs/exportStar3/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/test-outputs/exportStar3/api-extractor-scenarios.api.json index bbc59f0821e..97166819e35 100644 --- a/build-tests/api-extractor-scenarios/etc/test-outputs/exportStar3/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/test-outputs/exportStar3/api-extractor-scenarios.api.json @@ -22,15 +22,7 @@ "excerptTokens": [ { "kind": "Content", - "text": "export declare class " - }, - { - "kind": "Reference", - "text": "A" - }, - { - "kind": "Content", - "text": " " + "text": "export declare class A " } ], "releaseTag": "Public", diff --git a/build-tests/api-extractor-scenarios/etc/test-outputs/importEquals/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/test-outputs/importEquals/api-extractor-scenarios.api.json index bf2dc44a839..98d8fecbf06 100644 --- a/build-tests/api-extractor-scenarios/etc/test-outputs/importEquals/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/test-outputs/importEquals/api-extractor-scenarios.api.json @@ -22,23 +22,15 @@ "excerptTokens": [ { "kind": "Content", - "text": "export declare function " - }, - { - "kind": "Reference", - "text": "useColors" - }, - { - "kind": "Content", - "text": "(): " + "text": "export declare function useColors(): " }, { "kind": "Content", - "text": "typeof " + "text": "typeof colors." }, { "kind": "Reference", - "text": "colors.zebra", + "text": "zebra", "canonicalReference": "colors!zebra:var" }, { @@ -47,8 +39,8 @@ } ], "returnTypeTokenRange": { - "startIndex": 3, - "endIndex": 5 + "startIndex": 1, + "endIndex": 3 }, "releaseTag": "Public", "overloadIndex": 1, diff --git a/build-tests/api-extractor-scenarios/etc/test-outputs/inconsistentReleaseTags/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/test-outputs/inconsistentReleaseTags/api-extractor-scenarios.api.json index b3a58aeb6ac..25962c1f0f7 100644 --- a/build-tests/api-extractor-scenarios/etc/test-outputs/inconsistentReleaseTags/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/test-outputs/inconsistentReleaseTags/api-extractor-scenarios.api.json @@ -22,15 +22,7 @@ "excerptTokens": [ { "kind": "Content", - "text": "export interface " - }, - { - "kind": "Reference", - "text": "IBeta" - }, - { - "kind": "Content", - "text": " " + "text": "export interface IBeta " } ], "releaseTag": "Beta", @@ -41,13 +33,9 @@ "canonicalReference": "api-extractor-scenarios!IBeta#x:member", "docComment": "", "excerptTokens": [ - { - "kind": "Reference", - "text": "x" - }, { "kind": "Content", - "text": ": " + "text": "x: " }, { "kind": "Content", @@ -61,8 +49,8 @@ "releaseTag": "Beta", "name": "x", "propertyTypeTokenRange": { - "startIndex": 2, - "endIndex": 3 + "startIndex": 1, + "endIndex": 2 } } ], @@ -75,15 +63,7 @@ "excerptTokens": [ { "kind": "Content", - "text": "export declare function " - }, - { - "kind": "Reference", - "text": "publicFunctionReturnsBeta" - }, - { - "kind": "Content", - "text": "(): " + "text": "export declare function publicFunctionReturnsBeta(): " }, { "kind": "Reference", @@ -96,8 +76,8 @@ } ], "returnTypeTokenRange": { - "startIndex": 3, - "endIndex": 4 + "startIndex": 1, + "endIndex": 2 }, "releaseTag": "Public", "overloadIndex": 1, diff --git a/build-tests/api-extractor-scenarios/etc/test-outputs/typeOf/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/test-outputs/typeOf/api-extractor-scenarios.api.json index ffc12d3899d..c15727f370c 100644 --- a/build-tests/api-extractor-scenarios/etc/test-outputs/typeOf/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/test-outputs/typeOf/api-extractor-scenarios.api.json @@ -22,15 +22,7 @@ "excerptTokens": [ { "kind": "Content", - "text": "export declare function " - }, - { - "kind": "Reference", - "text": "f" - }, - { - "kind": "Content", - "text": "(): " + "text": "export declare function f(): " }, { "kind": "Content", @@ -51,8 +43,8 @@ } ], "returnTypeTokenRange": { - "startIndex": 3, - "endIndex": 6 + "startIndex": 1, + "endIndex": 4 }, "releaseTag": "Public", "overloadIndex": 1, @@ -66,15 +58,7 @@ "excerptTokens": [ { "kind": "Content", - "text": "export declare function " - }, - { - "kind": "Reference", - "text": "g" - }, - { - "kind": "Content", - "text": "(): " + "text": "export declare function g(): " }, { "kind": "Content", @@ -95,8 +79,8 @@ } ], "returnTypeTokenRange": { - "startIndex": 3, - "endIndex": 6 + "startIndex": 1, + "endIndex": 4 }, "releaseTag": "Public", "overloadIndex": 1, diff --git a/build-tests/api-extractor-scenarios/etc/test-outputs/typeOf2/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/test-outputs/typeOf2/api-extractor-scenarios.api.json index 643190bc47f..2f55e1cf757 100644 --- a/build-tests/api-extractor-scenarios/etc/test-outputs/typeOf2/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/test-outputs/typeOf2/api-extractor-scenarios.api.json @@ -22,27 +22,11 @@ "excerptTokens": [ { "kind": "Content", - "text": "export declare function " - }, - { - "kind": "Reference", - "text": "f" + "text": "export declare function f(): " }, { "kind": "Content", - "text": "(): " - }, - { - "kind": "Content", - "text": "{\n " - }, - { - "kind": "Reference", - "text": "a" - }, - { - "kind": "Content", - "text": ": number;\n}" + "text": "{\n a: number;\n}" }, { "kind": "Content", @@ -50,8 +34,8 @@ } ], "returnTypeTokenRange": { - "startIndex": 3, - "endIndex": 6 + "startIndex": 1, + "endIndex": 2 }, "releaseTag": "Public", "overloadIndex": 1, @@ -65,23 +49,7 @@ "excerptTokens": [ { "kind": "Content", - "text": "export declare function " - }, - { - "kind": "Reference", - "text": "g" - }, - { - "kind": "Content", - "text": "(" - }, - { - "kind": "Reference", - "text": "callback" - }, - { - "kind": "Content", - "text": ": " + "text": "export declare function g(callback: " }, { "kind": "Content", @@ -111,8 +79,8 @@ } ], "returnTypeTokenRange": { - "startIndex": 8, - "endIndex": 10 + "startIndex": 4, + "endIndex": 6 }, "releaseTag": "Public", "overloadIndex": 1, @@ -120,8 +88,8 @@ { "parameterName": "callback", "parameterTypeTokenRange": { - "startIndex": 5, - "endIndex": 7 + "startIndex": 1, + "endIndex": 3 } } ], diff --git a/build-tests/api-extractor-scenarios/etc/test-outputs/typeParameters/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/test-outputs/typeParameters/api-extractor-scenarios.api.json index 189423755b5..fa30f8925dd 100644 --- a/build-tests/api-extractor-scenarios/etc/test-outputs/typeParameters/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/test-outputs/typeParameters/api-extractor-scenarios.api.json @@ -22,15 +22,7 @@ "excerptTokens": [ { "kind": "Content", - "text": "export declare class " - }, - { - "kind": "Reference", - "text": "ClassWithGenericMethod" - }, - { - "kind": "Content", - "text": " " + "text": "export declare class ClassWithGenericMethod " } ], "releaseTag": "Public", @@ -41,21 +33,9 @@ "canonicalReference": "api-extractor-scenarios!ClassWithGenericMethod#method:member(1)", "docComment": "", "excerptTokens": [ - { - "kind": "Reference", - "text": "method" - }, - { - "kind": "Content", - "text": "<" - }, - { - "kind": "Reference", - "text": "T" - }, { "kind": "Content", - "text": ">(): " + "text": "method(): " }, { "kind": "Content", @@ -68,8 +48,8 @@ ], "isStatic": false, "returnTypeTokenRange": { - "startIndex": 4, - "endIndex": 5 + "startIndex": 1, + "endIndex": 2 }, "releaseTag": "Public", "overloadIndex": 1, @@ -99,23 +79,7 @@ "excerptTokens": [ { "kind": "Content", - "text": "export declare class " - }, - { - "kind": "Reference", - "text": "GenericClass" - }, - { - "kind": "Content", - "text": "<" - }, - { - "kind": "Reference", - "text": "T" - }, - { - "kind": "Content", - "text": "> " + "text": "export declare class GenericClass " } ], "releaseTag": "Public", @@ -143,23 +107,7 @@ "excerptTokens": [ { "kind": "Content", - "text": "export declare class " - }, - { - "kind": "Reference", - "text": "GenericClassWithConstraint" - }, - { - "kind": "Content", - "text": "<" - }, - { - "kind": "Reference", - "text": "T" - }, - { - "kind": "Content", - "text": " extends " + "text": "export declare class GenericClassWithConstraint(): " + "text": "export declare function genericFunction(): " }, { "kind": "Content", @@ -275,8 +191,8 @@ } ], "returnTypeTokenRange": { - "startIndex": 5, - "endIndex": 6 + "startIndex": 1, + "endIndex": 2 }, "releaseTag": "Public", "overloadIndex": 1, @@ -303,23 +219,7 @@ "excerptTokens": [ { "kind": "Content", - "text": "export interface " - }, - { - "kind": "Reference", - "text": "GenericInterface" - }, - { - "kind": "Content", - "text": "<" - }, - { - "kind": "Reference", - "text": "T" - }, - { - "kind": "Content", - "text": "> " + "text": "export interface GenericInterface " } ], "releaseTag": "Public", @@ -347,26 +247,10 @@ "excerptTokens": [ { "kind": "Content", - "text": "export declare type " - }, - { - "kind": "Reference", - "text": "GenericTypeAlias" - }, - { - "kind": "Content", - "text": "<" - }, - { - "kind": "Reference", - "text": "T" + "text": "export declare type GenericTypeAlias = " }, { "kind": "Content", - "text": "> = " - }, - { - "kind": "Reference", "text": "T" }, { @@ -390,8 +274,8 @@ } ], "typeTokenRange": { - "startIndex": 5, - "endIndex": 6 + "startIndex": 1, + "endIndex": 2 } }, { @@ -401,15 +285,7 @@ "excerptTokens": [ { "kind": "Content", - "text": "export interface " - }, - { - "kind": "Reference", - "text": "InterfaceWithGenericCallSignature" - }, - { - "kind": "Content", - "text": " " + "text": "export interface InterfaceWithGenericCallSignature " } ], "releaseTag": "Public", @@ -422,15 +298,7 @@ "excerptTokens": [ { "kind": "Content", - "text": "<" - }, - { - "kind": "Reference", - "text": "T" - }, - { - "kind": "Content", - "text": ">(): " + "text": "(): " }, { "kind": "Content", @@ -442,8 +310,8 @@ } ], "returnTypeTokenRange": { - "startIndex": 3, - "endIndex": 4 + "startIndex": 1, + "endIndex": 2 }, "releaseTag": "Public", "overloadIndex": 1, @@ -472,15 +340,7 @@ "excerptTokens": [ { "kind": "Content", - "text": "export interface " - }, - { - "kind": "Reference", - "text": "InterfaceWithGenericConstructSignature" - }, - { - "kind": "Content", - "text": " " + "text": "export interface InterfaceWithGenericConstructSignature " } ], "releaseTag": "Public", @@ -493,18 +353,10 @@ "excerptTokens": [ { "kind": "Content", - "text": "new <" - }, - { - "kind": "Reference", - "text": "T" + "text": "new (): " }, { "kind": "Content", - "text": ">(): " - }, - { - "kind": "Reference", "text": "T" }, { @@ -513,8 +365,8 @@ } ], "returnTypeTokenRange": { - "startIndex": 3, - "endIndex": 4 + "startIndex": 1, + "endIndex": 2 }, "releaseTag": "Public", "overloadIndex": 1,