From edd4240e69afef521f9c8a398d405fe71dc24ed9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martynas=20=C5=BDilinskas?= Date: Thu, 11 Jan 2018 16:26:38 +0200 Subject: [PATCH 1/4] Feature: Api item upgrade (#78) --- examples/simple/index.ts | 32 ++- src/abstractions/api-item.ts | 15 +- src/api-helpers.ts | 41 ++- src/contracts.ts | 1 + src/contracts/api-base-item-dto.ts | 8 +- src/contracts/api-item-kinds.ts | 3 +- src/contracts/definitions/api-mapped-dto.ts | 11 + src/contracts/extractor-options.ts | 4 + src/contracts/type-dto.ts | 2 +- src/definitions/api-call.ts | 5 +- src/definitions/api-class-constructor.ts | 5 +- src/definitions/api-class-method.ts | 5 +- src/definitions/api-class-property.ts | 5 +- src/definitions/api-class.ts | 5 +- src/definitions/api-construct.ts | 7 +- src/definitions/api-enum-member.ts | 5 +- src/definitions/api-enum.ts | 5 +- src/definitions/api-export-specifier.ts | 5 +- src/definitions/api-export.ts | 5 +- src/definitions/api-function-type.ts | 5 +- src/definitions/api-function.ts | 5 +- src/definitions/api-get-accessor.ts | 5 +- src/definitions/api-import-specifier.ts | 5 +- src/definitions/api-index.ts | 5 +- src/definitions/api-interface.ts | 5 +- src/definitions/api-mapped.ts | 56 ++++ src/definitions/api-method.ts | 5 +- src/definitions/api-namespace.ts | 5 +- src/definitions/api-parameter.ts | 5 +- src/definitions/api-property.ts | 5 +- src/definitions/api-set-accessor.ts | 5 +- src/definitions/api-source-file.ts | 5 +- src/definitions/api-type-literal.ts | 5 +- src/definitions/api-type-parameter.ts | 5 +- src/definitions/api-type.ts | 5 +- src/definitions/api-variable.ts | 5 +- tests/cases/MappedDeclaration1.ts | 1 + tests/cases/MappedDeclaration2.ts | 6 + tests/cases/MappedDeclaration3.ts | 8 + tests/cases/MappedDeclaration4.ts | 8 + .../ClassDeclaration1.test.ts.snap | 78 ++++-- .../ClassDeclaration10.test.ts.snap | 48 ++-- .../ClassDeclaration2.test.ts.snap | 48 ++-- .../ClassDeclaration3.test.ts.snap | 30 ++- .../ClassDeclaration4.test.ts.snap | 48 ++-- .../ClassDeclaration5.test.ts.snap | 36 ++- .../ClassDeclaration6.test.ts.snap | 54 ++-- .../ClassDeclaration7.test.ts.snap | 18 +- .../ClassDeclaration8.test.ts.snap | 42 ++- .../ClassDeclaration9.test.ts.snap | 48 ++-- .../ConstructSignature1.test.ts.snap | 24 +- .../ConstructSignature2.test.ts.snap | 24 +- .../EnumDeclaration1.test.ts.snap | 54 ++-- .../EnumDeclaration2.test.ts.snap | 54 ++-- .../EnumDeclaration3.test.ts.snap | 54 ++-- .../EnumDeclaration4.test.ts.snap | 54 ++-- .../ExportDeclaration1.test.ts.snap | 90 ++++--- .../ExportDeclaration2.test.ts.snap | 12 +- .../ExportSpecifier1.test.ts.snap | 54 ++-- .../ExportSpecifier2.test.ts.snap | 42 ++- .../ExportSpecifier3.test.ts.snap | 60 +++-- .../ExportSpecifier4.test.ts.snap | 60 +++-- .../FunctionDeclaration1.test.ts.snap | 12 +- .../FunctionDeclaration2.test.ts.snap | 24 +- .../FunctionDeclaration3.test.ts.snap | 12 +- .../__snapshots__/GetAccessor1.test.ts.snap | 18 +- .../__snapshots__/GetAccessor3.test.ts.snap | 36 ++- .../ImportDeclaration1.test.ts.snap | 90 ++++--- .../ImportSpecifier1.test.ts.snap | 90 ++++--- .../ImportSpecifier2.test.ts.snap | 18 +- .../IndexSignature1.test.ts.snap | 24 +- .../IndexSignature2.test.ts.snap | 24 +- .../IndexSignature3.test.ts.snap | 42 ++- .../InterfaceClassMerging.test.ts.snap | 108 +++++--- .../InterfaceDeclaration1.test.ts.snap | 12 +- .../InterfaceDeclaration2.test.ts.snap | 18 +- .../InterfaceDeclaration3.test.ts.snap | 30 ++- .../InterfaceDeclaration4.test.ts.snap | 234 +++++++++++------ .../InterfaceDeclaration5.test.ts.snap | 30 ++- .../InterfaceDeclaration6.test.ts.snap | 36 ++- .../InterfaceDeclaration7.test.ts.snap | 18 +- .../InterfaceSubtyping.test.ts.snap | 42 ++- .../MappedDeclaration1.test.ts.snap | 123 +++++++++ .../MappedDeclaration2.test.ts.snap | 240 ++++++++++++++++++ .../MappedDeclaration3.test.ts.snap | 240 ++++++++++++++++++ .../MappedDeclaration4.test.ts.snap | 240 ++++++++++++++++++ .../MultipleDeclaration.test.ts.snap | 84 ++++-- .../NamespaceDeclaration1.test.ts.snap | 12 +- .../NamespaceDeclaration2.test.ts.snap | 18 +- .../NamespaceDeclaration3.test.ts.snap | 24 +- .../ParameterDeclaration1.test.ts.snap | 18 +- .../ParameterDeclaration2.test.ts.snap | 18 +- .../ParameterDeclaration3.test.ts.snap | 18 +- .../__snapshots__/SetAccessor1.test.ts.snap | 24 +- .../__snapshots__/SetAccessor2.test.ts.snap | 30 ++- .../__snapshots__/SetAccessor3.test.ts.snap | 60 +++-- .../TypeAliasDeclaration1.test.ts.snap | 30 ++- .../TypeAliasDeclaration2.test.ts.snap | 60 +++-- .../TypeAliasDeclaration3.test.ts.snap | 138 ++++++---- .../TypeAliasDeclaration4.test.ts.snap | 30 ++- .../TypeParameterDeclaration1.test.ts.snap | 24 +- .../TypeParameterDeclaration2.test.ts.snap | 24 +- .../TypeParameterDeclaration3.test.ts.snap | 24 +- .../VariableDeclaration1.test.ts.snap | 12 +- .../VariableDeclaration2.test.ts.snap | 12 +- .../VariableDeclaration3.test.ts.snap | 12 +- .../VariableDeclaration4.test.ts.snap | 30 ++- tests/scripts/tests-builder.ts | 1 + 108 files changed, 2842 insertions(+), 982 deletions(-) create mode 100644 src/contracts/definitions/api-mapped-dto.ts create mode 100644 src/definitions/api-mapped.ts create mode 100644 tests/cases/MappedDeclaration1.ts create mode 100644 tests/cases/MappedDeclaration2.ts create mode 100644 tests/cases/MappedDeclaration3.ts create mode 100644 tests/cases/MappedDeclaration4.ts create mode 100644 tests/cases/__tests__/__snapshots__/MappedDeclaration1.test.ts.snap create mode 100644 tests/cases/__tests__/__snapshots__/MappedDeclaration2.test.ts.snap create mode 100644 tests/cases/__tests__/__snapshots__/MappedDeclaration3.test.ts.snap create mode 100644 tests/cases/__tests__/__snapshots__/MappedDeclaration4.test.ts.snap diff --git a/examples/simple/index.ts b/examples/simple/index.ts index bab15104..f26c0ecb 100644 --- a/examples/simple/index.ts +++ b/examples/simple/index.ts @@ -1,7 +1,29 @@ -export type Hello = { - prop: string; -}; +// import * as ts from "typescript"; + +// export enum ApiItemKindsAdditional { +// ___Any = "any", +// ___Any2 = "any2" +// } + +export interface Foo { + Name: string; + Surname: string; +} + +// export interface Bar { +// Number: number; +// } -export type ProxyHello1 = Hello; +// // export var x: this is string; -export type ProxyHello2 = ProxyHello1; +// export type SyntaxKinds___ = TValue; + +// export class Foo { +// public Bar(arg: any): arg is string { +// return true; +// } +// } + +export type TYPE__ = new () => { + name: string; +}; diff --git a/src/abstractions/api-item.ts b/src/abstractions/api-item.ts index a6e38557..30b1ce24 100644 --- a/src/abstractions/api-item.ts +++ b/src/abstractions/api-item.ts @@ -1,6 +1,6 @@ import * as ts from "typescript"; -import { ApiBaseItemDto } from "../contracts/api-base-item-dto"; +import { ApiBaseItemDto, TypeScriptTypeDeclarationDebug } from "../contracts/api-base-item-dto"; import { ApiMetadataDto } from "../contracts/api-metadata-dto"; import { ExtractorOptions } from "../contracts/extractor-options"; import { ReadonlyRegistry } from "../contracts/registry"; @@ -20,7 +20,7 @@ export enum ApiItemStatus { GatheredAndExtracted = Gathered | Extracted } -export abstract class ApiItem { +export abstract class ApiItem { constructor(private declaration: TDeclaration, private symbol: ts.Symbol, private options: ApiItemOptions) { this.TypeChecker = options.Program.getTypeChecker(); } @@ -52,6 +52,17 @@ export abstract class ApiItem 0) { + const declaration: ts.Declaration = symbol.declarations[0]; + + return { + name: symbol.getName(), + referenceId: GetItemId(declaration, symbol, options) + }; + } + + return { + name: symbol.getName() + }; + } + /** * Converts from TypeScript type AST to TypeDto. * @param type TypeScript type @@ -274,13 +303,9 @@ export namespace ApiHelpers { // Find declaration reference. const symbol = self ? type.getSymbol() : type.aliasSymbol || type.getSymbol(); if (symbol != null) { - name = symbol.getName(); - - if (symbol.declarations != null && symbol.declarations.length > 0) { - const declaration: ts.Declaration = symbol.declarations[0]; - - referenceId = GetItemId(declaration, symbol, options); - } + const resolvedReference = resolveTypeItemReference(symbol, options); + name = resolvedReference.name; + referenceId = resolvedReference.referenceId; } // Generics diff --git a/src/contracts.ts b/src/contracts.ts index 70a64437..764264eb 100644 --- a/src/contracts.ts +++ b/src/contracts.ts @@ -30,6 +30,7 @@ export * from "./contracts/definitions/api-type-parameter-dto"; export * from "./contracts/definitions/api-variable-dto"; export * from "./contracts/definitions/api-set-accessor-dto"; export * from "./contracts/definitions/api-get-accessor-dto"; +export * from "./contracts/definitions/api-mapped-dto"; export * from "./contracts/dictionary"; export * from "./contracts/extractor-options"; export * from "./contracts/registry"; diff --git a/src/contracts/api-base-item-dto.ts b/src/contracts/api-base-item-dto.ts index 2b645ee8..6c3293cf 100644 --- a/src/contracts/api-base-item-dto.ts +++ b/src/contracts/api-base-item-dto.ts @@ -3,14 +3,18 @@ import { ApiItemKinds } from "./api-item-kinds"; import { ApiMetadataDto } from "./api-metadata-dto"; import { ApiItemLocationDto } from "./api-item-location-dto"; +export interface TypeScriptTypeDeclarationDebug { + Kind: ts.SyntaxKind; + KindString: string; +} + /** * This is the interface for definitions like: interface, class or enum etc. */ export interface ApiBaseItemDto { Name: string; ApiKind: ApiItemKinds; - Kind: ts.SyntaxKind; - KindString: string; Metadata: ApiMetadataDto; Location: ApiItemLocationDto; + _ts?: TypeScriptTypeDeclarationDebug; } diff --git a/src/contracts/api-item-kinds.ts b/src/contracts/api-item-kinds.ts index 03110983..e87bc8da 100644 --- a/src/contracts/api-item-kinds.ts +++ b/src/contracts/api-item-kinds.ts @@ -24,5 +24,6 @@ export enum ApiItemKinds { ImportSpecifier = "import-specifier", TypeParameter = "type-parameter", TypeLiteral = "type-literal", - FunctionType = "function-type" + FunctionType = "function-type", + Mapped = "mapped" } diff --git a/src/contracts/definitions/api-mapped-dto.ts b/src/contracts/definitions/api-mapped-dto.ts new file mode 100644 index 00000000..1aa0340e --- /dev/null +++ b/src/contracts/definitions/api-mapped-dto.ts @@ -0,0 +1,11 @@ +import { ApiBaseItemDto } from "../api-base-item-dto"; +import { ApiItemKinds } from "../api-item-kinds"; +import { TypeDto } from "../type-dto"; + +export interface ApiMappedDto extends ApiBaseItemDto { + ApiKind: ApiItemKinds.Mapped; + TypeParameter: string | undefined; + IsReadonly: boolean; + IsOptional: boolean; + Type: TypeDto; +} diff --git a/src/contracts/extractor-options.ts b/src/contracts/extractor-options.ts index cb328701..f0f18d01 100644 --- a/src/contracts/extractor-options.ts +++ b/src/contracts/extractor-options.ts @@ -9,4 +9,8 @@ export interface ExtractorOptions { Exclude?: string[]; OutputPathSeparator?: string; ExternalPackages?: string[]; + /** + * Include TypeScript specific information in extracted data. + */ + IncludeTsDebugInfo?: boolean; } diff --git a/src/contracts/type-dto.ts b/src/contracts/type-dto.ts index f41956fd..6adee444 100644 --- a/src/contracts/type-dto.ts +++ b/src/contracts/type-dto.ts @@ -13,7 +13,7 @@ export interface BaseTypeDto { } export interface TypeScriptSpecificPropertiesDto { - Flags: ts.TypeFlags; + Flags: ts.TypeFlags | ts.NodeFlags; FlagsString: string; } diff --git a/src/definitions/api-call.ts b/src/definitions/api-call.ts index ddae07a5..5cf38424 100644 --- a/src/definitions/api-call.ts +++ b/src/definitions/api-call.ts @@ -15,14 +15,13 @@ export class ApiCall extends ApiCallableBase { return { ApiKind: ApiItemKinds.Class, Name: this.Symbol.name, - Kind: this.Declaration.kind, - KindString: ts.SyntaxKind[this.Declaration.kind], Metadata: metadata, Location: location, IsAbstract: this.isAbstract, Members: this.members, Extends: this.extends, Implements: this.implements, - TypeParameters: this.typeParameters + TypeParameters: this.typeParameters, + _ts: this.GetTsDebugInfo() }; } } diff --git a/src/definitions/api-construct.ts b/src/definitions/api-construct.ts index 9405e859..5d14d15b 100644 --- a/src/definitions/api-construct.ts +++ b/src/definitions/api-construct.ts @@ -8,7 +8,7 @@ import { ApiMetadataDto } from "../contracts/api-metadata-dto"; import { ApiCallableBase } from "../abstractions/api-callable-base"; import { ApiItemLocationDto } from "../contracts/api-item-location-dto"; -export class ApiConstruct extends ApiCallableBase { +export class ApiConstruct extends ApiCallableBase { public OnExtract(): ApiConstructDto { const metadata: ApiMetadataDto = this.GetItemMetadata(); const location: ApiItemLocationDto = ApiHelpers.GetApiItemLocationDtoFromNode(this.Declaration, this.Options); @@ -16,14 +16,13 @@ export class ApiConstruct extends ApiCallableBase { return { ApiKind: ApiItemKinds.EnumMember, Name: this.Symbol.name, - Kind: this.Declaration.kind, - KindString: ts.SyntaxKind[this.Declaration.kind], Metadata: metadata, Location: location, - Value: value + Value: value, + _ts: this.GetTsDebugInfo() }; } } diff --git a/src/definitions/api-enum.ts b/src/definitions/api-enum.ts index 518c6123..ace3232b 100644 --- a/src/definitions/api-enum.ts +++ b/src/definitions/api-enum.ts @@ -28,12 +28,11 @@ export class ApiEnum extends ApiItem { return { ApiKind: ApiItemKinds.Enum, Name: this.Symbol.name, - Kind: this.Declaration.kind, - KindString: ts.SyntaxKind[this.Declaration.kind], Metadata: metadata, Location: location, IsConst: this.isConst, - Members: this.members + Members: this.members, + _ts: this.GetTsDebugInfo() }; } } diff --git a/src/definitions/api-export-specifier.ts b/src/definitions/api-export-specifier.ts index 218a45bf..9eb4dbae 100644 --- a/src/definitions/api-export-specifier.ts +++ b/src/definitions/api-export-specifier.ts @@ -29,11 +29,10 @@ export class ApiExportSpecifier extends ApiItem { return { ApiKind: ApiItemKinds.Export, Name: this.Symbol.name, - Kind: this.Declaration.kind, - KindString: ts.SyntaxKind[this.Declaration.kind], Metadata: metadata, Location: location, SourceFileId: this.sourceFileId, - ExportPath: exportPath + ExportPath: exportPath, + _ts: this.GetTsDebugInfo() }; } } diff --git a/src/definitions/api-function-type.ts b/src/definitions/api-function-type.ts index 4dc64941..bcf57b00 100644 --- a/src/definitions/api-function-type.ts +++ b/src/definitions/api-function-type.ts @@ -15,14 +15,13 @@ export class ApiFunctionType extends ApiCallableBase return { ApiKind: ApiItemKinds.Index, Name: this.Symbol.name, - Kind: this.Declaration.kind, - KindString: ts.SyntaxKind[this.Declaration.kind], Metadata: metadata, Location: location, Parameter: this.parameter, IsReadonly: this.isReadonly, - Type: this.type + Type: this.type, + _ts: this.GetTsDebugInfo() }; } } diff --git a/src/definitions/api-interface.ts b/src/definitions/api-interface.ts index e2b5930e..9b22a108 100644 --- a/src/definitions/api-interface.ts +++ b/src/definitions/api-interface.ts @@ -39,13 +39,12 @@ export class ApiInterface extends ApiItem { + private typeParameter: string | undefined; + private type: TypeDto; + private isReadonly: boolean; + private isOptional: boolean; + + protected OnGatherData(): void { + // TypeParameter + const typeParameterSymbol = TSHelpers.GetSymbolFromDeclaration(this.Declaration.typeParameter, this.TypeChecker); + if (typeParameterSymbol != null) { + this.typeParameter = ApiHelpers.GetItemId(this.Declaration.typeParameter, typeParameterSymbol, this.Options); + } + + /** + * Type + * getTypeFromTypeNode method handles undefined and returns `any` type. + */ + const type = this.TypeChecker.getTypeFromTypeNode(this.Declaration.type!); + this.type = ApiHelpers.TypeToApiTypeDto(type, this.Options); + + // Readonly + this.isReadonly = Boolean(this.Declaration.readonlyToken); + + // Optional + this.isOptional = Boolean(this.Declaration.questionToken); + } + + public OnExtract(): ApiMappedDto { + const metadata: ApiMetadataDto = this.GetItemMetadata(); + const location: ApiItemLocationDto = ApiHelpers.GetApiItemLocationDtoFromNode(this.Declaration, this.Options); + + return { + ApiKind: ApiItemKinds.Mapped, + Name: this.Symbol.name, + Metadata: metadata, + Location: location, + TypeParameter: this.typeParameter, + IsOptional: this.isOptional, + IsReadonly: this.isReadonly, + Type: this.type, + _ts: this.GetTsDebugInfo() + }; + } +} diff --git a/src/definitions/api-method.ts b/src/definitions/api-method.ts index 1c0e354f..96cda78c 100644 --- a/src/definitions/api-method.ts +++ b/src/definitions/api-method.ts @@ -25,15 +25,14 @@ export class ApiMethod extends ApiCallableBase return { ApiKind: ApiItemKinds.Method, Name: this.Symbol.name, - Kind: this.Declaration.kind, - KindString: ts.SyntaxKind[this.Declaration.kind], Metadata: metadata, Location: location, IsOverloadBase: this.IsOverloadBase, Parameters: this.Parameters, ReturnType: this.ReturnType, IsOptional: this.isOptional, - TypeParameters: this.TypeParameters + TypeParameters: this.TypeParameters, + _ts: this.GetTsDebugInfo() }; } } diff --git a/src/definitions/api-namespace.ts b/src/definitions/api-namespace.ts index 10406752..536d61d9 100644 --- a/src/definitions/api-namespace.ts +++ b/src/definitions/api-namespace.ts @@ -23,11 +23,10 @@ export class ApiNamespace extends ApiItem { return { ApiKind: ApiItemKinds.Property, Name: this.Symbol.name, - Kind: this.Declaration.kind, - KindString: ts.SyntaxKind[this.Declaration.kind], Metadata: metadata, Location: location, IsOptional: this.isOptional, IsReadonly: this.isReadonly, - Type: this.type + Type: this.type, + _ts: this.GetTsDebugInfo() }; } } diff --git a/src/definitions/api-set-accessor.ts b/src/definitions/api-set-accessor.ts index 45588164..16ab25f6 100644 --- a/src/definitions/api-set-accessor.ts +++ b/src/definitions/api-set-accessor.ts @@ -44,14 +44,13 @@ export class ApiSetAccessor extends ApiItem { return { ApiKind: ApiItemKinds.SourceFile, Name: name, - Kind: this.Declaration.kind, Metadata: metadata, Location: location, - KindString: ts.SyntaxKind[this.Declaration.kind], - Members: this.members + Members: this.members, + _ts: this.GetTsDebugInfo() }; } } diff --git a/src/definitions/api-type-literal.ts b/src/definitions/api-type-literal.ts index ccf4d8fe..e4b10a66 100644 --- a/src/definitions/api-type-literal.ts +++ b/src/definitions/api-type-literal.ts @@ -23,11 +23,10 @@ export class ApiTypeLiteral extends ApiItem { return { ApiKind: ApiItemKinds.Type, Name: this.Symbol.name, - Kind: this.Declaration.kind, - KindString: ts.SyntaxKind[this.Declaration.kind], Metadata: metadata, Location: location, Type: this.type, - TypeParameters: this.typeParameters + TypeParameters: this.typeParameters, + _ts: this.GetTsDebugInfo() }; } } diff --git a/src/definitions/api-variable.ts b/src/definitions/api-variable.ts index fc2bbbfa..4679a86e 100644 --- a/src/definitions/api-variable.ts +++ b/src/definitions/api-variable.ts @@ -42,12 +42,11 @@ export class ApiVariable extends ApiItem return { ApiKind: ApiItemKinds.Variable, Name: this.Symbol.name, - Kind: this.Declaration.kind, - KindString: ts.SyntaxKind[this.Declaration.kind], Metadata: metadata, Location: location, VariableDeclarationType: this.variableDeclarationType, - Type: this.type + Type: this.type, + _ts: this.GetTsDebugInfo() }; } } diff --git a/tests/cases/MappedDeclaration1.ts b/tests/cases/MappedDeclaration1.ts new file mode 100644 index 00000000..12f04b69 --- /dev/null +++ b/tests/cases/MappedDeclaration1.ts @@ -0,0 +1 @@ +export type mapped = {[K in "a-b-c"]: number }; diff --git a/tests/cases/MappedDeclaration2.ts b/tests/cases/MappedDeclaration2.ts new file mode 100644 index 00000000..3f185868 --- /dev/null +++ b/tests/cases/MappedDeclaration2.ts @@ -0,0 +1,6 @@ +export interface Foo { + Name: string; + Age: number; +} + +export type mapped = {[K in keyof Foo]: number }; diff --git a/tests/cases/MappedDeclaration3.ts b/tests/cases/MappedDeclaration3.ts new file mode 100644 index 00000000..5346a368 --- /dev/null +++ b/tests/cases/MappedDeclaration3.ts @@ -0,0 +1,8 @@ +export interface Foo { + Name: string; + Age: number; +} + +export type mapped = { + readonly [K in keyof Foo]: number +}; diff --git a/tests/cases/MappedDeclaration4.ts b/tests/cases/MappedDeclaration4.ts new file mode 100644 index 00000000..b348bf92 --- /dev/null +++ b/tests/cases/MappedDeclaration4.ts @@ -0,0 +1,8 @@ +export interface Foo { + Name: string; + Age: number; +} + +export type mapped = { + [K in keyof Foo]?: number +}; diff --git a/tests/cases/__tests__/__snapshots__/ClassDeclaration1.test.ts.snap b/tests/cases/__tests__/__snapshots__/ClassDeclaration1.test.ts.snap index 08967947..2af32d4c 100644 --- a/tests/cases/__tests__/__snapshots__/ClassDeclaration1.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/ClassDeclaration1.test.ts.snap @@ -11,8 +11,6 @@ Object { "Extends": undefined, "Implements": Array [], "IsAbstract": false, - "Kind": 229, - "KindString": "ClassDeclaration", "Location": Object { "Character": 0, "FileName": "./cases/ClassDeclaration1.ts", @@ -64,6 +62,10 @@ Object { }, "Name": "FooClass", "TypeParameters": Array [], + "_ts": Object { + "Kind": 229, + "KindString": "ClassDeclaration", + }, }, "MethodDeclaration-0": Object { "AccessModifier": "protected", @@ -73,8 +75,6 @@ Object { "IsOptional": true, "IsOverloadBase": false, "IsStatic": false, - "Kind": 151, - "KindString": "MethodDeclaration", "Location": Object { "Character": 4, "FileName": "./cases/ClassDeclaration1.ts", @@ -104,6 +104,10 @@ Object { "Text": "void", }, "TypeParameters": Array [], + "_ts": Object { + "Kind": 151, + "KindString": "MethodDeclaration", + }, }, "MethodDeclaration-1": Object { "AccessModifier": "public", @@ -113,8 +117,6 @@ Object { "IsOptional": false, "IsOverloadBase": false, "IsStatic": false, - "Kind": 151, - "KindString": "MethodDeclaration", "Location": Object { "Character": 4, "FileName": "./cases/ClassDeclaration1.ts", @@ -146,6 +148,10 @@ GetFoo without A parameter comment line.", "Text": "string", }, "TypeParameters": Array [], + "_ts": Object { + "Kind": 151, + "KindString": "MethodDeclaration", + }, }, "MethodDeclaration-2": Object { "AccessModifier": "public", @@ -155,8 +161,6 @@ GetFoo without A parameter comment line.", "IsOptional": false, "IsOverloadBase": false, "IsStatic": false, - "Kind": 151, - "KindString": "MethodDeclaration", "Location": Object { "Character": 4, "FileName": "./cases/ClassDeclaration1.ts", @@ -188,6 +192,10 @@ GetFoo without A parameter comment line.", "Text": "string", }, "TypeParameters": Array [], + "_ts": Object { + "Kind": 151, + "KindString": "MethodDeclaration", + }, }, "MethodDeclaration-3": Object { "AccessModifier": "public", @@ -197,8 +205,6 @@ GetFoo without A parameter comment line.", "IsOptional": false, "IsOverloadBase": true, "IsStatic": false, - "Kind": 151, - "KindString": "MethodDeclaration", "Location": Object { "Character": 4, "FileName": "./cases/ClassDeclaration1.ts", @@ -230,6 +236,10 @@ GetFoo without A parameter comment line.", "Text": "string", }, "TypeParameters": Array [], + "_ts": Object { + "Kind": 151, + "KindString": "MethodDeclaration", + }, }, "MethodDeclaration-4": Object { "AccessModifier": "public", @@ -239,8 +249,6 @@ GetFoo without A parameter comment line.", "IsOptional": true, "IsOverloadBase": false, "IsStatic": false, - "Kind": 151, - "KindString": "MethodDeclaration", "Location": Object { "Character": 4, "FileName": "./cases/ClassDeclaration1.ts", @@ -273,14 +281,16 @@ GetFoo without A parameter comment line.", "Text": "Promise", }, "TypeParameters": Array [], + "_ts": Object { + "Kind": 151, + "KindString": "MethodDeclaration", + }, }, "Parameter-0": Object { "ApiKind": "parameter", "Initializer": undefined, "IsOptional": true, "IsSpread": false, - "Kind": 146, - "KindString": "Parameter", "Location": Object { "Character": 22, "FileName": "./cases/ClassDeclaration1.ts", @@ -301,14 +311,16 @@ GetFoo without A parameter comment line.", "ReferenceId": undefined, "Text": "string", }, + "_ts": Object { + "Kind": 146, + "KindString": "Parameter", + }, }, "Parameter-1": Object { "ApiKind": "parameter", "Initializer": undefined, "IsOptional": false, "IsSpread": false, - "Kind": 146, - "KindString": "Parameter", "Location": Object { "Character": 18, "FileName": "./cases/ClassDeclaration1.ts", @@ -329,14 +341,16 @@ GetFoo without A parameter comment line.", "ReferenceId": undefined, "Text": "string", }, + "_ts": Object { + "Kind": 146, + "KindString": "Parameter", + }, }, "Parameter-2": Object { "ApiKind": "parameter", "Initializer": undefined, "IsOptional": false, "IsSpread": false, - "Kind": 146, - "KindString": "Parameter", "Location": Object { "Character": 18, "FileName": "./cases/ClassDeclaration1.ts", @@ -376,14 +390,16 @@ GetFoo without A parameter comment line.", }, ], }, + "_ts": Object { + "Kind": 146, + "KindString": "Parameter", + }, }, "Parameter-3": Object { "ApiKind": "parameter", "Initializer": undefined, "IsOptional": false, "IsSpread": false, - "Kind": 146, - "KindString": "Parameter", "Location": Object { "Character": 18, "FileName": "./cases/ClassDeclaration1.ts", @@ -432,6 +448,10 @@ GetFoo without A parameter comment line.", }, ], }, + "_ts": Object { + "Kind": 146, + "KindString": "Parameter", + }, }, "PropertyDeclaration-0": Object { "AccessModifier": "public", @@ -440,8 +460,6 @@ GetFoo without A parameter comment line.", "IsOptional": false, "IsReadonly": true, "IsStatic": false, - "Kind": 149, - "KindString": "PropertyDeclaration", "Location": Object { "Character": 4, "FileName": "./cases/ClassDeclaration1.ts", @@ -467,6 +485,10 @@ GetFoo without A parameter comment line.", "ReferenceId": undefined, "Text": "string", }, + "_ts": Object { + "Kind": 149, + "KindString": "PropertyDeclaration", + }, }, "PropertyDeclaration-1": Object { "AccessModifier": "public", @@ -475,8 +497,6 @@ GetFoo without A parameter comment line.", "IsOptional": false, "IsReadonly": false, "IsStatic": true, - "Kind": 149, - "KindString": "PropertyDeclaration", "Location": Object { "Character": 4, "FileName": "./cases/ClassDeclaration1.ts", @@ -497,11 +517,13 @@ GetFoo without A parameter comment line.", "ReferenceId": undefined, "Text": "string", }, + "_ts": Object { + "Kind": 149, + "KindString": "PropertyDeclaration", + }, }, "SourceFile-0": Object { "ApiKind": "source-file", - "Kind": 268, - "KindString": "SourceFile", "Location": Object { "Character": 0, "FileName": "./cases/ClassDeclaration1.ts", @@ -521,6 +543,10 @@ GetFoo without A parameter comment line.", "JSDocTags": Array [], }, "Name": "ClassDeclaration1.ts", + "_ts": Object { + "Kind": 268, + "KindString": "SourceFile", + }, }, }, } diff --git a/tests/cases/__tests__/__snapshots__/ClassDeclaration10.test.ts.snap b/tests/cases/__tests__/__snapshots__/ClassDeclaration10.test.ts.snap index be6faf13..2334c09b 100644 --- a/tests/cases/__tests__/__snapshots__/ClassDeclaration10.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/ClassDeclaration10.test.ts.snap @@ -11,8 +11,6 @@ Object { "Extends": undefined, "Implements": Array [], "IsAbstract": false, - "Kind": 229, - "KindString": "ClassDeclaration", "Location": Object { "Character": 0, "FileName": "./cases/ClassDeclaration10.ts", @@ -35,13 +33,15 @@ Object { }, "Name": "FooClass", "TypeParameters": Array [], + "_ts": Object { + "Kind": 229, + "KindString": "ClassDeclaration", + }, }, "Constructor-0": Object { "AccessModifier": "public", "ApiKind": "class-constructor", "IsOverloadBase": false, - "Kind": 152, - "KindString": "Constructor", "Location": Object { "Character": 4, "FileName": "./cases/ClassDeclaration10.ts", @@ -62,13 +62,15 @@ Creating foo with boolean.", ], }, ], + "_ts": Object { + "Kind": 152, + "KindString": "Constructor", + }, }, "Constructor-1": Object { "AccessModifier": "public", "ApiKind": "class-constructor", "IsOverloadBase": false, - "Kind": 152, - "KindString": "Constructor", "Location": Object { "Character": 4, "FileName": "./cases/ClassDeclaration10.ts", @@ -89,13 +91,15 @@ Creating foo with boolean.", ], }, ], + "_ts": Object { + "Kind": 152, + "KindString": "Constructor", + }, }, "Constructor-2": Object { "AccessModifier": "public", "ApiKind": "class-constructor", "IsOverloadBase": true, - "Kind": 152, - "KindString": "Constructor", "Location": Object { "Character": 4, "FileName": "./cases/ClassDeclaration10.ts", @@ -116,14 +120,16 @@ Creating foo with boolean.", ], }, ], + "_ts": Object { + "Kind": 152, + "KindString": "Constructor", + }, }, "Parameter-0": Object { "ApiKind": "parameter", "Initializer": undefined, "IsOptional": false, "IsSpread": false, - "Kind": 146, - "KindString": "Parameter", "Location": Object { "Character": 16, "FileName": "./cases/ClassDeclaration10.ts", @@ -144,14 +150,16 @@ Creating foo with boolean.", "ReferenceId": undefined, "Text": "string", }, + "_ts": Object { + "Kind": 146, + "KindString": "Parameter", + }, }, "Parameter-1": Object { "ApiKind": "parameter", "Initializer": undefined, "IsOptional": false, "IsSpread": false, - "Kind": 146, - "KindString": "Parameter", "Location": Object { "Character": 16, "FileName": "./cases/ClassDeclaration10.ts", @@ -191,14 +199,16 @@ Creating foo with boolean.", }, ], }, + "_ts": Object { + "Kind": 146, + "KindString": "Parameter", + }, }, "Parameter-2": Object { "ApiKind": "parameter", "Initializer": undefined, "IsOptional": false, "IsSpread": false, - "Kind": 146, - "KindString": "Parameter", "Location": Object { "Character": 16, "FileName": "./cases/ClassDeclaration10.ts", @@ -247,11 +257,13 @@ Creating foo with boolean.", }, ], }, + "_ts": Object { + "Kind": 146, + "KindString": "Parameter", + }, }, "SourceFile-0": Object { "ApiKind": "source-file", - "Kind": 268, - "KindString": "SourceFile", "Location": Object { "Character": 0, "FileName": "./cases/ClassDeclaration10.ts", @@ -271,6 +283,10 @@ Creating foo with boolean.", "JSDocTags": Array [], }, "Name": "ClassDeclaration10.ts", + "_ts": Object { + "Kind": 268, + "KindString": "SourceFile", + }, }, }, } diff --git a/tests/cases/__tests__/__snapshots__/ClassDeclaration2.test.ts.snap b/tests/cases/__tests__/__snapshots__/ClassDeclaration2.test.ts.snap index 751c37a8..050c657e 100644 --- a/tests/cases/__tests__/__snapshots__/ClassDeclaration2.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/ClassDeclaration2.test.ts.snap @@ -11,8 +11,6 @@ Object { "Extends": undefined, "Implements": Array [], "IsAbstract": true, - "Kind": 229, - "KindString": "ClassDeclaration", "Location": Object { "Character": 0, "FileName": "./cases/ClassDeclaration2.ts", @@ -57,6 +55,10 @@ Object { }, "Name": "Foo", "TypeParameters": Array [], + "_ts": Object { + "Kind": 229, + "KindString": "ClassDeclaration", + }, }, "MethodDeclaration-0": Object { "AccessModifier": "protected", @@ -66,8 +68,6 @@ Object { "IsOptional": false, "IsOverloadBase": false, "IsStatic": false, - "Kind": 151, - "KindString": "MethodDeclaration", "Location": Object { "Character": 4, "FileName": "./cases/ClassDeclaration2.ts", @@ -97,6 +97,10 @@ Object { "Text": "void", }, "TypeParameters": Array [], + "_ts": Object { + "Kind": 151, + "KindString": "MethodDeclaration", + }, }, "MethodDeclaration-1": Object { "AccessModifier": "public", @@ -106,8 +110,6 @@ Object { "IsOptional": false, "IsOverloadBase": false, "IsStatic": false, - "Kind": 151, - "KindString": "MethodDeclaration", "Location": Object { "Character": 4, "FileName": "./cases/ClassDeclaration2.ts", @@ -130,14 +132,16 @@ Object { "Text": "string", }, "TypeParameters": Array [], + "_ts": Object { + "Kind": 151, + "KindString": "MethodDeclaration", + }, }, "Parameter-0": Object { "ApiKind": "parameter", "Initializer": undefined, "IsOptional": false, "IsSpread": false, - "Kind": 146, - "KindString": "Parameter", "Location": Object { "Character": 30, "FileName": "./cases/ClassDeclaration2.ts", @@ -158,6 +162,10 @@ Object { "ReferenceId": undefined, "Text": "string", }, + "_ts": Object { + "Kind": 146, + "KindString": "Parameter", + }, }, "PropertyDeclaration-0": Object { "AccessModifier": "private", @@ -166,8 +174,6 @@ Object { "IsOptional": false, "IsReadonly": false, "IsStatic": false, - "Kind": 149, - "KindString": "PropertyDeclaration", "Location": Object { "Character": 4, "FileName": "./cases/ClassDeclaration2.ts", @@ -188,6 +194,10 @@ Object { "ReferenceId": undefined, "Text": "string", }, + "_ts": Object { + "Kind": 149, + "KindString": "PropertyDeclaration", + }, }, "PropertyDeclaration-1": Object { "AccessModifier": "public", @@ -196,8 +206,6 @@ Object { "IsOptional": false, "IsReadonly": true, "IsStatic": false, - "Kind": 149, - "KindString": "PropertyDeclaration", "Location": Object { "Character": 4, "FileName": "./cases/ClassDeclaration2.ts", @@ -218,6 +226,10 @@ Object { "ReferenceId": undefined, "Text": "string", }, + "_ts": Object { + "Kind": 149, + "KindString": "PropertyDeclaration", + }, }, "PropertyDeclaration-2": Object { "AccessModifier": "public", @@ -226,8 +238,6 @@ Object { "IsOptional": false, "IsReadonly": false, "IsStatic": true, - "Kind": 149, - "KindString": "PropertyDeclaration", "Location": Object { "Character": 4, "FileName": "./cases/ClassDeclaration2.ts", @@ -248,11 +258,13 @@ Object { "ReferenceId": undefined, "Text": "string", }, + "_ts": Object { + "Kind": 149, + "KindString": "PropertyDeclaration", + }, }, "SourceFile-0": Object { "ApiKind": "source-file", - "Kind": 268, - "KindString": "SourceFile", "Location": Object { "Character": 0, "FileName": "./cases/ClassDeclaration2.ts", @@ -272,6 +284,10 @@ Object { "JSDocTags": Array [], }, "Name": "ClassDeclaration2.ts", + "_ts": Object { + "Kind": 268, + "KindString": "SourceFile", + }, }, }, } diff --git a/tests/cases/__tests__/__snapshots__/ClassDeclaration3.test.ts.snap b/tests/cases/__tests__/__snapshots__/ClassDeclaration3.test.ts.snap index 995d5a09..b8b0b7f9 100644 --- a/tests/cases/__tests__/__snapshots__/ClassDeclaration3.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/ClassDeclaration3.test.ts.snap @@ -21,8 +21,6 @@ Object { }, ], "IsAbstract": false, - "Kind": 229, - "KindString": "ClassDeclaration", "Location": Object { "Character": 0, "FileName": "./cases/ClassDeclaration3.ts", @@ -43,12 +41,14 @@ Object { }, "Name": "FooClass", "TypeParameters": Array [], + "_ts": Object { + "Kind": 229, + "KindString": "ClassDeclaration", + }, }, "InterfaceDeclaration-0": Object { "ApiKind": "interface", "Extends": Array [], - "Kind": 230, - "KindString": "InterfaceDeclaration", "Location": Object { "Character": 0, "FileName": "./cases/ClassDeclaration3.ts", @@ -69,6 +69,10 @@ Object { }, "Name": "Foo", "TypeParameters": Array [], + "_ts": Object { + "Kind": 230, + "KindString": "InterfaceDeclaration", + }, }, "PropertyDeclaration-0": Object { "AccessModifier": "public", @@ -77,8 +81,6 @@ Object { "IsOptional": false, "IsReadonly": false, "IsStatic": false, - "Kind": 149, - "KindString": "PropertyDeclaration", "Location": Object { "Character": 4, "FileName": "./cases/ClassDeclaration3.ts", @@ -99,13 +101,15 @@ Object { "ReferenceId": undefined, "Text": "string", }, + "_ts": Object { + "Kind": 149, + "KindString": "PropertyDeclaration", + }, }, "PropertySignature-0": Object { "ApiKind": "property", "IsOptional": false, "IsReadonly": false, - "Kind": 148, - "KindString": "PropertySignature", "Location": Object { "Character": 4, "FileName": "./cases/ClassDeclaration3.ts", @@ -126,11 +130,13 @@ Object { "ReferenceId": undefined, "Text": "string", }, + "_ts": Object { + "Kind": 148, + "KindString": "PropertySignature", + }, }, "SourceFile-0": Object { "ApiKind": "source-file", - "Kind": 268, - "KindString": "SourceFile", "Location": Object { "Character": 0, "FileName": "./cases/ClassDeclaration3.ts", @@ -156,6 +162,10 @@ Object { "JSDocTags": Array [], }, "Name": "ClassDeclaration3.ts", + "_ts": Object { + "Kind": 268, + "KindString": "SourceFile", + }, }, }, } diff --git a/tests/cases/__tests__/__snapshots__/ClassDeclaration4.test.ts.snap b/tests/cases/__tests__/__snapshots__/ClassDeclaration4.test.ts.snap index a3916f8c..24292b70 100644 --- a/tests/cases/__tests__/__snapshots__/ClassDeclaration4.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/ClassDeclaration4.test.ts.snap @@ -30,8 +30,6 @@ Object { }, ], "IsAbstract": false, - "Kind": 229, - "KindString": "ClassDeclaration", "Location": Object { "Character": 0, "FileName": "./cases/ClassDeclaration4.ts", @@ -58,12 +56,14 @@ Object { }, "Name": "FooClass", "TypeParameters": Array [], + "_ts": Object { + "Kind": 229, + "KindString": "ClassDeclaration", + }, }, "InterfaceDeclaration-0": Object { "ApiKind": "interface", "Extends": Array [], - "Kind": 230, - "KindString": "InterfaceDeclaration", "Location": Object { "Character": 0, "FileName": "./cases/ClassDeclaration4.ts", @@ -84,12 +84,14 @@ Object { }, "Name": "Foo", "TypeParameters": Array [], + "_ts": Object { + "Kind": 230, + "KindString": "InterfaceDeclaration", + }, }, "InterfaceDeclaration-1": Object { "ApiKind": "interface", "Extends": Array [], - "Kind": 230, - "KindString": "InterfaceDeclaration", "Location": Object { "Character": 0, "FileName": "./cases/ClassDeclaration4.ts", @@ -110,6 +112,10 @@ Object { }, "Name": "Foo2", "TypeParameters": Array [], + "_ts": Object { + "Kind": 230, + "KindString": "InterfaceDeclaration", + }, }, "PropertyDeclaration-0": Object { "AccessModifier": "public", @@ -118,8 +124,6 @@ Object { "IsOptional": false, "IsReadonly": false, "IsStatic": false, - "Kind": 149, - "KindString": "PropertyDeclaration", "Location": Object { "Character": 4, "FileName": "./cases/ClassDeclaration4.ts", @@ -140,6 +144,10 @@ Object { "ReferenceId": undefined, "Text": "string", }, + "_ts": Object { + "Kind": 149, + "KindString": "PropertyDeclaration", + }, }, "PropertyDeclaration-1": Object { "AccessModifier": "public", @@ -148,8 +156,6 @@ Object { "IsOptional": false, "IsReadonly": false, "IsStatic": false, - "Kind": 149, - "KindString": "PropertyDeclaration", "Location": Object { "Character": 4, "FileName": "./cases/ClassDeclaration4.ts", @@ -170,13 +176,15 @@ Object { "ReferenceId": undefined, "Text": "string", }, + "_ts": Object { + "Kind": 149, + "KindString": "PropertyDeclaration", + }, }, "PropertySignature-0": Object { "ApiKind": "property", "IsOptional": false, "IsReadonly": false, - "Kind": 148, - "KindString": "PropertySignature", "Location": Object { "Character": 4, "FileName": "./cases/ClassDeclaration4.ts", @@ -197,13 +205,15 @@ Object { "ReferenceId": undefined, "Text": "string", }, + "_ts": Object { + "Kind": 148, + "KindString": "PropertySignature", + }, }, "PropertySignature-1": Object { "ApiKind": "property", "IsOptional": false, "IsReadonly": false, - "Kind": 148, - "KindString": "PropertySignature", "Location": Object { "Character": 4, "FileName": "./cases/ClassDeclaration4.ts", @@ -224,11 +234,13 @@ Object { "ReferenceId": undefined, "Text": "string", }, + "_ts": Object { + "Kind": 148, + "KindString": "PropertySignature", + }, }, "SourceFile-0": Object { "ApiKind": "source-file", - "Kind": 268, - "KindString": "SourceFile", "Location": Object { "Character": 0, "FileName": "./cases/ClassDeclaration4.ts", @@ -260,6 +272,10 @@ Object { "JSDocTags": Array [], }, "Name": "ClassDeclaration4.ts", + "_ts": Object { + "Kind": 268, + "KindString": "SourceFile", + }, }, }, } diff --git a/tests/cases/__tests__/__snapshots__/ClassDeclaration5.test.ts.snap b/tests/cases/__tests__/__snapshots__/ClassDeclaration5.test.ts.snap index d43d0e75..9263af00 100644 --- a/tests/cases/__tests__/__snapshots__/ClassDeclaration5.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/ClassDeclaration5.test.ts.snap @@ -11,8 +11,6 @@ Object { "Extends": undefined, "Implements": Array [], "IsAbstract": true, - "Kind": 229, - "KindString": "ClassDeclaration", "Location": Object { "Character": 0, "FileName": "./cases/ClassDeclaration5.ts", @@ -40,6 +38,10 @@ Object { ], }, ], + "_ts": Object { + "Kind": 229, + "KindString": "ClassDeclaration", + }, }, "ClassDeclaration-1": Object { "ApiKind": "class", @@ -64,8 +66,6 @@ Object { }, "Implements": Array [], "IsAbstract": false, - "Kind": 229, - "KindString": "ClassDeclaration", "Location": Object { "Character": 0, "FileName": "./cases/ClassDeclaration5.ts", @@ -86,6 +86,10 @@ Object { }, "Name": "Foo", "TypeParameters": Array [], + "_ts": Object { + "Kind": 229, + "KindString": "ClassDeclaration", + }, }, "MethodDeclaration-0": Object { "AccessModifier": "public", @@ -95,8 +99,6 @@ Object { "IsOptional": false, "IsOverloadBase": false, "IsStatic": false, - "Kind": 151, - "KindString": "MethodDeclaration", "Location": Object { "Character": 4, "FileName": "./cases/ClassDeclaration5.ts", @@ -119,6 +121,10 @@ Object { "Text": "TValue", }, "TypeParameters": Array [], + "_ts": Object { + "Kind": 151, + "KindString": "MethodDeclaration", + }, }, "MethodDeclaration-1": Object { "AccessModifier": "public", @@ -128,8 +134,6 @@ Object { "IsOptional": false, "IsOverloadBase": false, "IsStatic": false, - "Kind": 151, - "KindString": "MethodDeclaration", "Location": Object { "Character": 4, "FileName": "./cases/ClassDeclaration5.ts", @@ -152,11 +156,13 @@ Object { "Text": "number", }, "TypeParameters": Array [], + "_ts": Object { + "Kind": 151, + "KindString": "MethodDeclaration", + }, }, "SourceFile-0": Object { "ApiKind": "source-file", - "Kind": 268, - "KindString": "SourceFile", "Location": Object { "Character": 0, "FileName": "./cases/ClassDeclaration5.ts", @@ -182,13 +188,15 @@ Object { "JSDocTags": Array [], }, "Name": "ClassDeclaration5.ts", + "_ts": Object { + "Kind": 268, + "KindString": "SourceFile", + }, }, "TypeParameter-0": Object { "ApiKind": "type-parameter", "ConstraintType": undefined, "DefaultType": undefined, - "Kind": 145, - "KindString": "TypeParameter", "Location": Object { "Character": 30, "FileName": "./cases/ClassDeclaration5.ts", @@ -200,6 +208,10 @@ Object { "JSDocTags": Array [], }, "Name": "TValue", + "_ts": Object { + "Kind": 145, + "KindString": "TypeParameter", + }, }, }, } diff --git a/tests/cases/__tests__/__snapshots__/ClassDeclaration6.test.ts.snap b/tests/cases/__tests__/__snapshots__/ClassDeclaration6.test.ts.snap index 724f07b1..ff7fe816 100644 --- a/tests/cases/__tests__/__snapshots__/ClassDeclaration6.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/ClassDeclaration6.test.ts.snap @@ -11,8 +11,6 @@ Object { "Extends": undefined, "Implements": Array [], "IsAbstract": true, - "Kind": 229, - "KindString": "ClassDeclaration", "Location": Object { "Character": 0, "FileName": "./cases/ClassDeclaration6.ts", @@ -40,6 +38,10 @@ Object { ], }, ], + "_ts": Object { + "Kind": 229, + "KindString": "ClassDeclaration", + }, }, "ClassDeclaration-1": Object { "ApiKind": "class", @@ -74,8 +76,6 @@ Object { }, ], "IsAbstract": false, - "Kind": 229, - "KindString": "ClassDeclaration", "Location": Object { "Character": 0, "FileName": "./cases/ClassDeclaration6.ts", @@ -102,12 +102,14 @@ Object { }, "Name": "Foo", "TypeParameters": Array [], + "_ts": Object { + "Kind": 229, + "KindString": "ClassDeclaration", + }, }, "InterfaceDeclaration-0": Object { "ApiKind": "interface", "Extends": Array [], - "Kind": 230, - "KindString": "InterfaceDeclaration", "Location": Object { "Character": 0, "FileName": "./cases/ClassDeclaration6.ts", @@ -128,6 +130,10 @@ Object { }, "Name": "Bar", "TypeParameters": Array [], + "_ts": Object { + "Kind": 230, + "KindString": "InterfaceDeclaration", + }, }, "MethodDeclaration-0": Object { "AccessModifier": "public", @@ -137,8 +143,6 @@ Object { "IsOptional": false, "IsOverloadBase": false, "IsStatic": false, - "Kind": 151, - "KindString": "MethodDeclaration", "Location": Object { "Character": 4, "FileName": "./cases/ClassDeclaration6.ts", @@ -161,6 +165,10 @@ Object { "Text": "TValue", }, "TypeParameters": Array [], + "_ts": Object { + "Kind": 151, + "KindString": "MethodDeclaration", + }, }, "MethodDeclaration-1": Object { "AccessModifier": "public", @@ -170,8 +178,6 @@ Object { "IsOptional": false, "IsOverloadBase": false, "IsStatic": false, - "Kind": 151, - "KindString": "MethodDeclaration", "Location": Object { "Character": 4, "FileName": "./cases/ClassDeclaration6.ts", @@ -194,6 +200,10 @@ Object { "Text": "number", }, "TypeParameters": Array [], + "_ts": Object { + "Kind": 151, + "KindString": "MethodDeclaration", + }, }, "PropertyDeclaration-0": Object { "AccessModifier": "public", @@ -202,8 +212,6 @@ Object { "IsOptional": false, "IsReadonly": false, "IsStatic": false, - "Kind": 149, - "KindString": "PropertyDeclaration", "Location": Object { "Character": 4, "FileName": "./cases/ClassDeclaration6.ts", @@ -224,13 +232,15 @@ Object { "ReferenceId": undefined, "Text": "string", }, + "_ts": Object { + "Kind": 149, + "KindString": "PropertyDeclaration", + }, }, "PropertySignature-0": Object { "ApiKind": "property", "IsOptional": false, "IsReadonly": false, - "Kind": 148, - "KindString": "PropertySignature", "Location": Object { "Character": 4, "FileName": "./cases/ClassDeclaration6.ts", @@ -251,11 +261,13 @@ Object { "ReferenceId": undefined, "Text": "string", }, + "_ts": Object { + "Kind": 148, + "KindString": "PropertySignature", + }, }, "SourceFile-0": Object { "ApiKind": "source-file", - "Kind": 268, - "KindString": "SourceFile", "Location": Object { "Character": 0, "FileName": "./cases/ClassDeclaration6.ts", @@ -287,13 +299,15 @@ Object { "JSDocTags": Array [], }, "Name": "ClassDeclaration6.ts", + "_ts": Object { + "Kind": 268, + "KindString": "SourceFile", + }, }, "TypeParameter-0": Object { "ApiKind": "type-parameter", "ConstraintType": undefined, "DefaultType": undefined, - "Kind": 145, - "KindString": "TypeParameter", "Location": Object { "Character": 30, "FileName": "./cases/ClassDeclaration6.ts", @@ -305,6 +319,10 @@ Object { "JSDocTags": Array [], }, "Name": "TValue", + "_ts": Object { + "Kind": 145, + "KindString": "TypeParameter", + }, }, }, } diff --git a/tests/cases/__tests__/__snapshots__/ClassDeclaration7.test.ts.snap b/tests/cases/__tests__/__snapshots__/ClassDeclaration7.test.ts.snap index 5c6436a8..8e3a0378 100644 --- a/tests/cases/__tests__/__snapshots__/ClassDeclaration7.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/ClassDeclaration7.test.ts.snap @@ -11,8 +11,6 @@ Object { "Extends": undefined, "Implements": Array [], "IsAbstract": false, - "Kind": 229, - "KindString": "ClassDeclaration", "Location": Object { "Character": 0, "FileName": "./cases/ClassDeclaration7.ts", @@ -33,11 +31,13 @@ Object { ], }, ], + "_ts": Object { + "Kind": 229, + "KindString": "ClassDeclaration", + }, }, "SourceFile-0": Object { "ApiKind": "source-file", - "Kind": 268, - "KindString": "SourceFile", "Location": Object { "Character": 0, "FileName": "./cases/ClassDeclaration7.ts", @@ -57,13 +57,15 @@ Object { "JSDocTags": Array [], }, "Name": "ClassDeclaration7.ts", + "_ts": Object { + "Kind": 268, + "KindString": "SourceFile", + }, }, "TypeParameter-0": Object { "ApiKind": "type-parameter", "ConstraintType": undefined, "DefaultType": undefined, - "Kind": 145, - "KindString": "TypeParameter", "Location": Object { "Character": 22, "FileName": "./cases/ClassDeclaration7.ts", @@ -75,6 +77,10 @@ Object { "JSDocTags": Array [], }, "Name": "TValue", + "_ts": Object { + "Kind": 145, + "KindString": "TypeParameter", + }, }, }, } diff --git a/tests/cases/__tests__/__snapshots__/ClassDeclaration8.test.ts.snap b/tests/cases/__tests__/__snapshots__/ClassDeclaration8.test.ts.snap index 2d1ac557..b9ab00b7 100644 --- a/tests/cases/__tests__/__snapshots__/ClassDeclaration8.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/ClassDeclaration8.test.ts.snap @@ -11,8 +11,6 @@ Object { "Extends": undefined, "Implements": Array [], "IsAbstract": false, - "Kind": 229, - "KindString": "ClassDeclaration", "Location": Object { "Character": 0, "FileName": "./cases/ClassDeclaration8.ts", @@ -33,6 +31,10 @@ Object { }, "Name": "Control", "TypeParameters": Array [], + "_ts": Object { + "Kind": 229, + "KindString": "ClassDeclaration", + }, }, "ClassDeclaration-1": Object { "ApiKind": "class", @@ -57,8 +59,6 @@ Object { }, ], "IsAbstract": false, - "Kind": 229, - "KindString": "ClassDeclaration", "Location": Object { "Character": 0, "FileName": "./cases/ClassDeclaration8.ts", @@ -79,6 +79,10 @@ Object { }, "Name": "Button", "TypeParameters": Array [], + "_ts": Object { + "Kind": 229, + "KindString": "ClassDeclaration", + }, }, "InterfaceDeclaration-0": Object { "ApiKind": "interface", @@ -93,8 +97,6 @@ Object { "Text": "Control", }, ], - "Kind": 230, - "KindString": "InterfaceDeclaration", "Location": Object { "Character": 0, "FileName": "./cases/ClassDeclaration8.ts", @@ -115,6 +117,10 @@ Object { }, "Name": "SelectableControl", "TypeParameters": Array [], + "_ts": Object { + "Kind": 230, + "KindString": "InterfaceDeclaration", + }, }, "MethodDeclaration-0": Object { "AccessModifier": "public", @@ -124,8 +130,6 @@ Object { "IsOptional": false, "IsOverloadBase": false, "IsStatic": false, - "Kind": 151, - "KindString": "MethodDeclaration", "Location": Object { "Character": 4, "FileName": "./cases/ClassDeclaration8.ts", @@ -148,13 +152,15 @@ Object { "Text": "void", }, "TypeParameters": Array [], + "_ts": Object { + "Kind": 151, + "KindString": "MethodDeclaration", + }, }, "MethodSignature-0": Object { "ApiKind": "method", "IsOptional": false, "IsOverloadBase": false, - "Kind": 150, - "KindString": "MethodSignature", "Location": Object { "Character": 4, "FileName": "./cases/ClassDeclaration8.ts", @@ -177,6 +183,10 @@ Object { "Text": "void", }, "TypeParameters": Array [], + "_ts": Object { + "Kind": 150, + "KindString": "MethodSignature", + }, }, "PropertyDeclaration-0": Object { "AccessModifier": "private", @@ -185,8 +195,6 @@ Object { "IsOptional": false, "IsReadonly": false, "IsStatic": false, - "Kind": 149, - "KindString": "PropertyDeclaration", "Location": Object { "Character": 4, "FileName": "./cases/ClassDeclaration8.ts", @@ -207,11 +215,13 @@ Object { "ReferenceId": undefined, "Text": "any", }, + "_ts": Object { + "Kind": 149, + "KindString": "PropertyDeclaration", + }, }, "SourceFile-0": Object { "ApiKind": "source-file", - "Kind": 268, - "KindString": "SourceFile", "Location": Object { "Character": 0, "FileName": "./cases/ClassDeclaration8.ts", @@ -243,6 +253,10 @@ Object { "JSDocTags": Array [], }, "Name": "ClassDeclaration8.ts", + "_ts": Object { + "Kind": 268, + "KindString": "SourceFile", + }, }, }, } diff --git a/tests/cases/__tests__/__snapshots__/ClassDeclaration9.test.ts.snap b/tests/cases/__tests__/__snapshots__/ClassDeclaration9.test.ts.snap index bab195ad..05e42560 100644 --- a/tests/cases/__tests__/__snapshots__/ClassDeclaration9.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/ClassDeclaration9.test.ts.snap @@ -11,8 +11,6 @@ Object { "Extends": undefined, "Implements": Array [], "IsAbstract": false, - "Kind": 229, - "KindString": "ClassDeclaration", "Location": Object { "Character": 0, "FileName": "./cases/ClassDeclaration9.ts", @@ -39,6 +37,10 @@ Object { }, "Name": "Point", "TypeParameters": Array [], + "_ts": Object { + "Kind": 229, + "KindString": "ClassDeclaration", + }, }, "ClassDeclaration-1": Object { "ApiKind": "class", @@ -55,8 +57,6 @@ Object { }, ], "IsAbstract": false, - "Kind": 229, - "KindString": "ClassDeclaration", "Location": Object { "Character": 0, "FileName": "./cases/ClassDeclaration9.ts", @@ -89,6 +89,10 @@ Object { }, "Name": "Point3d", "TypeParameters": Array [], + "_ts": Object { + "Kind": 229, + "KindString": "ClassDeclaration", + }, }, "PropertyDeclaration-0": Object { "AccessModifier": "public", @@ -97,8 +101,6 @@ Object { "IsOptional": false, "IsReadonly": false, "IsStatic": false, - "Kind": 149, - "KindString": "PropertyDeclaration", "Location": Object { "Character": 4, "FileName": "./cases/ClassDeclaration9.ts", @@ -119,6 +121,10 @@ Object { "ReferenceId": undefined, "Text": "number", }, + "_ts": Object { + "Kind": 149, + "KindString": "PropertyDeclaration", + }, }, "PropertyDeclaration-1": Object { "AccessModifier": "public", @@ -127,8 +133,6 @@ Object { "IsOptional": false, "IsReadonly": false, "IsStatic": false, - "Kind": 149, - "KindString": "PropertyDeclaration", "Location": Object { "Character": 4, "FileName": "./cases/ClassDeclaration9.ts", @@ -149,6 +153,10 @@ Object { "ReferenceId": undefined, "Text": "number", }, + "_ts": Object { + "Kind": 149, + "KindString": "PropertyDeclaration", + }, }, "PropertyDeclaration-2": Object { "AccessModifier": "public", @@ -157,8 +165,6 @@ Object { "IsOptional": false, "IsReadonly": false, "IsStatic": false, - "Kind": 149, - "KindString": "PropertyDeclaration", "Location": Object { "Character": 4, "FileName": "./cases/ClassDeclaration9.ts", @@ -179,6 +185,10 @@ Object { "ReferenceId": undefined, "Text": "number", }, + "_ts": Object { + "Kind": 149, + "KindString": "PropertyDeclaration", + }, }, "PropertyDeclaration-3": Object { "AccessModifier": "public", @@ -187,8 +197,6 @@ Object { "IsOptional": false, "IsReadonly": false, "IsStatic": false, - "Kind": 149, - "KindString": "PropertyDeclaration", "Location": Object { "Character": 4, "FileName": "./cases/ClassDeclaration9.ts", @@ -209,6 +217,10 @@ Object { "ReferenceId": undefined, "Text": "number", }, + "_ts": Object { + "Kind": 149, + "KindString": "PropertyDeclaration", + }, }, "PropertyDeclaration-4": Object { "AccessModifier": "public", @@ -217,8 +229,6 @@ Object { "IsOptional": false, "IsReadonly": false, "IsStatic": false, - "Kind": 149, - "KindString": "PropertyDeclaration", "Location": Object { "Character": 4, "FileName": "./cases/ClassDeclaration9.ts", @@ -239,11 +249,13 @@ Object { "ReferenceId": undefined, "Text": "number", }, + "_ts": Object { + "Kind": 149, + "KindString": "PropertyDeclaration", + }, }, "SourceFile-0": Object { "ApiKind": "source-file", - "Kind": 268, - "KindString": "SourceFile", "Location": Object { "Character": 0, "FileName": "./cases/ClassDeclaration9.ts", @@ -269,6 +281,10 @@ Object { "JSDocTags": Array [], }, "Name": "ClassDeclaration9.ts", + "_ts": Object { + "Kind": 268, + "KindString": "SourceFile", + }, }, }, } diff --git a/tests/cases/__tests__/__snapshots__/ConstructSignature1.test.ts.snap b/tests/cases/__tests__/__snapshots__/ConstructSignature1.test.ts.snap index e67fd171..f373ab11 100644 --- a/tests/cases/__tests__/__snapshots__/ConstructSignature1.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/ConstructSignature1.test.ts.snap @@ -9,8 +9,6 @@ Object { "ConstructSignature-0": Object { "ApiKind": "construct", "IsOverloadBase": false, - "Kind": 156, - "KindString": "ConstructSignature", "Location": Object { "Character": 4, "FileName": "./cases/ConstructSignature1.ts", @@ -40,12 +38,14 @@ Object { "Text": "Foo", }, "TypeParameters": Array [], + "_ts": Object { + "Kind": 156, + "KindString": "ConstructSignature", + }, }, "InterfaceDeclaration-0": Object { "ApiKind": "interface", "Extends": Array [], - "Kind": 230, - "KindString": "InterfaceDeclaration", "Location": Object { "Character": 0, "FileName": "./cases/ConstructSignature1.ts", @@ -66,14 +66,16 @@ Object { }, "Name": "Foo", "TypeParameters": Array [], + "_ts": Object { + "Kind": 230, + "KindString": "InterfaceDeclaration", + }, }, "Parameter-0": Object { "ApiKind": "parameter", "Initializer": undefined, "IsOptional": false, "IsSpread": false, - "Kind": 146, - "KindString": "Parameter", "Location": Object { "Character": 8, "FileName": "./cases/ConstructSignature1.ts", @@ -94,11 +96,13 @@ Object { "ReferenceId": undefined, "Text": "string", }, + "_ts": Object { + "Kind": 146, + "KindString": "Parameter", + }, }, "SourceFile-0": Object { "ApiKind": "source-file", - "Kind": 268, - "KindString": "SourceFile", "Location": Object { "Character": 0, "FileName": "./cases/ConstructSignature1.ts", @@ -118,6 +122,10 @@ Object { "JSDocTags": Array [], }, "Name": "ConstructSignature1.ts", + "_ts": Object { + "Kind": 268, + "KindString": "SourceFile", + }, }, }, } diff --git a/tests/cases/__tests__/__snapshots__/ConstructSignature2.test.ts.snap b/tests/cases/__tests__/__snapshots__/ConstructSignature2.test.ts.snap index 574b1b69..6e07d0ac 100644 --- a/tests/cases/__tests__/__snapshots__/ConstructSignature2.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/ConstructSignature2.test.ts.snap @@ -9,8 +9,6 @@ Object { "ConstructSignature-0": Object { "ApiKind": "construct", "IsOverloadBase": false, - "Kind": 156, - "KindString": "ConstructSignature", "Location": Object { "Character": 4, "FileName": "./cases/ConstructSignature2.ts", @@ -40,12 +38,14 @@ Object { ], }, ], + "_ts": Object { + "Kind": 156, + "KindString": "ConstructSignature", + }, }, "InterfaceDeclaration-0": Object { "ApiKind": "interface", "Extends": Array [], - "Kind": 230, - "KindString": "InterfaceDeclaration", "Location": Object { "Character": 0, "FileName": "./cases/ConstructSignature2.ts", @@ -66,11 +66,13 @@ Object { }, "Name": "Foo", "TypeParameters": Array [], + "_ts": Object { + "Kind": 230, + "KindString": "InterfaceDeclaration", + }, }, "SourceFile-0": Object { "ApiKind": "source-file", - "Kind": 268, - "KindString": "SourceFile", "Location": Object { "Character": 0, "FileName": "./cases/ConstructSignature2.ts", @@ -90,13 +92,15 @@ Object { "JSDocTags": Array [], }, "Name": "ConstructSignature2.ts", + "_ts": Object { + "Kind": 268, + "KindString": "SourceFile", + }, }, "TypeParameter-0": Object { "ApiKind": "type-parameter", "ConstraintType": undefined, "DefaultType": undefined, - "Kind": 145, - "KindString": "TypeParameter", "Location": Object { "Character": 9, "FileName": "./cases/ConstructSignature2.ts", @@ -108,6 +112,10 @@ Object { "JSDocTags": Array [], }, "Name": "T", + "_ts": Object { + "Kind": 145, + "KindString": "TypeParameter", + }, }, }, } diff --git a/tests/cases/__tests__/__snapshots__/EnumDeclaration1.test.ts.snap b/tests/cases/__tests__/__snapshots__/EnumDeclaration1.test.ts.snap index 509ea4ed..0940b03f 100644 --- a/tests/cases/__tests__/__snapshots__/EnumDeclaration1.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/EnumDeclaration1.test.ts.snap @@ -9,8 +9,6 @@ Object { "EnumDeclaration-0": Object { "ApiKind": "enum", "IsConst": false, - "Kind": 232, - "KindString": "EnumDeclaration", "Location": Object { "Character": 0, "FileName": "./cases/EnumDeclaration1.ts", @@ -66,11 +64,13 @@ Object { "JSDocTags": Array [], }, "Name": "LogLevel", + "_ts": Object { + "Kind": 232, + "KindString": "EnumDeclaration", + }, }, "EnumMember-0": Object { "ApiKind": "enum-member", - "Kind": 267, - "KindString": "EnumMember", "Location": Object { "Character": 4, "FileName": "./cases/EnumDeclaration1.ts", @@ -83,11 +83,13 @@ Object { }, "Name": "None", "Value": "0", + "_ts": Object { + "Kind": 267, + "KindString": "EnumMember", + }, }, "EnumMember-1": Object { "ApiKind": "enum-member", - "Kind": 267, - "KindString": "EnumMember", "Location": Object { "Character": 4, "FileName": "./cases/EnumDeclaration1.ts", @@ -100,11 +102,13 @@ Object { }, "Name": "Critical", "Value": "1", + "_ts": Object { + "Kind": 267, + "KindString": "EnumMember", + }, }, "EnumMember-2": Object { "ApiKind": "enum-member", - "Kind": 267, - "KindString": "EnumMember", "Location": Object { "Character": 4, "FileName": "./cases/EnumDeclaration1.ts", @@ -117,11 +121,13 @@ Object { }, "Name": "Error", "Value": "2", + "_ts": Object { + "Kind": 267, + "KindString": "EnumMember", + }, }, "EnumMember-3": Object { "ApiKind": "enum-member", - "Kind": 267, - "KindString": "EnumMember", "Location": Object { "Character": 4, "FileName": "./cases/EnumDeclaration1.ts", @@ -134,11 +140,13 @@ Object { }, "Name": "Warning", "Value": "3", + "_ts": Object { + "Kind": 267, + "KindString": "EnumMember", + }, }, "EnumMember-4": Object { "ApiKind": "enum-member", - "Kind": 267, - "KindString": "EnumMember", "Location": Object { "Character": 4, "FileName": "./cases/EnumDeclaration1.ts", @@ -151,11 +159,13 @@ Object { }, "Name": "Information", "Value": "4", + "_ts": Object { + "Kind": 267, + "KindString": "EnumMember", + }, }, "EnumMember-5": Object { "ApiKind": "enum-member", - "Kind": 267, - "KindString": "EnumMember", "Location": Object { "Character": 4, "FileName": "./cases/EnumDeclaration1.ts", @@ -168,11 +178,13 @@ Object { }, "Name": "Debug", "Value": "5", + "_ts": Object { + "Kind": 267, + "KindString": "EnumMember", + }, }, "EnumMember-6": Object { "ApiKind": "enum-member", - "Kind": 267, - "KindString": "EnumMember", "Location": Object { "Character": 4, "FileName": "./cases/EnumDeclaration1.ts", @@ -185,11 +197,13 @@ Object { }, "Name": "Trace", "Value": "6", + "_ts": Object { + "Kind": 267, + "KindString": "EnumMember", + }, }, "SourceFile-0": Object { "ApiKind": "source-file", - "Kind": 268, - "KindString": "SourceFile", "Location": Object { "Character": 0, "FileName": "./cases/EnumDeclaration1.ts", @@ -209,6 +223,10 @@ Object { "JSDocTags": Array [], }, "Name": "EnumDeclaration1.ts", + "_ts": Object { + "Kind": 268, + "KindString": "SourceFile", + }, }, }, } diff --git a/tests/cases/__tests__/__snapshots__/EnumDeclaration2.test.ts.snap b/tests/cases/__tests__/__snapshots__/EnumDeclaration2.test.ts.snap index 8709cf14..49ec18a8 100644 --- a/tests/cases/__tests__/__snapshots__/EnumDeclaration2.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/EnumDeclaration2.test.ts.snap @@ -9,8 +9,6 @@ Object { "EnumDeclaration-0": Object { "ApiKind": "enum", "IsConst": false, - "Kind": 232, - "KindString": "EnumDeclaration", "Location": Object { "Character": 0, "FileName": "./cases/EnumDeclaration2.ts", @@ -66,11 +64,13 @@ Object { "JSDocTags": Array [], }, "Name": "LogLevel", + "_ts": Object { + "Kind": 232, + "KindString": "EnumDeclaration", + }, }, "EnumMember-0": Object { "ApiKind": "enum-member", - "Kind": 267, - "KindString": "EnumMember", "Location": Object { "Character": 4, "FileName": "./cases/EnumDeclaration2.ts", @@ -83,11 +83,13 @@ Object { }, "Name": "None", "Value": "0", + "_ts": Object { + "Kind": 267, + "KindString": "EnumMember", + }, }, "EnumMember-1": Object { "ApiKind": "enum-member", - "Kind": 267, - "KindString": "EnumMember", "Location": Object { "Character": 4, "FileName": "./cases/EnumDeclaration2.ts", @@ -101,11 +103,13 @@ or a catastrophic failure that requires immediate attention.", }, "Name": "Critical", "Value": "1 << 0", + "_ts": Object { + "Kind": 267, + "KindString": "EnumMember", + }, }, "EnumMember-2": Object { "ApiKind": "enum-member", - "Kind": 267, - "KindString": "EnumMember", "Location": Object { "Character": 4, "FileName": "./cases/EnumDeclaration2.ts", @@ -119,11 +123,13 @@ These should indicate a failure in the current activity, not an application-wide }, "Name": "Error", "Value": "1 << 1", + "_ts": Object { + "Kind": 267, + "KindString": "EnumMember", + }, }, "EnumMember-3": Object { "ApiKind": "enum-member", - "Kind": 267, - "KindString": "EnumMember", "Location": Object { "Character": 4, "FileName": "./cases/EnumDeclaration2.ts", @@ -137,11 +143,13 @@ but do not otherwise cause the application execution to stop.", }, "Name": "Warning", "Value": "1 << 2", + "_ts": Object { + "Kind": 267, + "KindString": "EnumMember", + }, }, "EnumMember-4": Object { "ApiKind": "enum-member", - "Kind": 267, - "KindString": "EnumMember", "Location": Object { "Character": 4, "FileName": "./cases/EnumDeclaration2.ts", @@ -154,11 +162,13 @@ but do not otherwise cause the application execution to stop.", }, "Name": "Information", "Value": "1 << 3", + "_ts": Object { + "Kind": 267, + "KindString": "EnumMember", + }, }, "EnumMember-5": Object { "ApiKind": "enum-member", - "Kind": 267, - "KindString": "EnumMember", "Location": Object { "Character": 4, "FileName": "./cases/EnumDeclaration2.ts", @@ -172,11 +182,13 @@ These logs should primarily contain information useful for debugging and have no }, "Name": "Debug", "Value": "1 << 4", + "_ts": Object { + "Kind": 267, + "KindString": "EnumMember", + }, }, "EnumMember-6": Object { "ApiKind": "enum-member", - "Kind": 267, - "KindString": "EnumMember", "Location": Object { "Character": 4, "FileName": "./cases/EnumDeclaration2.ts", @@ -190,11 +202,13 @@ These messages are disabled by default and should never be enabled in a producti }, "Name": "Trace", "Value": "1 << 5", + "_ts": Object { + "Kind": 267, + "KindString": "EnumMember", + }, }, "SourceFile-0": Object { "ApiKind": "source-file", - "Kind": 268, - "KindString": "SourceFile", "Location": Object { "Character": 0, "FileName": "./cases/EnumDeclaration2.ts", @@ -214,6 +228,10 @@ These messages are disabled by default and should never be enabled in a producti "JSDocTags": Array [], }, "Name": "EnumDeclaration2.ts", + "_ts": Object { + "Kind": 268, + "KindString": "SourceFile", + }, }, }, } diff --git a/tests/cases/__tests__/__snapshots__/EnumDeclaration3.test.ts.snap b/tests/cases/__tests__/__snapshots__/EnumDeclaration3.test.ts.snap index 6944e671..ddaa8bb7 100644 --- a/tests/cases/__tests__/__snapshots__/EnumDeclaration3.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/EnumDeclaration3.test.ts.snap @@ -9,8 +9,6 @@ Object { "EnumDeclaration-0": Object { "ApiKind": "enum", "IsConst": false, - "Kind": 232, - "KindString": "EnumDeclaration", "Location": Object { "Character": 0, "FileName": "./cases/EnumDeclaration3.ts", @@ -66,11 +64,13 @@ Object { "JSDocTags": Array [], }, "Name": "LogLevel", + "_ts": Object { + "Kind": 232, + "KindString": "EnumDeclaration", + }, }, "EnumMember-0": Object { "ApiKind": "enum-member", - "Kind": 267, - "KindString": "EnumMember", "Location": Object { "Character": 4, "FileName": "./cases/EnumDeclaration3.ts", @@ -83,11 +83,13 @@ Object { }, "Name": "None", "Value": "\\"none\\"", + "_ts": Object { + "Kind": 267, + "KindString": "EnumMember", + }, }, "EnumMember-1": Object { "ApiKind": "enum-member", - "Kind": 267, - "KindString": "EnumMember", "Location": Object { "Character": 4, "FileName": "./cases/EnumDeclaration3.ts", @@ -101,11 +103,13 @@ or a catastrophic failure that requires immediate attention.", }, "Name": "Critical", "Value": "\\"critical\\"", + "_ts": Object { + "Kind": 267, + "KindString": "EnumMember", + }, }, "EnumMember-2": Object { "ApiKind": "enum-member", - "Kind": 267, - "KindString": "EnumMember", "Location": Object { "Character": 4, "FileName": "./cases/EnumDeclaration3.ts", @@ -119,11 +123,13 @@ These should indicate a failure in the current activity, not an application-wide }, "Name": "Error", "Value": "\\"error\\"", + "_ts": Object { + "Kind": 267, + "KindString": "EnumMember", + }, }, "EnumMember-3": Object { "ApiKind": "enum-member", - "Kind": 267, - "KindString": "EnumMember", "Location": Object { "Character": 4, "FileName": "./cases/EnumDeclaration3.ts", @@ -137,11 +143,13 @@ but do not otherwise cause the application execution to stop.", }, "Name": "Warning", "Value": "\\"warning\\"", + "_ts": Object { + "Kind": 267, + "KindString": "EnumMember", + }, }, "EnumMember-4": Object { "ApiKind": "enum-member", - "Kind": 267, - "KindString": "EnumMember", "Location": Object { "Character": 4, "FileName": "./cases/EnumDeclaration3.ts", @@ -154,11 +162,13 @@ but do not otherwise cause the application execution to stop.", }, "Name": "Information", "Value": "\\"information\\"", + "_ts": Object { + "Kind": 267, + "KindString": "EnumMember", + }, }, "EnumMember-5": Object { "ApiKind": "enum-member", - "Kind": 267, - "KindString": "EnumMember", "Location": Object { "Character": 4, "FileName": "./cases/EnumDeclaration3.ts", @@ -172,11 +182,13 @@ These logs should primarily contain information useful for debugging and have no }, "Name": "Debug", "Value": "\\"debug\\"", + "_ts": Object { + "Kind": 267, + "KindString": "EnumMember", + }, }, "EnumMember-6": Object { "ApiKind": "enum-member", - "Kind": 267, - "KindString": "EnumMember", "Location": Object { "Character": 4, "FileName": "./cases/EnumDeclaration3.ts", @@ -190,11 +202,13 @@ These messages are disabled by default and should never be enabled in a producti }, "Name": "Trace", "Value": "\\"trace\\"", + "_ts": Object { + "Kind": 267, + "KindString": "EnumMember", + }, }, "SourceFile-0": Object { "ApiKind": "source-file", - "Kind": 268, - "KindString": "SourceFile", "Location": Object { "Character": 0, "FileName": "./cases/EnumDeclaration3.ts", @@ -214,6 +228,10 @@ These messages are disabled by default and should never be enabled in a producti "JSDocTags": Array [], }, "Name": "EnumDeclaration3.ts", + "_ts": Object { + "Kind": 268, + "KindString": "SourceFile", + }, }, }, } diff --git a/tests/cases/__tests__/__snapshots__/EnumDeclaration4.test.ts.snap b/tests/cases/__tests__/__snapshots__/EnumDeclaration4.test.ts.snap index 5dab5eef..bf64558c 100644 --- a/tests/cases/__tests__/__snapshots__/EnumDeclaration4.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/EnumDeclaration4.test.ts.snap @@ -9,8 +9,6 @@ Object { "EnumDeclaration-0": Object { "ApiKind": "enum", "IsConst": true, - "Kind": 232, - "KindString": "EnumDeclaration", "Location": Object { "Character": 0, "FileName": "./cases/EnumDeclaration4.ts", @@ -66,11 +64,13 @@ Object { "JSDocTags": Array [], }, "Name": "LogLevel", + "_ts": Object { + "Kind": 232, + "KindString": "EnumDeclaration", + }, }, "EnumMember-0": Object { "ApiKind": "enum-member", - "Kind": 267, - "KindString": "EnumMember", "Location": Object { "Character": 4, "FileName": "./cases/EnumDeclaration4.ts", @@ -83,11 +83,13 @@ Object { }, "Name": "None", "Value": "0", + "_ts": Object { + "Kind": 267, + "KindString": "EnumMember", + }, }, "EnumMember-1": Object { "ApiKind": "enum-member", - "Kind": 267, - "KindString": "EnumMember", "Location": Object { "Character": 4, "FileName": "./cases/EnumDeclaration4.ts", @@ -100,11 +102,13 @@ Object { }, "Name": "Critical", "Value": "1", + "_ts": Object { + "Kind": 267, + "KindString": "EnumMember", + }, }, "EnumMember-2": Object { "ApiKind": "enum-member", - "Kind": 267, - "KindString": "EnumMember", "Location": Object { "Character": 4, "FileName": "./cases/EnumDeclaration4.ts", @@ -117,11 +121,13 @@ Object { }, "Name": "Error", "Value": "2", + "_ts": Object { + "Kind": 267, + "KindString": "EnumMember", + }, }, "EnumMember-3": Object { "ApiKind": "enum-member", - "Kind": 267, - "KindString": "EnumMember", "Location": Object { "Character": 4, "FileName": "./cases/EnumDeclaration4.ts", @@ -134,11 +140,13 @@ Object { }, "Name": "Warning", "Value": "3", + "_ts": Object { + "Kind": 267, + "KindString": "EnumMember", + }, }, "EnumMember-4": Object { "ApiKind": "enum-member", - "Kind": 267, - "KindString": "EnumMember", "Location": Object { "Character": 4, "FileName": "./cases/EnumDeclaration4.ts", @@ -151,11 +159,13 @@ Object { }, "Name": "Information", "Value": "4", + "_ts": Object { + "Kind": 267, + "KindString": "EnumMember", + }, }, "EnumMember-5": Object { "ApiKind": "enum-member", - "Kind": 267, - "KindString": "EnumMember", "Location": Object { "Character": 4, "FileName": "./cases/EnumDeclaration4.ts", @@ -168,11 +178,13 @@ Object { }, "Name": "Debug", "Value": "5", + "_ts": Object { + "Kind": 267, + "KindString": "EnumMember", + }, }, "EnumMember-6": Object { "ApiKind": "enum-member", - "Kind": 267, - "KindString": "EnumMember", "Location": Object { "Character": 4, "FileName": "./cases/EnumDeclaration4.ts", @@ -185,11 +197,13 @@ Object { }, "Name": "Trace", "Value": "6", + "_ts": Object { + "Kind": 267, + "KindString": "EnumMember", + }, }, "SourceFile-0": Object { "ApiKind": "source-file", - "Kind": 268, - "KindString": "SourceFile", "Location": Object { "Character": 0, "FileName": "./cases/EnumDeclaration4.ts", @@ -209,6 +223,10 @@ Object { "JSDocTags": Array [], }, "Name": "EnumDeclaration4.ts", + "_ts": Object { + "Kind": 268, + "KindString": "SourceFile", + }, }, }, } diff --git a/tests/cases/__tests__/__snapshots__/ExportDeclaration1.test.ts.snap b/tests/cases/__tests__/__snapshots__/ExportDeclaration1.test.ts.snap index caea2f40..40869228 100644 --- a/tests/cases/__tests__/__snapshots__/ExportDeclaration1.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/ExportDeclaration1.test.ts.snap @@ -11,8 +11,6 @@ Object { "Extends": undefined, "Implements": Array [], "IsAbstract": false, - "Kind": 229, - "KindString": "ClassDeclaration", "Location": Object { "Character": 0, "FileName": "./cases/ClassDeclaration1.ts", @@ -64,12 +62,14 @@ Object { }, "Name": "FooClass", "TypeParameters": Array [], + "_ts": Object { + "Kind": 229, + "KindString": "ClassDeclaration", + }, }, "ExportDeclaration-0": Object { "ApiKind": "export", "ExportPath": "./cases/ClassDeclaration1.ts", - "Kind": 244, - "KindString": "ExportDeclaration", "Location": Object { "Character": 0, "FileName": "./cases/ExportDeclaration1.ts", @@ -82,6 +82,10 @@ Object { }, "Name": "__export", "SourceFileId": "SourceFile-1", + "_ts": Object { + "Kind": 244, + "KindString": "ExportDeclaration", + }, }, "MethodDeclaration-0": Object { "AccessModifier": "protected", @@ -91,8 +95,6 @@ Object { "IsOptional": true, "IsOverloadBase": false, "IsStatic": false, - "Kind": 151, - "KindString": "MethodDeclaration", "Location": Object { "Character": 4, "FileName": "./cases/ClassDeclaration1.ts", @@ -122,6 +124,10 @@ Object { "Text": "void", }, "TypeParameters": Array [], + "_ts": Object { + "Kind": 151, + "KindString": "MethodDeclaration", + }, }, "MethodDeclaration-1": Object { "AccessModifier": "public", @@ -131,8 +137,6 @@ Object { "IsOptional": false, "IsOverloadBase": false, "IsStatic": false, - "Kind": 151, - "KindString": "MethodDeclaration", "Location": Object { "Character": 4, "FileName": "./cases/ClassDeclaration1.ts", @@ -164,6 +168,10 @@ GetFoo without A parameter comment line.", "Text": "string", }, "TypeParameters": Array [], + "_ts": Object { + "Kind": 151, + "KindString": "MethodDeclaration", + }, }, "MethodDeclaration-2": Object { "AccessModifier": "public", @@ -173,8 +181,6 @@ GetFoo without A parameter comment line.", "IsOptional": false, "IsOverloadBase": false, "IsStatic": false, - "Kind": 151, - "KindString": "MethodDeclaration", "Location": Object { "Character": 4, "FileName": "./cases/ClassDeclaration1.ts", @@ -206,6 +212,10 @@ GetFoo without A parameter comment line.", "Text": "string", }, "TypeParameters": Array [], + "_ts": Object { + "Kind": 151, + "KindString": "MethodDeclaration", + }, }, "MethodDeclaration-3": Object { "AccessModifier": "public", @@ -215,8 +225,6 @@ GetFoo without A parameter comment line.", "IsOptional": false, "IsOverloadBase": true, "IsStatic": false, - "Kind": 151, - "KindString": "MethodDeclaration", "Location": Object { "Character": 4, "FileName": "./cases/ClassDeclaration1.ts", @@ -248,6 +256,10 @@ GetFoo without A parameter comment line.", "Text": "string", }, "TypeParameters": Array [], + "_ts": Object { + "Kind": 151, + "KindString": "MethodDeclaration", + }, }, "MethodDeclaration-4": Object { "AccessModifier": "public", @@ -257,8 +269,6 @@ GetFoo without A parameter comment line.", "IsOptional": true, "IsOverloadBase": false, "IsStatic": false, - "Kind": 151, - "KindString": "MethodDeclaration", "Location": Object { "Character": 4, "FileName": "./cases/ClassDeclaration1.ts", @@ -291,14 +301,16 @@ GetFoo without A parameter comment line.", "Text": "Promise", }, "TypeParameters": Array [], + "_ts": Object { + "Kind": 151, + "KindString": "MethodDeclaration", + }, }, "Parameter-0": Object { "ApiKind": "parameter", "Initializer": undefined, "IsOptional": true, "IsSpread": false, - "Kind": 146, - "KindString": "Parameter", "Location": Object { "Character": 22, "FileName": "./cases/ClassDeclaration1.ts", @@ -319,14 +331,16 @@ GetFoo without A parameter comment line.", "ReferenceId": undefined, "Text": "string", }, + "_ts": Object { + "Kind": 146, + "KindString": "Parameter", + }, }, "Parameter-1": Object { "ApiKind": "parameter", "Initializer": undefined, "IsOptional": false, "IsSpread": false, - "Kind": 146, - "KindString": "Parameter", "Location": Object { "Character": 18, "FileName": "./cases/ClassDeclaration1.ts", @@ -347,14 +361,16 @@ GetFoo without A parameter comment line.", "ReferenceId": undefined, "Text": "string", }, + "_ts": Object { + "Kind": 146, + "KindString": "Parameter", + }, }, "Parameter-2": Object { "ApiKind": "parameter", "Initializer": undefined, "IsOptional": false, "IsSpread": false, - "Kind": 146, - "KindString": "Parameter", "Location": Object { "Character": 18, "FileName": "./cases/ClassDeclaration1.ts", @@ -394,14 +410,16 @@ GetFoo without A parameter comment line.", }, ], }, + "_ts": Object { + "Kind": 146, + "KindString": "Parameter", + }, }, "Parameter-3": Object { "ApiKind": "parameter", "Initializer": undefined, "IsOptional": false, "IsSpread": false, - "Kind": 146, - "KindString": "Parameter", "Location": Object { "Character": 18, "FileName": "./cases/ClassDeclaration1.ts", @@ -450,6 +468,10 @@ GetFoo without A parameter comment line.", }, ], }, + "_ts": Object { + "Kind": 146, + "KindString": "Parameter", + }, }, "PropertyDeclaration-0": Object { "AccessModifier": "public", @@ -458,8 +480,6 @@ GetFoo without A parameter comment line.", "IsOptional": false, "IsReadonly": true, "IsStatic": false, - "Kind": 149, - "KindString": "PropertyDeclaration", "Location": Object { "Character": 4, "FileName": "./cases/ClassDeclaration1.ts", @@ -485,6 +505,10 @@ GetFoo without A parameter comment line.", "ReferenceId": undefined, "Text": "string", }, + "_ts": Object { + "Kind": 149, + "KindString": "PropertyDeclaration", + }, }, "PropertyDeclaration-1": Object { "AccessModifier": "public", @@ -493,8 +517,6 @@ GetFoo without A parameter comment line.", "IsOptional": false, "IsReadonly": false, "IsStatic": true, - "Kind": 149, - "KindString": "PropertyDeclaration", "Location": Object { "Character": 4, "FileName": "./cases/ClassDeclaration1.ts", @@ -515,11 +537,13 @@ GetFoo without A parameter comment line.", "ReferenceId": undefined, "Text": "string", }, + "_ts": Object { + "Kind": 149, + "KindString": "PropertyDeclaration", + }, }, "SourceFile-0": Object { "ApiKind": "source-file", - "Kind": 268, - "KindString": "SourceFile", "Location": Object { "Character": 0, "FileName": "./cases/ExportDeclaration1.ts", @@ -539,11 +563,13 @@ GetFoo without A parameter comment line.", "JSDocTags": Array [], }, "Name": "ExportDeclaration1.ts", + "_ts": Object { + "Kind": 268, + "KindString": "SourceFile", + }, }, "SourceFile-1": Object { "ApiKind": "source-file", - "Kind": 268, - "KindString": "SourceFile", "Location": Object { "Character": 0, "FileName": "./cases/ClassDeclaration1.ts", @@ -563,6 +589,10 @@ GetFoo without A parameter comment line.", "JSDocTags": Array [], }, "Name": "ClassDeclaration1.ts", + "_ts": Object { + "Kind": 268, + "KindString": "SourceFile", + }, }, }, } diff --git a/tests/cases/__tests__/__snapshots__/ExportDeclaration2.test.ts.snap b/tests/cases/__tests__/__snapshots__/ExportDeclaration2.test.ts.snap index 3260d0c7..a0b2e4ad 100644 --- a/tests/cases/__tests__/__snapshots__/ExportDeclaration2.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/ExportDeclaration2.test.ts.snap @@ -9,8 +9,6 @@ Object { "ExportDeclaration-0": Object { "ApiKind": "export", "ExportPath": undefined, - "Kind": 244, - "KindString": "ExportDeclaration", "Location": Object { "Character": 0, "FileName": "./cases/ExportDeclaration2.ts", @@ -23,11 +21,13 @@ Object { }, "Name": "__export", "SourceFileId": undefined, + "_ts": Object { + "Kind": 244, + "KindString": "ExportDeclaration", + }, }, "SourceFile-0": Object { "ApiKind": "source-file", - "Kind": 268, - "KindString": "SourceFile", "Location": Object { "Character": 0, "FileName": "./cases/ExportDeclaration2.ts", @@ -47,6 +47,10 @@ Object { "JSDocTags": Array [], }, "Name": "ExportDeclaration2.ts", + "_ts": Object { + "Kind": 268, + "KindString": "SourceFile", + }, }, }, } diff --git a/tests/cases/__tests__/__snapshots__/ExportSpecifier1.test.ts.snap b/tests/cases/__tests__/__snapshots__/ExportSpecifier1.test.ts.snap index 3231d4c1..ea004578 100644 --- a/tests/cases/__tests__/__snapshots__/ExportSpecifier1.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/ExportSpecifier1.test.ts.snap @@ -11,8 +11,6 @@ Object { "Extends": undefined, "Implements": Array [], "IsAbstract": true, - "Kind": 229, - "KindString": "ClassDeclaration", "Location": Object { "Character": 0, "FileName": "./cases/ClassDeclaration2.ts", @@ -57,14 +55,16 @@ Object { }, "Name": "Foo", "TypeParameters": Array [], + "_ts": Object { + "Kind": 229, + "KindString": "ClassDeclaration", + }, }, "ExportSpecifier-0": Object { "ApiItems": Array [ "ClassDeclaration-0", ], "ApiKind": "export-specifier", - "Kind": 246, - "KindString": "ExportSpecifier", "Location": Object { "Character": 9, "FileName": "./cases/ExportSpecifier1.ts", @@ -76,6 +76,10 @@ Object { "JSDocTags": Array [], }, "Name": "Foo", + "_ts": Object { + "Kind": 246, + "KindString": "ExportSpecifier", + }, }, "MethodDeclaration-0": Object { "AccessModifier": "protected", @@ -85,8 +89,6 @@ Object { "IsOptional": false, "IsOverloadBase": false, "IsStatic": false, - "Kind": 151, - "KindString": "MethodDeclaration", "Location": Object { "Character": 4, "FileName": "./cases/ClassDeclaration2.ts", @@ -116,6 +118,10 @@ Object { "Text": "void", }, "TypeParameters": Array [], + "_ts": Object { + "Kind": 151, + "KindString": "MethodDeclaration", + }, }, "MethodDeclaration-1": Object { "AccessModifier": "public", @@ -125,8 +131,6 @@ Object { "IsOptional": false, "IsOverloadBase": false, "IsStatic": false, - "Kind": 151, - "KindString": "MethodDeclaration", "Location": Object { "Character": 4, "FileName": "./cases/ClassDeclaration2.ts", @@ -149,14 +153,16 @@ Object { "Text": "string", }, "TypeParameters": Array [], + "_ts": Object { + "Kind": 151, + "KindString": "MethodDeclaration", + }, }, "Parameter-0": Object { "ApiKind": "parameter", "Initializer": undefined, "IsOptional": false, "IsSpread": false, - "Kind": 146, - "KindString": "Parameter", "Location": Object { "Character": 30, "FileName": "./cases/ClassDeclaration2.ts", @@ -177,6 +183,10 @@ Object { "ReferenceId": undefined, "Text": "string", }, + "_ts": Object { + "Kind": 146, + "KindString": "Parameter", + }, }, "PropertyDeclaration-0": Object { "AccessModifier": "private", @@ -185,8 +195,6 @@ Object { "IsOptional": false, "IsReadonly": false, "IsStatic": false, - "Kind": 149, - "KindString": "PropertyDeclaration", "Location": Object { "Character": 4, "FileName": "./cases/ClassDeclaration2.ts", @@ -207,6 +215,10 @@ Object { "ReferenceId": undefined, "Text": "string", }, + "_ts": Object { + "Kind": 149, + "KindString": "PropertyDeclaration", + }, }, "PropertyDeclaration-1": Object { "AccessModifier": "public", @@ -215,8 +227,6 @@ Object { "IsOptional": false, "IsReadonly": true, "IsStatic": false, - "Kind": 149, - "KindString": "PropertyDeclaration", "Location": Object { "Character": 4, "FileName": "./cases/ClassDeclaration2.ts", @@ -237,6 +247,10 @@ Object { "ReferenceId": undefined, "Text": "string", }, + "_ts": Object { + "Kind": 149, + "KindString": "PropertyDeclaration", + }, }, "PropertyDeclaration-2": Object { "AccessModifier": "public", @@ -245,8 +259,6 @@ Object { "IsOptional": false, "IsReadonly": false, "IsStatic": true, - "Kind": 149, - "KindString": "PropertyDeclaration", "Location": Object { "Character": 4, "FileName": "./cases/ClassDeclaration2.ts", @@ -267,11 +279,13 @@ Object { "ReferenceId": undefined, "Text": "string", }, + "_ts": Object { + "Kind": 149, + "KindString": "PropertyDeclaration", + }, }, "SourceFile-0": Object { "ApiKind": "source-file", - "Kind": 268, - "KindString": "SourceFile", "Location": Object { "Character": 0, "FileName": "./cases/ExportSpecifier1.ts", @@ -291,6 +305,10 @@ Object { "JSDocTags": Array [], }, "Name": "ExportSpecifier1.ts", + "_ts": Object { + "Kind": 268, + "KindString": "SourceFile", + }, }, }, } diff --git a/tests/cases/__tests__/__snapshots__/ExportSpecifier2.test.ts.snap b/tests/cases/__tests__/__snapshots__/ExportSpecifier2.test.ts.snap index 54152bed..fe845a57 100644 --- a/tests/cases/__tests__/__snapshots__/ExportSpecifier2.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/ExportSpecifier2.test.ts.snap @@ -11,8 +11,6 @@ Object { "InterfaceDeclaration-0", ], "ApiKind": "export-specifier", - "Kind": 246, - "KindString": "ExportSpecifier", "Location": Object { "Character": 9, "FileName": "./cases/ExportSpecifier2.ts", @@ -24,14 +22,16 @@ Object { "JSDocTags": Array [], }, "Name": "Foo", + "_ts": Object { + "Kind": 246, + "KindString": "ExportSpecifier", + }, }, "ExportSpecifier-1": Object { "ApiItems": Array [ "InterfaceDeclaration-1", ], "ApiKind": "export-specifier", - "Kind": 246, - "KindString": "ExportSpecifier", "Location": Object { "Character": 14, "FileName": "./cases/ExportSpecifier2.ts", @@ -43,12 +43,14 @@ Object { "JSDocTags": Array [], }, "Name": "Foo2", + "_ts": Object { + "Kind": 246, + "KindString": "ExportSpecifier", + }, }, "InterfaceDeclaration-0": Object { "ApiKind": "interface", "Extends": Array [], - "Kind": 230, - "KindString": "InterfaceDeclaration", "Location": Object { "Character": 0, "FileName": "./cases/ClassDeclaration4.ts", @@ -69,12 +71,14 @@ Object { }, "Name": "Foo", "TypeParameters": Array [], + "_ts": Object { + "Kind": 230, + "KindString": "InterfaceDeclaration", + }, }, "InterfaceDeclaration-1": Object { "ApiKind": "interface", "Extends": Array [], - "Kind": 230, - "KindString": "InterfaceDeclaration", "Location": Object { "Character": 0, "FileName": "./cases/ClassDeclaration4.ts", @@ -95,13 +99,15 @@ Object { }, "Name": "Foo2", "TypeParameters": Array [], + "_ts": Object { + "Kind": 230, + "KindString": "InterfaceDeclaration", + }, }, "PropertySignature-0": Object { "ApiKind": "property", "IsOptional": false, "IsReadonly": false, - "Kind": 148, - "KindString": "PropertySignature", "Location": Object { "Character": 4, "FileName": "./cases/ClassDeclaration4.ts", @@ -122,13 +128,15 @@ Object { "ReferenceId": undefined, "Text": "string", }, + "_ts": Object { + "Kind": 148, + "KindString": "PropertySignature", + }, }, "PropertySignature-1": Object { "ApiKind": "property", "IsOptional": false, "IsReadonly": false, - "Kind": 148, - "KindString": "PropertySignature", "Location": Object { "Character": 4, "FileName": "./cases/ClassDeclaration4.ts", @@ -149,11 +157,13 @@ Object { "ReferenceId": undefined, "Text": "string", }, + "_ts": Object { + "Kind": 148, + "KindString": "PropertySignature", + }, }, "SourceFile-0": Object { "ApiKind": "source-file", - "Kind": 268, - "KindString": "SourceFile", "Location": Object { "Character": 0, "FileName": "./cases/ExportSpecifier2.ts", @@ -179,6 +189,10 @@ Object { "JSDocTags": Array [], }, "Name": "ExportSpecifier2.ts", + "_ts": Object { + "Kind": 268, + "KindString": "SourceFile", + }, }, }, } diff --git a/tests/cases/__tests__/__snapshots__/ExportSpecifier3.test.ts.snap b/tests/cases/__tests__/__snapshots__/ExportSpecifier3.test.ts.snap index b9f44cc7..b8b76a28 100644 --- a/tests/cases/__tests__/__snapshots__/ExportSpecifier3.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/ExportSpecifier3.test.ts.snap @@ -30,8 +30,6 @@ Object { }, ], "IsAbstract": false, - "Kind": 229, - "KindString": "ClassDeclaration", "Location": Object { "Character": 0, "FileName": "./cases/ClassDeclaration4.ts", @@ -58,14 +56,16 @@ Object { }, "Name": "FooClass", "TypeParameters": Array [], + "_ts": Object { + "Kind": 229, + "KindString": "ClassDeclaration", + }, }, "ExportSpecifier-0": Object { "ApiItems": Array [ "ClassDeclaration-0", ], "ApiKind": "export-specifier", - "Kind": 246, - "KindString": "ExportSpecifier", "Location": Object { "Character": 9, "FileName": "./cases/ExportSpecifier3.ts", @@ -77,14 +77,16 @@ Object { "JSDocTags": Array [], }, "Name": "Bar", + "_ts": Object { + "Kind": 246, + "KindString": "ExportSpecifier", + }, }, "ExportSpecifier-1": Object { "ApiItems": Array [ "ClassDeclaration-0", ], "ApiKind": "export-specifier", - "Kind": 246, - "KindString": "ExportSpecifier", "Location": Object { "Character": 9, "FileName": "./cases/ExportSpecifier3.ts", @@ -96,12 +98,14 @@ Object { "JSDocTags": Array [], }, "Name": "FooClass", + "_ts": Object { + "Kind": 246, + "KindString": "ExportSpecifier", + }, }, "InterfaceDeclaration-0": Object { "ApiKind": "interface", "Extends": Array [], - "Kind": 230, - "KindString": "InterfaceDeclaration", "Location": Object { "Character": 0, "FileName": "./cases/ClassDeclaration4.ts", @@ -122,12 +126,14 @@ Object { }, "Name": "Foo", "TypeParameters": Array [], + "_ts": Object { + "Kind": 230, + "KindString": "InterfaceDeclaration", + }, }, "InterfaceDeclaration-1": Object { "ApiKind": "interface", "Extends": Array [], - "Kind": 230, - "KindString": "InterfaceDeclaration", "Location": Object { "Character": 0, "FileName": "./cases/ClassDeclaration4.ts", @@ -148,6 +154,10 @@ Object { }, "Name": "Foo2", "TypeParameters": Array [], + "_ts": Object { + "Kind": 230, + "KindString": "InterfaceDeclaration", + }, }, "PropertyDeclaration-0": Object { "AccessModifier": "public", @@ -156,8 +166,6 @@ Object { "IsOptional": false, "IsReadonly": false, "IsStatic": false, - "Kind": 149, - "KindString": "PropertyDeclaration", "Location": Object { "Character": 4, "FileName": "./cases/ClassDeclaration4.ts", @@ -178,6 +186,10 @@ Object { "ReferenceId": undefined, "Text": "string", }, + "_ts": Object { + "Kind": 149, + "KindString": "PropertyDeclaration", + }, }, "PropertyDeclaration-1": Object { "AccessModifier": "public", @@ -186,8 +198,6 @@ Object { "IsOptional": false, "IsReadonly": false, "IsStatic": false, - "Kind": 149, - "KindString": "PropertyDeclaration", "Location": Object { "Character": 4, "FileName": "./cases/ClassDeclaration4.ts", @@ -208,13 +218,15 @@ Object { "ReferenceId": undefined, "Text": "string", }, + "_ts": Object { + "Kind": 149, + "KindString": "PropertyDeclaration", + }, }, "PropertySignature-0": Object { "ApiKind": "property", "IsOptional": false, "IsReadonly": false, - "Kind": 148, - "KindString": "PropertySignature", "Location": Object { "Character": 4, "FileName": "./cases/ClassDeclaration4.ts", @@ -235,13 +247,15 @@ Object { "ReferenceId": undefined, "Text": "string", }, + "_ts": Object { + "Kind": 148, + "KindString": "PropertySignature", + }, }, "PropertySignature-1": Object { "ApiKind": "property", "IsOptional": false, "IsReadonly": false, - "Kind": 148, - "KindString": "PropertySignature", "Location": Object { "Character": 4, "FileName": "./cases/ClassDeclaration4.ts", @@ -262,11 +276,13 @@ Object { "ReferenceId": undefined, "Text": "string", }, + "_ts": Object { + "Kind": 148, + "KindString": "PropertySignature", + }, }, "SourceFile-0": Object { "ApiKind": "source-file", - "Kind": 268, - "KindString": "SourceFile", "Location": Object { "Character": 0, "FileName": "./cases/ExportSpecifier3.ts", @@ -292,6 +308,10 @@ Object { "JSDocTags": Array [], }, "Name": "ExportSpecifier3.ts", + "_ts": Object { + "Kind": 268, + "KindString": "SourceFile", + }, }, }, } diff --git a/tests/cases/__tests__/__snapshots__/ExportSpecifier4.test.ts.snap b/tests/cases/__tests__/__snapshots__/ExportSpecifier4.test.ts.snap index a546d172..0dd72435 100644 --- a/tests/cases/__tests__/__snapshots__/ExportSpecifier4.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/ExportSpecifier4.test.ts.snap @@ -11,8 +11,6 @@ Object { "Extends": undefined, "Implements": Array [], "IsAbstract": true, - "Kind": 229, - "KindString": "ClassDeclaration", "Location": Object { "Character": 0, "FileName": "./cases/ClassDeclaration2.ts", @@ -57,14 +55,16 @@ Object { }, "Name": "Foo", "TypeParameters": Array [], + "_ts": Object { + "Kind": 229, + "KindString": "ClassDeclaration", + }, }, "ExportSpecifier-0": Object { "ApiItems": Array [ "ClassDeclaration-0", ], "ApiKind": "export-specifier", - "Kind": 246, - "KindString": "ExportSpecifier", "Location": Object { "Character": 9, "FileName": "./cases/ExportSpecifier4.ts", @@ -76,12 +76,14 @@ Object { "JSDocTags": Array [], }, "Name": "Foo", + "_ts": Object { + "Kind": 246, + "KindString": "ExportSpecifier", + }, }, "ExportSpecifier-1": Object { "ApiItems": undefined, "ApiKind": "export-specifier", - "Kind": 246, - "KindString": "ExportSpecifier", "Location": Object { "Character": 9, "FileName": "./cases/ExportSpecifier4.ts", @@ -93,6 +95,10 @@ Object { "JSDocTags": Array [], }, "Name": "NotValid", + "_ts": Object { + "Kind": 246, + "KindString": "ExportSpecifier", + }, }, "MethodDeclaration-0": Object { "AccessModifier": "protected", @@ -102,8 +108,6 @@ Object { "IsOptional": false, "IsOverloadBase": false, "IsStatic": false, - "Kind": 151, - "KindString": "MethodDeclaration", "Location": Object { "Character": 4, "FileName": "./cases/ClassDeclaration2.ts", @@ -133,6 +137,10 @@ Object { "Text": "void", }, "TypeParameters": Array [], + "_ts": Object { + "Kind": 151, + "KindString": "MethodDeclaration", + }, }, "MethodDeclaration-1": Object { "AccessModifier": "public", @@ -142,8 +150,6 @@ Object { "IsOptional": false, "IsOverloadBase": false, "IsStatic": false, - "Kind": 151, - "KindString": "MethodDeclaration", "Location": Object { "Character": 4, "FileName": "./cases/ClassDeclaration2.ts", @@ -166,14 +172,16 @@ Object { "Text": "string", }, "TypeParameters": Array [], + "_ts": Object { + "Kind": 151, + "KindString": "MethodDeclaration", + }, }, "Parameter-0": Object { "ApiKind": "parameter", "Initializer": undefined, "IsOptional": false, "IsSpread": false, - "Kind": 146, - "KindString": "Parameter", "Location": Object { "Character": 30, "FileName": "./cases/ClassDeclaration2.ts", @@ -194,6 +202,10 @@ Object { "ReferenceId": undefined, "Text": "string", }, + "_ts": Object { + "Kind": 146, + "KindString": "Parameter", + }, }, "PropertyDeclaration-0": Object { "AccessModifier": "private", @@ -202,8 +214,6 @@ Object { "IsOptional": false, "IsReadonly": false, "IsStatic": false, - "Kind": 149, - "KindString": "PropertyDeclaration", "Location": Object { "Character": 4, "FileName": "./cases/ClassDeclaration2.ts", @@ -224,6 +234,10 @@ Object { "ReferenceId": undefined, "Text": "string", }, + "_ts": Object { + "Kind": 149, + "KindString": "PropertyDeclaration", + }, }, "PropertyDeclaration-1": Object { "AccessModifier": "public", @@ -232,8 +246,6 @@ Object { "IsOptional": false, "IsReadonly": true, "IsStatic": false, - "Kind": 149, - "KindString": "PropertyDeclaration", "Location": Object { "Character": 4, "FileName": "./cases/ClassDeclaration2.ts", @@ -254,6 +266,10 @@ Object { "ReferenceId": undefined, "Text": "string", }, + "_ts": Object { + "Kind": 149, + "KindString": "PropertyDeclaration", + }, }, "PropertyDeclaration-2": Object { "AccessModifier": "public", @@ -262,8 +278,6 @@ Object { "IsOptional": false, "IsReadonly": false, "IsStatic": true, - "Kind": 149, - "KindString": "PropertyDeclaration", "Location": Object { "Character": 4, "FileName": "./cases/ClassDeclaration2.ts", @@ -284,11 +298,13 @@ Object { "ReferenceId": undefined, "Text": "string", }, + "_ts": Object { + "Kind": 149, + "KindString": "PropertyDeclaration", + }, }, "SourceFile-0": Object { "ApiKind": "source-file", - "Kind": 268, - "KindString": "SourceFile", "Location": Object { "Character": 0, "FileName": "./cases/ExportSpecifier4.ts", @@ -314,6 +330,10 @@ Object { "JSDocTags": Array [], }, "Name": "ExportSpecifier4.ts", + "_ts": Object { + "Kind": 268, + "KindString": "SourceFile", + }, }, }, } diff --git a/tests/cases/__tests__/__snapshots__/FunctionDeclaration1.test.ts.snap b/tests/cases/__tests__/__snapshots__/FunctionDeclaration1.test.ts.snap index 627f036e..887bf562 100644 --- a/tests/cases/__tests__/__snapshots__/FunctionDeclaration1.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/FunctionDeclaration1.test.ts.snap @@ -10,8 +10,6 @@ Object { "ApiKind": "function", "IsAsync": false, "IsOverloadBase": false, - "Kind": 228, - "KindString": "FunctionDeclaration", "Location": Object { "Character": 0, "FileName": "./cases/FunctionDeclaration1.ts", @@ -34,11 +32,13 @@ Object { "Text": "string", }, "TypeParameters": Array [], + "_ts": Object { + "Kind": 228, + "KindString": "FunctionDeclaration", + }, }, "SourceFile-0": Object { "ApiKind": "source-file", - "Kind": 268, - "KindString": "SourceFile", "Location": Object { "Character": 0, "FileName": "./cases/FunctionDeclaration1.ts", @@ -58,6 +58,10 @@ Object { "JSDocTags": Array [], }, "Name": "FunctionDeclaration1.ts", + "_ts": Object { + "Kind": 268, + "KindString": "SourceFile", + }, }, }, } diff --git a/tests/cases/__tests__/__snapshots__/FunctionDeclaration2.test.ts.snap b/tests/cases/__tests__/__snapshots__/FunctionDeclaration2.test.ts.snap index df771cf3..54992c11 100644 --- a/tests/cases/__tests__/__snapshots__/FunctionDeclaration2.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/FunctionDeclaration2.test.ts.snap @@ -10,8 +10,6 @@ Object { "ApiKind": "function", "IsAsync": false, "IsOverloadBase": false, - "Kind": 228, - "KindString": "FunctionDeclaration", "Location": Object { "Character": 0, "FileName": "./cases/FunctionDeclaration2.ts", @@ -48,14 +46,16 @@ Object { ], }, ], + "_ts": Object { + "Kind": 228, + "KindString": "FunctionDeclaration", + }, }, "Parameter-0": Object { "ApiKind": "parameter", "Initializer": undefined, "IsOptional": false, "IsSpread": false, - "Kind": 146, - "KindString": "Parameter", "Location": Object { "Character": 28, "FileName": "./cases/FunctionDeclaration2.ts", @@ -76,11 +76,13 @@ Object { "ReferenceId": "TypeParameter-0", "Text": "TValue", }, + "_ts": Object { + "Kind": 146, + "KindString": "Parameter", + }, }, "SourceFile-0": Object { "ApiKind": "source-file", - "Kind": 268, - "KindString": "SourceFile", "Location": Object { "Character": 0, "FileName": "./cases/FunctionDeclaration2.ts", @@ -100,13 +102,15 @@ Object { "JSDocTags": Array [], }, "Name": "FunctionDeclaration2.ts", + "_ts": Object { + "Kind": 268, + "KindString": "SourceFile", + }, }, "TypeParameter-0": Object { "ApiKind": "type-parameter", "ConstraintType": undefined, "DefaultType": undefined, - "Kind": 145, - "KindString": "TypeParameter", "Location": Object { "Character": 20, "FileName": "./cases/FunctionDeclaration2.ts", @@ -118,6 +122,10 @@ Object { "JSDocTags": Array [], }, "Name": "TValue", + "_ts": Object { + "Kind": 145, + "KindString": "TypeParameter", + }, }, }, } diff --git a/tests/cases/__tests__/__snapshots__/FunctionDeclaration3.test.ts.snap b/tests/cases/__tests__/__snapshots__/FunctionDeclaration3.test.ts.snap index 6ff11693..b462242c 100644 --- a/tests/cases/__tests__/__snapshots__/FunctionDeclaration3.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/FunctionDeclaration3.test.ts.snap @@ -10,8 +10,6 @@ Object { "ApiKind": "function", "IsAsync": true, "IsOverloadBase": false, - "Kind": 228, - "KindString": "FunctionDeclaration", "Location": Object { "Character": 0, "FileName": "./cases/FunctionDeclaration3.ts", @@ -44,11 +42,13 @@ Object { "Text": "Promise", }, "TypeParameters": Array [], + "_ts": Object { + "Kind": 228, + "KindString": "FunctionDeclaration", + }, }, "SourceFile-0": Object { "ApiKind": "source-file", - "Kind": 268, - "KindString": "SourceFile", "Location": Object { "Character": 0, "FileName": "./cases/FunctionDeclaration3.ts", @@ -68,6 +68,10 @@ Object { "JSDocTags": Array [], }, "Name": "FunctionDeclaration3.ts", + "_ts": Object { + "Kind": 268, + "KindString": "SourceFile", + }, }, }, } diff --git a/tests/cases/__tests__/__snapshots__/GetAccessor1.test.ts.snap b/tests/cases/__tests__/__snapshots__/GetAccessor1.test.ts.snap index 65247f81..74094c20 100644 --- a/tests/cases/__tests__/__snapshots__/GetAccessor1.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/GetAccessor1.test.ts.snap @@ -11,8 +11,6 @@ Object { "Extends": undefined, "Implements": Array [], "IsAbstract": false, - "Kind": 229, - "KindString": "ClassDeclaration", "Location": Object { "Character": 0, "FileName": "./cases/GetAccessor1.ts", @@ -33,14 +31,16 @@ Object { }, "Name": "Foo", "TypeParameters": Array [], + "_ts": Object { + "Kind": 229, + "KindString": "ClassDeclaration", + }, }, "GetAccessor-0": Object { "AccessModifier": "public", "ApiKind": "get-accessor", "IsAbstract": false, "IsStatic": false, - "Kind": 153, - "KindString": "GetAccessor", "Location": Object { "Character": 4, "FileName": "./cases/GetAccessor1.ts", @@ -61,11 +61,13 @@ Object { "ReferenceId": undefined, "Text": "string", }, + "_ts": Object { + "Kind": 153, + "KindString": "GetAccessor", + }, }, "SourceFile-0": Object { "ApiKind": "source-file", - "Kind": 268, - "KindString": "SourceFile", "Location": Object { "Character": 0, "FileName": "./cases/GetAccessor1.ts", @@ -85,6 +87,10 @@ Object { "JSDocTags": Array [], }, "Name": "GetAccessor1.ts", + "_ts": Object { + "Kind": 268, + "KindString": "SourceFile", + }, }, }, } diff --git a/tests/cases/__tests__/__snapshots__/GetAccessor3.test.ts.snap b/tests/cases/__tests__/__snapshots__/GetAccessor3.test.ts.snap index f0cff1e6..12302d21 100644 --- a/tests/cases/__tests__/__snapshots__/GetAccessor3.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/GetAccessor3.test.ts.snap @@ -11,8 +11,6 @@ Object { "Extends": undefined, "Implements": Array [], "IsAbstract": true, - "Kind": 229, - "KindString": "ClassDeclaration", "Location": Object { "Character": 0, "FileName": "./cases/GetAccessor3.ts", @@ -51,14 +49,16 @@ Object { }, "Name": "Foo", "TypeParameters": Array [], + "_ts": Object { + "Kind": 229, + "KindString": "ClassDeclaration", + }, }, "GetAccessor-0": Object { "AccessModifier": "public", "ApiKind": "get-accessor", "IsAbstract": true, "IsStatic": false, - "Kind": 153, - "KindString": "GetAccessor", "Location": Object { "Character": 4, "FileName": "./cases/GetAccessor3.ts", @@ -79,14 +79,16 @@ Object { "ReferenceId": undefined, "Text": "string", }, + "_ts": Object { + "Kind": 153, + "KindString": "GetAccessor", + }, }, "GetAccessor-1": Object { "AccessModifier": "public", "ApiKind": "get-accessor", "IsAbstract": false, "IsStatic": true, - "Kind": 153, - "KindString": "GetAccessor", "Location": Object { "Character": 4, "FileName": "./cases/GetAccessor3.ts", @@ -107,14 +109,16 @@ Object { "ReferenceId": undefined, "Text": "string", }, + "_ts": Object { + "Kind": 153, + "KindString": "GetAccessor", + }, }, "GetAccessor-2": Object { "AccessModifier": "private", "ApiKind": "get-accessor", "IsAbstract": false, "IsStatic": false, - "Kind": 153, - "KindString": "GetAccessor", "Location": Object { "Character": 4, "FileName": "./cases/GetAccessor3.ts", @@ -135,14 +139,16 @@ Object { "ReferenceId": undefined, "Text": "string", }, + "_ts": Object { + "Kind": 153, + "KindString": "GetAccessor", + }, }, "GetAccessor-3": Object { "AccessModifier": "protected", "ApiKind": "get-accessor", "IsAbstract": false, "IsStatic": false, - "Kind": 153, - "KindString": "GetAccessor", "Location": Object { "Character": 4, "FileName": "./cases/GetAccessor3.ts", @@ -163,11 +169,13 @@ Object { "ReferenceId": undefined, "Text": "string", }, + "_ts": Object { + "Kind": 153, + "KindString": "GetAccessor", + }, }, "SourceFile-0": Object { "ApiKind": "source-file", - "Kind": 268, - "KindString": "SourceFile", "Location": Object { "Character": 0, "FileName": "./cases/GetAccessor3.ts", @@ -187,6 +195,10 @@ Object { "JSDocTags": Array [], }, "Name": "GetAccessor3.ts", + "_ts": Object { + "Kind": 268, + "KindString": "SourceFile", + }, }, }, } diff --git a/tests/cases/__tests__/__snapshots__/ImportDeclaration1.test.ts.snap b/tests/cases/__tests__/__snapshots__/ImportDeclaration1.test.ts.snap index bd894e26..de4ffdb9 100644 --- a/tests/cases/__tests__/__snapshots__/ImportDeclaration1.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/ImportDeclaration1.test.ts.snap @@ -11,8 +11,6 @@ Object { "Extends": undefined, "Implements": Array [], "IsAbstract": false, - "Kind": 229, - "KindString": "ClassDeclaration", "Location": Object { "Character": 0, "FileName": "./cases/ClassDeclaration1.ts", @@ -64,14 +62,16 @@ Object { }, "Name": "FooClass", "TypeParameters": Array [], + "_ts": Object { + "Kind": 229, + "KindString": "ClassDeclaration", + }, }, "ExportSpecifier-0": Object { "ApiItems": Array [ "NamespaceImport-0", ], "ApiKind": "export-specifier", - "Kind": 246, - "KindString": "ExportSpecifier", "Location": Object { "Character": 9, "FileName": "./cases/ImportDeclaration1.ts", @@ -83,6 +83,10 @@ Object { "JSDocTags": Array [], }, "Name": "Something", + "_ts": Object { + "Kind": 246, + "KindString": "ExportSpecifier", + }, }, "MethodDeclaration-0": Object { "AccessModifier": "protected", @@ -92,8 +96,6 @@ Object { "IsOptional": true, "IsOverloadBase": false, "IsStatic": false, - "Kind": 151, - "KindString": "MethodDeclaration", "Location": Object { "Character": 4, "FileName": "./cases/ClassDeclaration1.ts", @@ -123,6 +125,10 @@ Object { "Text": "void", }, "TypeParameters": Array [], + "_ts": Object { + "Kind": 151, + "KindString": "MethodDeclaration", + }, }, "MethodDeclaration-1": Object { "AccessModifier": "public", @@ -132,8 +138,6 @@ Object { "IsOptional": false, "IsOverloadBase": false, "IsStatic": false, - "Kind": 151, - "KindString": "MethodDeclaration", "Location": Object { "Character": 4, "FileName": "./cases/ClassDeclaration1.ts", @@ -165,6 +169,10 @@ GetFoo without A parameter comment line.", "Text": "string", }, "TypeParameters": Array [], + "_ts": Object { + "Kind": 151, + "KindString": "MethodDeclaration", + }, }, "MethodDeclaration-2": Object { "AccessModifier": "public", @@ -174,8 +182,6 @@ GetFoo without A parameter comment line.", "IsOptional": false, "IsOverloadBase": false, "IsStatic": false, - "Kind": 151, - "KindString": "MethodDeclaration", "Location": Object { "Character": 4, "FileName": "./cases/ClassDeclaration1.ts", @@ -207,6 +213,10 @@ GetFoo without A parameter comment line.", "Text": "string", }, "TypeParameters": Array [], + "_ts": Object { + "Kind": 151, + "KindString": "MethodDeclaration", + }, }, "MethodDeclaration-3": Object { "AccessModifier": "public", @@ -216,8 +226,6 @@ GetFoo without A parameter comment line.", "IsOptional": false, "IsOverloadBase": true, "IsStatic": false, - "Kind": 151, - "KindString": "MethodDeclaration", "Location": Object { "Character": 4, "FileName": "./cases/ClassDeclaration1.ts", @@ -249,6 +257,10 @@ GetFoo without A parameter comment line.", "Text": "string", }, "TypeParameters": Array [], + "_ts": Object { + "Kind": 151, + "KindString": "MethodDeclaration", + }, }, "MethodDeclaration-4": Object { "AccessModifier": "public", @@ -258,8 +270,6 @@ GetFoo without A parameter comment line.", "IsOptional": true, "IsOverloadBase": false, "IsStatic": false, - "Kind": 151, - "KindString": "MethodDeclaration", "Location": Object { "Character": 4, "FileName": "./cases/ClassDeclaration1.ts", @@ -292,11 +302,13 @@ GetFoo without A parameter comment line.", "Text": "Promise", }, "TypeParameters": Array [], + "_ts": Object { + "Kind": 151, + "KindString": "MethodDeclaration", + }, }, "NamespaceImport-0": Object { "ApiKind": "namespace", - "Kind": 240, - "KindString": "NamespaceImport", "Location": Object { "Character": 7, "FileName": "./cases/ImportDeclaration1.ts", @@ -316,14 +328,16 @@ GetFoo without A parameter comment line.", "JSDocTags": Array [], }, "Name": "Something", + "_ts": Object { + "Kind": 240, + "KindString": "NamespaceImport", + }, }, "Parameter-0": Object { "ApiKind": "parameter", "Initializer": undefined, "IsOptional": true, "IsSpread": false, - "Kind": 146, - "KindString": "Parameter", "Location": Object { "Character": 22, "FileName": "./cases/ClassDeclaration1.ts", @@ -344,14 +358,16 @@ GetFoo without A parameter comment line.", "ReferenceId": undefined, "Text": "string", }, + "_ts": Object { + "Kind": 146, + "KindString": "Parameter", + }, }, "Parameter-1": Object { "ApiKind": "parameter", "Initializer": undefined, "IsOptional": false, "IsSpread": false, - "Kind": 146, - "KindString": "Parameter", "Location": Object { "Character": 18, "FileName": "./cases/ClassDeclaration1.ts", @@ -372,14 +388,16 @@ GetFoo without A parameter comment line.", "ReferenceId": undefined, "Text": "string", }, + "_ts": Object { + "Kind": 146, + "KindString": "Parameter", + }, }, "Parameter-2": Object { "ApiKind": "parameter", "Initializer": undefined, "IsOptional": false, "IsSpread": false, - "Kind": 146, - "KindString": "Parameter", "Location": Object { "Character": 18, "FileName": "./cases/ClassDeclaration1.ts", @@ -419,14 +437,16 @@ GetFoo without A parameter comment line.", }, ], }, + "_ts": Object { + "Kind": 146, + "KindString": "Parameter", + }, }, "Parameter-3": Object { "ApiKind": "parameter", "Initializer": undefined, "IsOptional": false, "IsSpread": false, - "Kind": 146, - "KindString": "Parameter", "Location": Object { "Character": 18, "FileName": "./cases/ClassDeclaration1.ts", @@ -475,6 +495,10 @@ GetFoo without A parameter comment line.", }, ], }, + "_ts": Object { + "Kind": 146, + "KindString": "Parameter", + }, }, "PropertyDeclaration-0": Object { "AccessModifier": "public", @@ -483,8 +507,6 @@ GetFoo without A parameter comment line.", "IsOptional": false, "IsReadonly": true, "IsStatic": false, - "Kind": 149, - "KindString": "PropertyDeclaration", "Location": Object { "Character": 4, "FileName": "./cases/ClassDeclaration1.ts", @@ -510,6 +532,10 @@ GetFoo without A parameter comment line.", "ReferenceId": undefined, "Text": "string", }, + "_ts": Object { + "Kind": 149, + "KindString": "PropertyDeclaration", + }, }, "PropertyDeclaration-1": Object { "AccessModifier": "public", @@ -518,8 +544,6 @@ GetFoo without A parameter comment line.", "IsOptional": false, "IsReadonly": false, "IsStatic": true, - "Kind": 149, - "KindString": "PropertyDeclaration", "Location": Object { "Character": 4, "FileName": "./cases/ClassDeclaration1.ts", @@ -540,11 +564,13 @@ GetFoo without A parameter comment line.", "ReferenceId": undefined, "Text": "string", }, + "_ts": Object { + "Kind": 149, + "KindString": "PropertyDeclaration", + }, }, "SourceFile-0": Object { "ApiKind": "source-file", - "Kind": 268, - "KindString": "SourceFile", "Location": Object { "Character": 0, "FileName": "./cases/ImportDeclaration1.ts", @@ -564,6 +590,10 @@ GetFoo without A parameter comment line.", "JSDocTags": Array [], }, "Name": "ImportDeclaration1.ts", + "_ts": Object { + "Kind": 268, + "KindString": "SourceFile", + }, }, }, } diff --git a/tests/cases/__tests__/__snapshots__/ImportSpecifier1.test.ts.snap b/tests/cases/__tests__/__snapshots__/ImportSpecifier1.test.ts.snap index da80a714..ddd727d9 100644 --- a/tests/cases/__tests__/__snapshots__/ImportSpecifier1.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/ImportSpecifier1.test.ts.snap @@ -11,8 +11,6 @@ Object { "Extends": undefined, "Implements": Array [], "IsAbstract": false, - "Kind": 229, - "KindString": "ClassDeclaration", "Location": Object { "Character": 0, "FileName": "./cases/ClassDeclaration1.ts", @@ -64,14 +62,16 @@ Object { }, "Name": "FooClass", "TypeParameters": Array [], + "_ts": Object { + "Kind": 229, + "KindString": "ClassDeclaration", + }, }, "ExportSpecifier-0": Object { "ApiItems": Array [ "ImportSpecifier-0", ], "ApiKind": "export-specifier", - "Kind": 246, - "KindString": "ExportSpecifier", "Location": Object { "Character": 9, "FileName": "./cases/ImportSpecifier1.ts", @@ -88,14 +88,16 @@ Object { ], }, "Name": "FooClass", + "_ts": Object { + "Kind": 246, + "KindString": "ExportSpecifier", + }, }, "ImportSpecifier-0": Object { "ApiItems": Array [ "ClassDeclaration-0", ], "ApiKind": "import-specifier", - "Kind": 242, - "KindString": "ImportSpecifier", "Location": Object { "Character": 9, "FileName": "./cases/ImportSpecifier1.ts", @@ -112,6 +114,10 @@ Object { ], }, "Name": "FooClass", + "_ts": Object { + "Kind": 242, + "KindString": "ImportSpecifier", + }, }, "MethodDeclaration-0": Object { "AccessModifier": "protected", @@ -121,8 +127,6 @@ Object { "IsOptional": true, "IsOverloadBase": false, "IsStatic": false, - "Kind": 151, - "KindString": "MethodDeclaration", "Location": Object { "Character": 4, "FileName": "./cases/ClassDeclaration1.ts", @@ -152,6 +156,10 @@ Object { "Text": "void", }, "TypeParameters": Array [], + "_ts": Object { + "Kind": 151, + "KindString": "MethodDeclaration", + }, }, "MethodDeclaration-1": Object { "AccessModifier": "public", @@ -161,8 +169,6 @@ Object { "IsOptional": false, "IsOverloadBase": false, "IsStatic": false, - "Kind": 151, - "KindString": "MethodDeclaration", "Location": Object { "Character": 4, "FileName": "./cases/ClassDeclaration1.ts", @@ -194,6 +200,10 @@ GetFoo without A parameter comment line.", "Text": "string", }, "TypeParameters": Array [], + "_ts": Object { + "Kind": 151, + "KindString": "MethodDeclaration", + }, }, "MethodDeclaration-2": Object { "AccessModifier": "public", @@ -203,8 +213,6 @@ GetFoo without A parameter comment line.", "IsOptional": false, "IsOverloadBase": false, "IsStatic": false, - "Kind": 151, - "KindString": "MethodDeclaration", "Location": Object { "Character": 4, "FileName": "./cases/ClassDeclaration1.ts", @@ -236,6 +244,10 @@ GetFoo without A parameter comment line.", "Text": "string", }, "TypeParameters": Array [], + "_ts": Object { + "Kind": 151, + "KindString": "MethodDeclaration", + }, }, "MethodDeclaration-3": Object { "AccessModifier": "public", @@ -245,8 +257,6 @@ GetFoo without A parameter comment line.", "IsOptional": false, "IsOverloadBase": true, "IsStatic": false, - "Kind": 151, - "KindString": "MethodDeclaration", "Location": Object { "Character": 4, "FileName": "./cases/ClassDeclaration1.ts", @@ -278,6 +288,10 @@ GetFoo without A parameter comment line.", "Text": "string", }, "TypeParameters": Array [], + "_ts": Object { + "Kind": 151, + "KindString": "MethodDeclaration", + }, }, "MethodDeclaration-4": Object { "AccessModifier": "public", @@ -287,8 +301,6 @@ GetFoo without A parameter comment line.", "IsOptional": true, "IsOverloadBase": false, "IsStatic": false, - "Kind": 151, - "KindString": "MethodDeclaration", "Location": Object { "Character": 4, "FileName": "./cases/ClassDeclaration1.ts", @@ -321,14 +333,16 @@ GetFoo without A parameter comment line.", "Text": "Promise", }, "TypeParameters": Array [], + "_ts": Object { + "Kind": 151, + "KindString": "MethodDeclaration", + }, }, "Parameter-0": Object { "ApiKind": "parameter", "Initializer": undefined, "IsOptional": true, "IsSpread": false, - "Kind": 146, - "KindString": "Parameter", "Location": Object { "Character": 22, "FileName": "./cases/ClassDeclaration1.ts", @@ -349,14 +363,16 @@ GetFoo without A parameter comment line.", "ReferenceId": undefined, "Text": "string", }, + "_ts": Object { + "Kind": 146, + "KindString": "Parameter", + }, }, "Parameter-1": Object { "ApiKind": "parameter", "Initializer": undefined, "IsOptional": false, "IsSpread": false, - "Kind": 146, - "KindString": "Parameter", "Location": Object { "Character": 18, "FileName": "./cases/ClassDeclaration1.ts", @@ -377,14 +393,16 @@ GetFoo without A parameter comment line.", "ReferenceId": undefined, "Text": "string", }, + "_ts": Object { + "Kind": 146, + "KindString": "Parameter", + }, }, "Parameter-2": Object { "ApiKind": "parameter", "Initializer": undefined, "IsOptional": false, "IsSpread": false, - "Kind": 146, - "KindString": "Parameter", "Location": Object { "Character": 18, "FileName": "./cases/ClassDeclaration1.ts", @@ -424,14 +442,16 @@ GetFoo without A parameter comment line.", }, ], }, + "_ts": Object { + "Kind": 146, + "KindString": "Parameter", + }, }, "Parameter-3": Object { "ApiKind": "parameter", "Initializer": undefined, "IsOptional": false, "IsSpread": false, - "Kind": 146, - "KindString": "Parameter", "Location": Object { "Character": 18, "FileName": "./cases/ClassDeclaration1.ts", @@ -480,6 +500,10 @@ GetFoo without A parameter comment line.", }, ], }, + "_ts": Object { + "Kind": 146, + "KindString": "Parameter", + }, }, "PropertyDeclaration-0": Object { "AccessModifier": "public", @@ -488,8 +512,6 @@ GetFoo without A parameter comment line.", "IsOptional": false, "IsReadonly": true, "IsStatic": false, - "Kind": 149, - "KindString": "PropertyDeclaration", "Location": Object { "Character": 4, "FileName": "./cases/ClassDeclaration1.ts", @@ -515,6 +537,10 @@ GetFoo without A parameter comment line.", "ReferenceId": undefined, "Text": "string", }, + "_ts": Object { + "Kind": 149, + "KindString": "PropertyDeclaration", + }, }, "PropertyDeclaration-1": Object { "AccessModifier": "public", @@ -523,8 +549,6 @@ GetFoo without A parameter comment line.", "IsOptional": false, "IsReadonly": false, "IsStatic": true, - "Kind": 149, - "KindString": "PropertyDeclaration", "Location": Object { "Character": 4, "FileName": "./cases/ClassDeclaration1.ts", @@ -545,11 +569,13 @@ GetFoo without A parameter comment line.", "ReferenceId": undefined, "Text": "string", }, + "_ts": Object { + "Kind": 149, + "KindString": "PropertyDeclaration", + }, }, "SourceFile-0": Object { "ApiKind": "source-file", - "Kind": 268, - "KindString": "SourceFile", "Location": Object { "Character": 0, "FileName": "./cases/ImportSpecifier1.ts", @@ -569,6 +595,10 @@ GetFoo without A parameter comment line.", "JSDocTags": Array [], }, "Name": "ImportSpecifier1.ts", + "_ts": Object { + "Kind": 268, + "KindString": "SourceFile", + }, }, }, } diff --git a/tests/cases/__tests__/__snapshots__/ImportSpecifier2.test.ts.snap b/tests/cases/__tests__/__snapshots__/ImportSpecifier2.test.ts.snap index 49d0c8cb..1acbecc5 100644 --- a/tests/cases/__tests__/__snapshots__/ImportSpecifier2.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/ImportSpecifier2.test.ts.snap @@ -11,8 +11,6 @@ Object { "ImportSpecifier-0", ], "ApiKind": "export-specifier", - "Kind": 246, - "KindString": "ExportSpecifier", "Location": Object { "Character": 9, "FileName": "./cases/ImportSpecifier2.ts", @@ -24,12 +22,14 @@ Object { "JSDocTags": Array [], }, "Name": "DoesNotExist", + "_ts": Object { + "Kind": 246, + "KindString": "ExportSpecifier", + }, }, "ImportSpecifier-0": Object { "ApiItems": undefined, "ApiKind": "import-specifier", - "Kind": 242, - "KindString": "ImportSpecifier", "Location": Object { "Character": 9, "FileName": "./cases/ImportSpecifier2.ts", @@ -41,11 +41,13 @@ Object { "JSDocTags": Array [], }, "Name": "unknown", + "_ts": Object { + "Kind": 242, + "KindString": "ImportSpecifier", + }, }, "SourceFile-0": Object { "ApiKind": "source-file", - "Kind": 268, - "KindString": "SourceFile", "Location": Object { "Character": 0, "FileName": "./cases/ImportSpecifier2.ts", @@ -65,6 +67,10 @@ Object { "JSDocTags": Array [], }, "Name": "ImportSpecifier2.ts", + "_ts": Object { + "Kind": 268, + "KindString": "SourceFile", + }, }, }, } diff --git a/tests/cases/__tests__/__snapshots__/IndexSignature1.test.ts.snap b/tests/cases/__tests__/__snapshots__/IndexSignature1.test.ts.snap index d7e1801c..82a96138 100644 --- a/tests/cases/__tests__/__snapshots__/IndexSignature1.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/IndexSignature1.test.ts.snap @@ -9,8 +9,6 @@ Object { "IndexSignature-0": Object { "ApiKind": "index", "IsReadonly": false, - "Kind": 157, - "KindString": "IndexSignature", "Location": Object { "Character": 4, "FileName": "./cases/IndexSignature1.ts", @@ -32,12 +30,14 @@ Object { "ReferenceId": undefined, "Text": "number", }, + "_ts": Object { + "Kind": 157, + "KindString": "IndexSignature", + }, }, "InterfaceDeclaration-0": Object { "ApiKind": "interface", "Extends": Array [], - "Kind": 230, - "KindString": "InterfaceDeclaration", "Location": Object { "Character": 0, "FileName": "./cases/IndexSignature1.ts", @@ -58,14 +58,16 @@ Object { }, "Name": "Foo", "TypeParameters": Array [], + "_ts": Object { + "Kind": 230, + "KindString": "InterfaceDeclaration", + }, }, "Parameter-0": Object { "ApiKind": "parameter", "Initializer": undefined, "IsOptional": false, "IsSpread": false, - "Kind": 146, - "KindString": "Parameter", "Location": Object { "Character": 5, "FileName": "./cases/IndexSignature1.ts", @@ -86,11 +88,13 @@ Object { "ReferenceId": undefined, "Text": "string", }, + "_ts": Object { + "Kind": 146, + "KindString": "Parameter", + }, }, "SourceFile-0": Object { "ApiKind": "source-file", - "Kind": 268, - "KindString": "SourceFile", "Location": Object { "Character": 0, "FileName": "./cases/IndexSignature1.ts", @@ -110,6 +114,10 @@ Object { "JSDocTags": Array [], }, "Name": "IndexSignature1.ts", + "_ts": Object { + "Kind": 268, + "KindString": "SourceFile", + }, }, }, } diff --git a/tests/cases/__tests__/__snapshots__/IndexSignature2.test.ts.snap b/tests/cases/__tests__/__snapshots__/IndexSignature2.test.ts.snap index 38d60969..59d12fe0 100644 --- a/tests/cases/__tests__/__snapshots__/IndexSignature2.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/IndexSignature2.test.ts.snap @@ -9,8 +9,6 @@ Object { "IndexSignature-0": Object { "ApiKind": "index", "IsReadonly": true, - "Kind": 157, - "KindString": "IndexSignature", "Location": Object { "Character": 4, "FileName": "./cases/IndexSignature2.ts", @@ -32,12 +30,14 @@ Object { "ReferenceId": undefined, "Text": "number", }, + "_ts": Object { + "Kind": 157, + "KindString": "IndexSignature", + }, }, "InterfaceDeclaration-0": Object { "ApiKind": "interface", "Extends": Array [], - "Kind": 230, - "KindString": "InterfaceDeclaration", "Location": Object { "Character": 0, "FileName": "./cases/IndexSignature2.ts", @@ -58,14 +58,16 @@ Object { }, "Name": "Foo", "TypeParameters": Array [], + "_ts": Object { + "Kind": 230, + "KindString": "InterfaceDeclaration", + }, }, "Parameter-0": Object { "ApiKind": "parameter", "Initializer": undefined, "IsOptional": false, "IsSpread": false, - "Kind": 146, - "KindString": "Parameter", "Location": Object { "Character": 14, "FileName": "./cases/IndexSignature2.ts", @@ -86,11 +88,13 @@ Object { "ReferenceId": undefined, "Text": "string", }, + "_ts": Object { + "Kind": 146, + "KindString": "Parameter", + }, }, "SourceFile-0": Object { "ApiKind": "source-file", - "Kind": 268, - "KindString": "SourceFile", "Location": Object { "Character": 0, "FileName": "./cases/IndexSignature2.ts", @@ -110,6 +114,10 @@ Object { "JSDocTags": Array [], }, "Name": "IndexSignature2.ts", + "_ts": Object { + "Kind": 268, + "KindString": "SourceFile", + }, }, }, } diff --git a/tests/cases/__tests__/__snapshots__/IndexSignature3.test.ts.snap b/tests/cases/__tests__/__snapshots__/IndexSignature3.test.ts.snap index da49f295..0ec9271e 100644 --- a/tests/cases/__tests__/__snapshots__/IndexSignature3.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/IndexSignature3.test.ts.snap @@ -9,8 +9,6 @@ Object { "IndexSignature-0": Object { "ApiKind": "index", "IsReadonly": false, - "Kind": 157, - "KindString": "IndexSignature", "Location": Object { "Character": 4, "FileName": "./cases/IndexSignature3.ts", @@ -32,12 +30,14 @@ Object { "ReferenceId": undefined, "Text": "number", }, + "_ts": Object { + "Kind": 157, + "KindString": "IndexSignature", + }, }, "IndexSignature-1": Object { "ApiKind": "index", "IsReadonly": false, - "Kind": 157, - "KindString": "IndexSignature", "Location": Object { "Character": 4, "FileName": "./cases/IndexSignature3.ts", @@ -59,12 +59,14 @@ Object { "ReferenceId": undefined, "Text": "any", }, + "_ts": Object { + "Kind": 157, + "KindString": "IndexSignature", + }, }, "InterfaceDeclaration-0": Object { "ApiKind": "interface", "Extends": Array [], - "Kind": 230, - "KindString": "InterfaceDeclaration", "Location": Object { "Character": 0, "FileName": "./cases/IndexSignature3.ts", @@ -86,14 +88,16 @@ Object { }, "Name": "Foo", "TypeParameters": Array [], + "_ts": Object { + "Kind": 230, + "KindString": "InterfaceDeclaration", + }, }, "Parameter-0": Object { "ApiKind": "parameter", "Initializer": undefined, "IsOptional": false, "IsSpread": false, - "Kind": 146, - "KindString": "Parameter", "Location": Object { "Character": 5, "FileName": "./cases/IndexSignature3.ts", @@ -114,14 +118,16 @@ Object { "ReferenceId": undefined, "Text": "string", }, + "_ts": Object { + "Kind": 146, + "KindString": "Parameter", + }, }, "Parameter-1": Object { "ApiKind": "parameter", "Initializer": undefined, "IsOptional": false, "IsSpread": false, - "Kind": 146, - "KindString": "Parameter", "Location": Object { "Character": 18, "FileName": "./cases/IndexSignature3.ts", @@ -142,14 +148,16 @@ Object { "ReferenceId": undefined, "Text": "string", }, + "_ts": Object { + "Kind": 146, + "KindString": "Parameter", + }, }, "Parameter-2": Object { "ApiKind": "parameter", "Initializer": undefined, "IsOptional": false, "IsSpread": false, - "Kind": 146, - "KindString": "Parameter", "Location": Object { "Character": 5, "FileName": "./cases/IndexSignature3.ts", @@ -170,11 +178,13 @@ Object { "ReferenceId": undefined, "Text": "number", }, + "_ts": Object { + "Kind": 146, + "KindString": "Parameter", + }, }, "SourceFile-0": Object { "ApiKind": "source-file", - "Kind": 268, - "KindString": "SourceFile", "Location": Object { "Character": 0, "FileName": "./cases/IndexSignature3.ts", @@ -194,6 +204,10 @@ Object { "JSDocTags": Array [], }, "Name": "IndexSignature3.ts", + "_ts": Object { + "Kind": 268, + "KindString": "SourceFile", + }, }, }, } diff --git a/tests/cases/__tests__/__snapshots__/InterfaceClassMerging.test.ts.snap b/tests/cases/__tests__/__snapshots__/InterfaceClassMerging.test.ts.snap index bb2063bc..c86f2ade 100644 --- a/tests/cases/__tests__/__snapshots__/InterfaceClassMerging.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/InterfaceClassMerging.test.ts.snap @@ -11,8 +11,6 @@ Object { "Extends": undefined, "Implements": Array [], "IsAbstract": false, - "Kind": 229, - "KindString": "ClassDeclaration", "Location": Object { "Character": 0, "FileName": "./cases/InterfaceClassMerging.ts", @@ -39,6 +37,10 @@ Object { }, "Name": "Foo", "TypeParameters": Array [], + "_ts": Object { + "Kind": 229, + "KindString": "ClassDeclaration", + }, }, "ClassDeclaration-1": Object { "ApiKind": "class", @@ -53,8 +55,6 @@ Object { }, "Implements": Array [], "IsAbstract": false, - "Kind": 229, - "KindString": "ClassDeclaration", "Location": Object { "Character": 0, "FileName": "./cases/InterfaceClassMerging.ts", @@ -75,12 +75,14 @@ Object { }, "Name": "Bar", "TypeParameters": Array [], + "_ts": Object { + "Kind": 229, + "KindString": "ClassDeclaration", + }, }, "InterfaceDeclaration-0": Object { "ApiKind": "interface", "Extends": Array [], - "Kind": 230, - "KindString": "InterfaceDeclaration", "Location": Object { "Character": 0, "FileName": "./cases/InterfaceClassMerging.ts", @@ -119,6 +121,10 @@ Object { }, "Name": "Foo", "TypeParameters": Array [], + "_ts": Object { + "Kind": 230, + "KindString": "InterfaceDeclaration", + }, }, "MethodDeclaration-0": Object { "AccessModifier": "public", @@ -128,8 +134,6 @@ Object { "IsOptional": false, "IsOverloadBase": false, "IsStatic": false, - "Kind": 151, - "KindString": "MethodDeclaration", "Location": Object { "Character": 4, "FileName": "./cases/InterfaceClassMerging.ts", @@ -159,6 +163,10 @@ Object { "Text": "string", }, "TypeParameters": Array [], + "_ts": Object { + "Kind": 151, + "KindString": "MethodDeclaration", + }, }, "MethodDeclaration-1": Object { "AccessModifier": "public", @@ -168,8 +176,6 @@ Object { "IsOptional": false, "IsOverloadBase": false, "IsStatic": false, - "Kind": 151, - "KindString": "MethodDeclaration", "Location": Object { "Character": 4, "FileName": "./cases/InterfaceClassMerging.ts", @@ -199,13 +205,15 @@ Object { "Text": "string", }, "TypeParameters": Array [], + "_ts": Object { + "Kind": 151, + "KindString": "MethodDeclaration", + }, }, "MethodSignature-0": Object { "ApiKind": "method", "IsOptional": false, "IsOverloadBase": false, - "Kind": 150, - "KindString": "MethodSignature", "Location": Object { "Character": 4, "FileName": "./cases/InterfaceClassMerging.ts", @@ -235,13 +243,15 @@ Object { "Text": "string", }, "TypeParameters": Array [], + "_ts": Object { + "Kind": 150, + "KindString": "MethodSignature", + }, }, "MethodSignature-1": Object { "ApiKind": "method", "IsOptional": true, "IsOverloadBase": false, - "Kind": 150, - "KindString": "MethodSignature", "Location": Object { "Character": 4, "FileName": "./cases/InterfaceClassMerging.ts", @@ -271,14 +281,16 @@ Object { "Text": "string", }, "TypeParameters": Array [], + "_ts": Object { + "Kind": 150, + "KindString": "MethodSignature", + }, }, "Parameter-0": Object { "ApiKind": "parameter", "Initializer": undefined, "IsOptional": false, "IsSpread": false, - "Kind": 146, - "KindString": "Parameter", "Location": Object { "Character": 11, "FileName": "./cases/InterfaceClassMerging.ts", @@ -299,14 +311,16 @@ Object { "ReferenceId": undefined, "Text": "number", }, + "_ts": Object { + "Kind": 146, + "KindString": "Parameter", + }, }, "Parameter-1": Object { "ApiKind": "parameter", "Initializer": undefined, "IsOptional": false, "IsSpread": false, - "Kind": 146, - "KindString": "Parameter", "Location": Object { "Character": 20, "FileName": "./cases/InterfaceClassMerging.ts", @@ -327,14 +341,16 @@ Object { "ReferenceId": undefined, "Text": "number", }, + "_ts": Object { + "Kind": 146, + "KindString": "Parameter", + }, }, "Parameter-2": Object { "ApiKind": "parameter", "Initializer": undefined, "IsOptional": false, "IsSpread": false, - "Kind": 146, - "KindString": "Parameter", "Location": Object { "Character": 28, "FileName": "./cases/InterfaceClassMerging.ts", @@ -355,14 +371,16 @@ Object { "ReferenceId": undefined, "Text": "number", }, + "_ts": Object { + "Kind": 146, + "KindString": "Parameter", + }, }, "Parameter-3": Object { "ApiKind": "parameter", "Initializer": undefined, "IsOptional": false, "IsSpread": false, - "Kind": 146, - "KindString": "Parameter", "Location": Object { "Character": 18, "FileName": "./cases/InterfaceClassMerging.ts", @@ -383,6 +401,10 @@ Object { "ReferenceId": undefined, "Text": "number", }, + "_ts": Object { + "Kind": 146, + "KindString": "Parameter", + }, }, "PropertyDeclaration-0": Object { "AccessModifier": "public", @@ -391,8 +413,6 @@ Object { "IsOptional": false, "IsReadonly": false, "IsStatic": false, - "Kind": 149, - "KindString": "PropertyDeclaration", "Location": Object { "Character": 4, "FileName": "./cases/InterfaceClassMerging.ts", @@ -413,13 +433,15 @@ Object { "ReferenceId": undefined, "Text": "string", }, + "_ts": Object { + "Kind": 149, + "KindString": "PropertyDeclaration", + }, }, "PropertySignature-0": Object { "ApiKind": "property", "IsOptional": false, "IsReadonly": false, - "Kind": 148, - "KindString": "PropertySignature", "Location": Object { "Character": 4, "FileName": "./cases/InterfaceClassMerging.ts", @@ -440,13 +462,15 @@ Object { "ReferenceId": undefined, "Text": "string", }, + "_ts": Object { + "Kind": 148, + "KindString": "PropertySignature", + }, }, "PropertySignature-1": Object { "ApiKind": "property", "IsOptional": true, "IsReadonly": false, - "Kind": 148, - "KindString": "PropertySignature", "Location": Object { "Character": 4, "FileName": "./cases/InterfaceClassMerging.ts", @@ -467,11 +491,13 @@ Object { "ReferenceId": undefined, "Text": "string", }, + "_ts": Object { + "Kind": 148, + "KindString": "PropertySignature", + }, }, "SourceFile-0": Object { "ApiKind": "source-file", - "Kind": 268, - "KindString": "SourceFile", "Location": Object { "Character": 0, "FileName": "./cases/InterfaceClassMerging.ts", @@ -516,11 +542,13 @@ Object { "JSDocTags": Array [], }, "Name": "InterfaceClassMerging.ts", + "_ts": Object { + "Kind": 268, + "KindString": "SourceFile", + }, }, "VariableDeclaration-0": Object { "ApiKind": "variable", - "Kind": 226, - "KindString": "VariableDeclaration", "Location": Object { "Character": 11, "FileName": "./cases/InterfaceClassMerging.ts", @@ -542,11 +570,13 @@ Object { "Text": "Bar", }, "VariableDeclarationType": "let", + "_ts": Object { + "Kind": 226, + "KindString": "VariableDeclaration", + }, }, "VariableDeclaration-1": Object { "ApiKind": "variable", - "Kind": 226, - "KindString": "VariableDeclaration", "Location": Object { "Character": 11, "FileName": "./cases/InterfaceClassMerging.ts", @@ -568,11 +598,13 @@ Object { "Text": "Foo", }, "VariableDeclarationType": "let", + "_ts": Object { + "Kind": 226, + "KindString": "VariableDeclaration", + }, }, "VariableDeclaration-2": Object { "ApiKind": "variable", - "Kind": 226, - "KindString": "VariableDeclaration", "Location": Object { "Character": 11, "FileName": "./cases/InterfaceClassMerging.ts", @@ -594,6 +626,10 @@ Object { "Text": "Foo", }, "VariableDeclarationType": "let", + "_ts": Object { + "Kind": 226, + "KindString": "VariableDeclaration", + }, }, }, } diff --git a/tests/cases/__tests__/__snapshots__/InterfaceDeclaration1.test.ts.snap b/tests/cases/__tests__/__snapshots__/InterfaceDeclaration1.test.ts.snap index 58b2ce36..c0290981 100644 --- a/tests/cases/__tests__/__snapshots__/InterfaceDeclaration1.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/InterfaceDeclaration1.test.ts.snap @@ -9,8 +9,6 @@ Object { "InterfaceDeclaration-0": Object { "ApiKind": "interface", "Extends": Array [], - "Kind": 230, - "KindString": "InterfaceDeclaration", "Location": Object { "Character": 0, "FileName": "./cases/InterfaceDeclaration1.ts", @@ -24,11 +22,13 @@ Object { }, "Name": "Foo", "TypeParameters": Array [], + "_ts": Object { + "Kind": 230, + "KindString": "InterfaceDeclaration", + }, }, "SourceFile-0": Object { "ApiKind": "source-file", - "Kind": 268, - "KindString": "SourceFile", "Location": Object { "Character": 0, "FileName": "./cases/InterfaceDeclaration1.ts", @@ -48,6 +48,10 @@ Object { "JSDocTags": Array [], }, "Name": "InterfaceDeclaration1.ts", + "_ts": Object { + "Kind": 268, + "KindString": "SourceFile", + }, }, }, } diff --git a/tests/cases/__tests__/__snapshots__/InterfaceDeclaration2.test.ts.snap b/tests/cases/__tests__/__snapshots__/InterfaceDeclaration2.test.ts.snap index 643e7a19..1f26e7d7 100644 --- a/tests/cases/__tests__/__snapshots__/InterfaceDeclaration2.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/InterfaceDeclaration2.test.ts.snap @@ -9,8 +9,6 @@ Object { "InterfaceDeclaration-0": Object { "ApiKind": "interface", "Extends": Array [], - "Kind": 230, - "KindString": "InterfaceDeclaration", "Location": Object { "Character": 0, "FileName": "./cases/InterfaceDeclaration2.ts", @@ -31,13 +29,15 @@ Object { }, "Name": "Foo", "TypeParameters": Array [], + "_ts": Object { + "Kind": 230, + "KindString": "InterfaceDeclaration", + }, }, "PropertySignature-0": Object { "ApiKind": "property", "IsOptional": false, "IsReadonly": false, - "Kind": 148, - "KindString": "PropertySignature", "Location": Object { "Character": 2, "FileName": "./cases/InterfaceDeclaration2.ts", @@ -58,11 +58,13 @@ Object { "ReferenceId": undefined, "Text": "string", }, + "_ts": Object { + "Kind": 148, + "KindString": "PropertySignature", + }, }, "SourceFile-0": Object { "ApiKind": "source-file", - "Kind": 268, - "KindString": "SourceFile", "Location": Object { "Character": 0, "FileName": "./cases/InterfaceDeclaration2.ts", @@ -82,6 +84,10 @@ Object { "JSDocTags": Array [], }, "Name": "InterfaceDeclaration2.ts", + "_ts": Object { + "Kind": 268, + "KindString": "SourceFile", + }, }, }, } diff --git a/tests/cases/__tests__/__snapshots__/InterfaceDeclaration3.test.ts.snap b/tests/cases/__tests__/__snapshots__/InterfaceDeclaration3.test.ts.snap index ea58a1c1..da986686 100644 --- a/tests/cases/__tests__/__snapshots__/InterfaceDeclaration3.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/InterfaceDeclaration3.test.ts.snap @@ -9,8 +9,6 @@ Object { "InterfaceDeclaration-0": Object { "ApiKind": "interface", "Extends": Array [], - "Kind": 230, - "KindString": "InterfaceDeclaration", "Location": Object { "Character": 0, "FileName": "./cases/InterfaceDeclaration3.ts", @@ -38,13 +36,15 @@ Object { ], }, ], + "_ts": Object { + "Kind": 230, + "KindString": "InterfaceDeclaration", + }, }, "PropertySignature-0": Object { "ApiKind": "property", "IsOptional": false, "IsReadonly": false, - "Kind": 148, - "KindString": "PropertySignature", "Location": Object { "Character": 4, "FileName": "./cases/InterfaceDeclaration3.ts", @@ -65,11 +65,13 @@ Object { "ReferenceId": "TypeParameter-0", "Text": "T", }, + "_ts": Object { + "Kind": 148, + "KindString": "PropertySignature", + }, }, "SourceFile-0": Object { "ApiKind": "source-file", - "Kind": 268, - "KindString": "SourceFile", "Location": Object { "Character": 0, "FileName": "./cases/InterfaceDeclaration3.ts", @@ -95,13 +97,15 @@ Object { "JSDocTags": Array [], }, "Name": "InterfaceDeclaration3.ts", + "_ts": Object { + "Kind": 268, + "KindString": "SourceFile", + }, }, "TypeParameter-0": Object { "ApiKind": "type-parameter", "ConstraintType": undefined, "DefaultType": undefined, - "Kind": 145, - "KindString": "TypeParameter", "Location": Object { "Character": 25, "FileName": "./cases/InterfaceDeclaration3.ts", @@ -113,11 +117,13 @@ Object { "JSDocTags": Array [], }, "Name": "T", + "_ts": Object { + "Kind": 145, + "KindString": "TypeParameter", + }, }, "VariableDeclaration-0": Object { "ApiKind": "variable", - "Kind": 226, - "KindString": "VariableDeclaration", "Location": Object { "Character": 13, "FileName": "./cases/InterfaceDeclaration3.ts", @@ -149,6 +155,10 @@ Object { "Text": "Generic", }, "VariableDeclarationType": "const", + "_ts": Object { + "Kind": 226, + "KindString": "VariableDeclaration", + }, }, }, } diff --git a/tests/cases/__tests__/__snapshots__/InterfaceDeclaration4.test.ts.snap b/tests/cases/__tests__/__snapshots__/InterfaceDeclaration4.test.ts.snap index 9d86e85d..2a6baadb 100644 --- a/tests/cases/__tests__/__snapshots__/InterfaceDeclaration4.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/InterfaceDeclaration4.test.ts.snap @@ -9,8 +9,6 @@ Object { "CallSignature-0": Object { "ApiKind": "call", "IsOverloadBase": false, - "Kind": 155, - "KindString": "CallSignature", "Location": Object { "Character": 4, "FileName": "./cases/InterfaceDeclaration4.ts", @@ -33,12 +31,14 @@ Object { "Text": "string", }, "TypeParameters": Array [], + "_ts": Object { + "Kind": 155, + "KindString": "CallSignature", + }, }, "CallSignature-1": Object { "ApiKind": "call", "IsOverloadBase": false, - "Kind": 155, - "KindString": "CallSignature", "Location": Object { "Character": 4, "FileName": "./cases/InterfaceDeclaration4.ts", @@ -80,6 +80,10 @@ Object { "Text": "number", }, "TypeParameters": Array [], + "_ts": Object { + "Kind": 155, + "KindString": "CallSignature", + }, }, "ClassDeclaration-0": Object { "ApiKind": "class", @@ -96,8 +100,6 @@ Object { }, ], "IsAbstract": false, - "Kind": 229, - "KindString": "ClassDeclaration", "Location": Object { "Character": 0, "FileName": "./cases/InterfaceDeclaration4.ts", @@ -111,12 +113,14 @@ Object { }, "Name": "c1", "TypeParameters": Array [], + "_ts": Object { + "Kind": 229, + "KindString": "ClassDeclaration", + }, }, "ConstructSignature-0": Object { "ApiKind": "construct", "IsOverloadBase": false, - "Kind": 156, - "KindString": "ConstructSignature", "Location": Object { "Character": 4, "FileName": "./cases/InterfaceDeclaration4.ts", @@ -139,12 +143,14 @@ Object { "Text": "string", }, "TypeParameters": Array [], + "_ts": Object { + "Kind": 156, + "KindString": "ConstructSignature", + }, }, "ConstructSignature-1": Object { "ApiKind": "construct", "IsOverloadBase": false, - "Kind": 156, - "KindString": "ConstructSignature", "Location": Object { "Character": 4, "FileName": "./cases/InterfaceDeclaration4.ts", @@ -174,12 +180,14 @@ Object { "Text": "any", }, "TypeParameters": Array [], + "_ts": Object { + "Kind": 156, + "KindString": "ConstructSignature", + }, }, "FunctionType-0": Object { "ApiKind": "function-type", "IsOverloadBase": false, - "Kind": 160, - "KindString": "FunctionType", "Location": Object { "Character": 17, "FileName": "./cases/InterfaceDeclaration4.ts", @@ -202,12 +210,14 @@ Object { "Text": "string", }, "TypeParameters": Array [], + "_ts": Object { + "Kind": 160, + "KindString": "FunctionType", + }, }, "IndexSignature-0": Object { "ApiKind": "index", "IsReadonly": false, - "Kind": 157, - "KindString": "IndexSignature", "Location": Object { "Character": 4, "FileName": "./cases/InterfaceDeclaration4.ts", @@ -229,12 +239,14 @@ Object { "ReferenceId": "FunctionType-0", "Text": "() => string", }, + "_ts": Object { + "Kind": 157, + "KindString": "IndexSignature", + }, }, "IndexSignature-1": Object { "ApiKind": "index", "IsReadonly": false, - "Kind": 157, - "KindString": "IndexSignature", "Location": Object { "Character": 4, "FileName": "./cases/InterfaceDeclaration4.ts", @@ -256,12 +268,14 @@ Object { "ReferenceId": undefined, "Text": "any", }, + "_ts": Object { + "Kind": 157, + "KindString": "IndexSignature", + }, }, "IndexSignature-2": Object { "ApiKind": "index", "IsReadonly": false, - "Kind": 157, - "KindString": "IndexSignature", "Location": Object { "Character": 4, "FileName": "./cases/InterfaceDeclaration4.ts", @@ -283,12 +297,14 @@ Object { "ReferenceId": undefined, "Text": "number", }, + "_ts": Object { + "Kind": 157, + "KindString": "IndexSignature", + }, }, "IndexSignature-3": Object { "ApiKind": "index", "IsReadonly": false, - "Kind": 157, - "KindString": "IndexSignature", "Location": Object { "Character": 4, "FileName": "./cases/InterfaceDeclaration4.ts", @@ -310,12 +326,14 @@ Object { "ReferenceId": undefined, "Text": "number", }, + "_ts": Object { + "Kind": 157, + "KindString": "IndexSignature", + }, }, "InterfaceDeclaration-0": Object { "ApiKind": "interface", "Extends": Array [], - "Kind": 230, - "KindString": "InterfaceDeclaration", "Location": Object { "Character": 0, "FileName": "./cases/InterfaceDeclaration4.ts", @@ -405,12 +423,14 @@ Object { }, "Name": "a0", "TypeParameters": Array [], + "_ts": Object { + "Kind": 230, + "KindString": "InterfaceDeclaration", + }, }, "InterfaceDeclaration-1": Object { "ApiKind": "interface", "Extends": Array [], - "Kind": 230, - "KindString": "InterfaceDeclaration", "Location": Object { "Character": 0, "FileName": "./cases/InterfaceDeclaration4.ts", @@ -431,12 +451,14 @@ Object { }, "Name": "a1", "TypeParameters": Array [], + "_ts": Object { + "Kind": 230, + "KindString": "InterfaceDeclaration", + }, }, "InterfaceDeclaration-2": Object { "ApiKind": "interface", "Extends": Array [], - "Kind": 230, - "KindString": "InterfaceDeclaration", "Location": Object { "Character": 0, "FileName": "./cases/InterfaceDeclaration4.ts", @@ -457,12 +479,14 @@ Object { }, "Name": "a2", "TypeParameters": Array [], + "_ts": Object { + "Kind": 230, + "KindString": "InterfaceDeclaration", + }, }, "InterfaceDeclaration-3": Object { "ApiKind": "interface", "Extends": Array [], - "Kind": 230, - "KindString": "InterfaceDeclaration", "Location": Object { "Character": 0, "FileName": "./cases/InterfaceDeclaration4.ts", @@ -476,6 +500,10 @@ Object { }, "Name": "a", "TypeParameters": Array [], + "_ts": Object { + "Kind": 230, + "KindString": "InterfaceDeclaration", + }, }, "InterfaceDeclaration-4": Object { "ApiKind": "interface", @@ -490,8 +518,6 @@ Object { "Text": "a", }, ], - "Kind": 230, - "KindString": "InterfaceDeclaration", "Location": Object { "Character": 0, "FileName": "./cases/InterfaceDeclaration4.ts", @@ -505,6 +531,10 @@ Object { }, "Name": "b", "TypeParameters": Array [], + "_ts": Object { + "Kind": 230, + "KindString": "InterfaceDeclaration", + }, }, "InterfaceDeclaration-5": Object { "ApiKind": "interface", @@ -528,8 +558,6 @@ Object { "Text": "b", }, ], - "Kind": 230, - "KindString": "InterfaceDeclaration", "Location": Object { "Character": 0, "FileName": "./cases/InterfaceDeclaration4.ts", @@ -543,6 +571,10 @@ Object { }, "Name": "c", "TypeParameters": Array [], + "_ts": Object { + "Kind": 230, + "KindString": "InterfaceDeclaration", + }, }, "InterfaceDeclaration-6": Object { "ApiKind": "interface", @@ -557,8 +589,6 @@ Object { "Text": "a", }, ], - "Kind": 230, - "KindString": "InterfaceDeclaration", "Location": Object { "Character": 0, "FileName": "./cases/InterfaceDeclaration4.ts", @@ -572,13 +602,15 @@ Object { }, "Name": "d", "TypeParameters": Array [], + "_ts": Object { + "Kind": 230, + "KindString": "InterfaceDeclaration", + }, }, "MethodSignature-0": Object { "ApiKind": "method", "IsOptional": false, "IsOverloadBase": false, - "Kind": 150, - "KindString": "MethodSignature", "Location": Object { "Character": 4, "FileName": "./cases/InterfaceDeclaration4.ts", @@ -608,13 +640,15 @@ Object { "Text": "string", }, "TypeParameters": Array [], + "_ts": Object { + "Kind": 150, + "KindString": "MethodSignature", + }, }, "MethodSignature-1": Object { "ApiKind": "method", "IsOptional": false, "IsOverloadBase": false, - "Kind": 150, - "KindString": "MethodSignature", "Location": Object { "Character": 4, "FileName": "./cases/InterfaceDeclaration4.ts", @@ -637,13 +671,15 @@ Object { "Text": "any", }, "TypeParameters": Array [], + "_ts": Object { + "Kind": 150, + "KindString": "MethodSignature", + }, }, "MethodSignature-2": Object { "ApiKind": "method", "IsOptional": true, "IsOverloadBase": false, - "Kind": 150, - "KindString": "MethodSignature", "Location": Object { "Character": 4, "FileName": "./cases/InterfaceDeclaration4.ts", @@ -666,13 +702,15 @@ Object { "Text": "any", }, "TypeParameters": Array [], + "_ts": Object { + "Kind": 150, + "KindString": "MethodSignature", + }, }, "MethodSignature-3": Object { "ApiKind": "method", "IsOptional": false, "IsOverloadBase": false, - "Kind": 150, - "KindString": "MethodSignature", "Location": Object { "Character": 4, "FileName": "./cases/InterfaceDeclaration4.ts", @@ -702,13 +740,15 @@ Object { "Text": "number", }, "TypeParameters": Array [], + "_ts": Object { + "Kind": 150, + "KindString": "MethodSignature", + }, }, "MethodSignature-4": Object { "ApiKind": "method", "IsOptional": true, "IsOverloadBase": false, - "Kind": 150, - "KindString": "MethodSignature", "Location": Object { "Character": 4, "FileName": "./cases/InterfaceDeclaration4.ts", @@ -738,14 +778,16 @@ Object { "Text": "string", }, "TypeParameters": Array [], + "_ts": Object { + "Kind": 150, + "KindString": "MethodSignature", + }, }, "Parameter-0": Object { "ApiKind": "parameter", "Initializer": undefined, "IsOptional": false, "IsSpread": false, - "Kind": 146, - "KindString": "Parameter", "Location": Object { "Character": 5, "FileName": "./cases/InterfaceDeclaration4.ts", @@ -766,14 +808,16 @@ Object { "ReferenceId": undefined, "Text": "any", }, + "_ts": Object { + "Kind": 146, + "KindString": "Parameter", + }, }, "Parameter-1": Object { "ApiKind": "parameter", "Initializer": undefined, "IsOptional": false, "IsSpread": false, - "Kind": 146, - "KindString": "Parameter", "Location": Object { "Character": 8, "FileName": "./cases/InterfaceDeclaration4.ts", @@ -794,14 +838,16 @@ Object { "ReferenceId": undefined, "Text": "any", }, + "_ts": Object { + "Kind": 146, + "KindString": "Parameter", + }, }, "Parameter-10": Object { "ApiKind": "parameter", "Initializer": undefined, "IsOptional": false, "IsSpread": false, - "Kind": 146, - "KindString": "Parameter", "Location": Object { "Character": 5, "FileName": "./cases/InterfaceDeclaration4.ts", @@ -822,14 +868,16 @@ Object { "ReferenceId": undefined, "Text": "string", }, + "_ts": Object { + "Kind": 146, + "KindString": "Parameter", + }, }, "Parameter-2": Object { "ApiKind": "parameter", "Initializer": undefined, "IsOptional": true, "IsSpread": false, - "Kind": 146, - "KindString": "Parameter", "Location": Object { "Character": 11, "FileName": "./cases/InterfaceDeclaration4.ts", @@ -850,14 +898,16 @@ Object { "ReferenceId": undefined, "Text": "string", }, + "_ts": Object { + "Kind": 146, + "KindString": "Parameter", + }, }, "Parameter-3": Object { "ApiKind": "parameter", "Initializer": undefined, "IsOptional": false, "IsSpread": false, - "Kind": 146, - "KindString": "Parameter", "Location": Object { "Character": 8, "FileName": "./cases/InterfaceDeclaration4.ts", @@ -878,14 +928,16 @@ Object { "ReferenceId": undefined, "Text": "string", }, + "_ts": Object { + "Kind": 146, + "KindString": "Parameter", + }, }, "Parameter-4": Object { "ApiKind": "parameter", "Initializer": undefined, "IsOptional": false, "IsSpread": false, - "Kind": 146, - "KindString": "Parameter", "Location": Object { "Character": 5, "FileName": "./cases/InterfaceDeclaration4.ts", @@ -906,14 +958,16 @@ Object { "ReferenceId": undefined, "Text": "number", }, + "_ts": Object { + "Kind": 146, + "KindString": "Parameter", + }, }, "Parameter-5": Object { "ApiKind": "parameter", "Initializer": undefined, "IsOptional": false, "IsSpread": false, - "Kind": 146, - "KindString": "Parameter", "Location": Object { "Character": 5, "FileName": "./cases/InterfaceDeclaration4.ts", @@ -934,14 +988,16 @@ Object { "ReferenceId": undefined, "Text": "string", }, + "_ts": Object { + "Kind": 146, + "KindString": "Parameter", + }, }, "Parameter-6": Object { "ApiKind": "parameter", "Initializer": undefined, "IsOptional": false, "IsSpread": false, - "Kind": 146, - "KindString": "Parameter", "Location": Object { "Character": 7, "FileName": "./cases/InterfaceDeclaration4.ts", @@ -962,14 +1018,16 @@ Object { "ReferenceId": undefined, "Text": "number", }, + "_ts": Object { + "Kind": 146, + "KindString": "Parameter", + }, }, "Parameter-7": Object { "ApiKind": "parameter", "Initializer": undefined, "IsOptional": false, "IsSpread": false, - "Kind": 146, - "KindString": "Parameter", "Location": Object { "Character": 7, "FileName": "./cases/InterfaceDeclaration4.ts", @@ -990,14 +1048,16 @@ Object { "ReferenceId": undefined, "Text": "string", }, + "_ts": Object { + "Kind": 146, + "KindString": "Parameter", + }, }, "Parameter-8": Object { "ApiKind": "parameter", "Initializer": undefined, "IsOptional": false, "IsSpread": false, - "Kind": 146, - "KindString": "Parameter", "Location": Object { "Character": 8, "FileName": "./cases/InterfaceDeclaration4.ts", @@ -1018,14 +1078,16 @@ Object { "ReferenceId": undefined, "Text": "number", }, + "_ts": Object { + "Kind": 146, + "KindString": "Parameter", + }, }, "Parameter-9": Object { "ApiKind": "parameter", "Initializer": undefined, "IsOptional": false, "IsSpread": false, - "Kind": 146, - "KindString": "Parameter", "Location": Object { "Character": 5, "FileName": "./cases/InterfaceDeclaration4.ts", @@ -1046,13 +1108,15 @@ Object { "ReferenceId": undefined, "Text": "number", }, + "_ts": Object { + "Kind": 146, + "KindString": "Parameter", + }, }, "PropertySignature-0": Object { "ApiKind": "property", "IsOptional": false, "IsReadonly": false, - "Kind": 148, - "KindString": "PropertySignature", "Location": Object { "Character": 4, "FileName": "./cases/InterfaceDeclaration4.ts", @@ -1073,13 +1137,15 @@ Object { "ReferenceId": undefined, "Text": "any", }, + "_ts": Object { + "Kind": 148, + "KindString": "PropertySignature", + }, }, "PropertySignature-1": Object { "ApiKind": "property", "IsOptional": true, "IsReadonly": false, - "Kind": 148, - "KindString": "PropertySignature", "Location": Object { "Character": 4, "FileName": "./cases/InterfaceDeclaration4.ts", @@ -1100,13 +1166,15 @@ Object { "ReferenceId": undefined, "Text": "any", }, + "_ts": Object { + "Kind": 148, + "KindString": "PropertySignature", + }, }, "PropertySignature-2": Object { "ApiKind": "property", "IsOptional": false, "IsReadonly": false, - "Kind": 148, - "KindString": "PropertySignature", "Location": Object { "Character": 4, "FileName": "./cases/InterfaceDeclaration4.ts", @@ -1127,13 +1195,15 @@ Object { "ReferenceId": undefined, "Text": "string", }, + "_ts": Object { + "Kind": 148, + "KindString": "PropertySignature", + }, }, "PropertySignature-3": Object { "ApiKind": "property", "IsOptional": true, "IsReadonly": false, - "Kind": 148, - "KindString": "PropertySignature", "Location": Object { "Character": 4, "FileName": "./cases/InterfaceDeclaration4.ts", @@ -1154,11 +1224,13 @@ Object { "ReferenceId": undefined, "Text": "number", }, + "_ts": Object { + "Kind": 148, + "KindString": "PropertySignature", + }, }, "SourceFile-0": Object { "ApiKind": "source-file", - "Kind": 268, - "KindString": "SourceFile", "Location": Object { "Character": 0, "FileName": "./cases/InterfaceDeclaration4.ts", @@ -1226,11 +1298,13 @@ Object { "JSDocTags": Array [], }, "Name": "InterfaceDeclaration4.ts", + "_ts": Object { + "Kind": 268, + "KindString": "SourceFile", + }, }, "VariableDeclaration-0": Object { "ApiKind": "variable", - "Kind": 226, - "KindString": "VariableDeclaration", "Location": Object { "Character": 11, "FileName": "./cases/InterfaceDeclaration4.ts", @@ -1252,6 +1326,10 @@ Object { "Text": "c1", }, "VariableDeclarationType": "var", + "_ts": Object { + "Kind": 226, + "KindString": "VariableDeclaration", + }, }, }, } diff --git a/tests/cases/__tests__/__snapshots__/InterfaceDeclaration5.test.ts.snap b/tests/cases/__tests__/__snapshots__/InterfaceDeclaration5.test.ts.snap index e846f761..55599925 100644 --- a/tests/cases/__tests__/__snapshots__/InterfaceDeclaration5.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/InterfaceDeclaration5.test.ts.snap @@ -9,8 +9,6 @@ Object { "CallSignature-0": Object { "ApiKind": "call", "IsOverloadBase": false, - "Kind": 155, - "KindString": "CallSignature", "Location": Object { "Character": 4, "FileName": "./cases/InterfaceDeclaration5.ts", @@ -47,12 +45,14 @@ Object { ], }, ], + "_ts": Object { + "Kind": 155, + "KindString": "CallSignature", + }, }, "InterfaceDeclaration-0": Object { "ApiKind": "interface", "Extends": Array [], - "Kind": 230, - "KindString": "InterfaceDeclaration", "Location": Object { "Character": 0, "FileName": "./cases/InterfaceDeclaration5.ts", @@ -73,14 +73,16 @@ Object { }, "Name": "GenericIdentityFn", "TypeParameters": Array [], + "_ts": Object { + "Kind": 230, + "KindString": "InterfaceDeclaration", + }, }, "Parameter-0": Object { "ApiKind": "parameter", "Initializer": undefined, "IsOptional": false, "IsSpread": false, - "Kind": 146, - "KindString": "Parameter", "Location": Object { "Character": 13, "FileName": "./cases/InterfaceDeclaration5.ts", @@ -101,11 +103,13 @@ Object { "ReferenceId": "TypeParameter-0", "Text": "TValue", }, + "_ts": Object { + "Kind": 146, + "KindString": "Parameter", + }, }, "SourceFile-0": Object { "ApiKind": "source-file", - "Kind": 268, - "KindString": "SourceFile", "Location": Object { "Character": 0, "FileName": "./cases/InterfaceDeclaration5.ts", @@ -125,13 +129,15 @@ Object { "JSDocTags": Array [], }, "Name": "InterfaceDeclaration5.ts", + "_ts": Object { + "Kind": 268, + "KindString": "SourceFile", + }, }, "TypeParameter-0": Object { "ApiKind": "type-parameter", "ConstraintType": undefined, "DefaultType": undefined, - "Kind": 145, - "KindString": "TypeParameter", "Location": Object { "Character": 5, "FileName": "./cases/InterfaceDeclaration5.ts", @@ -143,6 +149,10 @@ Object { "JSDocTags": Array [], }, "Name": "TValue", + "_ts": Object { + "Kind": 145, + "KindString": "TypeParameter", + }, }, }, } diff --git a/tests/cases/__tests__/__snapshots__/InterfaceDeclaration6.test.ts.snap b/tests/cases/__tests__/__snapshots__/InterfaceDeclaration6.test.ts.snap index 2fdf144b..bc0e14d3 100644 --- a/tests/cases/__tests__/__snapshots__/InterfaceDeclaration6.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/InterfaceDeclaration6.test.ts.snap @@ -9,8 +9,6 @@ Object { "InterfaceDeclaration-0": Object { "ApiKind": "interface", "Extends": Array [], - "Kind": 230, - "KindString": "InterfaceDeclaration", "Location": Object { "Character": 0, "FileName": "./cases/InterfaceDeclaration6.ts", @@ -38,13 +36,15 @@ Object { ], }, ], + "_ts": Object { + "Kind": 230, + "KindString": "InterfaceDeclaration", + }, }, "MethodSignature-0": Object { "ApiKind": "method", "IsOptional": false, "IsOverloadBase": false, - "Kind": 150, - "KindString": "MethodSignature", "Location": Object { "Character": 4, "FileName": "./cases/InterfaceDeclaration6.ts", @@ -81,14 +81,16 @@ Object { ], }, ], + "_ts": Object { + "Kind": 150, + "KindString": "MethodSignature", + }, }, "Parameter-0": Object { "ApiKind": "parameter", "Initializer": undefined, "IsOptional": false, "IsSpread": false, - "Kind": 146, - "KindString": "Parameter", "Location": Object { "Character": 16, "FileName": "./cases/InterfaceDeclaration6.ts", @@ -109,11 +111,13 @@ Object { "ReferenceId": undefined, "Text": "string", }, + "_ts": Object { + "Kind": 146, + "KindString": "Parameter", + }, }, "SourceFile-0": Object { "ApiKind": "source-file", - "Kind": 268, - "KindString": "SourceFile", "Location": Object { "Character": 0, "FileName": "./cases/InterfaceDeclaration6.ts", @@ -133,13 +137,15 @@ Object { "JSDocTags": Array [], }, "Name": "InterfaceDeclaration6.ts", + "_ts": Object { + "Kind": 268, + "KindString": "SourceFile", + }, }, "TypeParameter-0": Object { "ApiKind": "type-parameter", "ConstraintType": undefined, "DefaultType": undefined, - "Kind": 145, - "KindString": "TypeParameter", "Location": Object { "Character": 8, "FileName": "./cases/InterfaceDeclaration6.ts", @@ -151,13 +157,15 @@ Object { "JSDocTags": Array [], }, "Name": "TValue", + "_ts": Object { + "Kind": 145, + "KindString": "TypeParameter", + }, }, "TypeParameter-1": Object { "ApiKind": "type-parameter", "ConstraintType": undefined, "DefaultType": undefined, - "Kind": 145, - "KindString": "TypeParameter", "Location": Object { "Character": 21, "FileName": "./cases/InterfaceDeclaration6.ts", @@ -169,6 +177,10 @@ Object { "JSDocTags": Array [], }, "Name": "TValue", + "_ts": Object { + "Kind": 145, + "KindString": "TypeParameter", + }, }, }, } diff --git a/tests/cases/__tests__/__snapshots__/InterfaceDeclaration7.test.ts.snap b/tests/cases/__tests__/__snapshots__/InterfaceDeclaration7.test.ts.snap index 35512ba1..eda330a4 100644 --- a/tests/cases/__tests__/__snapshots__/InterfaceDeclaration7.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/InterfaceDeclaration7.test.ts.snap @@ -9,8 +9,6 @@ Object { "InterfaceDeclaration-0": Object { "ApiKind": "interface", "Extends": Array [], - "Kind": 230, - "KindString": "InterfaceDeclaration", "Location": Object { "Character": 0, "FileName": "./cases/InterfaceDeclaration7.ts", @@ -31,13 +29,15 @@ Object { }, "Name": "Foo", "TypeParameters": Array [], + "_ts": Object { + "Kind": 230, + "KindString": "InterfaceDeclaration", + }, }, "PropertySignature-0": Object { "ApiKind": "property", "IsOptional": false, "IsReadonly": true, - "Kind": 148, - "KindString": "PropertySignature", "Location": Object { "Character": 4, "FileName": "./cases/InterfaceDeclaration7.ts", @@ -58,11 +58,13 @@ Object { "ReferenceId": undefined, "Text": "string", }, + "_ts": Object { + "Kind": 148, + "KindString": "PropertySignature", + }, }, "SourceFile-0": Object { "ApiKind": "source-file", - "Kind": 268, - "KindString": "SourceFile", "Location": Object { "Character": 0, "FileName": "./cases/InterfaceDeclaration7.ts", @@ -82,6 +84,10 @@ Object { "JSDocTags": Array [], }, "Name": "InterfaceDeclaration7.ts", + "_ts": Object { + "Kind": 268, + "KindString": "SourceFile", + }, }, }, } diff --git a/tests/cases/__tests__/__snapshots__/InterfaceSubtyping.test.ts.snap b/tests/cases/__tests__/__snapshots__/InterfaceSubtyping.test.ts.snap index a8d78e2e..c4546b7b 100644 --- a/tests/cases/__tests__/__snapshots__/InterfaceSubtyping.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/InterfaceSubtyping.test.ts.snap @@ -21,8 +21,6 @@ Object { }, ], "IsAbstract": false, - "Kind": 229, - "KindString": "ClassDeclaration", "Location": Object { "Character": 0, "FileName": "./cases/InterfaceSubtyping.ts", @@ -49,13 +47,15 @@ Object { }, "Name": "Camera", "TypeParameters": Array [], + "_ts": Object { + "Kind": 229, + "KindString": "ClassDeclaration", + }, }, "Constructor-0": Object { "AccessModifier": "public", "ApiKind": "class-constructor", "IsOverloadBase": false, - "Kind": 152, - "KindString": "Constructor", "Location": Object { "Character": 4, "FileName": "./cases/InterfaceSubtyping.ts", @@ -75,12 +75,14 @@ Object { ], }, ], + "_ts": Object { + "Kind": 152, + "KindString": "Constructor", + }, }, "InterfaceDeclaration-0": Object { "ApiKind": "interface", "Extends": Array [], - "Kind": 230, - "KindString": "InterfaceDeclaration", "Location": Object { "Character": 0, "FileName": "./cases/InterfaceSubtyping.ts", @@ -101,6 +103,10 @@ Object { }, "Name": "Face", "TypeParameters": Array [], + "_ts": Object { + "Kind": 230, + "KindString": "InterfaceDeclaration", + }, }, "MethodDeclaration-0": Object { "AccessModifier": "public", @@ -110,8 +116,6 @@ Object { "IsOptional": false, "IsOverloadBase": false, "IsStatic": false, - "Kind": 151, - "KindString": "MethodDeclaration", "Location": Object { "Character": 4, "FileName": "./cases/InterfaceSubtyping.ts", @@ -134,13 +138,15 @@ Object { "Text": "string", }, "TypeParameters": Array [], + "_ts": Object { + "Kind": 151, + "KindString": "MethodDeclaration", + }, }, "MethodSignature-0": Object { "ApiKind": "method", "IsOptional": false, "IsOverloadBase": false, - "Kind": 150, - "KindString": "MethodSignature", "Location": Object { "Character": 4, "FileName": "./cases/InterfaceSubtyping.ts", @@ -163,14 +169,16 @@ Object { "Text": "void", }, "TypeParameters": Array [], + "_ts": Object { + "Kind": 150, + "KindString": "MethodSignature", + }, }, "Parameter-0": Object { "ApiKind": "parameter", "Initializer": undefined, "IsOptional": false, "IsSpread": false, - "Kind": 146, - "KindString": "Parameter", "Location": Object { "Character": 16, "FileName": "./cases/InterfaceSubtyping.ts", @@ -191,11 +199,13 @@ Object { "ReferenceId": undefined, "Text": "string", }, + "_ts": Object { + "Kind": 146, + "KindString": "Parameter", + }, }, "SourceFile-0": Object { "ApiKind": "source-file", - "Kind": 268, - "KindString": "SourceFile", "Location": Object { "Character": 0, "FileName": "./cases/InterfaceSubtyping.ts", @@ -221,6 +231,10 @@ Object { "JSDocTags": Array [], }, "Name": "InterfaceSubtyping.ts", + "_ts": Object { + "Kind": 268, + "KindString": "SourceFile", + }, }, }, } diff --git a/tests/cases/__tests__/__snapshots__/MappedDeclaration1.test.ts.snap b/tests/cases/__tests__/__snapshots__/MappedDeclaration1.test.ts.snap new file mode 100644 index 00000000..e6732ee5 --- /dev/null +++ b/tests/cases/__tests__/__snapshots__/MappedDeclaration1.test.ts.snap @@ -0,0 +1,123 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`MappedDeclaration1 1`] = ` +Object { + "EntryFiles": Array [ + "SourceFile-0", + ], + "Registry": Object { + "MappedType-0": Object { + "ApiKind": "mapped", + "IsOptional": false, + "IsReadonly": false, + "Location": Object { + "Character": 21, + "FileName": "./cases/MappedDeclaration1.ts", + "IsExternalPackage": false, + "Line": 0, + }, + "Metadata": Object { + "DocumentationComment": "", + "JSDocTags": Array [], + }, + "Name": "__type", + "Type": Object { + "ApiTypeKind": "basic", + "Flags": 4, + "FlagsString": "Number", + "Generics": undefined, + "Name": undefined, + "ReferenceId": undefined, + "Text": "number", + }, + "TypeParameter": "TypeParameter-0", + "_ts": Object { + "Kind": 172, + "KindString": "MappedType", + }, + }, + "SourceFile-0": Object { + "ApiKind": "source-file", + "Location": Object { + "Character": 0, + "FileName": "./cases/MappedDeclaration1.ts", + "IsExternalPackage": false, + "Line": 0, + }, + "Members": Array [ + Object { + "Alias": "mapped", + "Ids": Array [ + "TypeAliasDeclaration-0", + ], + }, + ], + "Metadata": Object { + "DocumentationComment": "", + "JSDocTags": Array [], + }, + "Name": "MappedDeclaration1.ts", + "_ts": Object { + "Kind": 268, + "KindString": "SourceFile", + }, + }, + "TypeAliasDeclaration-0": Object { + "ApiKind": "type", + "Location": Object { + "Character": 0, + "FileName": "./cases/MappedDeclaration1.ts", + "IsExternalPackage": false, + "Line": 0, + }, + "Metadata": Object { + "DocumentationComment": "", + "JSDocTags": Array [], + }, + "Name": "mapped", + "Type": Object { + "ApiTypeKind": "basic", + "Flags": 32768, + "FlagsString": "Object", + "Generics": undefined, + "Name": "__type", + "ReferenceId": "MappedType-0", + "Text": "mapped", + }, + "TypeParameters": Array [], + "_ts": Object { + "Kind": 231, + "KindString": "TypeAliasDeclaration", + }, + }, + "TypeParameter-0": Object { + "ApiKind": "type-parameter", + "ConstraintType": Object { + "ApiTypeKind": "basic", + "Flags": 32, + "FlagsString": "StringLiteral", + "Generics": undefined, + "Name": undefined, + "ReferenceId": undefined, + "Text": "\\"a-b-c\\"", + }, + "DefaultType": undefined, + "Location": Object { + "Character": 23, + "FileName": "./cases/MappedDeclaration1.ts", + "IsExternalPackage": false, + "Line": 0, + }, + "Metadata": Object { + "DocumentationComment": "", + "JSDocTags": Array [], + }, + "Name": "K", + "_ts": Object { + "Kind": 145, + "KindString": "TypeParameter", + }, + }, + }, +} +`; diff --git a/tests/cases/__tests__/__snapshots__/MappedDeclaration2.test.ts.snap b/tests/cases/__tests__/__snapshots__/MappedDeclaration2.test.ts.snap new file mode 100644 index 00000000..8504e863 --- /dev/null +++ b/tests/cases/__tests__/__snapshots__/MappedDeclaration2.test.ts.snap @@ -0,0 +1,240 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`MappedDeclaration2 1`] = ` +Object { + "EntryFiles": Array [ + "SourceFile-0", + ], + "Registry": Object { + "InterfaceDeclaration-0": Object { + "ApiKind": "interface", + "Extends": Array [], + "Location": Object { + "Character": 0, + "FileName": "./cases/MappedDeclaration2.ts", + "IsExternalPackage": false, + "Line": 0, + }, + "Members": Array [ + Object { + "Alias": "Name", + "Ids": Array [ + "PropertySignature-0", + ], + }, + Object { + "Alias": "Age", + "Ids": Array [ + "PropertySignature-1", + ], + }, + ], + "Metadata": Object { + "DocumentationComment": "", + "JSDocTags": Array [], + }, + "Name": "Foo", + "TypeParameters": Array [], + "_ts": Object { + "Kind": 230, + "KindString": "InterfaceDeclaration", + }, + }, + "MappedType-0": Object { + "ApiKind": "mapped", + "IsOptional": false, + "IsReadonly": false, + "Location": Object { + "Character": 21, + "FileName": "./cases/MappedDeclaration2.ts", + "IsExternalPackage": false, + "Line": 5, + }, + "Metadata": Object { + "DocumentationComment": "", + "JSDocTags": Array [], + }, + "Name": "__type", + "Type": Object { + "ApiTypeKind": "basic", + "Flags": 4, + "FlagsString": "Number", + "Generics": undefined, + "Name": undefined, + "ReferenceId": undefined, + "Text": "number", + }, + "TypeParameter": "TypeParameter-0", + "_ts": Object { + "Kind": 172, + "KindString": "MappedType", + }, + }, + "PropertySignature-0": Object { + "ApiKind": "property", + "IsOptional": false, + "IsReadonly": false, + "Location": Object { + "Character": 4, + "FileName": "./cases/MappedDeclaration2.ts", + "IsExternalPackage": false, + "Line": 1, + }, + "Metadata": Object { + "DocumentationComment": "", + "JSDocTags": Array [], + }, + "Name": "Name", + "Type": Object { + "ApiTypeKind": "basic", + "Flags": 2, + "FlagsString": "String", + "Generics": undefined, + "Name": undefined, + "ReferenceId": undefined, + "Text": "string", + }, + "_ts": Object { + "Kind": 148, + "KindString": "PropertySignature", + }, + }, + "PropertySignature-1": Object { + "ApiKind": "property", + "IsOptional": false, + "IsReadonly": false, + "Location": Object { + "Character": 4, + "FileName": "./cases/MappedDeclaration2.ts", + "IsExternalPackage": false, + "Line": 2, + }, + "Metadata": Object { + "DocumentationComment": "", + "JSDocTags": Array [], + }, + "Name": "Age", + "Type": Object { + "ApiTypeKind": "basic", + "Flags": 4, + "FlagsString": "Number", + "Generics": undefined, + "Name": undefined, + "ReferenceId": undefined, + "Text": "number", + }, + "_ts": Object { + "Kind": 148, + "KindString": "PropertySignature", + }, + }, + "SourceFile-0": Object { + "ApiKind": "source-file", + "Location": Object { + "Character": 0, + "FileName": "./cases/MappedDeclaration2.ts", + "IsExternalPackage": false, + "Line": 0, + }, + "Members": Array [ + Object { + "Alias": "Foo", + "Ids": Array [ + "InterfaceDeclaration-0", + ], + }, + Object { + "Alias": "mapped", + "Ids": Array [ + "TypeAliasDeclaration-0", + ], + }, + ], + "Metadata": Object { + "DocumentationComment": "", + "JSDocTags": Array [], + }, + "Name": "MappedDeclaration2.ts", + "_ts": Object { + "Kind": 268, + "KindString": "SourceFile", + }, + }, + "TypeAliasDeclaration-0": Object { + "ApiKind": "type", + "Location": Object { + "Character": 0, + "FileName": "./cases/MappedDeclaration2.ts", + "IsExternalPackage": false, + "Line": 5, + }, + "Metadata": Object { + "DocumentationComment": "", + "JSDocTags": Array [], + }, + "Name": "mapped", + "Type": Object { + "ApiTypeKind": "basic", + "Flags": 32768, + "FlagsString": "Object", + "Generics": undefined, + "Name": "__type", + "ReferenceId": "MappedType-0", + "Text": "mapped", + }, + "TypeParameters": Array [], + "_ts": Object { + "Kind": 231, + "KindString": "TypeAliasDeclaration", + }, + }, + "TypeParameter-0": Object { + "ApiKind": "type-parameter", + "ConstraintType": Object { + "ApiTypeKind": "union", + "Flags": 65536, + "FlagsString": "Union", + "Name": undefined, + "ReferenceId": undefined, + "Text": "\\"Name\\" | \\"Age\\"", + "Types": Array [ + Object { + "ApiTypeKind": "basic", + "Flags": 32, + "FlagsString": "StringLiteral", + "Generics": undefined, + "Name": undefined, + "ReferenceId": undefined, + "Text": "\\"Name\\"", + }, + Object { + "ApiTypeKind": "basic", + "Flags": 32, + "FlagsString": "StringLiteral", + "Generics": undefined, + "Name": undefined, + "ReferenceId": undefined, + "Text": "\\"Age\\"", + }, + ], + }, + "DefaultType": undefined, + "Location": Object { + "Character": 23, + "FileName": "./cases/MappedDeclaration2.ts", + "IsExternalPackage": false, + "Line": 5, + }, + "Metadata": Object { + "DocumentationComment": "", + "JSDocTags": Array [], + }, + "Name": "K", + "_ts": Object { + "Kind": 145, + "KindString": "TypeParameter", + }, + }, + }, +} +`; diff --git a/tests/cases/__tests__/__snapshots__/MappedDeclaration3.test.ts.snap b/tests/cases/__tests__/__snapshots__/MappedDeclaration3.test.ts.snap new file mode 100644 index 00000000..cc899872 --- /dev/null +++ b/tests/cases/__tests__/__snapshots__/MappedDeclaration3.test.ts.snap @@ -0,0 +1,240 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`MappedDeclaration3 1`] = ` +Object { + "EntryFiles": Array [ + "SourceFile-0", + ], + "Registry": Object { + "InterfaceDeclaration-0": Object { + "ApiKind": "interface", + "Extends": Array [], + "Location": Object { + "Character": 0, + "FileName": "./cases/MappedDeclaration3.ts", + "IsExternalPackage": false, + "Line": 0, + }, + "Members": Array [ + Object { + "Alias": "Name", + "Ids": Array [ + "PropertySignature-0", + ], + }, + Object { + "Alias": "Age", + "Ids": Array [ + "PropertySignature-1", + ], + }, + ], + "Metadata": Object { + "DocumentationComment": "", + "JSDocTags": Array [], + }, + "Name": "Foo", + "TypeParameters": Array [], + "_ts": Object { + "Kind": 230, + "KindString": "InterfaceDeclaration", + }, + }, + "MappedType-0": Object { + "ApiKind": "mapped", + "IsOptional": false, + "IsReadonly": true, + "Location": Object { + "Character": 21, + "FileName": "./cases/MappedDeclaration3.ts", + "IsExternalPackage": false, + "Line": 5, + }, + "Metadata": Object { + "DocumentationComment": "", + "JSDocTags": Array [], + }, + "Name": "__type", + "Type": Object { + "ApiTypeKind": "basic", + "Flags": 4, + "FlagsString": "Number", + "Generics": undefined, + "Name": undefined, + "ReferenceId": undefined, + "Text": "number", + }, + "TypeParameter": "TypeParameter-0", + "_ts": Object { + "Kind": 172, + "KindString": "MappedType", + }, + }, + "PropertySignature-0": Object { + "ApiKind": "property", + "IsOptional": false, + "IsReadonly": false, + "Location": Object { + "Character": 4, + "FileName": "./cases/MappedDeclaration3.ts", + "IsExternalPackage": false, + "Line": 1, + }, + "Metadata": Object { + "DocumentationComment": "", + "JSDocTags": Array [], + }, + "Name": "Name", + "Type": Object { + "ApiTypeKind": "basic", + "Flags": 2, + "FlagsString": "String", + "Generics": undefined, + "Name": undefined, + "ReferenceId": undefined, + "Text": "string", + }, + "_ts": Object { + "Kind": 148, + "KindString": "PropertySignature", + }, + }, + "PropertySignature-1": Object { + "ApiKind": "property", + "IsOptional": false, + "IsReadonly": false, + "Location": Object { + "Character": 4, + "FileName": "./cases/MappedDeclaration3.ts", + "IsExternalPackage": false, + "Line": 2, + }, + "Metadata": Object { + "DocumentationComment": "", + "JSDocTags": Array [], + }, + "Name": "Age", + "Type": Object { + "ApiTypeKind": "basic", + "Flags": 4, + "FlagsString": "Number", + "Generics": undefined, + "Name": undefined, + "ReferenceId": undefined, + "Text": "number", + }, + "_ts": Object { + "Kind": 148, + "KindString": "PropertySignature", + }, + }, + "SourceFile-0": Object { + "ApiKind": "source-file", + "Location": Object { + "Character": 0, + "FileName": "./cases/MappedDeclaration3.ts", + "IsExternalPackage": false, + "Line": 0, + }, + "Members": Array [ + Object { + "Alias": "Foo", + "Ids": Array [ + "InterfaceDeclaration-0", + ], + }, + Object { + "Alias": "mapped", + "Ids": Array [ + "TypeAliasDeclaration-0", + ], + }, + ], + "Metadata": Object { + "DocumentationComment": "", + "JSDocTags": Array [], + }, + "Name": "MappedDeclaration3.ts", + "_ts": Object { + "Kind": 268, + "KindString": "SourceFile", + }, + }, + "TypeAliasDeclaration-0": Object { + "ApiKind": "type", + "Location": Object { + "Character": 0, + "FileName": "./cases/MappedDeclaration3.ts", + "IsExternalPackage": false, + "Line": 5, + }, + "Metadata": Object { + "DocumentationComment": "", + "JSDocTags": Array [], + }, + "Name": "mapped", + "Type": Object { + "ApiTypeKind": "basic", + "Flags": 32768, + "FlagsString": "Object", + "Generics": undefined, + "Name": "__type", + "ReferenceId": "MappedType-0", + "Text": "mapped", + }, + "TypeParameters": Array [], + "_ts": Object { + "Kind": 231, + "KindString": "TypeAliasDeclaration", + }, + }, + "TypeParameter-0": Object { + "ApiKind": "type-parameter", + "ConstraintType": Object { + "ApiTypeKind": "union", + "Flags": 65536, + "FlagsString": "Union", + "Name": undefined, + "ReferenceId": undefined, + "Text": "\\"Name\\" | \\"Age\\"", + "Types": Array [ + Object { + "ApiTypeKind": "basic", + "Flags": 32, + "FlagsString": "StringLiteral", + "Generics": undefined, + "Name": undefined, + "ReferenceId": undefined, + "Text": "\\"Name\\"", + }, + Object { + "ApiTypeKind": "basic", + "Flags": 32, + "FlagsString": "StringLiteral", + "Generics": undefined, + "Name": undefined, + "ReferenceId": undefined, + "Text": "\\"Age\\"", + }, + ], + }, + "DefaultType": undefined, + "Location": Object { + "Character": 14, + "FileName": "./cases/MappedDeclaration3.ts", + "IsExternalPackage": false, + "Line": 6, + }, + "Metadata": Object { + "DocumentationComment": "", + "JSDocTags": Array [], + }, + "Name": "K", + "_ts": Object { + "Kind": 145, + "KindString": "TypeParameter", + }, + }, + }, +} +`; diff --git a/tests/cases/__tests__/__snapshots__/MappedDeclaration4.test.ts.snap b/tests/cases/__tests__/__snapshots__/MappedDeclaration4.test.ts.snap new file mode 100644 index 00000000..ad41ab69 --- /dev/null +++ b/tests/cases/__tests__/__snapshots__/MappedDeclaration4.test.ts.snap @@ -0,0 +1,240 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`MappedDeclaration4 1`] = ` +Object { + "EntryFiles": Array [ + "SourceFile-0", + ], + "Registry": Object { + "InterfaceDeclaration-0": Object { + "ApiKind": "interface", + "Extends": Array [], + "Location": Object { + "Character": 0, + "FileName": "./cases/MappedDeclaration4.ts", + "IsExternalPackage": false, + "Line": 0, + }, + "Members": Array [ + Object { + "Alias": "Name", + "Ids": Array [ + "PropertySignature-0", + ], + }, + Object { + "Alias": "Age", + "Ids": Array [ + "PropertySignature-1", + ], + }, + ], + "Metadata": Object { + "DocumentationComment": "", + "JSDocTags": Array [], + }, + "Name": "Foo", + "TypeParameters": Array [], + "_ts": Object { + "Kind": 230, + "KindString": "InterfaceDeclaration", + }, + }, + "MappedType-0": Object { + "ApiKind": "mapped", + "IsOptional": true, + "IsReadonly": false, + "Location": Object { + "Character": 21, + "FileName": "./cases/MappedDeclaration4.ts", + "IsExternalPackage": false, + "Line": 5, + }, + "Metadata": Object { + "DocumentationComment": "", + "JSDocTags": Array [], + }, + "Name": "__type", + "Type": Object { + "ApiTypeKind": "basic", + "Flags": 4, + "FlagsString": "Number", + "Generics": undefined, + "Name": undefined, + "ReferenceId": undefined, + "Text": "number", + }, + "TypeParameter": "TypeParameter-0", + "_ts": Object { + "Kind": 172, + "KindString": "MappedType", + }, + }, + "PropertySignature-0": Object { + "ApiKind": "property", + "IsOptional": false, + "IsReadonly": false, + "Location": Object { + "Character": 4, + "FileName": "./cases/MappedDeclaration4.ts", + "IsExternalPackage": false, + "Line": 1, + }, + "Metadata": Object { + "DocumentationComment": "", + "JSDocTags": Array [], + }, + "Name": "Name", + "Type": Object { + "ApiTypeKind": "basic", + "Flags": 2, + "FlagsString": "String", + "Generics": undefined, + "Name": undefined, + "ReferenceId": undefined, + "Text": "string", + }, + "_ts": Object { + "Kind": 148, + "KindString": "PropertySignature", + }, + }, + "PropertySignature-1": Object { + "ApiKind": "property", + "IsOptional": false, + "IsReadonly": false, + "Location": Object { + "Character": 4, + "FileName": "./cases/MappedDeclaration4.ts", + "IsExternalPackage": false, + "Line": 2, + }, + "Metadata": Object { + "DocumentationComment": "", + "JSDocTags": Array [], + }, + "Name": "Age", + "Type": Object { + "ApiTypeKind": "basic", + "Flags": 4, + "FlagsString": "Number", + "Generics": undefined, + "Name": undefined, + "ReferenceId": undefined, + "Text": "number", + }, + "_ts": Object { + "Kind": 148, + "KindString": "PropertySignature", + }, + }, + "SourceFile-0": Object { + "ApiKind": "source-file", + "Location": Object { + "Character": 0, + "FileName": "./cases/MappedDeclaration4.ts", + "IsExternalPackage": false, + "Line": 0, + }, + "Members": Array [ + Object { + "Alias": "Foo", + "Ids": Array [ + "InterfaceDeclaration-0", + ], + }, + Object { + "Alias": "mapped", + "Ids": Array [ + "TypeAliasDeclaration-0", + ], + }, + ], + "Metadata": Object { + "DocumentationComment": "", + "JSDocTags": Array [], + }, + "Name": "MappedDeclaration4.ts", + "_ts": Object { + "Kind": 268, + "KindString": "SourceFile", + }, + }, + "TypeAliasDeclaration-0": Object { + "ApiKind": "type", + "Location": Object { + "Character": 0, + "FileName": "./cases/MappedDeclaration4.ts", + "IsExternalPackage": false, + "Line": 5, + }, + "Metadata": Object { + "DocumentationComment": "", + "JSDocTags": Array [], + }, + "Name": "mapped", + "Type": Object { + "ApiTypeKind": "basic", + "Flags": 32768, + "FlagsString": "Object", + "Generics": undefined, + "Name": "__type", + "ReferenceId": "MappedType-0", + "Text": "mapped", + }, + "TypeParameters": Array [], + "_ts": Object { + "Kind": 231, + "KindString": "TypeAliasDeclaration", + }, + }, + "TypeParameter-0": Object { + "ApiKind": "type-parameter", + "ConstraintType": Object { + "ApiTypeKind": "union", + "Flags": 65536, + "FlagsString": "Union", + "Name": undefined, + "ReferenceId": undefined, + "Text": "\\"Name\\" | \\"Age\\"", + "Types": Array [ + Object { + "ApiTypeKind": "basic", + "Flags": 32, + "FlagsString": "StringLiteral", + "Generics": undefined, + "Name": undefined, + "ReferenceId": undefined, + "Text": "\\"Name\\"", + }, + Object { + "ApiTypeKind": "basic", + "Flags": 32, + "FlagsString": "StringLiteral", + "Generics": undefined, + "Name": undefined, + "ReferenceId": undefined, + "Text": "\\"Age\\"", + }, + ], + }, + "DefaultType": undefined, + "Location": Object { + "Character": 5, + "FileName": "./cases/MappedDeclaration4.ts", + "IsExternalPackage": false, + "Line": 6, + }, + "Metadata": Object { + "DocumentationComment": "", + "JSDocTags": Array [], + }, + "Name": "K", + "_ts": Object { + "Kind": 145, + "KindString": "TypeParameter", + }, + }, + }, +} +`; diff --git a/tests/cases/__tests__/__snapshots__/MultipleDeclaration.test.ts.snap b/tests/cases/__tests__/__snapshots__/MultipleDeclaration.test.ts.snap index 7945b4fb..df5a7f84 100644 --- a/tests/cases/__tests__/__snapshots__/MultipleDeclaration.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/MultipleDeclaration.test.ts.snap @@ -11,8 +11,6 @@ Object { "Extends": undefined, "Implements": Array [], "IsAbstract": false, - "Kind": 229, - "KindString": "ClassDeclaration", "Location": Object { "Character": 0, "FileName": "./cases/MultipleDeclaration.ts", @@ -40,14 +38,16 @@ Object { ], }, ], + "_ts": Object { + "Kind": 229, + "KindString": "ClassDeclaration", + }, }, "ClassDeclaration-1": Object { "ApiKind": "class", "Extends": undefined, "Implements": Array [], "IsAbstract": false, - "Kind": 229, - "KindString": "ClassDeclaration", "Location": Object { "Character": 0, "FileName": "./cases/MultipleDeclaration.ts", @@ -75,12 +75,14 @@ Object { ], }, ], + "_ts": Object { + "Kind": 229, + "KindString": "ClassDeclaration", + }, }, "InterfaceDeclaration-0": Object { "ApiKind": "interface", "Extends": Array [], - "Kind": 230, - "KindString": "InterfaceDeclaration", "Location": Object { "Character": 0, "FileName": "./cases/MultipleDeclaration.ts", @@ -108,12 +110,14 @@ Object { ], }, ], + "_ts": Object { + "Kind": 230, + "KindString": "InterfaceDeclaration", + }, }, "InterfaceDeclaration-1": Object { "ApiKind": "interface", "Extends": Array [], - "Kind": 230, - "KindString": "InterfaceDeclaration", "Location": Object { "Character": 0, "FileName": "./cases/MultipleDeclaration.ts", @@ -141,11 +145,13 @@ Object { ], }, ], + "_ts": Object { + "Kind": 230, + "KindString": "InterfaceDeclaration", + }, }, "ModuleDeclaration-0": Object { "ApiKind": "namespace", - "Kind": 233, - "KindString": "ModuleDeclaration", "Location": Object { "Character": 0, "FileName": "./cases/MultipleDeclaration.ts", @@ -158,6 +164,10 @@ Object { "JSDocTags": Array [], }, "Name": "M", + "_ts": Object { + "Kind": 233, + "KindString": "ModuleDeclaration", + }, }, "PropertyDeclaration-0": Object { "AccessModifier": "public", @@ -166,8 +176,6 @@ Object { "IsOptional": false, "IsReadonly": false, "IsStatic": false, - "Kind": 149, - "KindString": "PropertyDeclaration", "Location": Object { "Character": 4, "FileName": "./cases/MultipleDeclaration.ts", @@ -188,6 +196,10 @@ Object { "ReferenceId": undefined, "Text": "number", }, + "_ts": Object { + "Kind": 149, + "KindString": "PropertyDeclaration", + }, }, "PropertyDeclaration-1": Object { "AccessModifier": "public", @@ -196,8 +208,6 @@ Object { "IsOptional": false, "IsReadonly": false, "IsStatic": false, - "Kind": 149, - "KindString": "PropertyDeclaration", "Location": Object { "Character": 4, "FileName": "./cases/MultipleDeclaration.ts", @@ -218,13 +228,15 @@ Object { "ReferenceId": undefined, "Text": "number", }, + "_ts": Object { + "Kind": 149, + "KindString": "PropertyDeclaration", + }, }, "PropertySignature-0": Object { "ApiKind": "property", "IsOptional": false, "IsReadonly": false, - "Kind": 148, - "KindString": "PropertySignature", "Location": Object { "Character": 4, "FileName": "./cases/MultipleDeclaration.ts", @@ -245,13 +257,15 @@ Object { "ReferenceId": undefined, "Text": "string", }, + "_ts": Object { + "Kind": 148, + "KindString": "PropertySignature", + }, }, "PropertySignature-1": Object { "ApiKind": "property", "IsOptional": false, "IsReadonly": false, - "Kind": 148, - "KindString": "PropertySignature", "Location": Object { "Character": 4, "FileName": "./cases/MultipleDeclaration.ts", @@ -272,11 +286,13 @@ Object { "ReferenceId": undefined, "Text": "string", }, + "_ts": Object { + "Kind": 148, + "KindString": "PropertySignature", + }, }, "SourceFile-0": Object { "ApiKind": "source-file", - "Kind": 268, - "KindString": "SourceFile", "Location": Object { "Character": 0, "FileName": "./cases/MultipleDeclaration.ts", @@ -310,13 +326,15 @@ Object { "JSDocTags": Array [], }, "Name": "MultipleDeclaration.ts", + "_ts": Object { + "Kind": 268, + "KindString": "SourceFile", + }, }, "TypeParameter-0": Object { "ApiKind": "type-parameter", "ConstraintType": undefined, "DefaultType": undefined, - "Kind": 145, - "KindString": "TypeParameter", "Location": Object { "Character": 21, "FileName": "./cases/MultipleDeclaration.ts", @@ -328,13 +346,15 @@ Object { "JSDocTags": Array [], }, "Name": "T", + "_ts": Object { + "Kind": 145, + "KindString": "TypeParameter", + }, }, "TypeParameter-1": Object { "ApiKind": "type-parameter", "ConstraintType": undefined, "DefaultType": undefined, - "Kind": 145, - "KindString": "TypeParameter", "Location": Object { "Character": 17, "FileName": "./cases/MultipleDeclaration.ts", @@ -346,13 +366,15 @@ Object { "JSDocTags": Array [], }, "Name": "T", + "_ts": Object { + "Kind": 145, + "KindString": "TypeParameter", + }, }, "TypeParameter-2": Object { "ApiKind": "type-parameter", "ConstraintType": undefined, "DefaultType": undefined, - "Kind": 145, - "KindString": "TypeParameter", "Location": Object { "Character": 17, "FileName": "./cases/MultipleDeclaration.ts", @@ -364,13 +386,15 @@ Object { "JSDocTags": Array [], }, "Name": "T", + "_ts": Object { + "Kind": 145, + "KindString": "TypeParameter", + }, }, "TypeParameter-3": Object { "ApiKind": "type-parameter", "ConstraintType": undefined, "DefaultType": undefined, - "Kind": 145, - "KindString": "TypeParameter", "Location": Object { "Character": 21, "FileName": "./cases/MultipleDeclaration.ts", @@ -382,6 +406,10 @@ Object { "JSDocTags": Array [], }, "Name": "T", + "_ts": Object { + "Kind": 145, + "KindString": "TypeParameter", + }, }, }, } diff --git a/tests/cases/__tests__/__snapshots__/NamespaceDeclaration1.test.ts.snap b/tests/cases/__tests__/__snapshots__/NamespaceDeclaration1.test.ts.snap index a99ad42f..3415ed87 100644 --- a/tests/cases/__tests__/__snapshots__/NamespaceDeclaration1.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/NamespaceDeclaration1.test.ts.snap @@ -8,8 +8,6 @@ Object { "Registry": Object { "ModuleDeclaration-0": Object { "ApiKind": "namespace", - "Kind": 233, - "KindString": "ModuleDeclaration", "Location": Object { "Character": 0, "FileName": "./cases/NamespaceDeclaration1.ts", @@ -22,11 +20,13 @@ Object { "JSDocTags": Array [], }, "Name": "Foo", + "_ts": Object { + "Kind": 233, + "KindString": "ModuleDeclaration", + }, }, "SourceFile-0": Object { "ApiKind": "source-file", - "Kind": 268, - "KindString": "SourceFile", "Location": Object { "Character": 0, "FileName": "./cases/NamespaceDeclaration1.ts", @@ -46,6 +46,10 @@ Object { "JSDocTags": Array [], }, "Name": "NamespaceDeclaration1.ts", + "_ts": Object { + "Kind": 268, + "KindString": "SourceFile", + }, }, }, } diff --git a/tests/cases/__tests__/__snapshots__/NamespaceDeclaration2.test.ts.snap b/tests/cases/__tests__/__snapshots__/NamespaceDeclaration2.test.ts.snap index 6989d656..e0cf360f 100644 --- a/tests/cases/__tests__/__snapshots__/NamespaceDeclaration2.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/NamespaceDeclaration2.test.ts.snap @@ -8,8 +8,6 @@ Object { "Registry": Object { "ModuleDeclaration-0": Object { "ApiKind": "namespace", - "Kind": 233, - "KindString": "ModuleDeclaration", "Location": Object { "Character": 0, "FileName": "./cases/NamespaceDeclaration2.ts", @@ -29,11 +27,13 @@ Object { "JSDocTags": Array [], }, "Name": "Foo", + "_ts": Object { + "Kind": 233, + "KindString": "ModuleDeclaration", + }, }, "ModuleDeclaration-1": Object { "ApiKind": "namespace", - "Kind": 233, - "KindString": "ModuleDeclaration", "Location": Object { "Character": 4, "FileName": "./cases/NamespaceDeclaration2.ts", @@ -46,11 +46,13 @@ Object { "JSDocTags": Array [], }, "Name": "Bar", + "_ts": Object { + "Kind": 233, + "KindString": "ModuleDeclaration", + }, }, "SourceFile-0": Object { "ApiKind": "source-file", - "Kind": 268, - "KindString": "SourceFile", "Location": Object { "Character": 0, "FileName": "./cases/NamespaceDeclaration2.ts", @@ -70,6 +72,10 @@ Object { "JSDocTags": Array [], }, "Name": "NamespaceDeclaration2.ts", + "_ts": Object { + "Kind": 268, + "KindString": "SourceFile", + }, }, }, } diff --git a/tests/cases/__tests__/__snapshots__/NamespaceDeclaration3.test.ts.snap b/tests/cases/__tests__/__snapshots__/NamespaceDeclaration3.test.ts.snap index 47efc25d..6db7df07 100644 --- a/tests/cases/__tests__/__snapshots__/NamespaceDeclaration3.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/NamespaceDeclaration3.test.ts.snap @@ -8,8 +8,6 @@ Object { "Registry": Object { "ModuleDeclaration-0": Object { "ApiKind": "namespace", - "Kind": 233, - "KindString": "ModuleDeclaration", "Location": Object { "Character": 0, "FileName": "./cases/NamespaceDeclaration3.ts", @@ -29,11 +27,13 @@ Object { "JSDocTags": Array [], }, "Name": "Foo", + "_ts": Object { + "Kind": 233, + "KindString": "ModuleDeclaration", + }, }, "ModuleDeclaration-1": Object { "ApiKind": "namespace", - "Kind": 233, - "KindString": "ModuleDeclaration", "Location": Object { "Character": 4, "FileName": "./cases/NamespaceDeclaration3.ts", @@ -53,11 +53,13 @@ Object { "JSDocTags": Array [], }, "Name": "Bar", + "_ts": Object { + "Kind": 233, + "KindString": "ModuleDeclaration", + }, }, "SourceFile-0": Object { "ApiKind": "source-file", - "Kind": 268, - "KindString": "SourceFile", "Location": Object { "Character": 0, "FileName": "./cases/NamespaceDeclaration3.ts", @@ -77,11 +79,13 @@ Object { "JSDocTags": Array [], }, "Name": "NamespaceDeclaration3.ts", + "_ts": Object { + "Kind": 268, + "KindString": "SourceFile", + }, }, "VariableDeclaration-0": Object { "ApiKind": "variable", - "Kind": 226, - "KindString": "VariableDeclaration", "Location": Object { "Character": 21, "FileName": "./cases/NamespaceDeclaration3.ts", @@ -103,6 +107,10 @@ Object { "Text": "\\"world!\\"", }, "VariableDeclarationType": "const", + "_ts": Object { + "Kind": 226, + "KindString": "VariableDeclaration", + }, }, }, } diff --git a/tests/cases/__tests__/__snapshots__/ParameterDeclaration1.test.ts.snap b/tests/cases/__tests__/__snapshots__/ParameterDeclaration1.test.ts.snap index 9f637ba4..621579d7 100644 --- a/tests/cases/__tests__/__snapshots__/ParameterDeclaration1.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/ParameterDeclaration1.test.ts.snap @@ -10,8 +10,6 @@ Object { "ApiKind": "function", "IsAsync": false, "IsOverloadBase": false, - "Kind": 228, - "KindString": "FunctionDeclaration", "Location": Object { "Character": 0, "FileName": "./cases/ParameterDeclaration1.ts", @@ -41,14 +39,16 @@ Object { "Text": "void", }, "TypeParameters": Array [], + "_ts": Object { + "Kind": 228, + "KindString": "FunctionDeclaration", + }, }, "Parameter-0": Object { "ApiKind": "parameter", "Initializer": undefined, "IsOptional": true, "IsSpread": false, - "Kind": 146, - "KindString": "Parameter", "Location": Object { "Character": 28, "FileName": "./cases/ParameterDeclaration1.ts", @@ -88,11 +88,13 @@ Object { }, ], }, + "_ts": Object { + "Kind": 146, + "KindString": "Parameter", + }, }, "SourceFile-0": Object { "ApiKind": "source-file", - "Kind": 268, - "KindString": "SourceFile", "Location": Object { "Character": 0, "FileName": "./cases/ParameterDeclaration1.ts", @@ -112,6 +114,10 @@ Object { "JSDocTags": Array [], }, "Name": "ParameterDeclaration1.ts", + "_ts": Object { + "Kind": 268, + "KindString": "SourceFile", + }, }, }, } diff --git a/tests/cases/__tests__/__snapshots__/ParameterDeclaration2.test.ts.snap b/tests/cases/__tests__/__snapshots__/ParameterDeclaration2.test.ts.snap index ad27a2ae..b115dbe1 100644 --- a/tests/cases/__tests__/__snapshots__/ParameterDeclaration2.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/ParameterDeclaration2.test.ts.snap @@ -10,8 +10,6 @@ Object { "ApiKind": "function", "IsAsync": false, "IsOverloadBase": false, - "Kind": 228, - "KindString": "FunctionDeclaration", "Location": Object { "Character": 0, "FileName": "./cases/ParameterDeclaration2.ts", @@ -41,14 +39,16 @@ Object { "Text": "void", }, "TypeParameters": Array [], + "_ts": Object { + "Kind": 228, + "KindString": "FunctionDeclaration", + }, }, "Parameter-0": Object { "ApiKind": "parameter", "Initializer": undefined, "IsOptional": false, "IsSpread": true, - "Kind": 146, - "KindString": "Parameter", "Location": Object { "Character": 28, "FileName": "./cases/ParameterDeclaration2.ts", @@ -79,11 +79,13 @@ Object { "ReferenceId": undefined, "Text": "string[]", }, + "_ts": Object { + "Kind": 146, + "KindString": "Parameter", + }, }, "SourceFile-0": Object { "ApiKind": "source-file", - "Kind": 268, - "KindString": "SourceFile", "Location": Object { "Character": 0, "FileName": "./cases/ParameterDeclaration2.ts", @@ -103,6 +105,10 @@ Object { "JSDocTags": Array [], }, "Name": "ParameterDeclaration2.ts", + "_ts": Object { + "Kind": 268, + "KindString": "SourceFile", + }, }, }, } diff --git a/tests/cases/__tests__/__snapshots__/ParameterDeclaration3.test.ts.snap b/tests/cases/__tests__/__snapshots__/ParameterDeclaration3.test.ts.snap index 7ac49408..157d359a 100644 --- a/tests/cases/__tests__/__snapshots__/ParameterDeclaration3.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/ParameterDeclaration3.test.ts.snap @@ -10,8 +10,6 @@ Object { "ApiKind": "function", "IsAsync": false, "IsOverloadBase": false, - "Kind": 228, - "KindString": "FunctionDeclaration", "Location": Object { "Character": 0, "FileName": "./cases/ParameterDeclaration3.ts", @@ -41,14 +39,16 @@ Object { "Text": "void", }, "TypeParameters": Array [], + "_ts": Object { + "Kind": 228, + "KindString": "FunctionDeclaration", + }, }, "Parameter-0": Object { "ApiKind": "parameter", "Initializer": "\\"Hello World!\\"", "IsOptional": false, "IsSpread": false, - "Kind": 146, - "KindString": "Parameter", "Location": Object { "Character": 28, "FileName": "./cases/ParameterDeclaration3.ts", @@ -69,11 +69,13 @@ Object { "ReferenceId": undefined, "Text": "string", }, + "_ts": Object { + "Kind": 146, + "KindString": "Parameter", + }, }, "SourceFile-0": Object { "ApiKind": "source-file", - "Kind": 268, - "KindString": "SourceFile", "Location": Object { "Character": 0, "FileName": "./cases/ParameterDeclaration3.ts", @@ -93,6 +95,10 @@ Object { "JSDocTags": Array [], }, "Name": "ParameterDeclaration3.ts", + "_ts": Object { + "Kind": 268, + "KindString": "SourceFile", + }, }, }, } diff --git a/tests/cases/__tests__/__snapshots__/SetAccessor1.test.ts.snap b/tests/cases/__tests__/__snapshots__/SetAccessor1.test.ts.snap index 67e19653..d7ffdd2b 100644 --- a/tests/cases/__tests__/__snapshots__/SetAccessor1.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/SetAccessor1.test.ts.snap @@ -11,8 +11,6 @@ Object { "Extends": undefined, "Implements": Array [], "IsAbstract": false, - "Kind": 229, - "KindString": "ClassDeclaration", "Location": Object { "Character": 0, "FileName": "./cases/SetAccessor1.ts", @@ -33,14 +31,16 @@ Object { }, "Name": "Foo", "TypeParameters": Array [], + "_ts": Object { + "Kind": 229, + "KindString": "ClassDeclaration", + }, }, "Parameter-0": Object { "ApiKind": "parameter", "Initializer": undefined, "IsOptional": false, "IsSpread": false, - "Kind": 146, - "KindString": "Parameter", "Location": Object { "Character": 19, "FileName": "./cases/SetAccessor1.ts", @@ -61,14 +61,16 @@ Object { "ReferenceId": undefined, "Text": "string", }, + "_ts": Object { + "Kind": 146, + "KindString": "Parameter", + }, }, "SetAccessor-0": Object { "AccessModifier": "public", "ApiKind": "set-accessor", "IsAbstract": false, "IsStatic": false, - "Kind": 154, - "KindString": "SetAccessor", "Location": Object { "Character": 4, "FileName": "./cases/SetAccessor1.ts", @@ -86,11 +88,13 @@ Object { "Parameter-0", ], }, + "_ts": Object { + "Kind": 154, + "KindString": "SetAccessor", + }, }, "SourceFile-0": Object { "ApiKind": "source-file", - "Kind": 268, - "KindString": "SourceFile", "Location": Object { "Character": 0, "FileName": "./cases/SetAccessor1.ts", @@ -110,6 +114,10 @@ Object { "JSDocTags": Array [], }, "Name": "SetAccessor1.ts", + "_ts": Object { + "Kind": 268, + "KindString": "SourceFile", + }, }, }, } diff --git a/tests/cases/__tests__/__snapshots__/SetAccessor2.test.ts.snap b/tests/cases/__tests__/__snapshots__/SetAccessor2.test.ts.snap index 32b0b336..dc78b55e 100644 --- a/tests/cases/__tests__/__snapshots__/SetAccessor2.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/SetAccessor2.test.ts.snap @@ -11,8 +11,6 @@ Object { "Extends": undefined, "Implements": Array [], "IsAbstract": false, - "Kind": 229, - "KindString": "ClassDeclaration", "Location": Object { "Character": 0, "FileName": "./cases/SetAccessor2.ts", @@ -33,14 +31,16 @@ Object { }, "Name": "Foo", "TypeParameters": Array [], + "_ts": Object { + "Kind": 229, + "KindString": "ClassDeclaration", + }, }, "Parameter-0": Object { "ApiKind": "parameter", "Initializer": undefined, "IsOptional": false, "IsSpread": false, - "Kind": 146, - "KindString": "Parameter", "Location": Object { "Character": 19, "FileName": "./cases/SetAccessor2.ts", @@ -61,14 +61,16 @@ Object { "ReferenceId": undefined, "Text": "string", }, + "_ts": Object { + "Kind": 146, + "KindString": "Parameter", + }, }, "Parameter-1": Object { "ApiKind": "parameter", "Initializer": undefined, "IsOptional": false, "IsSpread": false, - "Kind": 146, - "KindString": "Parameter", "Location": Object { "Character": 32, "FileName": "./cases/SetAccessor2.ts", @@ -89,14 +91,16 @@ Object { "ReferenceId": undefined, "Text": "string", }, + "_ts": Object { + "Kind": 146, + "KindString": "Parameter", + }, }, "SetAccessor-0": Object { "AccessModifier": "public", "ApiKind": "set-accessor", "IsAbstract": false, "IsStatic": false, - "Kind": 154, - "KindString": "SetAccessor", "Location": Object { "Character": 4, "FileName": "./cases/SetAccessor2.ts", @@ -109,11 +113,13 @@ Object { }, "Name": "Foo", "Parameter": undefined, + "_ts": Object { + "Kind": 154, + "KindString": "SetAccessor", + }, }, "SourceFile-0": Object { "ApiKind": "source-file", - "Kind": 268, - "KindString": "SourceFile", "Location": Object { "Character": 0, "FileName": "./cases/SetAccessor2.ts", @@ -133,6 +139,10 @@ Object { "JSDocTags": Array [], }, "Name": "SetAccessor2.ts", + "_ts": Object { + "Kind": 268, + "KindString": "SourceFile", + }, }, }, } diff --git a/tests/cases/__tests__/__snapshots__/SetAccessor3.test.ts.snap b/tests/cases/__tests__/__snapshots__/SetAccessor3.test.ts.snap index 79a683b6..31236efc 100644 --- a/tests/cases/__tests__/__snapshots__/SetAccessor3.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/SetAccessor3.test.ts.snap @@ -11,8 +11,6 @@ Object { "Extends": undefined, "Implements": Array [], "IsAbstract": true, - "Kind": 229, - "KindString": "ClassDeclaration", "Location": Object { "Character": 0, "FileName": "./cases/SetAccessor3.ts", @@ -51,14 +49,16 @@ Object { }, "Name": "Foo", "TypeParameters": Array [], + "_ts": Object { + "Kind": 229, + "KindString": "ClassDeclaration", + }, }, "Parameter-0": Object { "ApiKind": "parameter", "Initializer": undefined, "IsOptional": false, "IsSpread": false, - "Kind": 146, - "KindString": "Parameter", "Location": Object { "Character": 28, "FileName": "./cases/SetAccessor3.ts", @@ -79,14 +79,16 @@ Object { "ReferenceId": undefined, "Text": "string", }, + "_ts": Object { + "Kind": 146, + "KindString": "Parameter", + }, }, "Parameter-1": Object { "ApiKind": "parameter", "Initializer": undefined, "IsOptional": false, "IsSpread": false, - "Kind": 146, - "KindString": "Parameter", "Location": Object { "Character": 32, "FileName": "./cases/SetAccessor3.ts", @@ -107,14 +109,16 @@ Object { "ReferenceId": undefined, "Text": "string", }, + "_ts": Object { + "Kind": 146, + "KindString": "Parameter", + }, }, "Parameter-2": Object { "ApiKind": "parameter", "Initializer": undefined, "IsOptional": false, "IsSpread": false, - "Kind": 146, - "KindString": "Parameter", "Location": Object { "Character": 20, "FileName": "./cases/SetAccessor3.ts", @@ -135,14 +139,16 @@ Object { "ReferenceId": undefined, "Text": "string", }, + "_ts": Object { + "Kind": 146, + "KindString": "Parameter", + }, }, "Parameter-3": Object { "ApiKind": "parameter", "Initializer": undefined, "IsOptional": false, "IsSpread": false, - "Kind": 146, - "KindString": "Parameter", "Location": Object { "Character": 31, "FileName": "./cases/SetAccessor3.ts", @@ -163,14 +169,16 @@ Object { "ReferenceId": undefined, "Text": "string", }, + "_ts": Object { + "Kind": 146, + "KindString": "Parameter", + }, }, "SetAccessor-0": Object { "AccessModifier": "public", "ApiKind": "set-accessor", "IsAbstract": true, "IsStatic": false, - "Kind": 154, - "KindString": "SetAccessor", "Location": Object { "Character": 4, "FileName": "./cases/SetAccessor3.ts", @@ -188,14 +196,16 @@ Object { "Parameter-0", ], }, + "_ts": Object { + "Kind": 154, + "KindString": "SetAccessor", + }, }, "SetAccessor-1": Object { "AccessModifier": "public", "ApiKind": "set-accessor", "IsAbstract": false, "IsStatic": true, - "Kind": 154, - "KindString": "SetAccessor", "Location": Object { "Character": 4, "FileName": "./cases/SetAccessor3.ts", @@ -213,14 +223,16 @@ Object { "Parameter-1", ], }, + "_ts": Object { + "Kind": 154, + "KindString": "SetAccessor", + }, }, "SetAccessor-2": Object { "AccessModifier": "private", "ApiKind": "set-accessor", "IsAbstract": false, "IsStatic": false, - "Kind": 154, - "KindString": "SetAccessor", "Location": Object { "Character": 4, "FileName": "./cases/SetAccessor3.ts", @@ -238,14 +250,16 @@ Object { "Parameter-2", ], }, + "_ts": Object { + "Kind": 154, + "KindString": "SetAccessor", + }, }, "SetAccessor-3": Object { "AccessModifier": "protected", "ApiKind": "set-accessor", "IsAbstract": false, "IsStatic": false, - "Kind": 154, - "KindString": "SetAccessor", "Location": Object { "Character": 4, "FileName": "./cases/SetAccessor3.ts", @@ -263,11 +277,13 @@ Object { "Parameter-3", ], }, + "_ts": Object { + "Kind": 154, + "KindString": "SetAccessor", + }, }, "SourceFile-0": Object { "ApiKind": "source-file", - "Kind": 268, - "KindString": "SourceFile", "Location": Object { "Character": 0, "FileName": "./cases/SetAccessor3.ts", @@ -287,6 +303,10 @@ Object { "JSDocTags": Array [], }, "Name": "SetAccessor3.ts", + "_ts": Object { + "Kind": 268, + "KindString": "SourceFile", + }, }, }, } diff --git a/tests/cases/__tests__/__snapshots__/TypeAliasDeclaration1.test.ts.snap b/tests/cases/__tests__/__snapshots__/TypeAliasDeclaration1.test.ts.snap index 104b21c9..5027fc8d 100644 --- a/tests/cases/__tests__/__snapshots__/TypeAliasDeclaration1.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/TypeAliasDeclaration1.test.ts.snap @@ -10,8 +10,6 @@ Object { "ApiKind": "property", "IsOptional": false, "IsReadonly": false, - "Kind": 148, - "KindString": "PropertySignature", "Location": Object { "Character": 4, "FileName": "./cases/TypeAliasDeclaration1.ts", @@ -32,11 +30,13 @@ Object { "ReferenceId": undefined, "Text": "string", }, + "_ts": Object { + "Kind": 148, + "KindString": "PropertySignature", + }, }, "SourceFile-0": Object { "ApiKind": "source-file", - "Kind": 268, - "KindString": "SourceFile", "Location": Object { "Character": 0, "FileName": "./cases/TypeAliasDeclaration1.ts", @@ -62,11 +62,13 @@ Object { "JSDocTags": Array [], }, "Name": "TypeAliasDeclaration1.ts", + "_ts": Object { + "Kind": 268, + "KindString": "SourceFile", + }, }, "TypeAliasDeclaration-0": Object { "ApiKind": "type", - "Kind": 231, - "KindString": "TypeAliasDeclaration", "Location": Object { "Character": 0, "FileName": "./cases/TypeAliasDeclaration1.ts", @@ -88,11 +90,13 @@ Object { "Text": "MyType", }, "TypeParameters": Array [], + "_ts": Object { + "Kind": 231, + "KindString": "TypeAliasDeclaration", + }, }, "TypeAliasDeclaration-1": Object { "ApiKind": "type", - "Kind": 231, - "KindString": "TypeAliasDeclaration", "Location": Object { "Character": 0, "FileName": "./cases/TypeAliasDeclaration1.ts", @@ -114,11 +118,13 @@ Object { "Text": "MyType", }, "TypeParameters": Array [], + "_ts": Object { + "Kind": 231, + "KindString": "TypeAliasDeclaration", + }, }, "TypeLiteral-0": Object { "ApiKind": "type-literal", - "Kind": 163, - "KindString": "TypeLiteral", "Location": Object { "Character": 21, "FileName": "./cases/TypeAliasDeclaration1.ts", @@ -138,6 +144,10 @@ Object { "JSDocTags": Array [], }, "Name": "__type", + "_ts": Object { + "Kind": 163, + "KindString": "TypeLiteral", + }, }, }, } diff --git a/tests/cases/__tests__/__snapshots__/TypeAliasDeclaration2.test.ts.snap b/tests/cases/__tests__/__snapshots__/TypeAliasDeclaration2.test.ts.snap index 9e329a87..5624f941 100644 --- a/tests/cases/__tests__/__snapshots__/TypeAliasDeclaration2.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/TypeAliasDeclaration2.test.ts.snap @@ -10,8 +10,6 @@ Object { "ApiKind": "property", "IsOptional": false, "IsReadonly": false, - "Kind": 148, - "KindString": "PropertySignature", "Location": Object { "Character": 4, "FileName": "./cases/TypeAliasDeclaration2.ts", @@ -32,13 +30,15 @@ Object { "ReferenceId": undefined, "Text": "string", }, + "_ts": Object { + "Kind": 148, + "KindString": "PropertySignature", + }, }, "PropertySignature-1": Object { "ApiKind": "property", "IsOptional": false, "IsReadonly": false, - "Kind": 148, - "KindString": "PropertySignature", "Location": Object { "Character": 4, "FileName": "./cases/TypeAliasDeclaration2.ts", @@ -59,13 +59,15 @@ Object { "ReferenceId": undefined, "Text": "string", }, + "_ts": Object { + "Kind": 148, + "KindString": "PropertySignature", + }, }, "PropertySignature-2": Object { "ApiKind": "property", "IsOptional": false, "IsReadonly": false, - "Kind": 148, - "KindString": "PropertySignature", "Location": Object { "Character": 4, "FileName": "./cases/TypeAliasDeclaration2.ts", @@ -86,13 +88,15 @@ Object { "ReferenceId": undefined, "Text": "string", }, + "_ts": Object { + "Kind": 148, + "KindString": "PropertySignature", + }, }, "PropertySignature-3": Object { "ApiKind": "property", "IsOptional": false, "IsReadonly": false, - "Kind": 148, - "KindString": "PropertySignature", "Location": Object { "Character": 4, "FileName": "./cases/TypeAliasDeclaration2.ts", @@ -113,11 +117,13 @@ Object { "ReferenceId": undefined, "Text": "string", }, + "_ts": Object { + "Kind": 148, + "KindString": "PropertySignature", + }, }, "SourceFile-0": Object { "ApiKind": "source-file", - "Kind": 268, - "KindString": "SourceFile", "Location": Object { "Character": 0, "FileName": "./cases/TypeAliasDeclaration2.ts", @@ -149,11 +155,13 @@ Object { "JSDocTags": Array [], }, "Name": "TypeAliasDeclaration2.ts", + "_ts": Object { + "Kind": 268, + "KindString": "SourceFile", + }, }, "TypeAliasDeclaration-0": Object { "ApiKind": "type", - "Kind": 231, - "KindString": "TypeAliasDeclaration", "Location": Object { "Character": 0, "FileName": "./cases/TypeAliasDeclaration2.ts", @@ -175,11 +183,13 @@ Object { "Text": "OneCommonField1", }, "TypeParameters": Array [], + "_ts": Object { + "Kind": 231, + "KindString": "TypeAliasDeclaration", + }, }, "TypeAliasDeclaration-1": Object { "ApiKind": "type", - "Kind": 231, - "KindString": "TypeAliasDeclaration", "Location": Object { "Character": 0, "FileName": "./cases/TypeAliasDeclaration2.ts", @@ -201,11 +211,13 @@ Object { "Text": "OneCommonField2", }, "TypeParameters": Array [], + "_ts": Object { + "Kind": 231, + "KindString": "TypeAliasDeclaration", + }, }, "TypeAliasDeclaration-2": Object { "ApiKind": "type", - "Kind": 231, - "KindString": "TypeAliasDeclaration", "Location": Object { "Character": 0, "FileName": "./cases/TypeAliasDeclaration2.ts", @@ -246,11 +258,13 @@ Object { ], }, "TypeParameters": Array [], + "_ts": Object { + "Kind": 231, + "KindString": "TypeAliasDeclaration", + }, }, "TypeLiteral-0": Object { "ApiKind": "type-literal", - "Kind": 163, - "KindString": "TypeLiteral", "Location": Object { "Character": 30, "FileName": "./cases/TypeAliasDeclaration2.ts", @@ -276,11 +290,13 @@ Object { "JSDocTags": Array [], }, "Name": "__type", + "_ts": Object { + "Kind": 163, + "KindString": "TypeLiteral", + }, }, "TypeLiteral-1": Object { "ApiKind": "type-literal", - "Kind": 163, - "KindString": "TypeLiteral", "Location": Object { "Character": 30, "FileName": "./cases/TypeAliasDeclaration2.ts", @@ -306,6 +322,10 @@ Object { "JSDocTags": Array [], }, "Name": "__type", + "_ts": Object { + "Kind": 163, + "KindString": "TypeLiteral", + }, }, }, } diff --git a/tests/cases/__tests__/__snapshots__/TypeAliasDeclaration3.test.ts.snap b/tests/cases/__tests__/__snapshots__/TypeAliasDeclaration3.test.ts.snap index 1a298112..30a2463e 100644 --- a/tests/cases/__tests__/__snapshots__/TypeAliasDeclaration3.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/TypeAliasDeclaration3.test.ts.snap @@ -10,8 +10,6 @@ Object { "ApiKind": "property", "IsOptional": false, "IsReadonly": false, - "Kind": 148, - "KindString": "PropertySignature", "Location": Object { "Character": 4, "FileName": "./cases/TypeAliasDeclaration3.ts", @@ -32,13 +30,15 @@ Object { "ReferenceId": undefined, "Text": "string", }, + "_ts": Object { + "Kind": 148, + "KindString": "PropertySignature", + }, }, "PropertySignature-1": Object { "ApiKind": "property", "IsOptional": false, "IsReadonly": false, - "Kind": 148, - "KindString": "PropertySignature", "Location": Object { "Character": 4, "FileName": "./cases/TypeAliasDeclaration3.ts", @@ -59,13 +59,15 @@ Object { "ReferenceId": "TypeParameter-0", "Text": "TType", }, + "_ts": Object { + "Kind": 148, + "KindString": "PropertySignature", + }, }, "PropertySignature-2": Object { "ApiKind": "property", "IsOptional": false, "IsReadonly": false, - "Kind": 148, - "KindString": "PropertySignature", "Location": Object { "Character": 4, "FileName": "./cases/TypeAliasDeclaration3.ts", @@ -86,13 +88,15 @@ Object { "ReferenceId": "TypeParameter-1", "Text": "TType", }, + "_ts": Object { + "Kind": 148, + "KindString": "PropertySignature", + }, }, "PropertySignature-3": Object { "ApiKind": "property", "IsOptional": false, "IsReadonly": false, - "Kind": 148, - "KindString": "PropertySignature", "Location": Object { "Character": 4, "FileName": "./cases/TypeAliasDeclaration3.ts", @@ -113,13 +117,15 @@ Object { "ReferenceId": "TypeParameter-2", "Text": "TType", }, + "_ts": Object { + "Kind": 148, + "KindString": "PropertySignature", + }, }, "PropertySignature-4": Object { "ApiKind": "property", "IsOptional": false, "IsReadonly": false, - "Kind": 148, - "KindString": "PropertySignature", "Location": Object { "Character": 4, "FileName": "./cases/TypeAliasDeclaration3.ts", @@ -140,13 +146,15 @@ Object { "ReferenceId": undefined, "Text": "string", }, + "_ts": Object { + "Kind": 148, + "KindString": "PropertySignature", + }, }, "PropertySignature-5": Object { "ApiKind": "property", "IsOptional": false, "IsReadonly": false, - "Kind": 148, - "KindString": "PropertySignature", "Location": Object { "Character": 4, "FileName": "./cases/TypeAliasDeclaration3.ts", @@ -167,13 +175,15 @@ Object { "ReferenceId": "TypeParameter-3", "Text": "TType", }, + "_ts": Object { + "Kind": 148, + "KindString": "PropertySignature", + }, }, "PropertySignature-6": Object { "ApiKind": "property", "IsOptional": false, "IsReadonly": false, - "Kind": 148, - "KindString": "PropertySignature", "Location": Object { "Character": 4, "FileName": "./cases/TypeAliasDeclaration3.ts", @@ -194,11 +204,13 @@ Object { "ReferenceId": undefined, "Text": "string", }, + "_ts": Object { + "Kind": 148, + "KindString": "PropertySignature", + }, }, "SourceFile-0": Object { "ApiKind": "source-file", - "Kind": 268, - "KindString": "SourceFile", "Location": Object { "Character": 0, "FileName": "./cases/TypeAliasDeclaration3.ts", @@ -254,11 +266,13 @@ Object { "JSDocTags": Array [], }, "Name": "TypeAliasDeclaration3.ts", + "_ts": Object { + "Kind": 268, + "KindString": "SourceFile", + }, }, "TypeAliasDeclaration-0": Object { "ApiKind": "type", - "Kind": 231, - "KindString": "TypeAliasDeclaration", "Location": Object { "Character": 0, "FileName": "./cases/TypeAliasDeclaration3.ts", @@ -297,11 +311,13 @@ Object { ], }, ], + "_ts": Object { + "Kind": 231, + "KindString": "TypeAliasDeclaration", + }, }, "TypeAliasDeclaration-1": Object { "ApiKind": "type", - "Kind": 231, - "KindString": "TypeAliasDeclaration", "Location": Object { "Character": 0, "FileName": "./cases/TypeAliasDeclaration3.ts", @@ -340,11 +356,13 @@ Object { ], }, ], + "_ts": Object { + "Kind": 231, + "KindString": "TypeAliasDeclaration", + }, }, "TypeAliasDeclaration-2": Object { "ApiKind": "type", - "Kind": 231, - "KindString": "TypeAliasDeclaration", "Location": Object { "Character": 0, "FileName": "./cases/TypeAliasDeclaration3.ts", @@ -405,11 +423,13 @@ Object { ], }, "TypeParameters": Array [], + "_ts": Object { + "Kind": 231, + "KindString": "TypeAliasDeclaration", + }, }, "TypeAliasDeclaration-3": Object { "ApiKind": "type", - "Kind": 231, - "KindString": "TypeAliasDeclaration", "Location": Object { "Character": 0, "FileName": "./cases/TypeAliasDeclaration3.ts", @@ -448,11 +468,13 @@ Object { ], }, ], + "_ts": Object { + "Kind": 231, + "KindString": "TypeAliasDeclaration", + }, }, "TypeAliasDeclaration-4": Object { "ApiKind": "type", - "Kind": 231, - "KindString": "TypeAliasDeclaration", "Location": Object { "Character": 0, "FileName": "./cases/TypeAliasDeclaration3.ts", @@ -491,11 +513,13 @@ Object { ], }, ], + "_ts": Object { + "Kind": 231, + "KindString": "TypeAliasDeclaration", + }, }, "TypeAliasDeclaration-5": Object { "ApiKind": "type", - "Kind": 231, - "KindString": "TypeAliasDeclaration", "Location": Object { "Character": 0, "FileName": "./cases/TypeAliasDeclaration3.ts", @@ -556,11 +580,13 @@ Object { ], }, "TypeParameters": Array [], + "_ts": Object { + "Kind": 231, + "KindString": "TypeAliasDeclaration", + }, }, "TypeAliasDeclaration-6": Object { "ApiKind": "type", - "Kind": 231, - "KindString": "TypeAliasDeclaration", "Location": Object { "Character": 0, "FileName": "./cases/TypeAliasDeclaration3.ts", @@ -621,11 +647,13 @@ Object { ], }, "TypeParameters": Array [], + "_ts": Object { + "Kind": 231, + "KindString": "TypeAliasDeclaration", + }, }, "TypeLiteral-0": Object { "ApiKind": "type-literal", - "Kind": 163, - "KindString": "TypeLiteral", "Location": Object { "Character": 37, "FileName": "./cases/TypeAliasDeclaration3.ts", @@ -651,11 +679,13 @@ Object { "JSDocTags": Array [], }, "Name": "__type", + "_ts": Object { + "Kind": 163, + "KindString": "TypeLiteral", + }, }, "TypeLiteral-1": Object { "ApiKind": "type-literal", - "Kind": 163, - "KindString": "TypeLiteral", "Location": Object { "Character": 37, "FileName": "./cases/TypeAliasDeclaration3.ts", @@ -675,11 +705,13 @@ Object { "JSDocTags": Array [], }, "Name": "__type", + "_ts": Object { + "Kind": 163, + "KindString": "TypeLiteral", + }, }, "TypeLiteral-2": Object { "ApiKind": "type-literal", - "Kind": 163, - "KindString": "TypeLiteral", "Location": Object { "Character": 37, "FileName": "./cases/TypeAliasDeclaration3.ts", @@ -705,11 +737,13 @@ Object { "JSDocTags": Array [], }, "Name": "__type", + "_ts": Object { + "Kind": 163, + "KindString": "TypeLiteral", + }, }, "TypeLiteral-3": Object { "ApiKind": "type-literal", - "Kind": 163, - "KindString": "TypeLiteral", "Location": Object { "Character": 37, "FileName": "./cases/TypeAliasDeclaration3.ts", @@ -735,13 +769,15 @@ Object { "JSDocTags": Array [], }, "Name": "__type", + "_ts": Object { + "Kind": 163, + "KindString": "TypeLiteral", + }, }, "TypeParameter-0": Object { "ApiKind": "type-parameter", "ConstraintType": undefined, "DefaultType": undefined, - "Kind": 145, - "KindString": "TypeParameter", "Location": Object { "Character": 28, "FileName": "./cases/TypeAliasDeclaration3.ts", @@ -753,13 +789,15 @@ Object { "JSDocTags": Array [], }, "Name": "TType", + "_ts": Object { + "Kind": 145, + "KindString": "TypeParameter", + }, }, "TypeParameter-1": Object { "ApiKind": "type-parameter", "ConstraintType": undefined, "DefaultType": undefined, - "Kind": 145, - "KindString": "TypeParameter", "Location": Object { "Character": 28, "FileName": "./cases/TypeAliasDeclaration3.ts", @@ -771,13 +809,15 @@ Object { "JSDocTags": Array [], }, "Name": "TType", + "_ts": Object { + "Kind": 145, + "KindString": "TypeParameter", + }, }, "TypeParameter-2": Object { "ApiKind": "type-parameter", "ConstraintType": undefined, "DefaultType": undefined, - "Kind": 145, - "KindString": "TypeParameter", "Location": Object { "Character": 28, "FileName": "./cases/TypeAliasDeclaration3.ts", @@ -789,13 +829,15 @@ Object { "JSDocTags": Array [], }, "Name": "TType", + "_ts": Object { + "Kind": 145, + "KindString": "TypeParameter", + }, }, "TypeParameter-3": Object { "ApiKind": "type-parameter", "ConstraintType": undefined, "DefaultType": undefined, - "Kind": 145, - "KindString": "TypeParameter", "Location": Object { "Character": 28, "FileName": "./cases/TypeAliasDeclaration3.ts", @@ -807,6 +849,10 @@ Object { "JSDocTags": Array [], }, "Name": "TType", + "_ts": Object { + "Kind": 145, + "KindString": "TypeParameter", + }, }, }, } diff --git a/tests/cases/__tests__/__snapshots__/TypeAliasDeclaration4.test.ts.snap b/tests/cases/__tests__/__snapshots__/TypeAliasDeclaration4.test.ts.snap index 442e6295..8dd9b703 100644 --- a/tests/cases/__tests__/__snapshots__/TypeAliasDeclaration4.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/TypeAliasDeclaration4.test.ts.snap @@ -10,8 +10,6 @@ Object { "ApiKind": "property", "IsOptional": false, "IsReadonly": false, - "Kind": 148, - "KindString": "PropertySignature", "Location": Object { "Character": 4, "FileName": "./cases/TypeAliasDeclaration4.ts", @@ -32,11 +30,13 @@ Object { "ReferenceId": undefined, "Text": "string", }, + "_ts": Object { + "Kind": 148, + "KindString": "PropertySignature", + }, }, "SourceFile-0": Object { "ApiKind": "source-file", - "Kind": 268, - "KindString": "SourceFile", "Location": Object { "Character": 0, "FileName": "./cases/TypeAliasDeclaration4.ts", @@ -62,11 +62,13 @@ Object { "JSDocTags": Array [], }, "Name": "TypeAliasDeclaration4.ts", + "_ts": Object { + "Kind": 268, + "KindString": "SourceFile", + }, }, "TypeAliasDeclaration-0": Object { "ApiKind": "type", - "Kind": 231, - "KindString": "TypeAliasDeclaration", "Location": Object { "Character": 0, "FileName": "./cases/TypeAliasDeclaration4.ts", @@ -88,11 +90,13 @@ Object { "Text": "User", }, "TypeParameters": Array [], + "_ts": Object { + "Kind": 231, + "KindString": "TypeAliasDeclaration", + }, }, "TypeAliasDeclaration-1": Object { "ApiKind": "type", - "Kind": 231, - "KindString": "TypeAliasDeclaration", "Location": Object { "Character": 0, "FileName": "./cases/TypeAliasDeclaration4.ts", @@ -124,11 +128,13 @@ Object { "Text": "Readonly", }, "TypeParameters": Array [], + "_ts": Object { + "Kind": 231, + "KindString": "TypeAliasDeclaration", + }, }, "TypeLiteral-0": Object { "ApiKind": "type-literal", - "Kind": 163, - "KindString": "TypeLiteral", "Location": Object { "Character": 19, "FileName": "./cases/TypeAliasDeclaration4.ts", @@ -148,6 +154,10 @@ Object { "JSDocTags": Array [], }, "Name": "__type", + "_ts": Object { + "Kind": 163, + "KindString": "TypeLiteral", + }, }, }, } diff --git a/tests/cases/__tests__/__snapshots__/TypeParameterDeclaration1.test.ts.snap b/tests/cases/__tests__/__snapshots__/TypeParameterDeclaration1.test.ts.snap index 087a17aa..a9905e6b 100644 --- a/tests/cases/__tests__/__snapshots__/TypeParameterDeclaration1.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/TypeParameterDeclaration1.test.ts.snap @@ -10,8 +10,6 @@ Object { "ApiKind": "function", "IsAsync": false, "IsOverloadBase": false, - "Kind": 228, - "KindString": "FunctionDeclaration", "Location": Object { "Character": 0, "FileName": "./cases/TypeParameterDeclaration1.ts", @@ -48,14 +46,16 @@ Object { ], }, ], + "_ts": Object { + "Kind": 228, + "KindString": "FunctionDeclaration", + }, }, "Parameter-0": Object { "ApiKind": "parameter", "Initializer": undefined, "IsOptional": false, "IsSpread": false, - "Kind": 146, - "KindString": "Parameter", "Location": Object { "Character": 37, "FileName": "./cases/TypeParameterDeclaration1.ts", @@ -76,11 +76,13 @@ Object { "ReferenceId": "TypeParameter-0", "Text": "TValue", }, + "_ts": Object { + "Kind": 146, + "KindString": "Parameter", + }, }, "SourceFile-0": Object { "ApiKind": "source-file", - "Kind": 268, - "KindString": "SourceFile", "Location": Object { "Character": 0, "FileName": "./cases/TypeParameterDeclaration1.ts", @@ -100,6 +102,10 @@ Object { "JSDocTags": Array [], }, "Name": "TypeParameterDeclaration1.ts", + "_ts": Object { + "Kind": 268, + "KindString": "SourceFile", + }, }, "TypeParameter-0": Object { "ApiKind": "type-parameter", @@ -113,8 +119,6 @@ Object { "ReferenceId": undefined, "Text": "string", }, - "Kind": 145, - "KindString": "TypeParameter", "Location": Object { "Character": 20, "FileName": "./cases/TypeParameterDeclaration1.ts", @@ -126,6 +130,10 @@ Object { "JSDocTags": Array [], }, "Name": "TValue", + "_ts": Object { + "Kind": 145, + "KindString": "TypeParameter", + }, }, }, } diff --git a/tests/cases/__tests__/__snapshots__/TypeParameterDeclaration2.test.ts.snap b/tests/cases/__tests__/__snapshots__/TypeParameterDeclaration2.test.ts.snap index e24e8cb7..cb1125bf 100644 --- a/tests/cases/__tests__/__snapshots__/TypeParameterDeclaration2.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/TypeParameterDeclaration2.test.ts.snap @@ -10,8 +10,6 @@ Object { "ApiKind": "function", "IsAsync": false, "IsOverloadBase": false, - "Kind": 228, - "KindString": "FunctionDeclaration", "Location": Object { "Character": 0, "FileName": "./cases/TypeParameterDeclaration2.ts", @@ -48,14 +46,16 @@ Object { ], }, ], + "_ts": Object { + "Kind": 228, + "KindString": "FunctionDeclaration", + }, }, "Parameter-0": Object { "ApiKind": "parameter", "Initializer": undefined, "IsOptional": false, "IsSpread": false, - "Kind": 146, - "KindString": "Parameter", "Location": Object { "Character": 41, "FileName": "./cases/TypeParameterDeclaration2.ts", @@ -76,11 +76,13 @@ Object { "ReferenceId": "TypeParameter-0", "Text": "TValue", }, + "_ts": Object { + "Kind": 146, + "KindString": "Parameter", + }, }, "SourceFile-0": Object { "ApiKind": "source-file", - "Kind": 268, - "KindString": "SourceFile", "Location": Object { "Character": 0, "FileName": "./cases/TypeParameterDeclaration2.ts", @@ -100,6 +102,10 @@ Object { "JSDocTags": Array [], }, "Name": "TypeParameterDeclaration2.ts", + "_ts": Object { + "Kind": 268, + "KindString": "SourceFile", + }, }, "TypeParameter-0": Object { "ApiKind": "type-parameter", @@ -113,8 +119,6 @@ Object { "Text": "Date", }, "DefaultType": undefined, - "Kind": 145, - "KindString": "TypeParameter", "Location": Object { "Character": 20, "FileName": "./cases/TypeParameterDeclaration2.ts", @@ -126,6 +130,10 @@ Object { "JSDocTags": Array [], }, "Name": "TValue", + "_ts": Object { + "Kind": 145, + "KindString": "TypeParameter", + }, }, }, } diff --git a/tests/cases/__tests__/__snapshots__/TypeParameterDeclaration3.test.ts.snap b/tests/cases/__tests__/__snapshots__/TypeParameterDeclaration3.test.ts.snap index 50ba3306..175db776 100644 --- a/tests/cases/__tests__/__snapshots__/TypeParameterDeclaration3.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/TypeParameterDeclaration3.test.ts.snap @@ -10,8 +10,6 @@ Object { "ApiKind": "function", "IsAsync": false, "IsOverloadBase": false, - "Kind": 228, - "KindString": "FunctionDeclaration", "Location": Object { "Character": 0, "FileName": "./cases/TypeParameterDeclaration3.ts", @@ -48,14 +46,16 @@ Object { ], }, ], + "_ts": Object { + "Kind": 228, + "KindString": "FunctionDeclaration", + }, }, "Parameter-0": Object { "ApiKind": "parameter", "Initializer": undefined, "IsOptional": false, "IsSpread": false, - "Kind": 146, - "KindString": "Parameter", "Location": Object { "Character": 48, "FileName": "./cases/TypeParameterDeclaration3.ts", @@ -76,11 +76,13 @@ Object { "ReferenceId": "TypeParameter-0", "Text": "TValue", }, + "_ts": Object { + "Kind": 146, + "KindString": "Parameter", + }, }, "SourceFile-0": Object { "ApiKind": "source-file", - "Kind": 268, - "KindString": "SourceFile", "Location": Object { "Character": 0, "FileName": "./cases/TypeParameterDeclaration3.ts", @@ -100,6 +102,10 @@ Object { "JSDocTags": Array [], }, "Name": "TypeParameterDeclaration3.ts", + "_ts": Object { + "Kind": 268, + "KindString": "SourceFile", + }, }, "TypeParameter-0": Object { "ApiKind": "type-parameter", @@ -121,8 +127,6 @@ Object { "ReferenceId": undefined, "Text": "Date", }, - "Kind": 145, - "KindString": "TypeParameter", "Location": Object { "Character": 20, "FileName": "./cases/TypeParameterDeclaration3.ts", @@ -134,6 +138,10 @@ Object { "JSDocTags": Array [], }, "Name": "TValue", + "_ts": Object { + "Kind": 145, + "KindString": "TypeParameter", + }, }, }, } diff --git a/tests/cases/__tests__/__snapshots__/VariableDeclaration1.test.ts.snap b/tests/cases/__tests__/__snapshots__/VariableDeclaration1.test.ts.snap index 183e2369..79ae3df3 100644 --- a/tests/cases/__tests__/__snapshots__/VariableDeclaration1.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/VariableDeclaration1.test.ts.snap @@ -8,8 +8,6 @@ Object { "Registry": Object { "SourceFile-0": Object { "ApiKind": "source-file", - "Kind": 268, - "KindString": "SourceFile", "Location": Object { "Character": 0, "FileName": "./cases/VariableDeclaration1.ts", @@ -29,11 +27,13 @@ Object { "JSDocTags": Array [], }, "Name": "VariableDeclaration1.ts", + "_ts": Object { + "Kind": 268, + "KindString": "SourceFile", + }, }, "VariableDeclaration-0": Object { "ApiKind": "variable", - "Kind": 226, - "KindString": "VariableDeclaration", "Location": Object { "Character": 13, "FileName": "./cases/VariableDeclaration1.ts", @@ -55,6 +55,10 @@ Object { "Text": "undefined", }, "VariableDeclarationType": "const", + "_ts": Object { + "Kind": 226, + "KindString": "VariableDeclaration", + }, }, }, } diff --git a/tests/cases/__tests__/__snapshots__/VariableDeclaration2.test.ts.snap b/tests/cases/__tests__/__snapshots__/VariableDeclaration2.test.ts.snap index 30c357f5..9a3022af 100644 --- a/tests/cases/__tests__/__snapshots__/VariableDeclaration2.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/VariableDeclaration2.test.ts.snap @@ -8,8 +8,6 @@ Object { "Registry": Object { "SourceFile-0": Object { "ApiKind": "source-file", - "Kind": 268, - "KindString": "SourceFile", "Location": Object { "Character": 0, "FileName": "./cases/VariableDeclaration2.ts", @@ -29,11 +27,13 @@ Object { "JSDocTags": Array [], }, "Name": "VariableDeclaration2.ts", + "_ts": Object { + "Kind": 268, + "KindString": "SourceFile", + }, }, "VariableDeclaration-0": Object { "ApiKind": "variable", - "Kind": 226, - "KindString": "VariableDeclaration", "Location": Object { "Character": 13, "FileName": "./cases/VariableDeclaration2.ts", @@ -55,6 +55,10 @@ Object { "Text": "string", }, "VariableDeclarationType": "const", + "_ts": Object { + "Kind": 226, + "KindString": "VariableDeclaration", + }, }, }, } diff --git a/tests/cases/__tests__/__snapshots__/VariableDeclaration3.test.ts.snap b/tests/cases/__tests__/__snapshots__/VariableDeclaration3.test.ts.snap index f25cf46a..c4301cc7 100644 --- a/tests/cases/__tests__/__snapshots__/VariableDeclaration3.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/VariableDeclaration3.test.ts.snap @@ -8,8 +8,6 @@ Object { "Registry": Object { "SourceFile-0": Object { "ApiKind": "source-file", - "Kind": 268, - "KindString": "SourceFile", "Location": Object { "Character": 0, "FileName": "./cases/VariableDeclaration3.ts", @@ -29,11 +27,13 @@ Object { "JSDocTags": Array [], }, "Name": "VariableDeclaration3.ts", + "_ts": Object { + "Kind": 268, + "KindString": "SourceFile", + }, }, "VariableDeclaration-0": Object { "ApiKind": "variable", - "Kind": 226, - "KindString": "VariableDeclaration", "Location": Object { "Character": 13, "FileName": "./cases/VariableDeclaration3.ts", @@ -55,6 +55,10 @@ Object { "Text": "string", }, "VariableDeclarationType": "const", + "_ts": Object { + "Kind": 226, + "KindString": "VariableDeclaration", + }, }, }, } diff --git a/tests/cases/__tests__/__snapshots__/VariableDeclaration4.test.ts.snap b/tests/cases/__tests__/__snapshots__/VariableDeclaration4.test.ts.snap index 886f10ce..6f16b134 100644 --- a/tests/cases/__tests__/__snapshots__/VariableDeclaration4.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/VariableDeclaration4.test.ts.snap @@ -9,8 +9,6 @@ Object { "InterfaceDeclaration-0": Object { "ApiKind": "interface", "Extends": Array [], - "Kind": 230, - "KindString": "InterfaceDeclaration", "Location": Object { "Character": 0, "FileName": "./cases/VariableDeclaration4.ts", @@ -31,13 +29,15 @@ Object { }, "Name": "A", "TypeParameters": Array [], + "_ts": Object { + "Kind": 230, + "KindString": "InterfaceDeclaration", + }, }, "PropertySignature-0": Object { "ApiKind": "property", "IsOptional": false, "IsReadonly": false, - "Kind": 148, - "KindString": "PropertySignature", "Location": Object { "Character": 4, "FileName": "./cases/VariableDeclaration4.ts", @@ -58,11 +58,13 @@ Object { "ReferenceId": undefined, "Text": "string", }, + "_ts": Object { + "Kind": 148, + "KindString": "PropertySignature", + }, }, "SourceFile-0": Object { "ApiKind": "source-file", - "Kind": 268, - "KindString": "SourceFile", "Location": Object { "Character": 0, "FileName": "./cases/VariableDeclaration4.ts", @@ -94,11 +96,13 @@ Object { "JSDocTags": Array [], }, "Name": "VariableDeclaration4.ts", + "_ts": Object { + "Kind": 268, + "KindString": "SourceFile", + }, }, "VariableDeclaration-0": Object { "ApiKind": "variable", - "Kind": 226, - "KindString": "VariableDeclaration", "Location": Object { "Character": 13, "FileName": "./cases/VariableDeclaration4.ts", @@ -120,11 +124,13 @@ Object { "Text": "A", }, "VariableDeclarationType": "const", + "_ts": Object { + "Kind": 226, + "KindString": "VariableDeclaration", + }, }, "VariableDeclaration-1": Object { "ApiKind": "variable", - "Kind": 226, - "KindString": "VariableDeclaration", "Location": Object { "Character": 13, "FileName": "./cases/VariableDeclaration4.ts", @@ -146,6 +152,10 @@ Object { "Text": "A", }, "VariableDeclarationType": "const", + "_ts": Object { + "Kind": 226, + "KindString": "VariableDeclaration", + }, }, }, } diff --git a/tests/scripts/tests-builder.ts b/tests/scripts/tests-builder.ts index 0eb1256b..d926520a 100644 --- a/tests/scripts/tests-builder.ts +++ b/tests/scripts/tests-builder.ts @@ -34,6 +34,7 @@ export async function TestsBuilder(dirName: string, cwd: string): Promise Tab(1) + `const extractor = new Extractor({`, Tab(2) + `CompilerOptions: ${JSON.stringify(EXTRACTOR_COMPILER_OPTIONS, undefined, Tab(3))},`, Tab(2) + `ProjectDirectory: projectDirectory`, + Tab(2) + `IncludeTsDebugInfo: true`, Tab(1) + `});`, "", Tab(1) + `expect(extractor.Extract([moduleName])).toMatchSnapshot();`, From 91d85f51e7aa8ce37c6beca28a22cca85a3ee3d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martynas=20=C5=BDilinskas?= Date: Fri, 12 Jan 2018 15:30:54 +0200 Subject: [PATCH 2/4] Feature: Types update (#79) --- examples/simple/index.ts | 30 +- src/abstractions/api-callable-base.ts | 7 +- src/api-helpers.ts | 130 +----- src/api-type-helpers.ts | 407 ++++++++++++++++++ src/contracts.ts | 5 +- src/contracts/api-callable-dto.ts | 4 +- src/contracts/api-item-dto.ts | 4 +- src/contracts/api-item-kinds.ts | 2 +- src/contracts/api-type.ts | 133 ++++++ src/contracts/definitions/api-class-dto.ts | 6 +- .../definitions/api-class-property-dto.ts | 4 +- .../definitions/api-get-accessor-dto.ts | 4 +- src/contracts/definitions/api-index-dto.ts | 4 +- .../definitions/api-interface-dto.ts | 4 +- src/contracts/definitions/api-mapped-dto.ts | 4 +- .../definitions/api-parameter-dto.ts | 4 +- src/contracts/definitions/api-property-dto.ts | 4 +- ...{api-type-dto.ts => api-type-alias-dto.ts} | 8 +- .../definitions/api-type-parameter-dto.ts | 6 +- src/contracts/definitions/api-variable-dto.ts | 4 +- src/contracts/type-dto.ts | 33 -- src/contracts/type-kinds.ts | 6 - src/definitions/api-class-property.ts | 7 +- src/definitions/api-class.ts | 13 +- src/definitions/api-enum-member.ts | 1 - src/definitions/api-get-accessor.ts | 7 +- src/definitions/api-index.ts | 7 +- src/definitions/api-interface.ts | 7 +- src/definitions/api-mapped.ts | 7 +- src/definitions/api-parameter.ts | 7 +- src/definitions/api-property.ts | 7 +- .../{api-type.ts => api-type-alias.ts} | 15 +- src/definitions/api-type-parameter.ts | 11 +- src/definitions/api-variable.ts | 7 +- src/ts-helpers.ts | 20 +- tests/cases/ClassDeclaration11.ts | 5 + tests/cases/FunctionDeclaration4.ts | 5 + tests/cases/FunctionDeclaration5.ts | 3 + tests/cases/FunctionDeclaration6.ts | 7 + tests/cases/FunctionDeclaration7.ts | 3 + tests/cases/FunctionDeclaration8.ts | 3 + tests/cases/TypeAliasDeclaration5.ts | 1 + tests/cases/TypeAliasDeclaration6.ts | 8 + tests/cases/TypeAliasDeclaration7.ts | 1 + tests/cases/TypeAliasDeclaration8.ts | 4 + .../ClassDeclaration1.test.ts.snap | 168 +++----- .../ClassDeclaration10.test.ts.snap | 80 ++-- .../ClassDeclaration11.test.ts.snap | 102 +++++ .../ClassDeclaration2.test.ts.snap | 54 ++- .../ClassDeclaration3.test.ts.snap | 30 +- .../ClassDeclaration4.test.ts.snap | 60 +-- .../ClassDeclaration5.test.ts.snap | 46 +- .../ClassDeclaration6.test.ts.snap | 76 ++-- .../ClassDeclaration8.test.ts.snap | 63 +-- .../ClassDeclaration9.test.ts.snap | 57 ++- .../ConstructSignature1.test.ts.snap | 21 +- .../ConstructSignature2.test.ts.snap | 12 +- .../ExportDeclaration1.test.ts.snap | 168 +++----- .../ExportSpecifier1.test.ts.snap | 54 ++- .../ExportSpecifier2.test.ts.snap | 18 +- .../ExportSpecifier3.test.ts.snap | 60 +-- .../ExportSpecifier4.test.ts.snap | 54 ++- .../FunctionDeclaration1.test.ts.snap | 9 +- .../FunctionDeclaration2.test.ts.snap | 21 +- .../FunctionDeclaration3.test.ts.snap | 25 +- .../FunctionDeclaration4.test.ts.snap | 119 +++++ .../FunctionDeclaration5.test.ts.snap | 130 ++++++ .../FunctionDeclaration6.test.ts.snap | 136 ++++++ .../FunctionDeclaration7.test.ts.snap | 147 +++++++ .../FunctionDeclaration8.test.ts.snap | 139 ++++++ .../__snapshots__/GetAccessor1.test.ts.snap | 9 +- .../__snapshots__/GetAccessor3.test.ts.snap | 36 +- .../ImportDeclaration1.test.ts.snap | 168 +++----- .../ImportSpecifier1.test.ts.snap | 168 +++----- .../IndexSignature1.test.ts.snap | 18 +- .../IndexSignature2.test.ts.snap | 18 +- .../IndexSignature3.test.ts.snap | 45 +- .../InterfaceClassMerging.test.ts.snap | 147 ++++--- .../InterfaceDeclaration2.test.ts.snap | 9 +- .../InterfaceDeclaration3.test.ts.snap | 37 +- .../InterfaceDeclaration4.test.ts.snap | 334 +++++++------- .../InterfaceDeclaration5.test.ts.snap | 24 +- .../InterfaceDeclaration6.test.ts.snap | 18 +- .../InterfaceDeclaration7.test.ts.snap | 9 +- .../InterfaceSubtyping.test.ts.snap | 39 +- .../MappedDeclaration1.test.ts.snap | 30 +- .../MappedDeclaration2.test.ts.snap | 81 ++-- .../MappedDeclaration3.test.ts.snap | 81 ++-- .../MappedDeclaration4.test.ts.snap | 81 ++-- .../MultipleDeclaration.test.ts.snap | 36 +- .../NamespaceDeclaration3.test.ts.snap | 9 +- .../ParameterDeclaration1.test.ts.snap | 39 +- .../ParameterDeclaration2.test.ts.snap | 38 +- .../ParameterDeclaration3.test.ts.snap | 18 +- .../__snapshots__/SetAccessor1.test.ts.snap | 9 +- .../__snapshots__/SetAccessor2.test.ts.snap | 18 +- .../__snapshots__/SetAccessor3.test.ts.snap | 36 +- .../TypeAliasDeclaration1.test.ts.snap | 35 +- .../TypeAliasDeclaration2.test.ts.snap | 98 ++--- .../TypeAliasDeclaration3.test.ts.snap | 337 ++++++--------- .../TypeAliasDeclaration4.test.ts.snap | 45 +- .../TypeAliasDeclaration5.test.ts.snap | 82 ++++ .../TypeAliasDeclaration6.test.ts.snap | 251 +++++++++++ .../TypeAliasDeclaration7.test.ts.snap | 98 +++++ .../TypeAliasDeclaration8.test.ts.snap | 183 ++++++++ .../TypeParameterDeclaration1.test.ts.snap | 30 +- .../TypeParameterDeclaration2.test.ts.snap | 33 +- .../TypeParameterDeclaration3.test.ts.snap | 45 +- .../VariableDeclaration1.test.ts.snap | 9 +- .../VariableDeclaration2.test.ts.snap | 9 +- .../VariableDeclaration3.test.ts.snap | 11 +- .../VariableDeclaration4.test.ts.snap | 32 +- 112 files changed, 3532 insertions(+), 2139 deletions(-) create mode 100644 src/api-type-helpers.ts create mode 100644 src/contracts/api-type.ts rename src/contracts/definitions/{api-type-dto.ts => api-type-alias-dto.ts} (57%) delete mode 100644 src/contracts/type-dto.ts delete mode 100644 src/contracts/type-kinds.ts rename src/definitions/{api-type.ts => api-type-alias.ts} (73%) create mode 100644 tests/cases/ClassDeclaration11.ts create mode 100644 tests/cases/FunctionDeclaration4.ts create mode 100644 tests/cases/FunctionDeclaration5.ts create mode 100644 tests/cases/FunctionDeclaration6.ts create mode 100644 tests/cases/FunctionDeclaration7.ts create mode 100644 tests/cases/FunctionDeclaration8.ts create mode 100644 tests/cases/TypeAliasDeclaration5.ts create mode 100644 tests/cases/TypeAliasDeclaration6.ts create mode 100644 tests/cases/TypeAliasDeclaration7.ts create mode 100644 tests/cases/TypeAliasDeclaration8.ts create mode 100644 tests/cases/__tests__/__snapshots__/ClassDeclaration11.test.ts.snap create mode 100644 tests/cases/__tests__/__snapshots__/FunctionDeclaration4.test.ts.snap create mode 100644 tests/cases/__tests__/__snapshots__/FunctionDeclaration5.test.ts.snap create mode 100644 tests/cases/__tests__/__snapshots__/FunctionDeclaration6.test.ts.snap create mode 100644 tests/cases/__tests__/__snapshots__/FunctionDeclaration7.test.ts.snap create mode 100644 tests/cases/__tests__/__snapshots__/FunctionDeclaration8.test.ts.snap create mode 100644 tests/cases/__tests__/__snapshots__/TypeAliasDeclaration5.test.ts.snap create mode 100644 tests/cases/__tests__/__snapshots__/TypeAliasDeclaration6.test.ts.snap create mode 100644 tests/cases/__tests__/__snapshots__/TypeAliasDeclaration7.test.ts.snap create mode 100644 tests/cases/__tests__/__snapshots__/TypeAliasDeclaration8.test.ts.snap diff --git a/examples/simple/index.ts b/examples/simple/index.ts index f26c0ecb..e80f31fd 100644 --- a/examples/simple/index.ts +++ b/examples/simple/index.ts @@ -1,29 +1,3 @@ -// import * as ts from "typescript"; - -// export enum ApiItemKindsAdditional { -// ___Any = "any", -// ___Any2 = "any2" -// } - -export interface Foo { - Name: string; - Surname: string; +export function Foo(arg: string | number) { + return arg; } - -// export interface Bar { -// Number: number; -// } - -// // export var x: this is string; - -// export type SyntaxKinds___ = TValue; - -// export class Foo { -// public Bar(arg: any): arg is string { -// return true; -// } -// } - -export type TYPE__ = new () => { - name: string; -}; diff --git a/src/abstractions/api-callable-base.ts b/src/abstractions/api-callable-base.ts index 5d24c453..845d9a62 100644 --- a/src/abstractions/api-callable-base.ts +++ b/src/abstractions/api-callable-base.ts @@ -3,8 +3,9 @@ import { ApiItem } from "../abstractions/api-item"; import { ApiHelpers } from "../api-helpers"; import { ApiItemReference } from "../contracts/api-item-reference"; -import { TypeDto } from "../contracts/type-dto"; +import { ApiType } from "../contracts/api-type"; import { ApiCallableDto } from "../contracts/api-callable-dto"; +import { ApiTypeHelpers } from "../api-type-helpers"; /** * A callable api item base. @@ -18,7 +19,7 @@ export abstract class ApiCallableBase< protected IsOverloadBase: boolean; protected Parameters: ApiItemReference[] = []; protected TypeParameters: ApiItemReference[] = []; - protected ReturnType: TypeDto | undefined; + protected ReturnType: ApiType | undefined; protected OnGatherData(): void { // Overload @@ -37,7 +38,7 @@ export abstract class ApiCallableBase< if (signature != null) { const type = this.TypeChecker.getReturnTypeOfSignature(signature); - this.ReturnType = ApiHelpers.TypeToApiTypeDto(type, this.Options); + this.ReturnType = ApiTypeHelpers.ResolveApiType(this.Options, type, this.Declaration.type); } } } diff --git a/src/api-helpers.ts b/src/api-helpers.ts index b53c63c9..0fb1f83c 100644 --- a/src/api-helpers.ts +++ b/src/api-helpers.ts @@ -5,12 +5,6 @@ import { LogLevel } from "simplr-logger"; import { ApiItem, ApiItemOptions } from "./abstractions/api-item"; import { ApiItemReference } from "./contracts/api-item-reference"; -import { - TypeDto, - TypeBasicDto, - TypeUnionOrIntersectionDto -} from "./contracts/type-dto"; -import { TypeKinds } from "./contracts/type-kinds"; import { AccessModifier } from "./contracts/access-modifier"; import { TSHelpers } from "./ts-helpers"; import { Logger } from "./utils/logger"; @@ -29,7 +23,7 @@ import { ApiInterface } from "./definitions/api-interface"; import { ApiProperty } from "./definitions/api-property"; import { ApiMethod } from "./definitions/api-method"; import { ApiParameter } from "./definitions/api-parameter"; -import { ApiType } from "./definitions/api-type"; +import { ApiTypeAlias } from "./definitions/api-type-alias"; import { ApiClass } from "./definitions/api-class"; import { ApiClassConstructor } from "./definitions/api-class-constructor"; import { ApiClassProperty } from "./definitions/api-class-property"; @@ -79,7 +73,7 @@ export namespace ApiHelpers { } else if (ts.isParameter(declaration)) { apiItem = new ApiParameter(declaration, symbol, options); } else if (ts.isTypeAliasDeclaration(declaration)) { - apiItem = new ApiType(declaration, symbol, options); + apiItem = new ApiTypeAlias(declaration, symbol, options); } else if (ts.isClassDeclaration(declaration)) { apiItem = new ApiClass(declaration, symbol, options); } else if (ts.isConstructorDeclaration(declaration)) { @@ -233,126 +227,6 @@ export namespace ApiHelpers { return items; } - export type HeritageKinds = ts.SyntaxKind.ImplementsKeyword | ts.SyntaxKind.ExtendsKeyword; - - export function GetHeritageList( - heritageClauses: ts.NodeArray, - kind: HeritageKinds, - options: ApiItemOptions - ): TypeDto[] { - const typeChecker = options.Program.getTypeChecker(); - const list: TypeDto[] = []; - - heritageClauses.forEach(heritage => { - if (heritage.token !== kind) { - return; - } - - heritage.types.forEach(expressionType => { - const type = typeChecker.getTypeFromTypeNode(expressionType); - - list.push(TypeToApiTypeDto(type, options)); - }); - }); - - return list; - } - - /** - * @internal - */ - export interface ResolvedTypeItemReference { - name?: string; - referenceId?: string; - } - - /** - * @internal - */ - export function resolveTypeItemReference(symbol: ts.Symbol, options: ApiItemOptions): ResolvedTypeItemReference { - if (symbol.declarations != null && symbol.declarations.length > 0) { - const declaration: ts.Declaration = symbol.declarations[0]; - - return { - name: symbol.getName(), - referenceId: GetItemId(declaration, symbol, options) - }; - } - - return { - name: symbol.getName() - }; - } - - /** - * Converts from TypeScript type AST to TypeDto. - * @param type TypeScript type - * @param options ApiItem options - * @param self This is only for `TypeAliasDeclaration` - */ - export function TypeToApiTypeDto(type: ts.Type, options: ApiItemOptions, self?: boolean): TypeDto { - const typeChecker = options.Program.getTypeChecker(); - const text = typeChecker.typeToString(type); - - let generics: TypeDto[] | undefined; - let kind = TypeKinds.Basic; - let types: TypeDto[] | undefined; - let name: string | undefined; - let referenceId: string | undefined; - - // Find declaration reference. - const symbol = self ? type.getSymbol() : type.aliasSymbol || type.getSymbol(); - if (symbol != null) { - const resolvedReference = resolveTypeItemReference(symbol, options); - name = resolvedReference.name; - referenceId = resolvedReference.referenceId; - } - - // Generics - if (TSHelpers.IsTypeWithTypeArguments(type)) { - generics = type.typeArguments.map(x => TypeToApiTypeDto(x, options)); - } else if (type.aliasTypeArguments != null) { - generics = type.aliasTypeArguments.map(x => TypeToApiTypeDto(x, options)); - } - - // Union or Intersection - if (TSHelpers.IsTypeUnionOrIntersectionType(type)) { - if (TSHelpers.IsTypeUnionType(type)) { - kind = TypeKinds.Union; - } else { - kind = TypeKinds.Intersection; - } - - types = type.types.map(x => TypeToApiTypeDto(x, options)); - - return { - ApiTypeKind: kind, - Flags: type.flags, - FlagsString: ts.TypeFlags[type.flags], - Name: name, - Text: text, - Types: types, - ReferenceId: referenceId - } as TypeUnionOrIntersectionDto; - } - - // Resolve other type kinds - if (TSHelpers.IsTypeTypeParameter(type)) { - kind = TypeKinds.TypeParameter; - } - - // Basic - return { - ApiTypeKind: kind, - Flags: type.flags, - FlagsString: ts.TypeFlags[type.flags], - Name: name, - Text: text, - Generics: generics, - ReferenceId: referenceId - } as TypeBasicDto; - } - export function ResolveAccessModifierFromModifiers(modifiers?: ts.NodeArray): AccessModifier { let accessModifier = AccessModifier.Public; diff --git a/src/api-type-helpers.ts b/src/api-type-helpers.ts new file mode 100644 index 00000000..692e5ed3 --- /dev/null +++ b/src/api-type-helpers.ts @@ -0,0 +1,407 @@ +import * as ts from "typescript"; +import { ApiItemOptions } from "./abstractions/api-item"; +import { ApiHelpers } from "./api-helpers"; +import { TSHelpers } from "./index"; +import { + ApiType, + TypeLiteralType, + ApiTypeKind, + MappedType, + FunctionTypeType, + ThisType, + ConstructorType, + ApiBaseType, + ApiBasicType, + ApiReferenceBaseType, + ApiReferenceType, + ApiUnionOrIntersectionType, + IndexedAccessType, + ArrayType, + ParenthesizedType, + TupleType, + TypeOperatorType, + TypePredicateType, + TypeQueryType, + TypeKeywords +} from "./contracts/api-type"; + +export namespace ApiTypeHelpers { + export function ResolveApiType(options: ApiItemOptions, type: ts.Type, typeNode?: ts.TypeNode, self?: boolean): ApiType { + const typeChecker = options.Program.getTypeChecker(); + + if (typeNode == null) { + typeNode = typeChecker.typeToTypeNode(type); + } + + if (ts.isTypeReferenceNode(typeNode) || ts.isExpressionWithTypeArguments(typeNode)) { + return TypeReferenceNodeToApiType(options, type, typeNode, self); + } else if (ts.isUnionTypeNode(typeNode) || ts.isIntersectionTypeNode(typeNode)) { + return TypeNodeUnionOrIntersectionToApiType(options, type as ts.UnionOrIntersectionType, typeNode); + } else if (ts.isArrayTypeNode(typeNode)) { + return ArrayTypeNodeToApiType(options, type, typeNode); + } else if (ts.isTupleTypeNode(typeNode)) { + return TupleTypeNodeToApiType(options, type, typeNode); + } else if (ts.isTypeLiteralNode(typeNode)) { + return ReferenceBaseTypeToTypeDto(options, type, typeNode, ApiTypeKind.TypeLiteral) as TypeLiteralType; + } else if (ts.isMappedTypeNode(typeNode)) { + return ReferenceBaseTypeToTypeDto(options, type, typeNode, ApiTypeKind.Mapped) as MappedType; + } else if (ts.isFunctionTypeNode(typeNode)) { + return ReferenceBaseTypeToTypeDto(options, type, typeNode, ApiTypeKind.FunctionType) as FunctionTypeType; + } else if (ts.isThisTypeNode(typeNode)) { + return ReferenceBaseTypeToTypeDto(options, type, typeNode, ApiTypeKind.This) as ThisType; + } else if (ts.isConstructorTypeNode(typeNode)) { + return ReferenceBaseTypeToTypeDto(options, type, typeNode, ApiTypeKind.Constructor) as ConstructorType; + } else if (ts.isTypePredicateNode(typeNode)) { + return TypePredicateNodeToApiType(options, type, typeNode); + } else if (ts.isTypeOperatorNode(typeNode)) { + return TypeOperatorNodeToApiType(options, type, typeNode); + } else if (ts.isIndexedAccessTypeNode(typeNode)) { + return IndexedAccessTypeNodeToApiType(options, type, typeNode); + } else if (ts.isParenthesizedTypeNode(typeNode)) { + return ParenthesizedTypeNodeToApiType(options, type, typeNode); + } else if (ts.isTypeQueryNode(typeNode)) { + return TypeQueryToApiType(options, type, typeNode); + } + + return ResolveApiBasicType(options, type, typeNode); + } + + /** + * @internal + */ + export function typeNodeToBaseType(options: ApiItemOptions, type: ts.Type, typeNode: ts.TypeNode): ApiBaseType { + const typeChecker = options.Program.getTypeChecker(); + const text = typeChecker.typeToString(type); + + const result: ApiBaseType = { + ApiTypeKind: ApiTypeKind.Basic, + Text: text + }; + + if (options.ExtractorOptions.IncludeTsDebugInfo) { + result._ts = { + Kind: typeNode.kind, + KindString: ts.SyntaxKind[typeNode.kind] + }; + } + + return result; + } + + /** + * @internal + */ + export interface ResolvedTypeItemReference { + name?: string; + referenceId?: string; + } + + /** + * @internal + */ + export function resolveTypeItemReference(symbol: ts.Symbol, options: ApiItemOptions): ResolvedTypeItemReference { + if (symbol.declarations != null && symbol.declarations.length > 0) { + const declaration: ts.Declaration = symbol.declarations[0]; + + return { + name: symbol.getName(), + referenceId: ApiHelpers.GetItemId(declaration, symbol, options) + }; + } + + return { + name: symbol.getName() + }; + } + + export function ResolveApiBasicType(options: ApiItemOptions, type: ts.Type, typeNode: ts.TypeNode): ApiBasicType { + return { + ...typeNodeToBaseType(options, type, typeNode), + ApiTypeKind: ApiTypeKind.Basic + }; + } + + /** + * Resolving `Definition` reference. + * @param kind `ApiReferenceBaseType` ApiTypeKind value + */ + export function ReferenceBaseTypeToTypeDto( + options: ApiItemOptions, + type: ts.Type, + typeNode: ts.TypeNode, + kind?: ApiTypeKind + ): ApiReferenceBaseType { + const symbol = type.getSymbol(); + let referenceId: string | undefined; + + if (symbol != null) { + referenceId = resolveTypeItemReference(symbol, options).referenceId; + } + + return { + ...typeNodeToBaseType(options, type, typeNode), + ApiTypeKind: kind || ApiTypeKind.Basic, + ReferenceId: referenceId + }; + } + + /** + * Example `Foo`. + */ + export function TypeReferenceNodeToApiType( + options: ApiItemOptions, + type: ts.Type, + typeNode: ts.TypeReferenceType, + self?: boolean + ): ApiReferenceType { + const typeChecker = options.Program.getTypeChecker(); + + let symbolName: string | undefined; + let typeParameters: ApiType[] | undefined; + let refenceId: string | undefined; + + if (TSHelpers.IsNodeSynthesized(typeNode) && typeNode.typeArguments != null) { + typeParameters = typeNode.typeArguments + .map(x => ResolveApiType(options, typeChecker.getTypeFromTypeNode(x), x)); + } else if (TSHelpers.IsTypeWithTypeArguments(type)) { + typeParameters = type.typeArguments + .map(x => ResolveApiType(options, x, typeChecker.typeToTypeNode(x))); + } + + const symbol = self ? type.getSymbol() : type.aliasSymbol || type.getSymbol(); + if (symbol != null) { + const { name, referenceId } = resolveTypeItemReference(symbol, options); + refenceId = referenceId; + symbolName = name; + } + + return { + ...typeNodeToBaseType(options, type, typeNode), + ApiTypeKind: ApiTypeKind.Reference, + ReferenceId: refenceId, + TypeParameters: typeParameters, + SymbolName: symbolName + }; + } + + /** + * Example `string | number` or `string & number`. + */ + export function TypeNodeUnionOrIntersectionToApiType( + options: ApiItemOptions, + type: ts.UnionOrIntersectionType, + typeNode: ts.UnionTypeNode | ts.IntersectionTypeNode + ): ApiUnionOrIntersectionType { + const typeChecker = options.Program.getTypeChecker(); + + let apiTypeKind: ApiTypeKind; + if (ts.isUnionTypeNode(typeNode)) { + apiTypeKind = ApiTypeKind.Union; + } else { + apiTypeKind = ApiTypeKind.Intersection; + } + + let members: ApiType[]; + if (!TSHelpers.IsNodeSynthesized(typeNode)) { + members = typeNode.types + .map(x => ResolveApiType(options, typeChecker.getTypeFromTypeNode(x), x)); + } else { + members = type.types + .map(x => ResolveApiType(options, x, typeChecker.typeToTypeNode(x))); + } + + return { + ...typeNodeToBaseType(options, type, typeNode), + ApiTypeKind: apiTypeKind, + Members: members + }; + } + + /** + * Example `string[]`. + */ + export function ArrayTypeNodeToApiType( + options: ApiItemOptions, + type: ts.Type, + typeNode: ts.ArrayTypeNode + ): ArrayType { + const typeChecker = options.Program.getTypeChecker(); + + let apiType: ApiType; + if (!TSHelpers.IsNodeSynthesized(typeNode)) { + apiType = ResolveApiType(options, typeChecker.getTypeFromTypeNode(typeNode.elementType), typeNode.elementType); + } else if (TSHelpers.IsTypeWithTypeArguments(type)) { + const arrayType = type.typeArguments[0]; + apiType = ResolveApiType(options, arrayType, typeChecker.typeToTypeNode(arrayType)); + } else { + // TODO: Log Error. + apiType = ResolveApiType(options, typeChecker.getTypeFromTypeNode(typeNode.elementType), typeNode.elementType); + } + + return { + ...typeNodeToBaseType(options, type, typeNode), + ApiTypeKind: ApiTypeKind.Array, + Type: apiType + }; + } + + /** + * Example `[string, number]`. + */ + export function TupleTypeNodeToApiType( + options: ApiItemOptions, + type: ts.Type, + typeNode: ts.TupleTypeNode + ): TupleType { + const typeChecker = options.Program.getTypeChecker(); + + let members: ApiType[]; + if (!TSHelpers.IsNodeSynthesized(typeNode)) { + members = typeNode.elementTypes + .map(x => ResolveApiType(options, typeChecker.getTypeFromTypeNode(x), x)); + } else if (TSHelpers.IsTypeWithTypeArguments(type)) { + members = type.typeArguments.map(x => ResolveApiType(options, x, typeChecker.typeToTypeNode(x))); + } else { + // TODO: Log Error. + members = []; + } + + return { + ...typeNodeToBaseType(options, type, typeNode), + ApiTypeKind: ApiTypeKind.Tuple, + Members: members + }; + } + + /** + * Example `arg is string`. + */ + export function TypePredicateNodeToApiType( + options: ApiItemOptions, + type: ts.Type, + typeNode: ts.TypePredicateNode + ): TypePredicateType { + const typeChecker = options.Program.getTypeChecker(); + const parameterName: string = typeNode.parameterName.getText(); + const apiType = ResolveApiType(options, typeChecker.getTypeFromTypeNode(typeNode.type), typeNode.type); + + // Otherwise text will be "boolean". + const text = `${parameterName} is ${apiType.Text}`; + + return { + ...typeNodeToBaseType(options, type, typeNode), + ApiTypeKind: ApiTypeKind.TypePredicate, + ParameterName: parameterName, + Type: apiType, + Text: text + }; + } + + /** + * Example `keyof Foo`. + */ + export function TypeOperatorNodeToApiType( + options: ApiItemOptions, + type: ts.Type, + typeNode: ts.TypeOperatorNode + ): TypeOperatorType { + const typeChecker = options.Program.getTypeChecker(); + const apiType = ResolveApiType(options, typeChecker.getTypeFromTypeNode(typeNode.type), typeNode.type); + let operator: TypeKeywords; + + switch (typeNode.operator) { + case ts.SyntaxKind.KeyOfKeyword: { + operator = TypeKeywords.Keyof; + break; + } + default: { + operator = TypeKeywords.Unknown; + } + } + + // Otherwise text will be union. + const text = `${operator} ${apiType.Text}`; + + return { + ...typeNodeToBaseType(options, type, typeNode), + ApiTypeKind: ApiTypeKind.TypeOperator, + Keyword: operator, + Type: apiType, + Text: text + }; + } + + /** + * Example: `Foo[T]`. + */ + export function IndexedAccessTypeNodeToApiType( + options: ApiItemOptions, + type: ts.Type, + typeNode: ts.IndexedAccessTypeNode + ): IndexedAccessType { + const typeChecker = options.Program.getTypeChecker(); + const objectApiType = ResolveApiType(options, typeChecker.getTypeFromTypeNode(typeNode.objectType), typeNode.objectType); + const indexApiType = ResolveApiType(options, typeChecker.getTypeFromTypeNode(typeNode.indexType), typeNode.indexType); + + return { + ...typeNodeToBaseType(options, type, typeNode), + ApiTypeKind: ApiTypeKind.IndexedAccess, + ObjectType: objectApiType, + IndexType: indexApiType + }; + } + + /** + * Example: `(string | number)`. + */ + export function ParenthesizedTypeNodeToApiType( + options: ApiItemOptions, + type: ts.Type, + typeNode: ts.ParenthesizedTypeNode + ): ParenthesizedType { + const typeChecker = options.Program.getTypeChecker(); + const apiType = ResolveApiType(options, typeChecker.getTypeFromTypeNode(typeNode.type), typeNode.type); + + return { + ...typeNodeToBaseType(options, type, typeNode), + ApiTypeKind: ApiTypeKind.Parenthesized, + Type: apiType + }; + } + + /** + * Example: `typeof Foo`. + */ + export function TypeQueryToApiType(options: ApiItemOptions, type: ts.Type, typeNode: ts.TypeQueryNode): TypeQueryType { + return { + ...ReferenceBaseTypeToTypeDto(options, type, typeNode), + ApiTypeKind: ApiTypeKind.TypeQuery, + Keyword: TypeKeywords.Typeof + }; + } + + export type HeritageKinds = ts.SyntaxKind.ImplementsKeyword | ts.SyntaxKind.ExtendsKeyword; + + export function GetHeritageList( + heritageClauses: ts.NodeArray, + kind: HeritageKinds, + options: ApiItemOptions + ): ApiType[] { + const typeChecker = options.Program.getTypeChecker(); + const list: ApiType[] = []; + + heritageClauses.forEach(heritage => { + if (heritage.token !== kind) { + return; + } + + heritage.types.forEach(expressionType => { + const type = typeChecker.getTypeFromTypeNode(expressionType); + + list.push(ResolveApiType(options, type, expressionType)); + }); + }); + + return list; + } +} diff --git a/src/contracts.ts b/src/contracts.ts index 764264eb..6d0e2aeb 100644 --- a/src/contracts.ts +++ b/src/contracts.ts @@ -24,7 +24,7 @@ export * from "./contracts/definitions/api-namespace-dto"; export * from "./contracts/definitions/api-parameter-dto"; export * from "./contracts/definitions/api-property-dto"; export * from "./contracts/definitions/api-source-file-dto"; -export * from "./contracts/definitions/api-type-dto"; +export * from "./contracts/definitions/api-type-alias-dto"; export * from "./contracts/definitions/api-type-literal-dto"; export * from "./contracts/definitions/api-type-parameter-dto"; export * from "./contracts/definitions/api-variable-dto"; @@ -34,7 +34,6 @@ export * from "./contracts/definitions/api-mapped-dto"; export * from "./contracts/dictionary"; export * from "./contracts/extractor-options"; export * from "./contracts/registry"; -export * from "./contracts/type-dto"; -export * from "./contracts/type-kinds"; export * from "./contracts/api-item-dto"; export * from "./contracts/api-item-location-dto"; +export * from "./contracts/api-type"; diff --git a/src/contracts/api-callable-dto.ts b/src/contracts/api-callable-dto.ts index 26db84c1..5cc77ac4 100644 --- a/src/contracts/api-callable-dto.ts +++ b/src/contracts/api-callable-dto.ts @@ -1,10 +1,10 @@ import { ApiBaseItemDto } from "./api-base-item-dto"; import { ApiItemReference } from "./api-item-reference"; -import { TypeDto } from "./type-dto"; +import { ApiType } from "./api-type"; export interface ApiCallableDto extends ApiBaseItemDto { TypeParameters: ApiItemReference[]; Parameters: ApiItemReference[]; IsOverloadBase: boolean; - ReturnType?: TypeDto; + ReturnType?: ApiType; } diff --git a/src/contracts/api-item-dto.ts b/src/contracts/api-item-dto.ts index 841ac520..b0887f78 100644 --- a/src/contracts/api-item-dto.ts +++ b/src/contracts/api-item-dto.ts @@ -18,7 +18,7 @@ import { ApiNamespaceDto } from "./definitions/api-namespace-dto"; import { ApiParameterDto } from "./definitions/api-parameter-dto"; import { ApiPropertyDto } from "./definitions/api-property-dto"; import { ApiSourceFileDto } from "./definitions/api-source-file-dto"; -import { ApiTypeDto } from "./definitions/api-type-dto"; +import { ApiTypeAliasDto } from "./definitions/api-type-alias-dto"; import { ApiTypeLiteralDto } from "./definitions/api-type-literal-dto"; import { ApiTypeParameterDto } from "./definitions/api-type-parameter-dto"; import { ApiVariableDto } from "./definitions/api-variable-dto"; @@ -45,7 +45,7 @@ export type ApiItemDto = ApiCallDto | ApiParameterDto | ApiPropertyDto | ApiSourceFileDto | - ApiTypeDto | + ApiTypeAliasDto | ApiTypeLiteralDto | ApiTypeParameterDto | ApiVariableDto | diff --git a/src/contracts/api-item-kinds.ts b/src/contracts/api-item-kinds.ts index e87bc8da..111d04a2 100644 --- a/src/contracts/api-item-kinds.ts +++ b/src/contracts/api-item-kinds.ts @@ -9,7 +9,7 @@ export enum ApiItemKinds { Parameter = "parameter", Property = "property", Variable = "variable", - Type = "type", + TypeAlias = "type-alias", Class = "class", ClassProperty = "class-property", ClassMethod = "class-method", diff --git a/src/contracts/api-type.ts b/src/contracts/api-type.ts new file mode 100644 index 00000000..5c13bacc --- /dev/null +++ b/src/contracts/api-type.ts @@ -0,0 +1,133 @@ +import * as ts from "typescript"; + +export type ApiType = ApiBasicType | + ApiReferenceType | + ApiUnionOrIntersectionType | + ArrayType | + TupleType | + TypeLiteralType | + MappedType | + FunctionTypeType | + ThisType | + TypePredicateType | + TypeOperatorType | + IndexedAccessType | + ParenthesizedType | + ConstructorType | + TypeQueryType; + +export enum ApiTypeKind { + Basic = "basic", + Reference = "reference", + Union = "union", + Intersection = "intersection", + Array = "array", + Tuple = "tuple", + TypeLiteral = "type-literal", + Mapped = "mapped", + FunctionType = "function-type", + This = "this", + TypePredicate = "type-predicate", + TypeOperator = "type-operator", + IndexedAccess = "indexed-access", + Parenthesized = "parenthesized", + Constructor = "constructor", + TypeQuery = "type-query" +} + +export enum TypeKeywords { + Unknown = "???", + Keyof = "keyof", + Typeof = "typeof" +} + +export interface TypeScriptTypeNodeDebug { + Kind: ts.SyntaxKind; + KindString: string; +} + +export interface ApiBaseType { + ApiTypeKind: ApiTypeKind; + Text: string; + _ts?: TypeScriptTypeNodeDebug; +} + +export interface ApiMembersBaseType extends ApiBaseType { + Members: ApiType[]; +} + +export interface ApiReferenceBaseType extends ApiBaseType { + ReferenceId?: string; +} + +export interface ApiBasicType extends ApiBaseType { + ApiTypeKind: ApiTypeKind.Basic; +} + +export interface ApiReferenceType extends ApiReferenceBaseType { + ApiTypeKind: ApiTypeKind.Reference; + TypeParameters: ApiType[] | undefined; + SymbolName?: string; +} + +export interface ApiUnionOrIntersectionType extends ApiMembersBaseType { + ApiTypeKind: ApiTypeKind.Intersection | ApiTypeKind.Union; +} + +export interface ArrayType extends ApiBaseType { + ApiTypeKind: ApiTypeKind.Array; + Type: ApiType; +} + +export interface TupleType extends ApiMembersBaseType { + ApiTypeKind: ApiTypeKind.Tuple; +} + +export interface TypeLiteralType extends ApiBaseType { + ApiTypeKind: ApiTypeKind.TypeLiteral; + ReferenceId?: string; +} + +export interface MappedType extends ApiBaseType, ApiReferenceBaseType { + ApiTypeKind: ApiTypeKind.Mapped; +} + +export interface FunctionTypeType extends ApiBaseType, ApiReferenceBaseType { + ApiTypeKind: ApiTypeKind.Mapped; +} + +export interface ThisType extends ApiReferenceBaseType { + ApiTypeKind: ApiTypeKind.This; +} + +export interface ConstructorType extends ApiReferenceBaseType { + ApiTypeKind: ApiTypeKind.Constructor; +} + +export interface TypePredicateType extends ApiBaseType { + ApiTypeKind: ApiTypeKind.TypePredicate; + ParameterName: string; + Type: ApiType; +} + +export interface TypeOperatorType extends ApiBaseType { + ApiTypeKind: ApiTypeKind.TypeOperator; + Keyword: TypeKeywords.Keyof | TypeKeywords.Unknown; + Type: ApiType; +} + +export interface IndexedAccessType extends ApiBaseType { + ApiTypeKind: ApiTypeKind.IndexedAccess; + ObjectType: ApiType; + IndexType: ApiType; +} + +export interface ParenthesizedType extends ApiBaseType { + ApiTypeKind: ApiTypeKind.Parenthesized; + Type: ApiType; +} + +export interface TypeQueryType extends ApiReferenceBaseType { + ApiTypeKind: ApiTypeKind.TypeQuery; + Keyword: TypeKeywords.Typeof; +} diff --git a/src/contracts/definitions/api-class-dto.ts b/src/contracts/definitions/api-class-dto.ts index 3d319697..953f0d0e 100644 --- a/src/contracts/definitions/api-class-dto.ts +++ b/src/contracts/definitions/api-class-dto.ts @@ -1,13 +1,13 @@ import { ApiBaseItemDto } from "../api-base-item-dto"; import { ApiItemReference } from "../api-item-reference"; -import { TypeDto } from "../type-dto"; import { ApiItemKinds } from "../api-item-kinds"; +import { ApiType } from "../api-type"; export interface ApiClassDto extends ApiBaseItemDto { ApiKind: ApiItemKinds.Class; TypeParameters: ApiItemReference[]; Members: ApiItemReference[]; - Extends?: TypeDto; - Implements: TypeDto[]; + Extends?: ApiType; + Implements: ApiType[]; IsAbstract: boolean; } diff --git a/src/contracts/definitions/api-class-property-dto.ts b/src/contracts/definitions/api-class-property-dto.ts index 30f5e928..c02a543f 100644 --- a/src/contracts/definitions/api-class-property-dto.ts +++ b/src/contracts/definitions/api-class-property-dto.ts @@ -1,7 +1,7 @@ import { ApiBaseItemDto } from "../api-base-item-dto"; -import { TypeDto } from "../type-dto"; import { AccessModifier } from "../access-modifier"; import { ApiItemKinds } from "../api-item-kinds"; +import { ApiType } from "../api-type"; export interface ApiClassPropertyDto extends ApiBaseItemDto { ApiKind: ApiItemKinds.ClassProperty; @@ -10,5 +10,5 @@ export interface ApiClassPropertyDto extends ApiBaseItemDto { IsStatic: boolean; IsReadonly: boolean; IsOptional: boolean; - Type: TypeDto; + Type: ApiType; } diff --git a/src/contracts/definitions/api-get-accessor-dto.ts b/src/contracts/definitions/api-get-accessor-dto.ts index 0e49ac12..6a902e35 100644 --- a/src/contracts/definitions/api-get-accessor-dto.ts +++ b/src/contracts/definitions/api-get-accessor-dto.ts @@ -1,12 +1,12 @@ import { ApiBaseItemDto } from "../api-base-item-dto"; import { ApiItemKinds } from "../api-item-kinds"; -import { TypeDto } from "../type-dto"; import { AccessModifier } from "../access-modifier"; +import { ApiType } from "../api-type"; export interface ApiGetAccessorDto extends ApiBaseItemDto { ApiKind: ApiItemKinds.GetAccessor; IsAbstract: boolean; IsStatic: boolean; AccessModifier: AccessModifier; - Type: TypeDto; + Type: ApiType; } diff --git a/src/contracts/definitions/api-index-dto.ts b/src/contracts/definitions/api-index-dto.ts index 31d624cf..fb3890c0 100644 --- a/src/contracts/definitions/api-index-dto.ts +++ b/src/contracts/definitions/api-index-dto.ts @@ -1,10 +1,10 @@ import { ApiBaseItemDto } from "../api-base-item-dto"; -import { TypeDto } from "../type-dto"; +import { ApiType } from "../api-type"; import { ApiItemKinds } from "../api-item-kinds"; export interface ApiIndexDto extends ApiBaseItemDto { ApiKind: ApiItemKinds.Index; Parameter: string; IsReadonly: boolean; - Type: TypeDto; + Type: ApiType; } diff --git a/src/contracts/definitions/api-interface-dto.ts b/src/contracts/definitions/api-interface-dto.ts index 4d8974a9..484a7d80 100644 --- a/src/contracts/definitions/api-interface-dto.ts +++ b/src/contracts/definitions/api-interface-dto.ts @@ -1,11 +1,11 @@ import { ApiBaseItemDto } from "../api-base-item-dto"; import { ApiItemReference } from "../api-item-reference"; -import { TypeDto } from "../type-dto"; +import { ApiType } from "../api-type"; import { ApiItemKinds } from "../api-item-kinds"; export interface ApiInterfaceDto extends ApiBaseItemDto { ApiKind: ApiItemKinds.Interface; TypeParameters: ApiItemReference[]; Members: ApiItemReference[]; - Extends: TypeDto[]; + Extends: ApiType[]; } diff --git a/src/contracts/definitions/api-mapped-dto.ts b/src/contracts/definitions/api-mapped-dto.ts index 1aa0340e..66f39353 100644 --- a/src/contracts/definitions/api-mapped-dto.ts +++ b/src/contracts/definitions/api-mapped-dto.ts @@ -1,11 +1,11 @@ import { ApiBaseItemDto } from "../api-base-item-dto"; import { ApiItemKinds } from "../api-item-kinds"; -import { TypeDto } from "../type-dto"; +import { ApiType } from "../api-type"; export interface ApiMappedDto extends ApiBaseItemDto { ApiKind: ApiItemKinds.Mapped; TypeParameter: string | undefined; IsReadonly: boolean; IsOptional: boolean; - Type: TypeDto; + Type: ApiType; } diff --git a/src/contracts/definitions/api-parameter-dto.ts b/src/contracts/definitions/api-parameter-dto.ts index fafd7004..6ff5ad94 100644 --- a/src/contracts/definitions/api-parameter-dto.ts +++ b/src/contracts/definitions/api-parameter-dto.ts @@ -1,10 +1,10 @@ import { ApiBaseItemDto } from "../api-base-item-dto"; -import { TypeDto } from "../type-dto"; +import { ApiType } from "../api-type"; import { ApiItemKinds } from "../api-item-kinds"; export interface ApiParameterDto extends ApiBaseItemDto { ApiKind: ApiItemKinds.Parameter; - Type: TypeDto; + Type: ApiType; IsSpread: boolean; Initializer: string | undefined; IsOptional: boolean; diff --git a/src/contracts/definitions/api-property-dto.ts b/src/contracts/definitions/api-property-dto.ts index ce06ebc7..0d22fbd0 100644 --- a/src/contracts/definitions/api-property-dto.ts +++ b/src/contracts/definitions/api-property-dto.ts @@ -1,10 +1,10 @@ import { ApiBaseItemDto } from "../api-base-item-dto"; -import { TypeDto } from "../type-dto"; +import { ApiType } from "../api-type"; import { ApiItemKinds } from "../api-item-kinds"; export interface ApiPropertyDto extends ApiBaseItemDto { ApiKind: ApiItemKinds.Property; IsOptional: boolean; IsReadonly: boolean; - Type: TypeDto; + Type: ApiType; } diff --git a/src/contracts/definitions/api-type-dto.ts b/src/contracts/definitions/api-type-alias-dto.ts similarity index 57% rename from src/contracts/definitions/api-type-dto.ts rename to src/contracts/definitions/api-type-alias-dto.ts index 54b6d7ec..9b6eb559 100644 --- a/src/contracts/definitions/api-type-dto.ts +++ b/src/contracts/definitions/api-type-alias-dto.ts @@ -1,10 +1,10 @@ import { ApiBaseItemDto } from "../api-base-item-dto"; -import { TypeDto } from "../type-dto"; import { ApiItemReference } from "../api-item-reference"; import { ApiItemKinds } from "../api-item-kinds"; +import { ApiType } from "../api-type"; -export interface ApiTypeDto extends ApiBaseItemDto { - ApiKind: ApiItemKinds.Type; +export interface ApiTypeAliasDto extends ApiBaseItemDto { + ApiKind: ApiItemKinds.TypeAlias; TypeParameters: ApiItemReference[]; - Type: TypeDto; + Type: ApiType; } diff --git a/src/contracts/definitions/api-type-parameter-dto.ts b/src/contracts/definitions/api-type-parameter-dto.ts index b3d553b6..35cd7cd6 100644 --- a/src/contracts/definitions/api-type-parameter-dto.ts +++ b/src/contracts/definitions/api-type-parameter-dto.ts @@ -1,9 +1,9 @@ import { ApiBaseItemDto } from "../api-base-item-dto"; -import { TypeDto } from "../type-dto"; +import { ApiType } from "../api-type"; import { ApiItemKinds } from "../api-item-kinds"; export interface ApiTypeParameterDto extends ApiBaseItemDto { ApiKind: ApiItemKinds.TypeParameter; - ConstraintType: TypeDto | undefined; - DefaultType: TypeDto | undefined; + ConstraintType: ApiType | undefined; + DefaultType: ApiType | undefined; } diff --git a/src/contracts/definitions/api-variable-dto.ts b/src/contracts/definitions/api-variable-dto.ts index cdf64086..536d2040 100644 --- a/src/contracts/definitions/api-variable-dto.ts +++ b/src/contracts/definitions/api-variable-dto.ts @@ -1,5 +1,5 @@ import { ApiBaseItemDto } from "../api-base-item-dto"; -import { TypeDto } from "../type-dto"; +import { ApiType } from "../api-type"; import { ApiItemKinds } from "../api-item-kinds"; export enum ApiVariableDeclarationType { @@ -10,6 +10,6 @@ export enum ApiVariableDeclarationType { export interface ApiVariableDto extends ApiBaseItemDto { ApiKind: ApiItemKinds.Variable; - Type: TypeDto; + Type: ApiType; VariableDeclarationType: ApiVariableDeclarationType; } diff --git a/src/contracts/type-dto.ts b/src/contracts/type-dto.ts deleted file mode 100644 index 6adee444..00000000 --- a/src/contracts/type-dto.ts +++ /dev/null @@ -1,33 +0,0 @@ -import * as ts from "typescript"; - -import { TypeKinds } from "./type-kinds"; - -/** - * Base type interface. - */ -export interface BaseTypeDto { - ApiTypeKind: TypeKinds; - ReferenceId: string | undefined; - Text: string; - Name?: string; -} - -export interface TypeScriptSpecificPropertiesDto { - Flags: ts.TypeFlags | ts.NodeFlags; - FlagsString: string; -} - -export type TypeDto = TypeBasicDto | TypeUnionOrIntersectionDto; - -/** - * Basic type. It can be "basic", "type-parameter" etc. - */ -export interface TypeBasicDto extends BaseTypeDto, TypeScriptSpecificPropertiesDto { - ApiTypeKind: TypeKinds.Basic | TypeKinds.TypeParameter; - Generics?: TypeDto[]; -} - -export interface TypeUnionOrIntersectionDto extends BaseTypeDto, TypeScriptSpecificPropertiesDto { - ApiTypeKind: TypeKinds.Union | TypeKinds.Intersection; - Types: TypeDto[]; -} diff --git a/src/contracts/type-kinds.ts b/src/contracts/type-kinds.ts deleted file mode 100644 index d9cafdf3..00000000 --- a/src/contracts/type-kinds.ts +++ /dev/null @@ -1,6 +0,0 @@ -export enum TypeKinds { - Basic = "basic", - Union = "union", - Intersection = "intersection", - TypeParameter = "type-parameter" -} diff --git a/src/definitions/api-class-property.ts b/src/definitions/api-class-property.ts index 572e8819..2c40954c 100644 --- a/src/definitions/api-class-property.ts +++ b/src/definitions/api-class-property.ts @@ -4,10 +4,11 @@ import { ApiItem } from "../abstractions/api-item"; import { ApiHelpers } from "../api-helpers"; import { ApiClassPropertyDto } from "../contracts/definitions/api-class-property-dto"; import { ApiItemKinds } from "../contracts/api-item-kinds"; -import { TypeDto } from "../contracts/type-dto"; +import { ApiType } from "../contracts/api-type"; import { AccessModifier } from "../contracts/access-modifier"; import { ApiMetadataDto } from "../contracts/api-metadata-dto"; import { ApiItemLocationDto } from "../contracts/api-item-location-dto"; +import { ApiTypeHelpers } from "../api-type-helpers"; export class ApiClassProperty extends ApiItem { private accessModifier: AccessModifier; @@ -15,7 +16,7 @@ export class ApiClassProperty extends ApiItem { /** * Interfaces can extend multiple interfaces. */ - private extends: TypeDto | undefined; - private implements: TypeDto[] = []; + private extends: ApiType | undefined; + private implements: ApiType[] = []; private typeParameters: ApiItemReference[] = []; private members: ApiItemReference[] = []; private isAbstract: boolean = false; @@ -25,7 +26,8 @@ export class ApiClass extends ApiItem { // Extends if (this.Declaration.heritageClauses != null) { - const extendingList = ApiHelpers.GetHeritageList(this.Declaration.heritageClauses, ts.SyntaxKind.ExtendsKeyword, this.Options); + const extendingList = ApiTypeHelpers + .GetHeritageList(this.Declaration.heritageClauses, ts.SyntaxKind.ExtendsKeyword, this.Options); if (extendingList.length > 0) { this.extends = extendingList[0]; @@ -34,7 +36,8 @@ export class ApiClass extends ApiItem { // Implements if (this.Declaration.heritageClauses != null) { - this.implements = ApiHelpers.GetHeritageList(this.Declaration.heritageClauses, ts.SyntaxKind.ImplementsKeyword, this.Options); + this.implements = ApiTypeHelpers + .GetHeritageList(this.Declaration.heritageClauses, ts.SyntaxKind.ImplementsKeyword, this.Options); } // IsAbstract diff --git a/src/definitions/api-enum-member.ts b/src/definitions/api-enum-member.ts index 4d76c052..8b0f39de 100644 --- a/src/definitions/api-enum-member.ts +++ b/src/definitions/api-enum-member.ts @@ -8,7 +8,6 @@ import { ApiMetadataDto } from "../contracts/api-metadata-dto"; import { ApiItemLocationDto } from "../contracts/api-item-location-dto"; export class ApiEnumMember extends ApiItem { - public GetValue(): string { for (const item of this.Declaration.getChildren()) { if (ts.isNumericLiteral(item) || diff --git a/src/definitions/api-get-accessor.ts b/src/definitions/api-get-accessor.ts index dd21811c..7911ee07 100644 --- a/src/definitions/api-get-accessor.ts +++ b/src/definitions/api-get-accessor.ts @@ -6,14 +6,15 @@ import { ApiItemKinds } from "../contracts/api-item-kinds"; import { ApiMetadataDto } from "../contracts/api-metadata-dto"; import { ApiItemLocationDto } from "../contracts/api-item-location-dto"; import { ApiGetAccessorDto } from "../contracts/definitions/api-get-accessor-dto"; -import { TypeDto } from "../contracts/type-dto"; +import { ApiType } from "../contracts/api-type"; import { AccessModifier } from "../contracts/access-modifier"; +import { ApiTypeHelpers } from "../api-type-helpers"; export class ApiGetAccessor extends ApiItem { private accessModifier: AccessModifier; private isAbstract: boolean; private isStatic: boolean; - private type: TypeDto; + private type: ApiType; protected OnGatherData(): void { // Modifiers @@ -23,7 +24,7 @@ export class ApiGetAccessor extends ApiItem { private parameter: string; - private type: TypeDto; + private type: ApiType; private isReadonly: boolean; protected OnGatherData(): void { @@ -36,7 +37,7 @@ export class ApiIndex extends ApiItem * getTypeFromTypeNode method handles undefined and returns `any` type. */ const type = this.TypeChecker.getTypeFromTypeNode(this.Declaration.type!); - this.type = ApiHelpers.TypeToApiTypeDto(type, this.Options); + this.type = ApiTypeHelpers.ResolveApiType(this.Options, type, this.Declaration.type); // Modifiers this.isReadonly = ApiHelpers.ModifierKindExistsInModifiers(this.Declaration.modifiers, ts.SyntaxKind.ReadonlyKeyword); diff --git a/src/definitions/api-interface.ts b/src/definitions/api-interface.ts index 9b22a108..0f11343a 100644 --- a/src/definitions/api-interface.ts +++ b/src/definitions/api-interface.ts @@ -5,15 +5,16 @@ import { ApiHelpers } from "../api-helpers"; import { ApiInterfaceDto } from "../contracts/definitions/api-interface-dto"; import { ApiItemReference } from "../contracts/api-item-reference"; import { ApiItemKinds } from "../contracts/api-item-kinds"; -import { TypeDto } from "../contracts/type-dto"; +import { ApiType } from "../contracts/api-type"; import { ApiMetadataDto } from "../contracts/api-metadata-dto"; import { ApiItemLocationDto } from "../contracts/api-item-location-dto"; +import { ApiTypeHelpers } from "../api-type-helpers"; export class ApiInterface extends ApiItem { /** * Interfaces can extend multiple interfaces. */ - private extends: TypeDto[] = []; + private extends: ApiType[] = []; private typeParameters: ApiItemReference[] = []; private members: ApiItemReference[] = []; @@ -23,7 +24,7 @@ export class ApiInterface extends ApiItem { private typeParameter: string | undefined; - private type: TypeDto; + private type: ApiType; private isReadonly: boolean; private isOptional: boolean; @@ -28,7 +29,7 @@ export class ApiMapped extends ApiItem { * getTypeFromTypeNode method handles undefined and returns `any` type. */ const type = this.TypeChecker.getTypeFromTypeNode(this.Declaration.type!); - this.type = ApiHelpers.TypeToApiTypeDto(type, this.Options); + this.type = ApiTypeHelpers.ResolveApiType(this.Options, type, this.Declaration.type); // Readonly this.isReadonly = Boolean(this.Declaration.readonlyToken); diff --git a/src/definitions/api-parameter.ts b/src/definitions/api-parameter.ts index 0d647ed5..c4e0fba9 100644 --- a/src/definitions/api-parameter.ts +++ b/src/definitions/api-parameter.ts @@ -4,12 +4,13 @@ import { ApiItem } from "../abstractions/api-item"; import { ApiHelpers } from "../api-helpers"; import { ApiParameterDto } from "../contracts/definitions/api-parameter-dto"; import { ApiItemKinds } from "../contracts/api-item-kinds"; -import { TypeDto } from "../contracts/type-dto"; +import { ApiType } from "../contracts/api-type"; import { ApiMetadataDto } from "../contracts/api-metadata-dto"; import { ApiItemLocationDto } from "../contracts/api-item-location-dto"; +import { ApiTypeHelpers } from "../api-type-helpers"; export class ApiParameter extends ApiItem { - private type: TypeDto; + private type: ApiType; private isOptional: boolean; private isSpread: boolean; private initializer: string | undefined; @@ -17,7 +18,7 @@ export class ApiParameter extends ApiItem { - private type: TypeDto; + private type: ApiType; private isOptional: boolean; private isReadonly: boolean; protected OnGatherData(): void { // Type const type = this.TypeChecker.getTypeOfSymbolAtLocation(this.Symbol, this.Declaration); - this.type = ApiHelpers.TypeToApiTypeDto(type, this.Options); + this.type = ApiTypeHelpers.ResolveApiType(this.Options, type, this.Declaration.type); // IsOptional this.isOptional = Boolean(this.Declaration.questionToken); diff --git a/src/definitions/api-type.ts b/src/definitions/api-type-alias.ts similarity index 73% rename from src/definitions/api-type.ts rename to src/definitions/api-type-alias.ts index c8f00f35..d74a3228 100644 --- a/src/definitions/api-type.ts +++ b/src/definitions/api-type-alias.ts @@ -3,16 +3,17 @@ import { ApiItem } from "../abstractions/api-item"; import { ApiHelpers } from "../api-helpers"; -import { ApiTypeDto } from "../contracts/definitions/api-type-dto"; +import { ApiTypeAliasDto } from "../contracts/definitions/api-type-alias-dto"; import { ApiItemKinds } from "../contracts/api-item-kinds"; -import { TypeDto } from "../contracts/type-dto"; import { ApiMetadataDto } from "../contracts/api-metadata-dto"; import { ApiItemReference } from "../contracts/api-item-reference"; import { ApiItemLocationDto } from "../contracts/api-item-location-dto"; +import { ApiType } from "../contracts"; +import { ApiTypeHelpers } from "../api-type-helpers"; -export class ApiType extends ApiItem { +export class ApiTypeAlias extends ApiItem { private typeParameters: ApiItemReference[] = []; - private type: TypeDto; + private type: ApiType; protected OnGatherData(): void { // TypeParameters @@ -23,15 +24,15 @@ export class ApiType extends ApiItem { // Type const type = this.TypeChecker.getTypeFromTypeNode(this.Declaration.type); const self = type.aliasSymbol === this.Symbol; - this.type = ApiHelpers.TypeToApiTypeDto(type, this.Options, self); + this.type = ApiTypeHelpers.ResolveApiType(this.Options, type, this.Declaration.type, self); } - public OnExtract(): ApiTypeDto { + public OnExtract(): ApiTypeAliasDto { const metadata: ApiMetadataDto = this.GetItemMetadata(); const location: ApiItemLocationDto = ApiHelpers.GetApiItemLocationDtoFromNode(this.Declaration, this.Options); return { - ApiKind: ApiItemKinds.Type, + ApiKind: ApiItemKinds.TypeAlias, Name: this.Symbol.name, Metadata: metadata, Location: location, diff --git a/src/definitions/api-type-parameter.ts b/src/definitions/api-type-parameter.ts index abbe1674..459e367c 100644 --- a/src/definitions/api-type-parameter.ts +++ b/src/definitions/api-type-parameter.ts @@ -5,25 +5,26 @@ import { ApiHelpers } from "../api-helpers"; import { ApiTypeParameterDto } from "../contracts/definitions/api-type-parameter-dto"; import { ApiItemKinds } from "../contracts/api-item-kinds"; -import { TypeDto } from "../contracts/type-dto"; +import { ApiType } from "../contracts/api-type"; import { ApiMetadataDto } from "../contracts/api-metadata-dto"; import { ApiItemLocationDto } from "../contracts/api-item-location-dto"; +import { ApiTypeHelpers } from "../api-type-helpers"; export class ApiTypeParameter extends ApiItem { - private constraintType: TypeDto | undefined; - private defaultType: TypeDto | undefined; + private constraintType: ApiType | undefined; + private defaultType: ApiType | undefined; protected OnGatherData(): void { // Constraint type if (this.Declaration.constraint != null) { const type = this.TypeChecker.getTypeFromTypeNode(this.Declaration.constraint); - this.constraintType = ApiHelpers.TypeToApiTypeDto(type, this.Options); + this.constraintType = ApiTypeHelpers.ResolveApiType(this.Options, type, this.Declaration.constraint); } // Default type if (this.Declaration.default != null) { const type = this.TypeChecker.getTypeFromTypeNode(this.Declaration.default); - this.defaultType = ApiHelpers.TypeToApiTypeDto(type, this.Options); + this.defaultType = ApiTypeHelpers.ResolveApiType(this.Options, type, this.Declaration.default); } } diff --git a/src/definitions/api-variable.ts b/src/definitions/api-variable.ts index 4679a86e..a18d001b 100644 --- a/src/definitions/api-variable.ts +++ b/src/definitions/api-variable.ts @@ -4,18 +4,19 @@ import { ApiItem } from "../abstractions/api-item"; import { ApiHelpers } from "../api-helpers"; import { ApiVariableDto, ApiVariableDeclarationType } from "../contracts/definitions/api-variable-dto"; import { ApiItemKinds } from "../contracts/api-item-kinds"; -import { TypeDto } from "../contracts/type-dto"; +import { ApiType } from "../contracts/api-type"; import { ApiMetadataDto } from "../contracts/api-metadata-dto"; import { ApiItemLocationDto } from "../contracts/api-item-location-dto"; +import { ApiTypeHelpers } from "../api-type-helpers"; export class ApiVariable extends ApiItem { - private type: TypeDto; + private type: ApiType; private variableDeclarationType: ApiVariableDeclarationType; protected OnGatherData(): void { // Type const type = this.TypeChecker.getTypeOfSymbolAtLocation(this.Symbol, this.Declaration); - this.type = ApiHelpers.TypeToApiTypeDto(type, this.Options); + this.type = ApiTypeHelpers.ResolveApiType(this.Options, type, this.Declaration.type); // VariableDeclarationType if (this.Declaration.parent != null) { diff --git a/src/ts-helpers.ts b/src/ts-helpers.ts index 63a78b80..f6d55df3 100644 --- a/src/ts-helpers.ts +++ b/src/ts-helpers.ts @@ -98,22 +98,6 @@ export namespace TSHelpers { return (type as TypeWithTypeArguments).typeArguments != null; } - export function IsTypeUnionOrIntersectionType(type: ts.Type): type is ts.UnionOrIntersectionType { - return Boolean(type.flags & ts.TypeFlags.UnionOrIntersection); - } - - export function IsTypeUnionType(type: ts.Type): type is ts.UnionType { - return Boolean(type.flags & ts.TypeFlags.Union); - } - - export function IsTypeIntersectionType(type: ts.Type): type is ts.IntersectionType { - return Boolean(type.flags & ts.TypeFlags.Intersection); - } - - export function IsTypeTypeParameter(type: ts.Type): type is ts.TypeParameter { - return Boolean(type.flags & ts.TypeFlags.TypeParameter); - } - export function GetResolvedModule(sourceFile: ts.SourceFile, moduleNameText: string): ts.ResolvedModuleFull | undefined { return sourceFile && (sourceFile as any).resolvedModules && (sourceFile as any).resolvedModules.get(moduleNameText); } @@ -142,4 +126,8 @@ export namespace TSHelpers { export function IsInternalSymbolName(name: string): boolean { return Object.values(ts.InternalSymbolName).indexOf(name) !== -1; } + + export function IsNodeSynthesized(node: ts.Node): boolean { + return Boolean(node.flags & ts.NodeFlags.Synthesized); + } } diff --git a/tests/cases/ClassDeclaration11.ts b/tests/cases/ClassDeclaration11.ts new file mode 100644 index 00000000..93570321 --- /dev/null +++ b/tests/cases/ClassDeclaration11.ts @@ -0,0 +1,5 @@ +export class Foo { + public getFoo(): this { + return this; + } +} diff --git a/tests/cases/FunctionDeclaration4.ts b/tests/cases/FunctionDeclaration4.ts new file mode 100644 index 00000000..b728a876 --- /dev/null +++ b/tests/cases/FunctionDeclaration4.ts @@ -0,0 +1,5 @@ +// Foo with missing return type. + +export function Foo(arg: string[]) { + return arg; +} diff --git a/tests/cases/FunctionDeclaration5.ts b/tests/cases/FunctionDeclaration5.ts new file mode 100644 index 00000000..e3909759 --- /dev/null +++ b/tests/cases/FunctionDeclaration5.ts @@ -0,0 +1,3 @@ +export function IsString(arg: string | number): arg is string { + return typeof arg === "string"; +} diff --git a/tests/cases/FunctionDeclaration6.ts b/tests/cases/FunctionDeclaration6.ts new file mode 100644 index 00000000..b83703fc --- /dev/null +++ b/tests/cases/FunctionDeclaration6.ts @@ -0,0 +1,7 @@ +export interface Foo { + +} + +export function Bar(arg: Foo) { + return arg; +} diff --git a/tests/cases/FunctionDeclaration7.ts b/tests/cases/FunctionDeclaration7.ts new file mode 100644 index 00000000..189d24c3 --- /dev/null +++ b/tests/cases/FunctionDeclaration7.ts @@ -0,0 +1,3 @@ +export function Foo(arg: string | boolean) { + return arg; +} diff --git a/tests/cases/FunctionDeclaration8.ts b/tests/cases/FunctionDeclaration8.ts new file mode 100644 index 00000000..bb6089e5 --- /dev/null +++ b/tests/cases/FunctionDeclaration8.ts @@ -0,0 +1,3 @@ +export function Foo(arg: [string, number]) { + return arg; +} diff --git a/tests/cases/TypeAliasDeclaration5.ts b/tests/cases/TypeAliasDeclaration5.ts new file mode 100644 index 00000000..19c9462c --- /dev/null +++ b/tests/cases/TypeAliasDeclaration5.ts @@ -0,0 +1 @@ +export type FooTuple = [string, number]; diff --git a/tests/cases/TypeAliasDeclaration6.ts b/tests/cases/TypeAliasDeclaration6.ts new file mode 100644 index 00000000..fca2ec53 --- /dev/null +++ b/tests/cases/TypeAliasDeclaration6.ts @@ -0,0 +1,8 @@ +export interface Foo { + Name: string; + LastName: string; +} + +export type Bar = { + [TKey in keyof Foo]: Foo[TKey] +}; diff --git a/tests/cases/TypeAliasDeclaration7.ts b/tests/cases/TypeAliasDeclaration7.ts new file mode 100644 index 00000000..8a53f541 --- /dev/null +++ b/tests/cases/TypeAliasDeclaration7.ts @@ -0,0 +1 @@ +export type Foo = (string | number)[]; diff --git a/tests/cases/TypeAliasDeclaration8.ts b/tests/cases/TypeAliasDeclaration8.ts new file mode 100644 index 00000000..b9cd21aa --- /dev/null +++ b/tests/cases/TypeAliasDeclaration8.ts @@ -0,0 +1,4 @@ +export type Foo = new () => { + Name: string; + Age: number; +}; diff --git a/tests/cases/__tests__/__snapshots__/ClassDeclaration1.test.ts.snap b/tests/cases/__tests__/__snapshots__/ClassDeclaration1.test.ts.snap index 2af32d4c..df2bfab4 100644 --- a/tests/cases/__tests__/__snapshots__/ClassDeclaration1.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/ClassDeclaration1.test.ts.snap @@ -96,12 +96,11 @@ Object { ], "ReturnType": Object { "ApiTypeKind": "basic", - "Flags": 1024, - "FlagsString": "Void", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "void", + "_ts": Object { + "Kind": 105, + "KindString": "VoidKeyword", + }, }, "TypeParameters": Array [], "_ts": Object { @@ -140,12 +139,11 @@ GetFoo without A parameter comment line.", ], "ReturnType": Object { "ApiTypeKind": "basic", - "Flags": 2, - "FlagsString": "String", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, }, "TypeParameters": Array [], "_ts": Object { @@ -184,12 +182,11 @@ GetFoo without A parameter comment line.", ], "ReturnType": Object { "ApiTypeKind": "basic", - "Flags": 2, - "FlagsString": "String", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, }, "TypeParameters": Array [], "_ts": Object { @@ -228,12 +225,11 @@ GetFoo without A parameter comment line.", ], "ReturnType": Object { "ApiTypeKind": "basic", - "Flags": 2, - "FlagsString": "String", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, }, "TypeParameters": Array [], "_ts": Object { @@ -262,23 +258,24 @@ GetFoo without A parameter comment line.", "Name": "AsyncGetFoo", "Parameters": Array [], "ReturnType": Object { - "ApiTypeKind": "basic", - "Flags": 32768, - "FlagsString": "Object", - "Generics": Array [ + "ApiTypeKind": "reference", + "ReferenceId": undefined, + "SymbolName": "Promise", + "Text": "Promise", + "TypeParameters": Array [ Object { "ApiTypeKind": "basic", - "Flags": 2, - "FlagsString": "String", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, }, ], - "Name": "Promise", - "ReferenceId": undefined, - "Text": "Promise", + "_ts": Object { + "Kind": 159, + "KindString": "TypeReference", + }, }, "TypeParameters": Array [], "_ts": Object { @@ -304,12 +301,11 @@ GetFoo without A parameter comment line.", "Name": "foo", "Type": Object { "ApiTypeKind": "basic", - "Flags": 2, - "FlagsString": "String", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, }, "_ts": Object { "Kind": 146, @@ -334,12 +330,11 @@ GetFoo without A parameter comment line.", "Name": "text", "Type": Object { "ApiTypeKind": "basic", - "Flags": 2, - "FlagsString": "String", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, }, "_ts": Object { "Kind": 146, @@ -363,32 +358,12 @@ GetFoo without A parameter comment line.", }, "Name": "open", "Type": Object { - "ApiTypeKind": "union", - "Flags": 65544, - "FlagsString": undefined, - "Name": undefined, - "ReferenceId": undefined, + "ApiTypeKind": "basic", "Text": "boolean", - "Types": Array [ - Object { - "ApiTypeKind": "basic", - "Flags": 128, - "FlagsString": "BooleanLiteral", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, - "Text": "true", - }, - Object { - "ApiTypeKind": "basic", - "Flags": 128, - "FlagsString": "BooleanLiteral", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, - "Text": "false", - }, - ], + "_ts": Object { + "Kind": 122, + "KindString": "BooleanKeyword", + }, }, "_ts": Object { "Kind": 146, @@ -413,40 +388,29 @@ GetFoo without A parameter comment line.", "Name": "arg", "Type": Object { "ApiTypeKind": "union", - "Flags": 65536, - "FlagsString": "Union", - "Name": undefined, - "ReferenceId": undefined, - "Text": "string | boolean", - "Types": Array [ + "Members": Array [ Object { "ApiTypeKind": "basic", - "Flags": 2, - "FlagsString": "String", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, }, Object { "ApiTypeKind": "basic", - "Flags": 128, - "FlagsString": "BooleanLiteral", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, - "Text": "true", - }, - Object { - "ApiTypeKind": "basic", - "Flags": 128, - "FlagsString": "BooleanLiteral", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, - "Text": "false", + "Text": "boolean", + "_ts": Object { + "Kind": 122, + "KindString": "BooleanKeyword", + }, }, ], + "Text": "string | boolean", + "_ts": Object { + "Kind": 166, + "KindString": "UnionType", + }, }, "_ts": Object { "Kind": 146, @@ -478,12 +442,11 @@ GetFoo without A parameter comment line.", "Name": "IdProperty", "Type": Object { "ApiTypeKind": "basic", - "Flags": 2, - "FlagsString": "String", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, }, "_ts": Object { "Kind": 149, @@ -510,12 +473,11 @@ GetFoo without A parameter comment line.", "Name": "BarProperty", "Type": Object { "ApiTypeKind": "basic", - "Flags": 2, - "FlagsString": "String", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, }, "_ts": Object { "Kind": 149, diff --git a/tests/cases/__tests__/__snapshots__/ClassDeclaration10.test.ts.snap b/tests/cases/__tests__/__snapshots__/ClassDeclaration10.test.ts.snap index 2334c09b..72533615 100644 --- a/tests/cases/__tests__/__snapshots__/ClassDeclaration10.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/ClassDeclaration10.test.ts.snap @@ -143,12 +143,11 @@ Creating foo with boolean.", "Name": "text", "Type": Object { "ApiTypeKind": "basic", - "Flags": 2, - "FlagsString": "String", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, }, "_ts": Object { "Kind": 146, @@ -172,32 +171,12 @@ Creating foo with boolean.", }, "Name": "should", "Type": Object { - "ApiTypeKind": "union", - "Flags": 65544, - "FlagsString": undefined, - "Name": undefined, - "ReferenceId": undefined, + "ApiTypeKind": "basic", "Text": "boolean", - "Types": Array [ - Object { - "ApiTypeKind": "basic", - "Flags": 128, - "FlagsString": "BooleanLiteral", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, - "Text": "true", - }, - Object { - "ApiTypeKind": "basic", - "Flags": 128, - "FlagsString": "BooleanLiteral", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, - "Text": "false", - }, - ], + "_ts": Object { + "Kind": 122, + "KindString": "BooleanKeyword", + }, }, "_ts": Object { "Kind": 146, @@ -222,40 +201,29 @@ Creating foo with boolean.", "Name": "arg", "Type": Object { "ApiTypeKind": "union", - "Flags": 65536, - "FlagsString": "Union", - "Name": undefined, - "ReferenceId": undefined, - "Text": "string | boolean", - "Types": Array [ + "Members": Array [ Object { "ApiTypeKind": "basic", - "Flags": 2, - "FlagsString": "String", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, }, Object { "ApiTypeKind": "basic", - "Flags": 128, - "FlagsString": "BooleanLiteral", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, - "Text": "true", - }, - Object { - "ApiTypeKind": "basic", - "Flags": 128, - "FlagsString": "BooleanLiteral", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, - "Text": "false", + "Text": "boolean", + "_ts": Object { + "Kind": 122, + "KindString": "BooleanKeyword", + }, }, ], + "Text": "string | boolean", + "_ts": Object { + "Kind": 166, + "KindString": "UnionType", + }, }, "_ts": Object { "Kind": 146, diff --git a/tests/cases/__tests__/__snapshots__/ClassDeclaration11.test.ts.snap b/tests/cases/__tests__/__snapshots__/ClassDeclaration11.test.ts.snap new file mode 100644 index 00000000..623bbf5a --- /dev/null +++ b/tests/cases/__tests__/__snapshots__/ClassDeclaration11.test.ts.snap @@ -0,0 +1,102 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`ClassDeclaration11 1`] = ` +Object { + "EntryFiles": Array [ + "SourceFile-0", + ], + "Registry": Object { + "ClassDeclaration-0": Object { + "ApiKind": "class", + "Extends": undefined, + "Implements": Array [], + "IsAbstract": false, + "Location": Object { + "Character": 0, + "FileName": "./cases/ClassDeclaration11.ts", + "IsExternalPackage": false, + "Line": 0, + }, + "Members": Array [ + Object { + "Alias": "getFoo", + "Ids": Array [ + "MethodDeclaration-0", + ], + }, + ], + "Metadata": Object { + "DocumentationComment": "", + "JSDocTags": Array [], + }, + "Name": "Foo", + "TypeParameters": Array [], + "_ts": Object { + "Kind": 229, + "KindString": "ClassDeclaration", + }, + }, + "MethodDeclaration-0": Object { + "AccessModifier": "public", + "ApiKind": "class-method", + "IsAbstract": false, + "IsAsync": false, + "IsOptional": false, + "IsOverloadBase": false, + "IsStatic": false, + "Location": Object { + "Character": 4, + "FileName": "./cases/ClassDeclaration11.ts", + "IsExternalPackage": false, + "Line": 1, + }, + "Metadata": Object { + "DocumentationComment": "", + "JSDocTags": Array [], + }, + "Name": "getFoo", + "Parameters": Array [], + "ReturnType": Object { + "ApiTypeKind": "this", + "ReferenceId": "ClassDeclaration-0", + "Text": "this", + "_ts": Object { + "Kind": 169, + "KindString": "ThisType", + }, + }, + "TypeParameters": Array [], + "_ts": Object { + "Kind": 151, + "KindString": "MethodDeclaration", + }, + }, + "SourceFile-0": Object { + "ApiKind": "source-file", + "Location": Object { + "Character": 0, + "FileName": "./cases/ClassDeclaration11.ts", + "IsExternalPackage": false, + "Line": 0, + }, + "Members": Array [ + Object { + "Alias": "Foo", + "Ids": Array [ + "ClassDeclaration-0", + ], + }, + ], + "Metadata": Object { + "DocumentationComment": "", + "JSDocTags": Array [], + }, + "Name": "ClassDeclaration11.ts", + "_ts": Object { + "Kind": 268, + "KindString": "SourceFile", + }, + }, + }, +} +`; diff --git a/tests/cases/__tests__/__snapshots__/ClassDeclaration2.test.ts.snap b/tests/cases/__tests__/__snapshots__/ClassDeclaration2.test.ts.snap index 050c657e..3f44866a 100644 --- a/tests/cases/__tests__/__snapshots__/ClassDeclaration2.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/ClassDeclaration2.test.ts.snap @@ -89,12 +89,11 @@ Object { ], "ReturnType": Object { "ApiTypeKind": "basic", - "Flags": 1024, - "FlagsString": "Void", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "void", + "_ts": Object { + "Kind": 105, + "KindString": "VoidKeyword", + }, }, "TypeParameters": Array [], "_ts": Object { @@ -124,12 +123,11 @@ Object { "Parameters": Array [], "ReturnType": Object { "ApiTypeKind": "basic", - "Flags": 2, - "FlagsString": "String", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, }, "TypeParameters": Array [], "_ts": Object { @@ -155,12 +153,11 @@ Object { "Name": "foo", "Type": Object { "ApiTypeKind": "basic", - "Flags": 2, - "FlagsString": "String", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, }, "_ts": Object { "Kind": 146, @@ -187,12 +184,11 @@ Object { "Name": "property", "Type": Object { "ApiTypeKind": "basic", - "Flags": 2, - "FlagsString": "String", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, }, "_ts": Object { "Kind": 149, @@ -219,12 +215,11 @@ Object { "Name": "Id", "Type": Object { "ApiTypeKind": "basic", - "Flags": 2, - "FlagsString": "String", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, }, "_ts": Object { "Kind": 149, @@ -251,12 +246,11 @@ Object { "Name": "Bar", "Type": Object { "ApiTypeKind": "basic", - "Flags": 2, - "FlagsString": "String", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, }, "_ts": Object { "Kind": 149, diff --git a/tests/cases/__tests__/__snapshots__/ClassDeclaration3.test.ts.snap b/tests/cases/__tests__/__snapshots__/ClassDeclaration3.test.ts.snap index b8b0b7f9..537b9b47 100644 --- a/tests/cases/__tests__/__snapshots__/ClassDeclaration3.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/ClassDeclaration3.test.ts.snap @@ -11,13 +11,15 @@ Object { "Extends": undefined, "Implements": Array [ Object { - "ApiTypeKind": "basic", - "Flags": 32768, - "FlagsString": "Object", - "Generics": undefined, - "Name": "Foo", + "ApiTypeKind": "reference", "ReferenceId": "InterfaceDeclaration-0", + "SymbolName": "Foo", "Text": "Foo", + "TypeParameters": undefined, + "_ts": Object { + "Kind": 201, + "KindString": "ExpressionWithTypeArguments", + }, }, ], "IsAbstract": false, @@ -94,12 +96,11 @@ Object { "Name": "Bar", "Type": Object { "ApiTypeKind": "basic", - "Flags": 2, - "FlagsString": "String", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, }, "_ts": Object { "Kind": 149, @@ -123,12 +124,11 @@ Object { "Name": "Bar", "Type": Object { "ApiTypeKind": "basic", - "Flags": 2, - "FlagsString": "String", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, }, "_ts": Object { "Kind": 148, diff --git a/tests/cases/__tests__/__snapshots__/ClassDeclaration4.test.ts.snap b/tests/cases/__tests__/__snapshots__/ClassDeclaration4.test.ts.snap index 24292b70..56a5721d 100644 --- a/tests/cases/__tests__/__snapshots__/ClassDeclaration4.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/ClassDeclaration4.test.ts.snap @@ -11,22 +11,26 @@ Object { "Extends": undefined, "Implements": Array [ Object { - "ApiTypeKind": "basic", - "Flags": 32768, - "FlagsString": "Object", - "Generics": undefined, - "Name": "Foo", + "ApiTypeKind": "reference", "ReferenceId": "InterfaceDeclaration-0", + "SymbolName": "Foo", "Text": "Foo", + "TypeParameters": undefined, + "_ts": Object { + "Kind": 201, + "KindString": "ExpressionWithTypeArguments", + }, }, Object { - "ApiTypeKind": "basic", - "Flags": 32768, - "FlagsString": "Object", - "Generics": undefined, - "Name": "Foo2", + "ApiTypeKind": "reference", "ReferenceId": "InterfaceDeclaration-1", + "SymbolName": "Foo2", "Text": "Foo2", + "TypeParameters": undefined, + "_ts": Object { + "Kind": 201, + "KindString": "ExpressionWithTypeArguments", + }, }, ], "IsAbstract": false, @@ -137,12 +141,11 @@ Object { "Name": "Bar", "Type": Object { "ApiTypeKind": "basic", - "Flags": 2, - "FlagsString": "String", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, }, "_ts": Object { "Kind": 149, @@ -169,12 +172,11 @@ Object { "Name": "Bar2", "Type": Object { "ApiTypeKind": "basic", - "Flags": 2, - "FlagsString": "String", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, }, "_ts": Object { "Kind": 149, @@ -198,12 +200,11 @@ Object { "Name": "Bar", "Type": Object { "ApiTypeKind": "basic", - "Flags": 2, - "FlagsString": "String", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, }, "_ts": Object { "Kind": 148, @@ -227,12 +228,11 @@ Object { "Name": "Bar2", "Type": Object { "ApiTypeKind": "basic", - "Flags": 2, - "FlagsString": "String", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, }, "_ts": Object { "Kind": 148, diff --git a/tests/cases/__tests__/__snapshots__/ClassDeclaration5.test.ts.snap b/tests/cases/__tests__/__snapshots__/ClassDeclaration5.test.ts.snap index 9263af00..cd8312d9 100644 --- a/tests/cases/__tests__/__snapshots__/ClassDeclaration5.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/ClassDeclaration5.test.ts.snap @@ -46,23 +46,24 @@ Object { "ClassDeclaration-1": Object { "ApiKind": "class", "Extends": Object { - "ApiTypeKind": "basic", - "Flags": 32768, - "FlagsString": "Object", - "Generics": Array [ + "ApiTypeKind": "reference", + "ReferenceId": "ClassDeclaration-0", + "SymbolName": "FooBase", + "Text": "FooBase", + "TypeParameters": Array [ Object { "ApiTypeKind": "basic", - "Flags": 4, - "FlagsString": "Number", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "number", + "_ts": Object { + "Kind": 133, + "KindString": "NumberKeyword", + }, }, ], - "Name": "FooBase", - "ReferenceId": "ClassDeclaration-0", - "Text": "FooBase", + "_ts": Object { + "Kind": 201, + "KindString": "ExpressionWithTypeArguments", + }, }, "Implements": Array [], "IsAbstract": false, @@ -112,13 +113,15 @@ Object { "Name": "GetValue", "Parameters": Array [], "ReturnType": Object { - "ApiTypeKind": "type-parameter", - "Flags": 16384, - "FlagsString": "TypeParameter", - "Generics": undefined, - "Name": "TValue", + "ApiTypeKind": "reference", "ReferenceId": "TypeParameter-0", + "SymbolName": "TValue", "Text": "TValue", + "TypeParameters": undefined, + "_ts": Object { + "Kind": 159, + "KindString": "TypeReference", + }, }, "TypeParameters": Array [], "_ts": Object { @@ -148,12 +151,11 @@ Object { "Parameters": Array [], "ReturnType": Object { "ApiTypeKind": "basic", - "Flags": 4, - "FlagsString": "Number", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "number", + "_ts": Object { + "Kind": 133, + "KindString": "NumberKeyword", + }, }, "TypeParameters": Array [], "_ts": Object { diff --git a/tests/cases/__tests__/__snapshots__/ClassDeclaration6.test.ts.snap b/tests/cases/__tests__/__snapshots__/ClassDeclaration6.test.ts.snap index ff7fe816..5b1539dc 100644 --- a/tests/cases/__tests__/__snapshots__/ClassDeclaration6.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/ClassDeclaration6.test.ts.snap @@ -46,33 +46,36 @@ Object { "ClassDeclaration-1": Object { "ApiKind": "class", "Extends": Object { - "ApiTypeKind": "basic", - "Flags": 32768, - "FlagsString": "Object", - "Generics": Array [ + "ApiTypeKind": "reference", + "ReferenceId": "ClassDeclaration-0", + "SymbolName": "FooBase", + "Text": "FooBase", + "TypeParameters": Array [ Object { "ApiTypeKind": "basic", - "Flags": 4, - "FlagsString": "Number", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "number", + "_ts": Object { + "Kind": 133, + "KindString": "NumberKeyword", + }, }, ], - "Name": "FooBase", - "ReferenceId": "ClassDeclaration-0", - "Text": "FooBase", + "_ts": Object { + "Kind": 201, + "KindString": "ExpressionWithTypeArguments", + }, }, "Implements": Array [ Object { - "ApiTypeKind": "basic", - "Flags": 32768, - "FlagsString": "Object", - "Generics": undefined, - "Name": "Bar", + "ApiTypeKind": "reference", "ReferenceId": "InterfaceDeclaration-0", + "SymbolName": "Bar", "Text": "Bar", + "TypeParameters": undefined, + "_ts": Object { + "Kind": 201, + "KindString": "ExpressionWithTypeArguments", + }, }, ], "IsAbstract": false, @@ -156,13 +159,15 @@ Object { "Name": "GetValue", "Parameters": Array [], "ReturnType": Object { - "ApiTypeKind": "type-parameter", - "Flags": 16384, - "FlagsString": "TypeParameter", - "Generics": undefined, - "Name": "TValue", + "ApiTypeKind": "reference", "ReferenceId": "TypeParameter-0", + "SymbolName": "TValue", "Text": "TValue", + "TypeParameters": undefined, + "_ts": Object { + "Kind": 159, + "KindString": "TypeReference", + }, }, "TypeParameters": Array [], "_ts": Object { @@ -192,12 +197,11 @@ Object { "Parameters": Array [], "ReturnType": Object { "ApiTypeKind": "basic", - "Flags": 4, - "FlagsString": "Number", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "number", + "_ts": Object { + "Kind": 133, + "KindString": "NumberKeyword", + }, }, "TypeParameters": Array [], "_ts": Object { @@ -225,12 +229,11 @@ Object { "Name": "BarName", "Type": Object { "ApiTypeKind": "basic", - "Flags": 2, - "FlagsString": "String", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, }, "_ts": Object { "Kind": 149, @@ -254,12 +257,11 @@ Object { "Name": "BarName", "Type": Object { "ApiTypeKind": "basic", - "Flags": 2, - "FlagsString": "String", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, }, "_ts": Object { "Kind": 148, diff --git a/tests/cases/__tests__/__snapshots__/ClassDeclaration8.test.ts.snap b/tests/cases/__tests__/__snapshots__/ClassDeclaration8.test.ts.snap index b9ab00b7..aa703ed5 100644 --- a/tests/cases/__tests__/__snapshots__/ClassDeclaration8.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/ClassDeclaration8.test.ts.snap @@ -39,23 +39,27 @@ Object { "ClassDeclaration-1": Object { "ApiKind": "class", "Extends": Object { - "ApiTypeKind": "basic", - "Flags": 32768, - "FlagsString": "Object", - "Generics": undefined, - "Name": "Control", + "ApiTypeKind": "reference", "ReferenceId": "ClassDeclaration-0", + "SymbolName": "Control", "Text": "Control", + "TypeParameters": undefined, + "_ts": Object { + "Kind": 201, + "KindString": "ExpressionWithTypeArguments", + }, }, "Implements": Array [ Object { - "ApiTypeKind": "basic", - "Flags": 32768, - "FlagsString": "Object", - "Generics": undefined, - "Name": "SelectableControl", + "ApiTypeKind": "reference", "ReferenceId": "InterfaceDeclaration-0", + "SymbolName": "SelectableControl", "Text": "SelectableControl", + "TypeParameters": undefined, + "_ts": Object { + "Kind": 201, + "KindString": "ExpressionWithTypeArguments", + }, }, ], "IsAbstract": false, @@ -88,13 +92,15 @@ Object { "ApiKind": "interface", "Extends": Array [ Object { - "ApiTypeKind": "basic", - "Flags": 32768, - "FlagsString": "Object", - "Generics": undefined, - "Name": "Control", + "ApiTypeKind": "reference", "ReferenceId": "ClassDeclaration-0", + "SymbolName": "Control", "Text": "Control", + "TypeParameters": undefined, + "_ts": Object { + "Kind": 201, + "KindString": "ExpressionWithTypeArguments", + }, }, ], "Location": Object { @@ -144,12 +150,11 @@ Object { "Parameters": Array [], "ReturnType": Object { "ApiTypeKind": "basic", - "Flags": 1024, - "FlagsString": "Void", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "void", + "_ts": Object { + "Kind": 105, + "KindString": "VoidKeyword", + }, }, "TypeParameters": Array [], "_ts": Object { @@ -175,12 +180,11 @@ Object { "Parameters": Array [], "ReturnType": Object { "ApiTypeKind": "basic", - "Flags": 1024, - "FlagsString": "Void", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "void", + "_ts": Object { + "Kind": 105, + "KindString": "VoidKeyword", + }, }, "TypeParameters": Array [], "_ts": Object { @@ -208,12 +212,11 @@ Object { "Name": "state", "Type": Object { "ApiTypeKind": "basic", - "Flags": 1, - "FlagsString": "Any", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "any", + "_ts": Object { + "Kind": 119, + "KindString": "AnyKeyword", + }, }, "_ts": Object { "Kind": 149, diff --git a/tests/cases/__tests__/__snapshots__/ClassDeclaration9.test.ts.snap b/tests/cases/__tests__/__snapshots__/ClassDeclaration9.test.ts.snap index 05e42560..9239d807 100644 --- a/tests/cases/__tests__/__snapshots__/ClassDeclaration9.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/ClassDeclaration9.test.ts.snap @@ -47,13 +47,15 @@ Object { "Extends": undefined, "Implements": Array [ Object { - "ApiTypeKind": "basic", - "Flags": 32768, - "FlagsString": "Object", - "Generics": undefined, - "Name": "Point", + "ApiTypeKind": "reference", "ReferenceId": "ClassDeclaration-0", + "SymbolName": "Point", "Text": "Point", + "TypeParameters": undefined, + "_ts": Object { + "Kind": 201, + "KindString": "ExpressionWithTypeArguments", + }, }, ], "IsAbstract": false, @@ -114,12 +116,11 @@ Object { "Name": "x", "Type": Object { "ApiTypeKind": "basic", - "Flags": 4, - "FlagsString": "Number", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "number", + "_ts": Object { + "Kind": 133, + "KindString": "NumberKeyword", + }, }, "_ts": Object { "Kind": 149, @@ -146,12 +147,11 @@ Object { "Name": "y", "Type": Object { "ApiTypeKind": "basic", - "Flags": 4, - "FlagsString": "Number", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "number", + "_ts": Object { + "Kind": 133, + "KindString": "NumberKeyword", + }, }, "_ts": Object { "Kind": 149, @@ -178,12 +178,11 @@ Object { "Name": "x", "Type": Object { "ApiTypeKind": "basic", - "Flags": 4, - "FlagsString": "Number", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "number", + "_ts": Object { + "Kind": 133, + "KindString": "NumberKeyword", + }, }, "_ts": Object { "Kind": 149, @@ -210,12 +209,11 @@ Object { "Name": "y", "Type": Object { "ApiTypeKind": "basic", - "Flags": 4, - "FlagsString": "Number", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "number", + "_ts": Object { + "Kind": 133, + "KindString": "NumberKeyword", + }, }, "_ts": Object { "Kind": 149, @@ -242,12 +240,11 @@ Object { "Name": "z", "Type": Object { "ApiTypeKind": "basic", - "Flags": 4, - "FlagsString": "Number", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "number", + "_ts": Object { + "Kind": 133, + "KindString": "NumberKeyword", + }, }, "_ts": Object { "Kind": 149, diff --git a/tests/cases/__tests__/__snapshots__/ConstructSignature1.test.ts.snap b/tests/cases/__tests__/__snapshots__/ConstructSignature1.test.ts.snap index f373ab11..7c37ee3c 100644 --- a/tests/cases/__tests__/__snapshots__/ConstructSignature1.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/ConstructSignature1.test.ts.snap @@ -29,13 +29,15 @@ Object { }, ], "ReturnType": Object { - "ApiTypeKind": "basic", - "Flags": 32768, - "FlagsString": "Object", - "Generics": undefined, - "Name": "Foo", + "ApiTypeKind": "reference", "ReferenceId": "InterfaceDeclaration-0", + "SymbolName": "Foo", "Text": "Foo", + "TypeParameters": undefined, + "_ts": Object { + "Kind": 159, + "KindString": "TypeReference", + }, }, "TypeParameters": Array [], "_ts": Object { @@ -89,12 +91,11 @@ Object { "Name": "arg", "Type": Object { "ApiTypeKind": "basic", - "Flags": 2, - "FlagsString": "String", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, }, "_ts": Object { "Kind": 146, diff --git a/tests/cases/__tests__/__snapshots__/ConstructSignature2.test.ts.snap b/tests/cases/__tests__/__snapshots__/ConstructSignature2.test.ts.snap index 6e07d0ac..8df15ef5 100644 --- a/tests/cases/__tests__/__snapshots__/ConstructSignature2.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/ConstructSignature2.test.ts.snap @@ -22,13 +22,15 @@ Object { "Name": "__new", "Parameters": Array [], "ReturnType": Object { - "ApiTypeKind": "type-parameter", - "Flags": 16384, - "FlagsString": "TypeParameter", - "Generics": undefined, - "Name": "T", + "ApiTypeKind": "reference", "ReferenceId": "TypeParameter-0", + "SymbolName": "T", "Text": "T", + "TypeParameters": undefined, + "_ts": Object { + "Kind": 159, + "KindString": "TypeReference", + }, }, "TypeParameters": Array [ Object { diff --git a/tests/cases/__tests__/__snapshots__/ExportDeclaration1.test.ts.snap b/tests/cases/__tests__/__snapshots__/ExportDeclaration1.test.ts.snap index 40869228..c1315177 100644 --- a/tests/cases/__tests__/__snapshots__/ExportDeclaration1.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/ExportDeclaration1.test.ts.snap @@ -116,12 +116,11 @@ Object { ], "ReturnType": Object { "ApiTypeKind": "basic", - "Flags": 1024, - "FlagsString": "Void", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "void", + "_ts": Object { + "Kind": 105, + "KindString": "VoidKeyword", + }, }, "TypeParameters": Array [], "_ts": Object { @@ -160,12 +159,11 @@ GetFoo without A parameter comment line.", ], "ReturnType": Object { "ApiTypeKind": "basic", - "Flags": 2, - "FlagsString": "String", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, }, "TypeParameters": Array [], "_ts": Object { @@ -204,12 +202,11 @@ GetFoo without A parameter comment line.", ], "ReturnType": Object { "ApiTypeKind": "basic", - "Flags": 2, - "FlagsString": "String", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, }, "TypeParameters": Array [], "_ts": Object { @@ -248,12 +245,11 @@ GetFoo without A parameter comment line.", ], "ReturnType": Object { "ApiTypeKind": "basic", - "Flags": 2, - "FlagsString": "String", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, }, "TypeParameters": Array [], "_ts": Object { @@ -282,23 +278,24 @@ GetFoo without A parameter comment line.", "Name": "AsyncGetFoo", "Parameters": Array [], "ReturnType": Object { - "ApiTypeKind": "basic", - "Flags": 32768, - "FlagsString": "Object", - "Generics": Array [ + "ApiTypeKind": "reference", + "ReferenceId": undefined, + "SymbolName": "Promise", + "Text": "Promise", + "TypeParameters": Array [ Object { "ApiTypeKind": "basic", - "Flags": 2, - "FlagsString": "String", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, }, ], - "Name": "Promise", - "ReferenceId": undefined, - "Text": "Promise", + "_ts": Object { + "Kind": 159, + "KindString": "TypeReference", + }, }, "TypeParameters": Array [], "_ts": Object { @@ -324,12 +321,11 @@ GetFoo without A parameter comment line.", "Name": "foo", "Type": Object { "ApiTypeKind": "basic", - "Flags": 2, - "FlagsString": "String", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, }, "_ts": Object { "Kind": 146, @@ -354,12 +350,11 @@ GetFoo without A parameter comment line.", "Name": "text", "Type": Object { "ApiTypeKind": "basic", - "Flags": 2, - "FlagsString": "String", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, }, "_ts": Object { "Kind": 146, @@ -383,32 +378,12 @@ GetFoo without A parameter comment line.", }, "Name": "open", "Type": Object { - "ApiTypeKind": "union", - "Flags": 65544, - "FlagsString": undefined, - "Name": undefined, - "ReferenceId": undefined, + "ApiTypeKind": "basic", "Text": "boolean", - "Types": Array [ - Object { - "ApiTypeKind": "basic", - "Flags": 128, - "FlagsString": "BooleanLiteral", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, - "Text": "true", - }, - Object { - "ApiTypeKind": "basic", - "Flags": 128, - "FlagsString": "BooleanLiteral", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, - "Text": "false", - }, - ], + "_ts": Object { + "Kind": 122, + "KindString": "BooleanKeyword", + }, }, "_ts": Object { "Kind": 146, @@ -433,40 +408,29 @@ GetFoo without A parameter comment line.", "Name": "arg", "Type": Object { "ApiTypeKind": "union", - "Flags": 65536, - "FlagsString": "Union", - "Name": undefined, - "ReferenceId": undefined, - "Text": "string | boolean", - "Types": Array [ + "Members": Array [ Object { "ApiTypeKind": "basic", - "Flags": 2, - "FlagsString": "String", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, }, Object { "ApiTypeKind": "basic", - "Flags": 128, - "FlagsString": "BooleanLiteral", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, - "Text": "true", - }, - Object { - "ApiTypeKind": "basic", - "Flags": 128, - "FlagsString": "BooleanLiteral", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, - "Text": "false", + "Text": "boolean", + "_ts": Object { + "Kind": 122, + "KindString": "BooleanKeyword", + }, }, ], + "Text": "string | boolean", + "_ts": Object { + "Kind": 166, + "KindString": "UnionType", + }, }, "_ts": Object { "Kind": 146, @@ -498,12 +462,11 @@ GetFoo without A parameter comment line.", "Name": "IdProperty", "Type": Object { "ApiTypeKind": "basic", - "Flags": 2, - "FlagsString": "String", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, }, "_ts": Object { "Kind": 149, @@ -530,12 +493,11 @@ GetFoo without A parameter comment line.", "Name": "BarProperty", "Type": Object { "ApiTypeKind": "basic", - "Flags": 2, - "FlagsString": "String", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, }, "_ts": Object { "Kind": 149, diff --git a/tests/cases/__tests__/__snapshots__/ExportSpecifier1.test.ts.snap b/tests/cases/__tests__/__snapshots__/ExportSpecifier1.test.ts.snap index ea004578..dedea20e 100644 --- a/tests/cases/__tests__/__snapshots__/ExportSpecifier1.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/ExportSpecifier1.test.ts.snap @@ -110,12 +110,11 @@ Object { ], "ReturnType": Object { "ApiTypeKind": "basic", - "Flags": 1024, - "FlagsString": "Void", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "void", + "_ts": Object { + "Kind": 105, + "KindString": "VoidKeyword", + }, }, "TypeParameters": Array [], "_ts": Object { @@ -145,12 +144,11 @@ Object { "Parameters": Array [], "ReturnType": Object { "ApiTypeKind": "basic", - "Flags": 2, - "FlagsString": "String", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, }, "TypeParameters": Array [], "_ts": Object { @@ -176,12 +174,11 @@ Object { "Name": "foo", "Type": Object { "ApiTypeKind": "basic", - "Flags": 2, - "FlagsString": "String", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, }, "_ts": Object { "Kind": 146, @@ -208,12 +205,11 @@ Object { "Name": "property", "Type": Object { "ApiTypeKind": "basic", - "Flags": 2, - "FlagsString": "String", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, }, "_ts": Object { "Kind": 149, @@ -240,12 +236,11 @@ Object { "Name": "Id", "Type": Object { "ApiTypeKind": "basic", - "Flags": 2, - "FlagsString": "String", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, }, "_ts": Object { "Kind": 149, @@ -272,12 +267,11 @@ Object { "Name": "Bar", "Type": Object { "ApiTypeKind": "basic", - "Flags": 2, - "FlagsString": "String", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, }, "_ts": Object { "Kind": 149, diff --git a/tests/cases/__tests__/__snapshots__/ExportSpecifier2.test.ts.snap b/tests/cases/__tests__/__snapshots__/ExportSpecifier2.test.ts.snap index fe845a57..b22c5e4e 100644 --- a/tests/cases/__tests__/__snapshots__/ExportSpecifier2.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/ExportSpecifier2.test.ts.snap @@ -121,12 +121,11 @@ Object { "Name": "Bar", "Type": Object { "ApiTypeKind": "basic", - "Flags": 2, - "FlagsString": "String", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, }, "_ts": Object { "Kind": 148, @@ -150,12 +149,11 @@ Object { "Name": "Bar2", "Type": Object { "ApiTypeKind": "basic", - "Flags": 2, - "FlagsString": "String", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, }, "_ts": Object { "Kind": 148, diff --git a/tests/cases/__tests__/__snapshots__/ExportSpecifier3.test.ts.snap b/tests/cases/__tests__/__snapshots__/ExportSpecifier3.test.ts.snap index b8b76a28..e3949b9e 100644 --- a/tests/cases/__tests__/__snapshots__/ExportSpecifier3.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/ExportSpecifier3.test.ts.snap @@ -11,22 +11,26 @@ Object { "Extends": undefined, "Implements": Array [ Object { - "ApiTypeKind": "basic", - "Flags": 32768, - "FlagsString": "Object", - "Generics": undefined, - "Name": "Foo", + "ApiTypeKind": "reference", "ReferenceId": "InterfaceDeclaration-0", + "SymbolName": "Foo", "Text": "Foo", + "TypeParameters": undefined, + "_ts": Object { + "Kind": 201, + "KindString": "ExpressionWithTypeArguments", + }, }, Object { - "ApiTypeKind": "basic", - "Flags": 32768, - "FlagsString": "Object", - "Generics": undefined, - "Name": "Foo2", + "ApiTypeKind": "reference", "ReferenceId": "InterfaceDeclaration-1", + "SymbolName": "Foo2", "Text": "Foo2", + "TypeParameters": undefined, + "_ts": Object { + "Kind": 201, + "KindString": "ExpressionWithTypeArguments", + }, }, ], "IsAbstract": false, @@ -179,12 +183,11 @@ Object { "Name": "Bar", "Type": Object { "ApiTypeKind": "basic", - "Flags": 2, - "FlagsString": "String", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, }, "_ts": Object { "Kind": 149, @@ -211,12 +214,11 @@ Object { "Name": "Bar2", "Type": Object { "ApiTypeKind": "basic", - "Flags": 2, - "FlagsString": "String", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, }, "_ts": Object { "Kind": 149, @@ -240,12 +242,11 @@ Object { "Name": "Bar", "Type": Object { "ApiTypeKind": "basic", - "Flags": 2, - "FlagsString": "String", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, }, "_ts": Object { "Kind": 148, @@ -269,12 +270,11 @@ Object { "Name": "Bar2", "Type": Object { "ApiTypeKind": "basic", - "Flags": 2, - "FlagsString": "String", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, }, "_ts": Object { "Kind": 148, diff --git a/tests/cases/__tests__/__snapshots__/ExportSpecifier4.test.ts.snap b/tests/cases/__tests__/__snapshots__/ExportSpecifier4.test.ts.snap index 0dd72435..152a0ed3 100644 --- a/tests/cases/__tests__/__snapshots__/ExportSpecifier4.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/ExportSpecifier4.test.ts.snap @@ -129,12 +129,11 @@ Object { ], "ReturnType": Object { "ApiTypeKind": "basic", - "Flags": 1024, - "FlagsString": "Void", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "void", + "_ts": Object { + "Kind": 105, + "KindString": "VoidKeyword", + }, }, "TypeParameters": Array [], "_ts": Object { @@ -164,12 +163,11 @@ Object { "Parameters": Array [], "ReturnType": Object { "ApiTypeKind": "basic", - "Flags": 2, - "FlagsString": "String", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, }, "TypeParameters": Array [], "_ts": Object { @@ -195,12 +193,11 @@ Object { "Name": "foo", "Type": Object { "ApiTypeKind": "basic", - "Flags": 2, - "FlagsString": "String", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, }, "_ts": Object { "Kind": 146, @@ -227,12 +224,11 @@ Object { "Name": "property", "Type": Object { "ApiTypeKind": "basic", - "Flags": 2, - "FlagsString": "String", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, }, "_ts": Object { "Kind": 149, @@ -259,12 +255,11 @@ Object { "Name": "Id", "Type": Object { "ApiTypeKind": "basic", - "Flags": 2, - "FlagsString": "String", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, }, "_ts": Object { "Kind": 149, @@ -291,12 +286,11 @@ Object { "Name": "Bar", "Type": Object { "ApiTypeKind": "basic", - "Flags": 2, - "FlagsString": "String", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, }, "_ts": Object { "Kind": 149, diff --git a/tests/cases/__tests__/__snapshots__/FunctionDeclaration1.test.ts.snap b/tests/cases/__tests__/__snapshots__/FunctionDeclaration1.test.ts.snap index 887bf562..1218cb1d 100644 --- a/tests/cases/__tests__/__snapshots__/FunctionDeclaration1.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/FunctionDeclaration1.test.ts.snap @@ -24,12 +24,11 @@ Object { "Parameters": Array [], "ReturnType": Object { "ApiTypeKind": "basic", - "Flags": 2, - "FlagsString": "String", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, }, "TypeParameters": Array [], "_ts": Object { diff --git a/tests/cases/__tests__/__snapshots__/FunctionDeclaration2.test.ts.snap b/tests/cases/__tests__/__snapshots__/FunctionDeclaration2.test.ts.snap index 54992c11..04e0f5d2 100644 --- a/tests/cases/__tests__/__snapshots__/FunctionDeclaration2.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/FunctionDeclaration2.test.ts.snap @@ -31,12 +31,11 @@ Object { ], "ReturnType": Object { "ApiTypeKind": "basic", - "Flags": 1024, - "FlagsString": "Void", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "void", + "_ts": Object { + "Kind": 105, + "KindString": "VoidKeyword", + }, }, "TypeParameters": Array [ Object { @@ -68,13 +67,15 @@ Object { }, "Name": "value", "Type": Object { - "ApiTypeKind": "type-parameter", - "Flags": 16384, - "FlagsString": "TypeParameter", - "Generics": undefined, - "Name": "TValue", + "ApiTypeKind": "reference", "ReferenceId": "TypeParameter-0", + "SymbolName": "TValue", "Text": "TValue", + "TypeParameters": undefined, + "_ts": Object { + "Kind": 159, + "KindString": "TypeReference", + }, }, "_ts": Object { "Kind": 146, diff --git a/tests/cases/__tests__/__snapshots__/FunctionDeclaration3.test.ts.snap b/tests/cases/__tests__/__snapshots__/FunctionDeclaration3.test.ts.snap index b462242c..1d393700 100644 --- a/tests/cases/__tests__/__snapshots__/FunctionDeclaration3.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/FunctionDeclaration3.test.ts.snap @@ -23,23 +23,24 @@ Object { "Name": "AsyncFoo", "Parameters": Array [], "ReturnType": Object { - "ApiTypeKind": "basic", - "Flags": 32768, - "FlagsString": "Object", - "Generics": Array [ + "ApiTypeKind": "reference", + "ReferenceId": undefined, + "SymbolName": "Promise", + "Text": "Promise", + "TypeParameters": Array [ Object { "ApiTypeKind": "basic", - "Flags": 1024, - "FlagsString": "Void", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "void", + "_ts": Object { + "Kind": 105, + "KindString": "VoidKeyword", + }, }, ], - "Name": "Promise", - "ReferenceId": undefined, - "Text": "Promise", + "_ts": Object { + "Kind": 159, + "KindString": "TypeReference", + }, }, "TypeParameters": Array [], "_ts": Object { diff --git a/tests/cases/__tests__/__snapshots__/FunctionDeclaration4.test.ts.snap b/tests/cases/__tests__/__snapshots__/FunctionDeclaration4.test.ts.snap new file mode 100644 index 00000000..1f4aaf49 --- /dev/null +++ b/tests/cases/__tests__/__snapshots__/FunctionDeclaration4.test.ts.snap @@ -0,0 +1,119 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`FunctionDeclaration4 1`] = ` +Object { + "EntryFiles": Array [ + "SourceFile-0", + ], + "Registry": Object { + "FunctionDeclaration-0": Object { + "ApiKind": "function", + "IsAsync": false, + "IsOverloadBase": false, + "Location": Object { + "Character": 0, + "FileName": "./cases/FunctionDeclaration4.ts", + "IsExternalPackage": false, + "Line": 2, + }, + "Metadata": Object { + "DocumentationComment": "", + "JSDocTags": Array [], + }, + "Name": "Foo", + "Parameters": Array [ + Object { + "Alias": "arg", + "Ids": Array [ + "Parameter-0", + ], + }, + ], + "ReturnType": Object { + "ApiTypeKind": "array", + "Text": "string[]", + "Type": Object { + "ApiTypeKind": "basic", + "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, + }, + "_ts": Object { + "Kind": 164, + "KindString": "ArrayType", + }, + }, + "TypeParameters": Array [], + "_ts": Object { + "Kind": 228, + "KindString": "FunctionDeclaration", + }, + }, + "Parameter-0": Object { + "ApiKind": "parameter", + "Initializer": undefined, + "IsOptional": false, + "IsSpread": false, + "Location": Object { + "Character": 20, + "FileName": "./cases/FunctionDeclaration4.ts", + "IsExternalPackage": false, + "Line": 2, + }, + "Metadata": Object { + "DocumentationComment": "", + "JSDocTags": Array [], + }, + "Name": "arg", + "Type": Object { + "ApiTypeKind": "array", + "Text": "string[]", + "Type": Object { + "ApiTypeKind": "basic", + "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, + }, + "_ts": Object { + "Kind": 164, + "KindString": "ArrayType", + }, + }, + "_ts": Object { + "Kind": 146, + "KindString": "Parameter", + }, + }, + "SourceFile-0": Object { + "ApiKind": "source-file", + "Location": Object { + "Character": 0, + "FileName": "./cases/FunctionDeclaration4.ts", + "IsExternalPackage": false, + "Line": 2, + }, + "Members": Array [ + Object { + "Alias": "Foo", + "Ids": Array [ + "FunctionDeclaration-0", + ], + }, + ], + "Metadata": Object { + "DocumentationComment": "", + "JSDocTags": Array [], + }, + "Name": "FunctionDeclaration4.ts", + "_ts": Object { + "Kind": 268, + "KindString": "SourceFile", + }, + }, + }, +} +`; diff --git a/tests/cases/__tests__/__snapshots__/FunctionDeclaration5.test.ts.snap b/tests/cases/__tests__/__snapshots__/FunctionDeclaration5.test.ts.snap new file mode 100644 index 00000000..40b5923a --- /dev/null +++ b/tests/cases/__tests__/__snapshots__/FunctionDeclaration5.test.ts.snap @@ -0,0 +1,130 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`FunctionDeclaration5 1`] = ` +Object { + "EntryFiles": Array [ + "SourceFile-0", + ], + "Registry": Object { + "FunctionDeclaration-0": Object { + "ApiKind": "function", + "IsAsync": false, + "IsOverloadBase": false, + "Location": Object { + "Character": 0, + "FileName": "./cases/FunctionDeclaration5.ts", + "IsExternalPackage": false, + "Line": 0, + }, + "Metadata": Object { + "DocumentationComment": "", + "JSDocTags": Array [], + }, + "Name": "IsString", + "Parameters": Array [ + Object { + "Alias": "arg", + "Ids": Array [ + "Parameter-0", + ], + }, + ], + "ReturnType": Object { + "ApiTypeKind": "type-predicate", + "ParameterName": "arg", + "Text": "arg is string", + "Type": Object { + "ApiTypeKind": "basic", + "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, + }, + "_ts": Object { + "Kind": 158, + "KindString": "FirstTypeNode", + }, + }, + "TypeParameters": Array [], + "_ts": Object { + "Kind": 228, + "KindString": "FunctionDeclaration", + }, + }, + "Parameter-0": Object { + "ApiKind": "parameter", + "Initializer": undefined, + "IsOptional": false, + "IsSpread": false, + "Location": Object { + "Character": 25, + "FileName": "./cases/FunctionDeclaration5.ts", + "IsExternalPackage": false, + "Line": 0, + }, + "Metadata": Object { + "DocumentationComment": "", + "JSDocTags": Array [], + }, + "Name": "arg", + "Type": Object { + "ApiTypeKind": "union", + "Members": Array [ + Object { + "ApiTypeKind": "basic", + "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, + }, + Object { + "ApiTypeKind": "basic", + "Text": "number", + "_ts": Object { + "Kind": 133, + "KindString": "NumberKeyword", + }, + }, + ], + "Text": "string | number", + "_ts": Object { + "Kind": 166, + "KindString": "UnionType", + }, + }, + "_ts": Object { + "Kind": 146, + "KindString": "Parameter", + }, + }, + "SourceFile-0": Object { + "ApiKind": "source-file", + "Location": Object { + "Character": 0, + "FileName": "./cases/FunctionDeclaration5.ts", + "IsExternalPackage": false, + "Line": 0, + }, + "Members": Array [ + Object { + "Alias": "IsString", + "Ids": Array [ + "FunctionDeclaration-0", + ], + }, + ], + "Metadata": Object { + "DocumentationComment": "", + "JSDocTags": Array [], + }, + "Name": "FunctionDeclaration5.ts", + "_ts": Object { + "Kind": 268, + "KindString": "SourceFile", + }, + }, + }, +} +`; diff --git a/tests/cases/__tests__/__snapshots__/FunctionDeclaration6.test.ts.snap b/tests/cases/__tests__/__snapshots__/FunctionDeclaration6.test.ts.snap new file mode 100644 index 00000000..163ea9c8 --- /dev/null +++ b/tests/cases/__tests__/__snapshots__/FunctionDeclaration6.test.ts.snap @@ -0,0 +1,136 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`FunctionDeclaration6 1`] = ` +Object { + "EntryFiles": Array [ + "SourceFile-0", + ], + "Registry": Object { + "FunctionDeclaration-0": Object { + "ApiKind": "function", + "IsAsync": false, + "IsOverloadBase": false, + "Location": Object { + "Character": 0, + "FileName": "./cases/FunctionDeclaration6.ts", + "IsExternalPackage": false, + "Line": 4, + }, + "Metadata": Object { + "DocumentationComment": "", + "JSDocTags": Array [], + }, + "Name": "Bar", + "Parameters": Array [ + Object { + "Alias": "arg", + "Ids": Array [ + "Parameter-0", + ], + }, + ], + "ReturnType": Object { + "ApiTypeKind": "reference", + "ReferenceId": "InterfaceDeclaration-0", + "SymbolName": "Foo", + "Text": "Foo", + "TypeParameters": undefined, + "_ts": Object { + "Kind": 159, + "KindString": "TypeReference", + }, + }, + "TypeParameters": Array [], + "_ts": Object { + "Kind": 228, + "KindString": "FunctionDeclaration", + }, + }, + "InterfaceDeclaration-0": Object { + "ApiKind": "interface", + "Extends": Array [], + "Location": Object { + "Character": 0, + "FileName": "./cases/FunctionDeclaration6.ts", + "IsExternalPackage": false, + "Line": 0, + }, + "Members": Array [], + "Metadata": Object { + "DocumentationComment": "", + "JSDocTags": Array [], + }, + "Name": "Foo", + "TypeParameters": Array [], + "_ts": Object { + "Kind": 230, + "KindString": "InterfaceDeclaration", + }, + }, + "Parameter-0": Object { + "ApiKind": "parameter", + "Initializer": undefined, + "IsOptional": false, + "IsSpread": false, + "Location": Object { + "Character": 20, + "FileName": "./cases/FunctionDeclaration6.ts", + "IsExternalPackage": false, + "Line": 4, + }, + "Metadata": Object { + "DocumentationComment": "", + "JSDocTags": Array [], + }, + "Name": "arg", + "Type": Object { + "ApiTypeKind": "reference", + "ReferenceId": "InterfaceDeclaration-0", + "SymbolName": "Foo", + "Text": "Foo", + "TypeParameters": undefined, + "_ts": Object { + "Kind": 159, + "KindString": "TypeReference", + }, + }, + "_ts": Object { + "Kind": 146, + "KindString": "Parameter", + }, + }, + "SourceFile-0": Object { + "ApiKind": "source-file", + "Location": Object { + "Character": 0, + "FileName": "./cases/FunctionDeclaration6.ts", + "IsExternalPackage": false, + "Line": 0, + }, + "Members": Array [ + Object { + "Alias": "Foo", + "Ids": Array [ + "InterfaceDeclaration-0", + ], + }, + Object { + "Alias": "Bar", + "Ids": Array [ + "FunctionDeclaration-0", + ], + }, + ], + "Metadata": Object { + "DocumentationComment": "", + "JSDocTags": Array [], + }, + "Name": "FunctionDeclaration6.ts", + "_ts": Object { + "Kind": 268, + "KindString": "SourceFile", + }, + }, + }, +} +`; diff --git a/tests/cases/__tests__/__snapshots__/FunctionDeclaration7.test.ts.snap b/tests/cases/__tests__/__snapshots__/FunctionDeclaration7.test.ts.snap new file mode 100644 index 00000000..1da36437 --- /dev/null +++ b/tests/cases/__tests__/__snapshots__/FunctionDeclaration7.test.ts.snap @@ -0,0 +1,147 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`FunctionDeclaration7 1`] = ` +Object { + "EntryFiles": Array [ + "SourceFile-0", + ], + "Registry": Object { + "FunctionDeclaration-0": Object { + "ApiKind": "function", + "IsAsync": false, + "IsOverloadBase": false, + "Location": Object { + "Character": 0, + "FileName": "./cases/FunctionDeclaration7.ts", + "IsExternalPackage": false, + "Line": 0, + }, + "Metadata": Object { + "DocumentationComment": "", + "JSDocTags": Array [], + }, + "Name": "Foo", + "Parameters": Array [ + Object { + "Alias": "arg", + "Ids": Array [ + "Parameter-0", + ], + }, + ], + "ReturnType": Object { + "ApiTypeKind": "union", + "Members": Array [ + Object { + "ApiTypeKind": "basic", + "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, + }, + Object { + "ApiTypeKind": "basic", + "Text": "true", + "_ts": Object { + "Kind": 101, + "KindString": "TrueKeyword", + }, + }, + Object { + "ApiTypeKind": "basic", + "Text": "false", + "_ts": Object { + "Kind": 86, + "KindString": "FalseKeyword", + }, + }, + ], + "Text": "string | boolean", + "_ts": Object { + "Kind": 166, + "KindString": "UnionType", + }, + }, + "TypeParameters": Array [], + "_ts": Object { + "Kind": 228, + "KindString": "FunctionDeclaration", + }, + }, + "Parameter-0": Object { + "ApiKind": "parameter", + "Initializer": undefined, + "IsOptional": false, + "IsSpread": false, + "Location": Object { + "Character": 20, + "FileName": "./cases/FunctionDeclaration7.ts", + "IsExternalPackage": false, + "Line": 0, + }, + "Metadata": Object { + "DocumentationComment": "", + "JSDocTags": Array [], + }, + "Name": "arg", + "Type": Object { + "ApiTypeKind": "union", + "Members": Array [ + Object { + "ApiTypeKind": "basic", + "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, + }, + Object { + "ApiTypeKind": "basic", + "Text": "boolean", + "_ts": Object { + "Kind": 122, + "KindString": "BooleanKeyword", + }, + }, + ], + "Text": "string | boolean", + "_ts": Object { + "Kind": 166, + "KindString": "UnionType", + }, + }, + "_ts": Object { + "Kind": 146, + "KindString": "Parameter", + }, + }, + "SourceFile-0": Object { + "ApiKind": "source-file", + "Location": Object { + "Character": 0, + "FileName": "./cases/FunctionDeclaration7.ts", + "IsExternalPackage": false, + "Line": 0, + }, + "Members": Array [ + Object { + "Alias": "Foo", + "Ids": Array [ + "FunctionDeclaration-0", + ], + }, + ], + "Metadata": Object { + "DocumentationComment": "", + "JSDocTags": Array [], + }, + "Name": "FunctionDeclaration7.ts", + "_ts": Object { + "Kind": 268, + "KindString": "SourceFile", + }, + }, + }, +} +`; diff --git a/tests/cases/__tests__/__snapshots__/FunctionDeclaration8.test.ts.snap b/tests/cases/__tests__/__snapshots__/FunctionDeclaration8.test.ts.snap new file mode 100644 index 00000000..323bce27 --- /dev/null +++ b/tests/cases/__tests__/__snapshots__/FunctionDeclaration8.test.ts.snap @@ -0,0 +1,139 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`FunctionDeclaration8 1`] = ` +Object { + "EntryFiles": Array [ + "SourceFile-0", + ], + "Registry": Object { + "FunctionDeclaration-0": Object { + "ApiKind": "function", + "IsAsync": false, + "IsOverloadBase": false, + "Location": Object { + "Character": 0, + "FileName": "./cases/FunctionDeclaration8.ts", + "IsExternalPackage": false, + "Line": 0, + }, + "Metadata": Object { + "DocumentationComment": "", + "JSDocTags": Array [], + }, + "Name": "Foo", + "Parameters": Array [ + Object { + "Alias": "arg", + "Ids": Array [ + "Parameter-0", + ], + }, + ], + "ReturnType": Object { + "ApiTypeKind": "tuple", + "Members": Array [ + Object { + "ApiTypeKind": "basic", + "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, + }, + Object { + "ApiTypeKind": "basic", + "Text": "number", + "_ts": Object { + "Kind": 133, + "KindString": "NumberKeyword", + }, + }, + ], + "Text": "[string, number]", + "_ts": Object { + "Kind": 165, + "KindString": "TupleType", + }, + }, + "TypeParameters": Array [], + "_ts": Object { + "Kind": 228, + "KindString": "FunctionDeclaration", + }, + }, + "Parameter-0": Object { + "ApiKind": "parameter", + "Initializer": undefined, + "IsOptional": false, + "IsSpread": false, + "Location": Object { + "Character": 20, + "FileName": "./cases/FunctionDeclaration8.ts", + "IsExternalPackage": false, + "Line": 0, + }, + "Metadata": Object { + "DocumentationComment": "", + "JSDocTags": Array [], + }, + "Name": "arg", + "Type": Object { + "ApiTypeKind": "tuple", + "Members": Array [ + Object { + "ApiTypeKind": "basic", + "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, + }, + Object { + "ApiTypeKind": "basic", + "Text": "number", + "_ts": Object { + "Kind": 133, + "KindString": "NumberKeyword", + }, + }, + ], + "Text": "[string, number]", + "_ts": Object { + "Kind": 165, + "KindString": "TupleType", + }, + }, + "_ts": Object { + "Kind": 146, + "KindString": "Parameter", + }, + }, + "SourceFile-0": Object { + "ApiKind": "source-file", + "Location": Object { + "Character": 0, + "FileName": "./cases/FunctionDeclaration8.ts", + "IsExternalPackage": false, + "Line": 0, + }, + "Members": Array [ + Object { + "Alias": "Foo", + "Ids": Array [ + "FunctionDeclaration-0", + ], + }, + ], + "Metadata": Object { + "DocumentationComment": "", + "JSDocTags": Array [], + }, + "Name": "FunctionDeclaration8.ts", + "_ts": Object { + "Kind": 268, + "KindString": "SourceFile", + }, + }, + }, +} +`; diff --git a/tests/cases/__tests__/__snapshots__/GetAccessor1.test.ts.snap b/tests/cases/__tests__/__snapshots__/GetAccessor1.test.ts.snap index 74094c20..a4daa920 100644 --- a/tests/cases/__tests__/__snapshots__/GetAccessor1.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/GetAccessor1.test.ts.snap @@ -54,12 +54,11 @@ Object { "Name": "Foo", "Type": Object { "ApiTypeKind": "basic", - "Flags": 2, - "FlagsString": "String", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, }, "_ts": Object { "Kind": 153, diff --git a/tests/cases/__tests__/__snapshots__/GetAccessor3.test.ts.snap b/tests/cases/__tests__/__snapshots__/GetAccessor3.test.ts.snap index 12302d21..f6eac375 100644 --- a/tests/cases/__tests__/__snapshots__/GetAccessor3.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/GetAccessor3.test.ts.snap @@ -72,12 +72,11 @@ Object { "Name": "Foo", "Type": Object { "ApiTypeKind": "basic", - "Flags": 2, - "FlagsString": "String", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, }, "_ts": Object { "Kind": 153, @@ -102,12 +101,11 @@ Object { "Name": "StaticFoo", "Type": Object { "ApiTypeKind": "basic", - "Flags": 2, - "FlagsString": "String", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, }, "_ts": Object { "Kind": 153, @@ -132,12 +130,11 @@ Object { "Name": "foo", "Type": Object { "ApiTypeKind": "basic", - "Flags": 2, - "FlagsString": "String", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, }, "_ts": Object { "Kind": 153, @@ -162,12 +159,11 @@ Object { "Name": "ProtectedFoo", "Type": Object { "ApiTypeKind": "basic", - "Flags": 2, - "FlagsString": "String", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, }, "_ts": Object { "Kind": 153, diff --git a/tests/cases/__tests__/__snapshots__/ImportDeclaration1.test.ts.snap b/tests/cases/__tests__/__snapshots__/ImportDeclaration1.test.ts.snap index de4ffdb9..ca2c260a 100644 --- a/tests/cases/__tests__/__snapshots__/ImportDeclaration1.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/ImportDeclaration1.test.ts.snap @@ -117,12 +117,11 @@ Object { ], "ReturnType": Object { "ApiTypeKind": "basic", - "Flags": 1024, - "FlagsString": "Void", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "void", + "_ts": Object { + "Kind": 105, + "KindString": "VoidKeyword", + }, }, "TypeParameters": Array [], "_ts": Object { @@ -161,12 +160,11 @@ GetFoo without A parameter comment line.", ], "ReturnType": Object { "ApiTypeKind": "basic", - "Flags": 2, - "FlagsString": "String", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, }, "TypeParameters": Array [], "_ts": Object { @@ -205,12 +203,11 @@ GetFoo without A parameter comment line.", ], "ReturnType": Object { "ApiTypeKind": "basic", - "Flags": 2, - "FlagsString": "String", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, }, "TypeParameters": Array [], "_ts": Object { @@ -249,12 +246,11 @@ GetFoo without A parameter comment line.", ], "ReturnType": Object { "ApiTypeKind": "basic", - "Flags": 2, - "FlagsString": "String", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, }, "TypeParameters": Array [], "_ts": Object { @@ -283,23 +279,24 @@ GetFoo without A parameter comment line.", "Name": "AsyncGetFoo", "Parameters": Array [], "ReturnType": Object { - "ApiTypeKind": "basic", - "Flags": 32768, - "FlagsString": "Object", - "Generics": Array [ + "ApiTypeKind": "reference", + "ReferenceId": undefined, + "SymbolName": "Promise", + "Text": "Promise", + "TypeParameters": Array [ Object { "ApiTypeKind": "basic", - "Flags": 2, - "FlagsString": "String", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, }, ], - "Name": "Promise", - "ReferenceId": undefined, - "Text": "Promise", + "_ts": Object { + "Kind": 159, + "KindString": "TypeReference", + }, }, "TypeParameters": Array [], "_ts": Object { @@ -351,12 +348,11 @@ GetFoo without A parameter comment line.", "Name": "foo", "Type": Object { "ApiTypeKind": "basic", - "Flags": 2, - "FlagsString": "String", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, }, "_ts": Object { "Kind": 146, @@ -381,12 +377,11 @@ GetFoo without A parameter comment line.", "Name": "text", "Type": Object { "ApiTypeKind": "basic", - "Flags": 2, - "FlagsString": "String", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, }, "_ts": Object { "Kind": 146, @@ -410,32 +405,12 @@ GetFoo without A parameter comment line.", }, "Name": "open", "Type": Object { - "ApiTypeKind": "union", - "Flags": 65544, - "FlagsString": undefined, - "Name": undefined, - "ReferenceId": undefined, + "ApiTypeKind": "basic", "Text": "boolean", - "Types": Array [ - Object { - "ApiTypeKind": "basic", - "Flags": 128, - "FlagsString": "BooleanLiteral", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, - "Text": "true", - }, - Object { - "ApiTypeKind": "basic", - "Flags": 128, - "FlagsString": "BooleanLiteral", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, - "Text": "false", - }, - ], + "_ts": Object { + "Kind": 122, + "KindString": "BooleanKeyword", + }, }, "_ts": Object { "Kind": 146, @@ -460,40 +435,29 @@ GetFoo without A parameter comment line.", "Name": "arg", "Type": Object { "ApiTypeKind": "union", - "Flags": 65536, - "FlagsString": "Union", - "Name": undefined, - "ReferenceId": undefined, - "Text": "string | boolean", - "Types": Array [ + "Members": Array [ Object { "ApiTypeKind": "basic", - "Flags": 2, - "FlagsString": "String", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, }, Object { "ApiTypeKind": "basic", - "Flags": 128, - "FlagsString": "BooleanLiteral", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, - "Text": "true", - }, - Object { - "ApiTypeKind": "basic", - "Flags": 128, - "FlagsString": "BooleanLiteral", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, - "Text": "false", + "Text": "boolean", + "_ts": Object { + "Kind": 122, + "KindString": "BooleanKeyword", + }, }, ], + "Text": "string | boolean", + "_ts": Object { + "Kind": 166, + "KindString": "UnionType", + }, }, "_ts": Object { "Kind": 146, @@ -525,12 +489,11 @@ GetFoo without A parameter comment line.", "Name": "IdProperty", "Type": Object { "ApiTypeKind": "basic", - "Flags": 2, - "FlagsString": "String", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, }, "_ts": Object { "Kind": 149, @@ -557,12 +520,11 @@ GetFoo without A parameter comment line.", "Name": "BarProperty", "Type": Object { "ApiTypeKind": "basic", - "Flags": 2, - "FlagsString": "String", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, }, "_ts": Object { "Kind": 149, diff --git a/tests/cases/__tests__/__snapshots__/ImportSpecifier1.test.ts.snap b/tests/cases/__tests__/__snapshots__/ImportSpecifier1.test.ts.snap index ddd727d9..4fe9c1aa 100644 --- a/tests/cases/__tests__/__snapshots__/ImportSpecifier1.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/ImportSpecifier1.test.ts.snap @@ -148,12 +148,11 @@ Object { ], "ReturnType": Object { "ApiTypeKind": "basic", - "Flags": 1024, - "FlagsString": "Void", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "void", + "_ts": Object { + "Kind": 105, + "KindString": "VoidKeyword", + }, }, "TypeParameters": Array [], "_ts": Object { @@ -192,12 +191,11 @@ GetFoo without A parameter comment line.", ], "ReturnType": Object { "ApiTypeKind": "basic", - "Flags": 2, - "FlagsString": "String", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, }, "TypeParameters": Array [], "_ts": Object { @@ -236,12 +234,11 @@ GetFoo without A parameter comment line.", ], "ReturnType": Object { "ApiTypeKind": "basic", - "Flags": 2, - "FlagsString": "String", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, }, "TypeParameters": Array [], "_ts": Object { @@ -280,12 +277,11 @@ GetFoo without A parameter comment line.", ], "ReturnType": Object { "ApiTypeKind": "basic", - "Flags": 2, - "FlagsString": "String", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, }, "TypeParameters": Array [], "_ts": Object { @@ -314,23 +310,24 @@ GetFoo without A parameter comment line.", "Name": "AsyncGetFoo", "Parameters": Array [], "ReturnType": Object { - "ApiTypeKind": "basic", - "Flags": 32768, - "FlagsString": "Object", - "Generics": Array [ + "ApiTypeKind": "reference", + "ReferenceId": undefined, + "SymbolName": "Promise", + "Text": "Promise", + "TypeParameters": Array [ Object { "ApiTypeKind": "basic", - "Flags": 2, - "FlagsString": "String", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, }, ], - "Name": "Promise", - "ReferenceId": undefined, - "Text": "Promise", + "_ts": Object { + "Kind": 159, + "KindString": "TypeReference", + }, }, "TypeParameters": Array [], "_ts": Object { @@ -356,12 +353,11 @@ GetFoo without A parameter comment line.", "Name": "foo", "Type": Object { "ApiTypeKind": "basic", - "Flags": 2, - "FlagsString": "String", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, }, "_ts": Object { "Kind": 146, @@ -386,12 +382,11 @@ GetFoo without A parameter comment line.", "Name": "text", "Type": Object { "ApiTypeKind": "basic", - "Flags": 2, - "FlagsString": "String", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, }, "_ts": Object { "Kind": 146, @@ -415,32 +410,12 @@ GetFoo without A parameter comment line.", }, "Name": "open", "Type": Object { - "ApiTypeKind": "union", - "Flags": 65544, - "FlagsString": undefined, - "Name": undefined, - "ReferenceId": undefined, + "ApiTypeKind": "basic", "Text": "boolean", - "Types": Array [ - Object { - "ApiTypeKind": "basic", - "Flags": 128, - "FlagsString": "BooleanLiteral", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, - "Text": "true", - }, - Object { - "ApiTypeKind": "basic", - "Flags": 128, - "FlagsString": "BooleanLiteral", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, - "Text": "false", - }, - ], + "_ts": Object { + "Kind": 122, + "KindString": "BooleanKeyword", + }, }, "_ts": Object { "Kind": 146, @@ -465,40 +440,29 @@ GetFoo without A parameter comment line.", "Name": "arg", "Type": Object { "ApiTypeKind": "union", - "Flags": 65536, - "FlagsString": "Union", - "Name": undefined, - "ReferenceId": undefined, - "Text": "string | boolean", - "Types": Array [ + "Members": Array [ Object { "ApiTypeKind": "basic", - "Flags": 2, - "FlagsString": "String", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, }, Object { "ApiTypeKind": "basic", - "Flags": 128, - "FlagsString": "BooleanLiteral", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, - "Text": "true", - }, - Object { - "ApiTypeKind": "basic", - "Flags": 128, - "FlagsString": "BooleanLiteral", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, - "Text": "false", + "Text": "boolean", + "_ts": Object { + "Kind": 122, + "KindString": "BooleanKeyword", + }, }, ], + "Text": "string | boolean", + "_ts": Object { + "Kind": 166, + "KindString": "UnionType", + }, }, "_ts": Object { "Kind": 146, @@ -530,12 +494,11 @@ GetFoo without A parameter comment line.", "Name": "IdProperty", "Type": Object { "ApiTypeKind": "basic", - "Flags": 2, - "FlagsString": "String", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, }, "_ts": Object { "Kind": 149, @@ -562,12 +525,11 @@ GetFoo without A parameter comment line.", "Name": "BarProperty", "Type": Object { "ApiTypeKind": "basic", - "Flags": 2, - "FlagsString": "String", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, }, "_ts": Object { "Kind": 149, diff --git a/tests/cases/__tests__/__snapshots__/IndexSignature1.test.ts.snap b/tests/cases/__tests__/__snapshots__/IndexSignature1.test.ts.snap index 82a96138..dd5b64c2 100644 --- a/tests/cases/__tests__/__snapshots__/IndexSignature1.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/IndexSignature1.test.ts.snap @@ -23,12 +23,11 @@ Object { "Parameter": "Parameter-0", "Type": Object { "ApiTypeKind": "basic", - "Flags": 4, - "FlagsString": "Number", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "number", + "_ts": Object { + "Kind": 133, + "KindString": "NumberKeyword", + }, }, "_ts": Object { "Kind": 157, @@ -81,12 +80,11 @@ Object { "Name": "key", "Type": Object { "ApiTypeKind": "basic", - "Flags": 2, - "FlagsString": "String", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, }, "_ts": Object { "Kind": 146, diff --git a/tests/cases/__tests__/__snapshots__/IndexSignature2.test.ts.snap b/tests/cases/__tests__/__snapshots__/IndexSignature2.test.ts.snap index 59d12fe0..ebe5b29a 100644 --- a/tests/cases/__tests__/__snapshots__/IndexSignature2.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/IndexSignature2.test.ts.snap @@ -23,12 +23,11 @@ Object { "Parameter": "Parameter-0", "Type": Object { "ApiTypeKind": "basic", - "Flags": 4, - "FlagsString": "Number", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "number", + "_ts": Object { + "Kind": 133, + "KindString": "NumberKeyword", + }, }, "_ts": Object { "Kind": 157, @@ -81,12 +80,11 @@ Object { "Name": "key", "Type": Object { "ApiTypeKind": "basic", - "Flags": 2, - "FlagsString": "String", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, }, "_ts": Object { "Kind": 146, diff --git a/tests/cases/__tests__/__snapshots__/IndexSignature3.test.ts.snap b/tests/cases/__tests__/__snapshots__/IndexSignature3.test.ts.snap index 0ec9271e..54888d69 100644 --- a/tests/cases/__tests__/__snapshots__/IndexSignature3.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/IndexSignature3.test.ts.snap @@ -23,12 +23,11 @@ Object { "Parameter": undefined, "Type": Object { "ApiTypeKind": "basic", - "Flags": 4, - "FlagsString": "Number", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "number", + "_ts": Object { + "Kind": 133, + "KindString": "NumberKeyword", + }, }, "_ts": Object { "Kind": 157, @@ -52,12 +51,11 @@ Object { "Parameter": "Parameter-2", "Type": Object { "ApiTypeKind": "basic", - "Flags": 1, - "FlagsString": "Any", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "any", + "_ts": Object { + "Kind": 119, + "KindString": "AnyKeyword", + }, }, "_ts": Object { "Kind": 157, @@ -111,12 +109,11 @@ Object { "Name": "key", "Type": Object { "ApiTypeKind": "basic", - "Flags": 2, - "FlagsString": "String", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, }, "_ts": Object { "Kind": 146, @@ -141,12 +138,11 @@ Object { "Name": "key2", "Type": Object { "ApiTypeKind": "basic", - "Flags": 2, - "FlagsString": "String", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, }, "_ts": Object { "Kind": 146, @@ -171,12 +167,11 @@ Object { "Name": "a", "Type": Object { "ApiTypeKind": "basic", - "Flags": 4, - "FlagsString": "Number", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "number", + "_ts": Object { + "Kind": 133, + "KindString": "NumberKeyword", + }, }, "_ts": Object { "Kind": 146, diff --git a/tests/cases/__tests__/__snapshots__/InterfaceClassMerging.test.ts.snap b/tests/cases/__tests__/__snapshots__/InterfaceClassMerging.test.ts.snap index c86f2ade..e708eff6 100644 --- a/tests/cases/__tests__/__snapshots__/InterfaceClassMerging.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/InterfaceClassMerging.test.ts.snap @@ -45,13 +45,15 @@ Object { "ClassDeclaration-1": Object { "ApiKind": "class", "Extends": Object { - "ApiTypeKind": "basic", - "Flags": 32768, - "FlagsString": "Object", - "Generics": undefined, - "Name": "Foo", + "ApiTypeKind": "reference", "ReferenceId": "InterfaceDeclaration-0", + "SymbolName": "Foo", "Text": "Foo", + "TypeParameters": undefined, + "_ts": Object { + "Kind": 201, + "KindString": "ExpressionWithTypeArguments", + }, }, "Implements": Array [], "IsAbstract": false, @@ -155,12 +157,11 @@ Object { ], "ReturnType": Object { "ApiTypeKind": "basic", - "Flags": 2, - "FlagsString": "String", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, }, "TypeParameters": Array [], "_ts": Object { @@ -197,12 +198,11 @@ Object { ], "ReturnType": Object { "ApiTypeKind": "basic", - "Flags": 2, - "FlagsString": "String", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, }, "TypeParameters": Array [], "_ts": Object { @@ -235,12 +235,11 @@ Object { ], "ReturnType": Object { "ApiTypeKind": "basic", - "Flags": 2, - "FlagsString": "String", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, }, "TypeParameters": Array [], "_ts": Object { @@ -273,12 +272,11 @@ Object { ], "ReturnType": Object { "ApiTypeKind": "basic", - "Flags": 2, - "FlagsString": "String", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, }, "TypeParameters": Array [], "_ts": Object { @@ -304,12 +302,11 @@ Object { "Name": "a", "Type": Object { "ApiTypeKind": "basic", - "Flags": 4, - "FlagsString": "Number", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "number", + "_ts": Object { + "Kind": 133, + "KindString": "NumberKeyword", + }, }, "_ts": Object { "Kind": 146, @@ -334,12 +331,11 @@ Object { "Name": "a", "Type": Object { "ApiTypeKind": "basic", - "Flags": 4, - "FlagsString": "Number", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "number", + "_ts": Object { + "Kind": 133, + "KindString": "NumberKeyword", + }, }, "_ts": Object { "Kind": 146, @@ -364,12 +360,11 @@ Object { "Name": "a", "Type": Object { "ApiTypeKind": "basic", - "Flags": 4, - "FlagsString": "Number", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "number", + "_ts": Object { + "Kind": 133, + "KindString": "NumberKeyword", + }, }, "_ts": Object { "Kind": 146, @@ -394,12 +389,11 @@ Object { "Name": "a", "Type": Object { "ApiTypeKind": "basic", - "Flags": 4, - "FlagsString": "Number", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "number", + "_ts": Object { + "Kind": 133, + "KindString": "NumberKeyword", + }, }, "_ts": Object { "Kind": 146, @@ -426,12 +420,11 @@ Object { "Name": "additionalProperty", "Type": Object { "ApiTypeKind": "basic", - "Flags": 2, - "FlagsString": "String", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, }, "_ts": Object { "Kind": 149, @@ -455,12 +448,11 @@ Object { "Name": "property", "Type": Object { "ApiTypeKind": "basic", - "Flags": 2, - "FlagsString": "String", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, }, "_ts": Object { "Kind": 148, @@ -484,12 +476,11 @@ Object { "Name": "optionalProperty", "Type": Object { "ApiTypeKind": "basic", - "Flags": 2, - "FlagsString": "String", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, }, "_ts": Object { "Kind": 148, @@ -561,13 +552,15 @@ Object { }, "Name": "bar", "Type": Object { - "ApiTypeKind": "basic", - "Flags": 32768, - "FlagsString": "Object", - "Generics": undefined, - "Name": "Bar", + "ApiTypeKind": "reference", "ReferenceId": "ClassDeclaration-1", + "SymbolName": "Bar", "Text": "Bar", + "TypeParameters": undefined, + "_ts": Object { + "Kind": 159, + "KindString": "TypeReference", + }, }, "VariableDeclarationType": "let", "_ts": Object { @@ -589,13 +582,15 @@ Object { }, "Name": "foo", "Type": Object { - "ApiTypeKind": "basic", - "Flags": 32768, - "FlagsString": "Object", - "Generics": undefined, - "Name": "Foo", + "ApiTypeKind": "reference", "ReferenceId": "InterfaceDeclaration-0", + "SymbolName": "Foo", "Text": "Foo", + "TypeParameters": undefined, + "_ts": Object { + "Kind": 159, + "KindString": "TypeReference", + }, }, "VariableDeclarationType": "let", "_ts": Object { @@ -617,13 +612,15 @@ Object { }, "Name": "iFoo", "Type": Object { - "ApiTypeKind": "basic", - "Flags": 32768, - "FlagsString": "Object", - "Generics": undefined, - "Name": "Foo", + "ApiTypeKind": "reference", "ReferenceId": "InterfaceDeclaration-0", + "SymbolName": "Foo", "Text": "Foo", + "TypeParameters": undefined, + "_ts": Object { + "Kind": 159, + "KindString": "TypeReference", + }, }, "VariableDeclarationType": "let", "_ts": Object { diff --git a/tests/cases/__tests__/__snapshots__/InterfaceDeclaration2.test.ts.snap b/tests/cases/__tests__/__snapshots__/InterfaceDeclaration2.test.ts.snap index 1f26e7d7..d030f5ce 100644 --- a/tests/cases/__tests__/__snapshots__/InterfaceDeclaration2.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/InterfaceDeclaration2.test.ts.snap @@ -51,12 +51,11 @@ Object { "Name": "Bar", "Type": Object { "ApiTypeKind": "basic", - "Flags": 2, - "FlagsString": "String", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, }, "_ts": Object { "Kind": 148, diff --git a/tests/cases/__tests__/__snapshots__/InterfaceDeclaration3.test.ts.snap b/tests/cases/__tests__/__snapshots__/InterfaceDeclaration3.test.ts.snap index da986686..dadcf6db 100644 --- a/tests/cases/__tests__/__snapshots__/InterfaceDeclaration3.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/InterfaceDeclaration3.test.ts.snap @@ -57,13 +57,15 @@ Object { }, "Name": "x", "Type": Object { - "ApiTypeKind": "type-parameter", - "Flags": 16384, - "FlagsString": "TypeParameter", - "Generics": undefined, - "Name": "T", + "ApiTypeKind": "reference", "ReferenceId": "TypeParameter-0", + "SymbolName": "T", "Text": "T", + "TypeParameters": undefined, + "_ts": Object { + "Kind": 159, + "KindString": "TypeReference", + }, }, "_ts": Object { "Kind": 148, @@ -136,23 +138,24 @@ Object { }, "Name": "y", "Type": Object { - "ApiTypeKind": "basic", - "Flags": 32768, - "FlagsString": "Object", - "Generics": Array [ + "ApiTypeKind": "reference", + "ReferenceId": "InterfaceDeclaration-0", + "SymbolName": "Generic", + "Text": "Generic", + "TypeParameters": Array [ Object { "ApiTypeKind": "basic", - "Flags": 4, - "FlagsString": "Number", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "number", + "_ts": Object { + "Kind": 133, + "KindString": "NumberKeyword", + }, }, ], - "Name": "Generic", - "ReferenceId": "InterfaceDeclaration-0", - "Text": "Generic", + "_ts": Object { + "Kind": 159, + "KindString": "TypeReference", + }, }, "VariableDeclarationType": "const", "_ts": Object { diff --git a/tests/cases/__tests__/__snapshots__/InterfaceDeclaration4.test.ts.snap b/tests/cases/__tests__/__snapshots__/InterfaceDeclaration4.test.ts.snap index 2a6baadb..7fdab763 100644 --- a/tests/cases/__tests__/__snapshots__/InterfaceDeclaration4.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/InterfaceDeclaration4.test.ts.snap @@ -23,12 +23,11 @@ Object { "Parameters": Array [], "ReturnType": Object { "ApiTypeKind": "basic", - "Flags": 2, - "FlagsString": "String", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, }, "TypeParameters": Array [], "_ts": Object { @@ -72,12 +71,11 @@ Object { ], "ReturnType": Object { "ApiTypeKind": "basic", - "Flags": 4, - "FlagsString": "Number", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "number", + "_ts": Object { + "Kind": 133, + "KindString": "NumberKeyword", + }, }, "TypeParameters": Array [], "_ts": Object { @@ -90,13 +88,15 @@ Object { "Extends": undefined, "Implements": Array [ Object { - "ApiTypeKind": "basic", - "Flags": 32768, - "FlagsString": "Object", - "Generics": undefined, - "Name": "a", + "ApiTypeKind": "reference", "ReferenceId": "InterfaceDeclaration-3", + "SymbolName": "a", "Text": "a", + "TypeParameters": undefined, + "_ts": Object { + "Kind": 201, + "KindString": "ExpressionWithTypeArguments", + }, }, ], "IsAbstract": false, @@ -135,12 +135,11 @@ Object { "Parameters": Array [], "ReturnType": Object { "ApiTypeKind": "basic", - "Flags": 2, - "FlagsString": "String", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, }, "TypeParameters": Array [], "_ts": Object { @@ -172,12 +171,11 @@ Object { ], "ReturnType": Object { "ApiTypeKind": "basic", - "Flags": 1, - "FlagsString": "Any", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "any", + "_ts": Object { + "Kind": 119, + "KindString": "AnyKeyword", + }, }, "TypeParameters": Array [], "_ts": Object { @@ -202,12 +200,11 @@ Object { "Parameters": Array [], "ReturnType": Object { "ApiTypeKind": "basic", - "Flags": 2, - "FlagsString": "String", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, }, "TypeParameters": Array [], "_ts": Object { @@ -231,13 +228,13 @@ Object { "Name": "__index", "Parameter": "Parameter-4", "Type": Object { - "ApiTypeKind": "basic", - "Flags": 32768, - "FlagsString": "Object", - "Generics": undefined, - "Name": "__type", + "ApiTypeKind": "function-type", "ReferenceId": "FunctionType-0", "Text": "() => string", + "_ts": Object { + "Kind": 160, + "KindString": "FunctionType", + }, }, "_ts": Object { "Kind": 157, @@ -261,12 +258,11 @@ Object { "Parameter": "Parameter-5", "Type": Object { "ApiTypeKind": "basic", - "Flags": 1, - "FlagsString": "Any", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "any", + "_ts": Object { + "Kind": 119, + "KindString": "AnyKeyword", + }, }, "_ts": Object { "Kind": 157, @@ -290,12 +286,11 @@ Object { "Parameter": "Parameter-9", "Type": Object { "ApiTypeKind": "basic", - "Flags": 4, - "FlagsString": "Number", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "number", + "_ts": Object { + "Kind": 133, + "KindString": "NumberKeyword", + }, }, "_ts": Object { "Kind": 157, @@ -319,12 +314,11 @@ Object { "Parameter": "Parameter-10", "Type": Object { "ApiTypeKind": "basic", - "Flags": 4, - "FlagsString": "Number", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "number", + "_ts": Object { + "Kind": 133, + "KindString": "NumberKeyword", + }, }, "_ts": Object { "Kind": 157, @@ -509,13 +503,15 @@ Object { "ApiKind": "interface", "Extends": Array [ Object { - "ApiTypeKind": "basic", - "Flags": 32768, - "FlagsString": "Object", - "Generics": undefined, - "Name": "a", + "ApiTypeKind": "reference", "ReferenceId": "InterfaceDeclaration-3", + "SymbolName": "a", "Text": "a", + "TypeParameters": undefined, + "_ts": Object { + "Kind": 201, + "KindString": "ExpressionWithTypeArguments", + }, }, ], "Location": Object { @@ -540,22 +536,26 @@ Object { "ApiKind": "interface", "Extends": Array [ Object { - "ApiTypeKind": "basic", - "Flags": 32768, - "FlagsString": "Object", - "Generics": undefined, - "Name": "a", + "ApiTypeKind": "reference", "ReferenceId": "InterfaceDeclaration-3", + "SymbolName": "a", "Text": "a", + "TypeParameters": undefined, + "_ts": Object { + "Kind": 201, + "KindString": "ExpressionWithTypeArguments", + }, }, Object { - "ApiTypeKind": "basic", - "Flags": 32768, - "FlagsString": "Object", - "Generics": undefined, - "Name": "b", + "ApiTypeKind": "reference", "ReferenceId": "InterfaceDeclaration-4", + "SymbolName": "b", "Text": "b", + "TypeParameters": undefined, + "_ts": Object { + "Kind": 201, + "KindString": "ExpressionWithTypeArguments", + }, }, ], "Location": Object { @@ -580,13 +580,15 @@ Object { "ApiKind": "interface", "Extends": Array [ Object { - "ApiTypeKind": "basic", - "Flags": 32768, - "FlagsString": "Object", - "Generics": undefined, - "Name": "a", + "ApiTypeKind": "reference", "ReferenceId": "InterfaceDeclaration-3", + "SymbolName": "a", "Text": "a", + "TypeParameters": undefined, + "_ts": Object { + "Kind": 201, + "KindString": "ExpressionWithTypeArguments", + }, }, ], "Location": Object { @@ -632,12 +634,11 @@ Object { ], "ReturnType": Object { "ApiTypeKind": "basic", - "Flags": 2, - "FlagsString": "String", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, }, "TypeParameters": Array [], "_ts": Object { @@ -663,12 +664,11 @@ Object { "Parameters": Array [], "ReturnType": Object { "ApiTypeKind": "basic", - "Flags": 1, - "FlagsString": "Any", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "any", + "_ts": Object { + "Kind": 119, + "KindString": "AnyKeyword", + }, }, "TypeParameters": Array [], "_ts": Object { @@ -694,12 +694,11 @@ Object { "Parameters": Array [], "ReturnType": Object { "ApiTypeKind": "basic", - "Flags": 1, - "FlagsString": "Any", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "any", + "_ts": Object { + "Kind": 119, + "KindString": "AnyKeyword", + }, }, "TypeParameters": Array [], "_ts": Object { @@ -732,12 +731,11 @@ Object { ], "ReturnType": Object { "ApiTypeKind": "basic", - "Flags": 4, - "FlagsString": "Number", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "number", + "_ts": Object { + "Kind": 133, + "KindString": "NumberKeyword", + }, }, "TypeParameters": Array [], "_ts": Object { @@ -770,12 +768,11 @@ Object { ], "ReturnType": Object { "ApiTypeKind": "basic", - "Flags": 2, - "FlagsString": "String", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, }, "TypeParameters": Array [], "_ts": Object { @@ -801,12 +798,11 @@ Object { "Name": "a", "Type": Object { "ApiTypeKind": "basic", - "Flags": 1, - "FlagsString": "Any", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "any", + "_ts": Object { + "Kind": 119, + "KindString": "AnyKeyword", + }, }, "_ts": Object { "Kind": 146, @@ -831,12 +827,11 @@ Object { "Name": "b", "Type": Object { "ApiTypeKind": "basic", - "Flags": 1, - "FlagsString": "Any", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "any", + "_ts": Object { + "Kind": 119, + "KindString": "AnyKeyword", + }, }, "_ts": Object { "Kind": 146, @@ -861,12 +856,11 @@ Object { "Name": "s", "Type": Object { "ApiTypeKind": "basic", - "Flags": 2, - "FlagsString": "String", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, }, "_ts": Object { "Kind": 146, @@ -891,12 +885,11 @@ Object { "Name": "c", "Type": Object { "ApiTypeKind": "basic", - "Flags": 2, - "FlagsString": "String", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, }, "_ts": Object { "Kind": 146, @@ -921,12 +914,11 @@ Object { "Name": "s", "Type": Object { "ApiTypeKind": "basic", - "Flags": 2, - "FlagsString": "String", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, }, "_ts": Object { "Kind": 146, @@ -951,12 +943,11 @@ Object { "Name": "n", "Type": Object { "ApiTypeKind": "basic", - "Flags": 4, - "FlagsString": "Number", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "number", + "_ts": Object { + "Kind": 133, + "KindString": "NumberKeyword", + }, }, "_ts": Object { "Kind": 146, @@ -981,12 +972,11 @@ Object { "Name": "s", "Type": Object { "ApiTypeKind": "basic", - "Flags": 2, - "FlagsString": "String", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, }, "_ts": Object { "Kind": 146, @@ -1011,12 +1001,11 @@ Object { "Name": "s", "Type": Object { "ApiTypeKind": "basic", - "Flags": 4, - "FlagsString": "Number", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "number", + "_ts": Object { + "Kind": 133, + "KindString": "NumberKeyword", + }, }, "_ts": Object { "Kind": 146, @@ -1041,12 +1030,11 @@ Object { "Name": "a", "Type": Object { "ApiTypeKind": "basic", - "Flags": 2, - "FlagsString": "String", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, }, "_ts": Object { "Kind": 146, @@ -1071,12 +1059,11 @@ Object { "Name": "s", "Type": Object { "ApiTypeKind": "basic", - "Flags": 4, - "FlagsString": "Number", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "number", + "_ts": Object { + "Kind": 133, + "KindString": "NumberKeyword", + }, }, "_ts": Object { "Kind": 146, @@ -1101,12 +1088,11 @@ Object { "Name": "n", "Type": Object { "ApiTypeKind": "basic", - "Flags": 4, - "FlagsString": "Number", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "number", + "_ts": Object { + "Kind": 133, + "KindString": "NumberKeyword", + }, }, "_ts": Object { "Kind": 146, @@ -1130,12 +1116,11 @@ Object { "Name": "p1", "Type": Object { "ApiTypeKind": "basic", - "Flags": 1, - "FlagsString": "Any", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "any", + "_ts": Object { + "Kind": 119, + "KindString": "AnyKeyword", + }, }, "_ts": Object { "Kind": 148, @@ -1159,12 +1144,11 @@ Object { "Name": "p3", "Type": Object { "ApiTypeKind": "basic", - "Flags": 1, - "FlagsString": "Any", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "any", + "_ts": Object { + "Kind": 119, + "KindString": "AnyKeyword", + }, }, "_ts": Object { "Kind": 148, @@ -1188,12 +1172,11 @@ Object { "Name": "p2", "Type": Object { "ApiTypeKind": "basic", - "Flags": 2, - "FlagsString": "String", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, }, "_ts": Object { "Kind": 148, @@ -1217,12 +1200,11 @@ Object { "Name": "p4", "Type": Object { "ApiTypeKind": "basic", - "Flags": 4, - "FlagsString": "Number", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "number", + "_ts": Object { + "Kind": 133, + "KindString": "NumberKeyword", + }, }, "_ts": Object { "Kind": 148, @@ -1317,13 +1299,15 @@ Object { }, "Name": "instance2", "Type": Object { - "ApiTypeKind": "basic", - "Flags": 32768, - "FlagsString": "Object", - "Generics": undefined, - "Name": "c1", + "ApiTypeKind": "reference", "ReferenceId": "ClassDeclaration-0", + "SymbolName": "c1", "Text": "c1", + "TypeParameters": undefined, + "_ts": Object { + "Kind": 159, + "KindString": "TypeReference", + }, }, "VariableDeclarationType": "var", "_ts": Object { diff --git a/tests/cases/__tests__/__snapshots__/InterfaceDeclaration5.test.ts.snap b/tests/cases/__tests__/__snapshots__/InterfaceDeclaration5.test.ts.snap index 55599925..eebf2265 100644 --- a/tests/cases/__tests__/__snapshots__/InterfaceDeclaration5.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/InterfaceDeclaration5.test.ts.snap @@ -29,13 +29,15 @@ Object { }, ], "ReturnType": Object { - "ApiTypeKind": "type-parameter", - "Flags": 16384, - "FlagsString": "TypeParameter", - "Generics": undefined, - "Name": "TValue", + "ApiTypeKind": "reference", "ReferenceId": "TypeParameter-0", + "SymbolName": "TValue", "Text": "TValue", + "TypeParameters": undefined, + "_ts": Object { + "Kind": 159, + "KindString": "TypeReference", + }, }, "TypeParameters": Array [ Object { @@ -95,13 +97,15 @@ Object { }, "Name": "value", "Type": Object { - "ApiTypeKind": "type-parameter", - "Flags": 16384, - "FlagsString": "TypeParameter", - "Generics": undefined, - "Name": "TValue", + "ApiTypeKind": "reference", "ReferenceId": "TypeParameter-0", + "SymbolName": "TValue", "Text": "TValue", + "TypeParameters": undefined, + "_ts": Object { + "Kind": 159, + "KindString": "TypeReference", + }, }, "_ts": Object { "Kind": 146, diff --git a/tests/cases/__tests__/__snapshots__/InterfaceDeclaration6.test.ts.snap b/tests/cases/__tests__/__snapshots__/InterfaceDeclaration6.test.ts.snap index bc0e14d3..707398e9 100644 --- a/tests/cases/__tests__/__snapshots__/InterfaceDeclaration6.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/InterfaceDeclaration6.test.ts.snap @@ -66,12 +66,11 @@ Object { ], "ReturnType": Object { "ApiTypeKind": "basic", - "Flags": 1024, - "FlagsString": "Void", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "void", + "_ts": Object { + "Kind": 105, + "KindString": "VoidKeyword", + }, }, "TypeParameters": Array [ Object { @@ -104,12 +103,11 @@ Object { "Name": "args", "Type": Object { "ApiTypeKind": "basic", - "Flags": 2, - "FlagsString": "String", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, }, "_ts": Object { "Kind": 146, diff --git a/tests/cases/__tests__/__snapshots__/InterfaceDeclaration7.test.ts.snap b/tests/cases/__tests__/__snapshots__/InterfaceDeclaration7.test.ts.snap index eda330a4..54dff313 100644 --- a/tests/cases/__tests__/__snapshots__/InterfaceDeclaration7.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/InterfaceDeclaration7.test.ts.snap @@ -51,12 +51,11 @@ Object { "Name": "Bar", "Type": Object { "ApiTypeKind": "basic", - "Flags": 2, - "FlagsString": "String", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, }, "_ts": Object { "Kind": 148, diff --git a/tests/cases/__tests__/__snapshots__/InterfaceSubtyping.test.ts.snap b/tests/cases/__tests__/__snapshots__/InterfaceSubtyping.test.ts.snap index c4546b7b..5c5f68b1 100644 --- a/tests/cases/__tests__/__snapshots__/InterfaceSubtyping.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/InterfaceSubtyping.test.ts.snap @@ -11,13 +11,15 @@ Object { "Extends": undefined, "Implements": Array [ Object { - "ApiTypeKind": "basic", - "Flags": 32768, - "FlagsString": "Object", - "Generics": undefined, - "Name": "Face", + "ApiTypeKind": "reference", "ReferenceId": "InterfaceDeclaration-0", + "SymbolName": "Face", "Text": "Face", + "TypeParameters": undefined, + "_ts": Object { + "Kind": 201, + "KindString": "ExpressionWithTypeArguments", + }, }, ], "IsAbstract": false, @@ -130,12 +132,11 @@ Object { "Parameters": Array [], "ReturnType": Object { "ApiTypeKind": "basic", - "Flags": 2, - "FlagsString": "String", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, }, "TypeParameters": Array [], "_ts": Object { @@ -161,12 +162,11 @@ Object { "Parameters": Array [], "ReturnType": Object { "ApiTypeKind": "basic", - "Flags": 1024, - "FlagsString": "Void", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "void", + "_ts": Object { + "Kind": 105, + "KindString": "VoidKeyword", + }, }, "TypeParameters": Array [], "_ts": Object { @@ -192,12 +192,11 @@ Object { "Name": "str", "Type": Object { "ApiTypeKind": "basic", - "Flags": 2, - "FlagsString": "String", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, }, "_ts": Object { "Kind": 146, diff --git a/tests/cases/__tests__/__snapshots__/MappedDeclaration1.test.ts.snap b/tests/cases/__tests__/__snapshots__/MappedDeclaration1.test.ts.snap index e6732ee5..756f88bd 100644 --- a/tests/cases/__tests__/__snapshots__/MappedDeclaration1.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/MappedDeclaration1.test.ts.snap @@ -23,12 +23,11 @@ Object { "Name": "__type", "Type": Object { "ApiTypeKind": "basic", - "Flags": 4, - "FlagsString": "Number", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "number", + "_ts": Object { + "Kind": 133, + "KindString": "NumberKeyword", + }, }, "TypeParameter": "TypeParameter-0", "_ts": Object { @@ -63,7 +62,7 @@ Object { }, }, "TypeAliasDeclaration-0": Object { - "ApiKind": "type", + "ApiKind": "type-alias", "Location": Object { "Character": 0, "FileName": "./cases/MappedDeclaration1.ts", @@ -76,13 +75,13 @@ Object { }, "Name": "mapped", "Type": Object { - "ApiTypeKind": "basic", - "Flags": 32768, - "FlagsString": "Object", - "Generics": undefined, - "Name": "__type", + "ApiTypeKind": "mapped", "ReferenceId": "MappedType-0", "Text": "mapped", + "_ts": Object { + "Kind": 172, + "KindString": "MappedType", + }, }, "TypeParameters": Array [], "_ts": Object { @@ -94,12 +93,11 @@ Object { "ApiKind": "type-parameter", "ConstraintType": Object { "ApiTypeKind": "basic", - "Flags": 32, - "FlagsString": "StringLiteral", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "\\"a-b-c\\"", + "_ts": Object { + "Kind": 173, + "KindString": "LastTypeNode", + }, }, "DefaultType": undefined, "Location": Object { diff --git a/tests/cases/__tests__/__snapshots__/MappedDeclaration2.test.ts.snap b/tests/cases/__tests__/__snapshots__/MappedDeclaration2.test.ts.snap index 8504e863..32766706 100644 --- a/tests/cases/__tests__/__snapshots__/MappedDeclaration2.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/MappedDeclaration2.test.ts.snap @@ -57,12 +57,11 @@ Object { "Name": "__type", "Type": Object { "ApiTypeKind": "basic", - "Flags": 4, - "FlagsString": "Number", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "number", + "_ts": Object { + "Kind": 133, + "KindString": "NumberKeyword", + }, }, "TypeParameter": "TypeParameter-0", "_ts": Object { @@ -87,12 +86,11 @@ Object { "Name": "Name", "Type": Object { "ApiTypeKind": "basic", - "Flags": 2, - "FlagsString": "String", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, }, "_ts": Object { "Kind": 148, @@ -116,12 +114,11 @@ Object { "Name": "Age", "Type": Object { "ApiTypeKind": "basic", - "Flags": 4, - "FlagsString": "Number", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "number", + "_ts": Object { + "Kind": 133, + "KindString": "NumberKeyword", + }, }, "_ts": Object { "Kind": 148, @@ -161,7 +158,7 @@ Object { }, }, "TypeAliasDeclaration-0": Object { - "ApiKind": "type", + "ApiKind": "type-alias", "Location": Object { "Character": 0, "FileName": "./cases/MappedDeclaration2.ts", @@ -174,13 +171,13 @@ Object { }, "Name": "mapped", "Type": Object { - "ApiTypeKind": "basic", - "Flags": 32768, - "FlagsString": "Object", - "Generics": undefined, - "Name": "__type", + "ApiTypeKind": "mapped", "ReferenceId": "MappedType-0", "Text": "mapped", + "_ts": Object { + "Kind": 172, + "KindString": "MappedType", + }, }, "TypeParameters": Array [], "_ts": Object { @@ -191,32 +188,24 @@ Object { "TypeParameter-0": Object { "ApiKind": "type-parameter", "ConstraintType": Object { - "ApiTypeKind": "union", - "Flags": 65536, - "FlagsString": "Union", - "Name": undefined, - "ReferenceId": undefined, - "Text": "\\"Name\\" | \\"Age\\"", - "Types": Array [ - Object { - "ApiTypeKind": "basic", - "Flags": 32, - "FlagsString": "StringLiteral", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, - "Text": "\\"Name\\"", - }, - Object { - "ApiTypeKind": "basic", - "Flags": 32, - "FlagsString": "StringLiteral", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, - "Text": "\\"Age\\"", + "ApiTypeKind": "type-operator", + "Keyword": "keyof", + "Text": "keyof Foo", + "Type": Object { + "ApiTypeKind": "reference", + "ReferenceId": "InterfaceDeclaration-0", + "SymbolName": "Foo", + "Text": "Foo", + "TypeParameters": undefined, + "_ts": Object { + "Kind": 159, + "KindString": "TypeReference", }, - ], + }, + "_ts": Object { + "Kind": 170, + "KindString": "TypeOperator", + }, }, "DefaultType": undefined, "Location": Object { diff --git a/tests/cases/__tests__/__snapshots__/MappedDeclaration3.test.ts.snap b/tests/cases/__tests__/__snapshots__/MappedDeclaration3.test.ts.snap index cc899872..77d057ec 100644 --- a/tests/cases/__tests__/__snapshots__/MappedDeclaration3.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/MappedDeclaration3.test.ts.snap @@ -57,12 +57,11 @@ Object { "Name": "__type", "Type": Object { "ApiTypeKind": "basic", - "Flags": 4, - "FlagsString": "Number", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "number", + "_ts": Object { + "Kind": 133, + "KindString": "NumberKeyword", + }, }, "TypeParameter": "TypeParameter-0", "_ts": Object { @@ -87,12 +86,11 @@ Object { "Name": "Name", "Type": Object { "ApiTypeKind": "basic", - "Flags": 2, - "FlagsString": "String", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, }, "_ts": Object { "Kind": 148, @@ -116,12 +114,11 @@ Object { "Name": "Age", "Type": Object { "ApiTypeKind": "basic", - "Flags": 4, - "FlagsString": "Number", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "number", + "_ts": Object { + "Kind": 133, + "KindString": "NumberKeyword", + }, }, "_ts": Object { "Kind": 148, @@ -161,7 +158,7 @@ Object { }, }, "TypeAliasDeclaration-0": Object { - "ApiKind": "type", + "ApiKind": "type-alias", "Location": Object { "Character": 0, "FileName": "./cases/MappedDeclaration3.ts", @@ -174,13 +171,13 @@ Object { }, "Name": "mapped", "Type": Object { - "ApiTypeKind": "basic", - "Flags": 32768, - "FlagsString": "Object", - "Generics": undefined, - "Name": "__type", + "ApiTypeKind": "mapped", "ReferenceId": "MappedType-0", "Text": "mapped", + "_ts": Object { + "Kind": 172, + "KindString": "MappedType", + }, }, "TypeParameters": Array [], "_ts": Object { @@ -191,32 +188,24 @@ Object { "TypeParameter-0": Object { "ApiKind": "type-parameter", "ConstraintType": Object { - "ApiTypeKind": "union", - "Flags": 65536, - "FlagsString": "Union", - "Name": undefined, - "ReferenceId": undefined, - "Text": "\\"Name\\" | \\"Age\\"", - "Types": Array [ - Object { - "ApiTypeKind": "basic", - "Flags": 32, - "FlagsString": "StringLiteral", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, - "Text": "\\"Name\\"", - }, - Object { - "ApiTypeKind": "basic", - "Flags": 32, - "FlagsString": "StringLiteral", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, - "Text": "\\"Age\\"", + "ApiTypeKind": "type-operator", + "Keyword": "keyof", + "Text": "keyof Foo", + "Type": Object { + "ApiTypeKind": "reference", + "ReferenceId": "InterfaceDeclaration-0", + "SymbolName": "Foo", + "Text": "Foo", + "TypeParameters": undefined, + "_ts": Object { + "Kind": 159, + "KindString": "TypeReference", }, - ], + }, + "_ts": Object { + "Kind": 170, + "KindString": "TypeOperator", + }, }, "DefaultType": undefined, "Location": Object { diff --git a/tests/cases/__tests__/__snapshots__/MappedDeclaration4.test.ts.snap b/tests/cases/__tests__/__snapshots__/MappedDeclaration4.test.ts.snap index ad41ab69..c22e40ad 100644 --- a/tests/cases/__tests__/__snapshots__/MappedDeclaration4.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/MappedDeclaration4.test.ts.snap @@ -57,12 +57,11 @@ Object { "Name": "__type", "Type": Object { "ApiTypeKind": "basic", - "Flags": 4, - "FlagsString": "Number", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "number", + "_ts": Object { + "Kind": 133, + "KindString": "NumberKeyword", + }, }, "TypeParameter": "TypeParameter-0", "_ts": Object { @@ -87,12 +86,11 @@ Object { "Name": "Name", "Type": Object { "ApiTypeKind": "basic", - "Flags": 2, - "FlagsString": "String", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, }, "_ts": Object { "Kind": 148, @@ -116,12 +114,11 @@ Object { "Name": "Age", "Type": Object { "ApiTypeKind": "basic", - "Flags": 4, - "FlagsString": "Number", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "number", + "_ts": Object { + "Kind": 133, + "KindString": "NumberKeyword", + }, }, "_ts": Object { "Kind": 148, @@ -161,7 +158,7 @@ Object { }, }, "TypeAliasDeclaration-0": Object { - "ApiKind": "type", + "ApiKind": "type-alias", "Location": Object { "Character": 0, "FileName": "./cases/MappedDeclaration4.ts", @@ -174,13 +171,13 @@ Object { }, "Name": "mapped", "Type": Object { - "ApiTypeKind": "basic", - "Flags": 32768, - "FlagsString": "Object", - "Generics": undefined, - "Name": "__type", + "ApiTypeKind": "mapped", "ReferenceId": "MappedType-0", "Text": "mapped", + "_ts": Object { + "Kind": 172, + "KindString": "MappedType", + }, }, "TypeParameters": Array [], "_ts": Object { @@ -191,32 +188,24 @@ Object { "TypeParameter-0": Object { "ApiKind": "type-parameter", "ConstraintType": Object { - "ApiTypeKind": "union", - "Flags": 65536, - "FlagsString": "Union", - "Name": undefined, - "ReferenceId": undefined, - "Text": "\\"Name\\" | \\"Age\\"", - "Types": Array [ - Object { - "ApiTypeKind": "basic", - "Flags": 32, - "FlagsString": "StringLiteral", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, - "Text": "\\"Name\\"", - }, - Object { - "ApiTypeKind": "basic", - "Flags": 32, - "FlagsString": "StringLiteral", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, - "Text": "\\"Age\\"", + "ApiTypeKind": "type-operator", + "Keyword": "keyof", + "Text": "keyof Foo", + "Type": Object { + "ApiTypeKind": "reference", + "ReferenceId": "InterfaceDeclaration-0", + "SymbolName": "Foo", + "Text": "Foo", + "TypeParameters": undefined, + "_ts": Object { + "Kind": 159, + "KindString": "TypeReference", }, - ], + }, + "_ts": Object { + "Kind": 170, + "KindString": "TypeOperator", + }, }, "DefaultType": undefined, "Location": Object { diff --git a/tests/cases/__tests__/__snapshots__/MultipleDeclaration.test.ts.snap b/tests/cases/__tests__/__snapshots__/MultipleDeclaration.test.ts.snap index df5a7f84..5d025e46 100644 --- a/tests/cases/__tests__/__snapshots__/MultipleDeclaration.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/MultipleDeclaration.test.ts.snap @@ -189,12 +189,11 @@ Object { "Name": "b", "Type": Object { "ApiTypeKind": "basic", - "Flags": 4, - "FlagsString": "Number", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "number", + "_ts": Object { + "Kind": 133, + "KindString": "NumberKeyword", + }, }, "_ts": Object { "Kind": 149, @@ -221,12 +220,11 @@ Object { "Name": "b", "Type": Object { "ApiTypeKind": "basic", - "Flags": 4, - "FlagsString": "Number", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "number", + "_ts": Object { + "Kind": 133, + "KindString": "NumberKeyword", + }, }, "_ts": Object { "Kind": 149, @@ -250,12 +248,11 @@ Object { "Name": "a", "Type": Object { "ApiTypeKind": "basic", - "Flags": 2, - "FlagsString": "String", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, }, "_ts": Object { "Kind": 148, @@ -279,12 +276,11 @@ Object { "Name": "a", "Type": Object { "ApiTypeKind": "basic", - "Flags": 2, - "FlagsString": "String", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, }, "_ts": Object { "Kind": 148, diff --git a/tests/cases/__tests__/__snapshots__/NamespaceDeclaration3.test.ts.snap b/tests/cases/__tests__/__snapshots__/NamespaceDeclaration3.test.ts.snap index 6db7df07..c8541f41 100644 --- a/tests/cases/__tests__/__snapshots__/NamespaceDeclaration3.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/NamespaceDeclaration3.test.ts.snap @@ -99,12 +99,11 @@ Object { "Name": "Hello", "Type": Object { "ApiTypeKind": "basic", - "Flags": 1048608, - "FlagsString": undefined, - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "\\"world!\\"", + "_ts": Object { + "Kind": 173, + "KindString": "LastTypeNode", + }, }, "VariableDeclarationType": "const", "_ts": Object { diff --git a/tests/cases/__tests__/__snapshots__/ParameterDeclaration1.test.ts.snap b/tests/cases/__tests__/__snapshots__/ParameterDeclaration1.test.ts.snap index 621579d7..f623e6bb 100644 --- a/tests/cases/__tests__/__snapshots__/ParameterDeclaration1.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/ParameterDeclaration1.test.ts.snap @@ -31,12 +31,11 @@ Object { ], "ReturnType": Object { "ApiTypeKind": "basic", - "Flags": 1024, - "FlagsString": "Void", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "void", + "_ts": Object { + "Kind": 105, + "KindString": "VoidKeyword", + }, }, "TypeParameters": Array [], "_ts": Object { @@ -61,32 +60,12 @@ Object { }, "Name": "bar", "Type": Object { - "ApiTypeKind": "union", - "Flags": 65544, - "FlagsString": undefined, - "Name": undefined, - "ReferenceId": undefined, + "ApiTypeKind": "basic", "Text": "boolean", - "Types": Array [ - Object { - "ApiTypeKind": "basic", - "Flags": 128, - "FlagsString": "BooleanLiteral", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, - "Text": "true", - }, - Object { - "ApiTypeKind": "basic", - "Flags": 128, - "FlagsString": "BooleanLiteral", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, - "Text": "false", - }, - ], + "_ts": Object { + "Kind": 122, + "KindString": "BooleanKeyword", + }, }, "_ts": Object { "Kind": 146, diff --git a/tests/cases/__tests__/__snapshots__/ParameterDeclaration2.test.ts.snap b/tests/cases/__tests__/__snapshots__/ParameterDeclaration2.test.ts.snap index b115dbe1..01ed2895 100644 --- a/tests/cases/__tests__/__snapshots__/ParameterDeclaration2.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/ParameterDeclaration2.test.ts.snap @@ -31,12 +31,11 @@ Object { ], "ReturnType": Object { "ApiTypeKind": "basic", - "Flags": 1024, - "FlagsString": "Void", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "void", + "_ts": Object { + "Kind": 105, + "KindString": "VoidKeyword", + }, }, "TypeParameters": Array [], "_ts": Object { @@ -61,23 +60,20 @@ Object { }, "Name": "bar", "Type": Object { - "ApiTypeKind": "basic", - "Flags": 32768, - "FlagsString": "Object", - "Generics": Array [ - Object { - "ApiTypeKind": "basic", - "Flags": 2, - "FlagsString": "String", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, - "Text": "string", - }, - ], - "Name": "Array", - "ReferenceId": undefined, + "ApiTypeKind": "array", "Text": "string[]", + "Type": Object { + "ApiTypeKind": "basic", + "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, + }, + "_ts": Object { + "Kind": 164, + "KindString": "ArrayType", + }, }, "_ts": Object { "Kind": 146, diff --git a/tests/cases/__tests__/__snapshots__/ParameterDeclaration3.test.ts.snap b/tests/cases/__tests__/__snapshots__/ParameterDeclaration3.test.ts.snap index 157d359a..351f0a13 100644 --- a/tests/cases/__tests__/__snapshots__/ParameterDeclaration3.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/ParameterDeclaration3.test.ts.snap @@ -31,12 +31,11 @@ Object { ], "ReturnType": Object { "ApiTypeKind": "basic", - "Flags": 1024, - "FlagsString": "Void", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "void", + "_ts": Object { + "Kind": 105, + "KindString": "VoidKeyword", + }, }, "TypeParameters": Array [], "_ts": Object { @@ -62,12 +61,11 @@ Object { "Name": "bar", "Type": Object { "ApiTypeKind": "basic", - "Flags": 2, - "FlagsString": "String", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, }, "_ts": Object { "Kind": 146, diff --git a/tests/cases/__tests__/__snapshots__/SetAccessor1.test.ts.snap b/tests/cases/__tests__/__snapshots__/SetAccessor1.test.ts.snap index d7ffdd2b..7eae7939 100644 --- a/tests/cases/__tests__/__snapshots__/SetAccessor1.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/SetAccessor1.test.ts.snap @@ -54,12 +54,11 @@ Object { "Name": "arg", "Type": Object { "ApiTypeKind": "basic", - "Flags": 2, - "FlagsString": "String", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, }, "_ts": Object { "Kind": 146, diff --git a/tests/cases/__tests__/__snapshots__/SetAccessor2.test.ts.snap b/tests/cases/__tests__/__snapshots__/SetAccessor2.test.ts.snap index dc78b55e..f424a3a0 100644 --- a/tests/cases/__tests__/__snapshots__/SetAccessor2.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/SetAccessor2.test.ts.snap @@ -54,12 +54,11 @@ Object { "Name": "arg", "Type": Object { "ApiTypeKind": "basic", - "Flags": 2, - "FlagsString": "String", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, }, "_ts": Object { "Kind": 146, @@ -84,12 +83,11 @@ Object { "Name": "arg2", "Type": Object { "ApiTypeKind": "basic", - "Flags": 2, - "FlagsString": "String", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, }, "_ts": Object { "Kind": 146, diff --git a/tests/cases/__tests__/__snapshots__/SetAccessor3.test.ts.snap b/tests/cases/__tests__/__snapshots__/SetAccessor3.test.ts.snap index 31236efc..039266b2 100644 --- a/tests/cases/__tests__/__snapshots__/SetAccessor3.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/SetAccessor3.test.ts.snap @@ -72,12 +72,11 @@ Object { "Name": "arg", "Type": Object { "ApiTypeKind": "basic", - "Flags": 2, - "FlagsString": "String", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, }, "_ts": Object { "Kind": 146, @@ -102,12 +101,11 @@ Object { "Name": "arg", "Type": Object { "ApiTypeKind": "basic", - "Flags": 2, - "FlagsString": "String", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, }, "_ts": Object { "Kind": 146, @@ -132,12 +130,11 @@ Object { "Name": "arg", "Type": Object { "ApiTypeKind": "basic", - "Flags": 2, - "FlagsString": "String", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, }, "_ts": Object { "Kind": 146, @@ -162,12 +159,11 @@ Object { "Name": "arg", "Type": Object { "ApiTypeKind": "basic", - "Flags": 2, - "FlagsString": "String", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, }, "_ts": Object { "Kind": 146, diff --git a/tests/cases/__tests__/__snapshots__/TypeAliasDeclaration1.test.ts.snap b/tests/cases/__tests__/__snapshots__/TypeAliasDeclaration1.test.ts.snap index 5027fc8d..a0235908 100644 --- a/tests/cases/__tests__/__snapshots__/TypeAliasDeclaration1.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/TypeAliasDeclaration1.test.ts.snap @@ -23,12 +23,11 @@ Object { "Name": "BarName", "Type": Object { "ApiTypeKind": "basic", - "Flags": 2, - "FlagsString": "String", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, }, "_ts": Object { "Kind": 148, @@ -68,7 +67,7 @@ Object { }, }, "TypeAliasDeclaration-0": Object { - "ApiKind": "type", + "ApiKind": "type-alias", "Location": Object { "Character": 0, "FileName": "./cases/TypeAliasDeclaration1.ts", @@ -81,13 +80,13 @@ Object { }, "Name": "MyType", "Type": Object { - "ApiTypeKind": "basic", - "Flags": 32768, - "FlagsString": "Object", - "Generics": undefined, - "Name": "__type", + "ApiTypeKind": "type-literal", "ReferenceId": "TypeLiteral-0", "Text": "MyType", + "_ts": Object { + "Kind": 163, + "KindString": "TypeLiteral", + }, }, "TypeParameters": Array [], "_ts": Object { @@ -96,7 +95,7 @@ Object { }, }, "TypeAliasDeclaration-1": Object { - "ApiKind": "type", + "ApiKind": "type-alias", "Location": Object { "Character": 0, "FileName": "./cases/TypeAliasDeclaration1.ts", @@ -109,13 +108,15 @@ Object { }, "Name": "AnotherType", "Type": Object { - "ApiTypeKind": "basic", - "Flags": 32768, - "FlagsString": "Object", - "Generics": undefined, - "Name": "MyType", + "ApiTypeKind": "reference", "ReferenceId": "TypeAliasDeclaration-0", + "SymbolName": "MyType", "Text": "MyType", + "TypeParameters": undefined, + "_ts": Object { + "Kind": 159, + "KindString": "TypeReference", + }, }, "TypeParameters": Array [], "_ts": Object { diff --git a/tests/cases/__tests__/__snapshots__/TypeAliasDeclaration2.test.ts.snap b/tests/cases/__tests__/__snapshots__/TypeAliasDeclaration2.test.ts.snap index 5624f941..538f454f 100644 --- a/tests/cases/__tests__/__snapshots__/TypeAliasDeclaration2.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/TypeAliasDeclaration2.test.ts.snap @@ -23,12 +23,11 @@ Object { "Name": "BarName", "Type": Object { "ApiTypeKind": "basic", - "Flags": 2, - "FlagsString": "String", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, }, "_ts": Object { "Kind": 148, @@ -52,12 +51,11 @@ Object { "Name": "FooName", "Type": Object { "ApiTypeKind": "basic", - "Flags": 2, - "FlagsString": "String", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, }, "_ts": Object { "Kind": 148, @@ -81,12 +79,11 @@ Object { "Name": "BarName", "Type": Object { "ApiTypeKind": "basic", - "Flags": 2, - "FlagsString": "String", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, }, "_ts": Object { "Kind": 148, @@ -110,12 +107,11 @@ Object { "Name": "BazName", "Type": Object { "ApiTypeKind": "basic", - "Flags": 2, - "FlagsString": "String", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, }, "_ts": Object { "Kind": 148, @@ -161,7 +157,7 @@ Object { }, }, "TypeAliasDeclaration-0": Object { - "ApiKind": "type", + "ApiKind": "type-alias", "Location": Object { "Character": 0, "FileName": "./cases/TypeAliasDeclaration2.ts", @@ -174,13 +170,13 @@ Object { }, "Name": "OneCommonField1", "Type": Object { - "ApiTypeKind": "basic", - "Flags": 32768, - "FlagsString": "Object", - "Generics": undefined, - "Name": "__type", + "ApiTypeKind": "type-literal", "ReferenceId": "TypeLiteral-0", "Text": "OneCommonField1", + "_ts": Object { + "Kind": 163, + "KindString": "TypeLiteral", + }, }, "TypeParameters": Array [], "_ts": Object { @@ -189,7 +185,7 @@ Object { }, }, "TypeAliasDeclaration-1": Object { - "ApiKind": "type", + "ApiKind": "type-alias", "Location": Object { "Character": 0, "FileName": "./cases/TypeAliasDeclaration2.ts", @@ -202,13 +198,13 @@ Object { }, "Name": "OneCommonField2", "Type": Object { - "ApiTypeKind": "basic", - "Flags": 32768, - "FlagsString": "Object", - "Generics": undefined, - "Name": "__type", + "ApiTypeKind": "type-literal", "ReferenceId": "TypeLiteral-1", "Text": "OneCommonField2", + "_ts": Object { + "Kind": 163, + "KindString": "TypeLiteral", + }, }, "TypeParameters": Array [], "_ts": Object { @@ -217,7 +213,7 @@ Object { }, }, "TypeAliasDeclaration-2": Object { - "ApiKind": "type", + "ApiKind": "type-alias", "Location": Object { "Character": 0, "FileName": "./cases/TypeAliasDeclaration2.ts", @@ -231,31 +227,35 @@ Object { "Name": "OneCommonFieldTypeIntersection", "Type": Object { "ApiTypeKind": "union", - "Flags": 65536, - "FlagsString": "Union", - "Name": undefined, - "ReferenceId": undefined, - "Text": "OneCommonFieldTypeIntersection", - "Types": Array [ + "Members": Array [ Object { - "ApiTypeKind": "basic", - "Flags": 32768, - "FlagsString": "Object", - "Generics": undefined, - "Name": "OneCommonField1", + "ApiTypeKind": "reference", "ReferenceId": "TypeAliasDeclaration-0", + "SymbolName": "OneCommonField1", "Text": "OneCommonField1", + "TypeParameters": undefined, + "_ts": Object { + "Kind": 159, + "KindString": "TypeReference", + }, }, Object { - "ApiTypeKind": "basic", - "Flags": 32768, - "FlagsString": "Object", - "Generics": undefined, - "Name": "OneCommonField2", + "ApiTypeKind": "reference", "ReferenceId": "TypeAliasDeclaration-1", + "SymbolName": "OneCommonField2", "Text": "OneCommonField2", + "TypeParameters": undefined, + "_ts": Object { + "Kind": 159, + "KindString": "TypeReference", + }, }, ], + "Text": "OneCommonFieldTypeIntersection", + "_ts": Object { + "Kind": 166, + "KindString": "UnionType", + }, }, "TypeParameters": Array [], "_ts": Object { diff --git a/tests/cases/__tests__/__snapshots__/TypeAliasDeclaration3.test.ts.snap b/tests/cases/__tests__/__snapshots__/TypeAliasDeclaration3.test.ts.snap index 30a2463e..410cbc07 100644 --- a/tests/cases/__tests__/__snapshots__/TypeAliasDeclaration3.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/TypeAliasDeclaration3.test.ts.snap @@ -23,12 +23,11 @@ Object { "Name": "BarName", "Type": Object { "ApiTypeKind": "basic", - "Flags": 2, - "FlagsString": "String", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, }, "_ts": Object { "Kind": 148, @@ -51,13 +50,15 @@ Object { }, "Name": "FooName", "Type": Object { - "ApiTypeKind": "type-parameter", - "Flags": 16384, - "FlagsString": "TypeParameter", - "Generics": undefined, - "Name": "TType", + "ApiTypeKind": "reference", "ReferenceId": "TypeParameter-0", + "SymbolName": "TType", "Text": "TType", + "TypeParameters": undefined, + "_ts": Object { + "Kind": 159, + "KindString": "TypeReference", + }, }, "_ts": Object { "Kind": 148, @@ -80,13 +81,15 @@ Object { }, "Name": "BazName", "Type": Object { - "ApiTypeKind": "type-parameter", - "Flags": 16384, - "FlagsString": "TypeParameter", - "Generics": undefined, - "Name": "TType", + "ApiTypeKind": "reference", "ReferenceId": "TypeParameter-1", + "SymbolName": "TType", "Text": "TType", + "TypeParameters": undefined, + "_ts": Object { + "Kind": 159, + "KindString": "TypeReference", + }, }, "_ts": Object { "Kind": 148, @@ -109,13 +112,15 @@ Object { }, "Name": "BarName", "Type": Object { - "ApiTypeKind": "type-parameter", - "Flags": 16384, - "FlagsString": "TypeParameter", - "Generics": undefined, - "Name": "TType", + "ApiTypeKind": "reference", "ReferenceId": "TypeParameter-2", + "SymbolName": "TType", "Text": "TType", + "TypeParameters": undefined, + "_ts": Object { + "Kind": 159, + "KindString": "TypeReference", + }, }, "_ts": Object { "Kind": 148, @@ -139,12 +144,11 @@ Object { "Name": "FooName", "Type": Object { "ApiTypeKind": "basic", - "Flags": 2, - "FlagsString": "String", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, }, "_ts": Object { "Kind": 148, @@ -167,13 +171,15 @@ Object { }, "Name": "BarName", "Type": Object { - "ApiTypeKind": "type-parameter", - "Flags": 16384, - "FlagsString": "TypeParameter", - "Generics": undefined, - "Name": "TType", + "ApiTypeKind": "reference", "ReferenceId": "TypeParameter-3", + "SymbolName": "TType", "Text": "TType", + "TypeParameters": undefined, + "_ts": Object { + "Kind": 159, + "KindString": "TypeReference", + }, }, "_ts": Object { "Kind": 148, @@ -197,12 +203,11 @@ Object { "Name": "BazName", "Type": Object { "ApiTypeKind": "basic", - "Flags": 2, - "FlagsString": "String", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, }, "_ts": Object { "Kind": 148, @@ -272,7 +277,7 @@ Object { }, }, "TypeAliasDeclaration-0": Object { - "ApiKind": "type", + "ApiKind": "type-alias", "Location": Object { "Character": 0, "FileName": "./cases/TypeAliasDeclaration3.ts", @@ -285,23 +290,13 @@ Object { }, "Name": "NoCommonFields1", "Type": Object { - "ApiTypeKind": "basic", - "Flags": 32768, - "FlagsString": "Object", - "Generics": Array [ - Object { - "ApiTypeKind": "type-parameter", - "Flags": 16384, - "FlagsString": "TypeParameter", - "Generics": undefined, - "Name": "TType", - "ReferenceId": "TypeParameter-0", - "Text": "TType", - }, - ], - "Name": "__type", + "ApiTypeKind": "type-literal", "ReferenceId": "TypeLiteral-0", "Text": "NoCommonFields1", + "_ts": Object { + "Kind": 163, + "KindString": "TypeLiteral", + }, }, "TypeParameters": Array [ Object { @@ -317,7 +312,7 @@ Object { }, }, "TypeAliasDeclaration-1": Object { - "ApiKind": "type", + "ApiKind": "type-alias", "Location": Object { "Character": 0, "FileName": "./cases/TypeAliasDeclaration3.ts", @@ -330,23 +325,13 @@ Object { }, "Name": "NoCommonFields2", "Type": Object { - "ApiTypeKind": "basic", - "Flags": 32768, - "FlagsString": "Object", - "Generics": Array [ - Object { - "ApiTypeKind": "type-parameter", - "Flags": 16384, - "FlagsString": "TypeParameter", - "Generics": undefined, - "Name": "TType", - "ReferenceId": "TypeParameter-1", - "Text": "TType", - }, - ], - "Name": "__type", + "ApiTypeKind": "type-literal", "ReferenceId": "TypeLiteral-1", "Text": "NoCommonFields2", + "_ts": Object { + "Kind": 163, + "KindString": "TypeLiteral", + }, }, "TypeParameters": Array [ Object { @@ -362,7 +347,7 @@ Object { }, }, "TypeAliasDeclaration-2": Object { - "ApiKind": "type", + "ApiKind": "type-alias", "Location": Object { "Character": 0, "FileName": "./cases/TypeAliasDeclaration3.ts", @@ -376,51 +361,35 @@ Object { "Name": "AnotherType", "Type": Object { "ApiTypeKind": "union", - "Flags": 65536, - "FlagsString": "Union", - "Name": undefined, - "ReferenceId": undefined, - "Text": "AnotherType", - "Types": Array [ + "Members": Array [ Object { - "ApiTypeKind": "basic", - "Flags": 32768, - "FlagsString": "Object", - "Generics": Array [ - Object { - "ApiTypeKind": "basic", - "Flags": 4, - "FlagsString": "Number", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, - "Text": "number", - }, - ], - "Name": "NoCommonFields1", + "ApiTypeKind": "reference", "ReferenceId": "TypeAliasDeclaration-0", + "SymbolName": "NoCommonFields1", "Text": "NoCommonFields1", + "TypeParameters": undefined, + "_ts": Object { + "Kind": 159, + "KindString": "TypeReference", + }, }, Object { - "ApiTypeKind": "basic", - "Flags": 32768, - "FlagsString": "Object", - "Generics": Array [ - Object { - "ApiTypeKind": "basic", - "Flags": 2, - "FlagsString": "String", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, - "Text": "string", - }, - ], - "Name": "NoCommonFields2", + "ApiTypeKind": "reference", "ReferenceId": "TypeAliasDeclaration-1", + "SymbolName": "NoCommonFields2", "Text": "NoCommonFields2", + "TypeParameters": undefined, + "_ts": Object { + "Kind": 159, + "KindString": "TypeReference", + }, }, ], + "Text": "AnotherType", + "_ts": Object { + "Kind": 166, + "KindString": "UnionType", + }, }, "TypeParameters": Array [], "_ts": Object { @@ -429,7 +398,7 @@ Object { }, }, "TypeAliasDeclaration-3": Object { - "ApiKind": "type", + "ApiKind": "type-alias", "Location": Object { "Character": 0, "FileName": "./cases/TypeAliasDeclaration3.ts", @@ -442,23 +411,13 @@ Object { }, "Name": "OneCommonField1", "Type": Object { - "ApiTypeKind": "basic", - "Flags": 32768, - "FlagsString": "Object", - "Generics": Array [ - Object { - "ApiTypeKind": "type-parameter", - "Flags": 16384, - "FlagsString": "TypeParameter", - "Generics": undefined, - "Name": "TType", - "ReferenceId": "TypeParameter-2", - "Text": "TType", - }, - ], - "Name": "__type", + "ApiTypeKind": "type-literal", "ReferenceId": "TypeLiteral-2", "Text": "OneCommonField1", + "_ts": Object { + "Kind": 163, + "KindString": "TypeLiteral", + }, }, "TypeParameters": Array [ Object { @@ -474,7 +433,7 @@ Object { }, }, "TypeAliasDeclaration-4": Object { - "ApiKind": "type", + "ApiKind": "type-alias", "Location": Object { "Character": 0, "FileName": "./cases/TypeAliasDeclaration3.ts", @@ -487,23 +446,13 @@ Object { }, "Name": "OneCommonField2", "Type": Object { - "ApiTypeKind": "basic", - "Flags": 32768, - "FlagsString": "Object", - "Generics": Array [ - Object { - "ApiTypeKind": "type-parameter", - "Flags": 16384, - "FlagsString": "TypeParameter", - "Generics": undefined, - "Name": "TType", - "ReferenceId": "TypeParameter-3", - "Text": "TType", - }, - ], - "Name": "__type", + "ApiTypeKind": "type-literal", "ReferenceId": "TypeLiteral-3", "Text": "OneCommonField2", + "_ts": Object { + "Kind": 163, + "KindString": "TypeLiteral", + }, }, "TypeParameters": Array [ Object { @@ -519,7 +468,7 @@ Object { }, }, "TypeAliasDeclaration-5": Object { - "ApiKind": "type", + "ApiKind": "type-alias", "Location": Object { "Character": 0, "FileName": "./cases/TypeAliasDeclaration3.ts", @@ -533,51 +482,35 @@ Object { "Name": "OneCommonFieldTypeIntersection", "Type": Object { "ApiTypeKind": "union", - "Flags": 65536, - "FlagsString": "Union", - "Name": undefined, - "ReferenceId": undefined, - "Text": "OneCommonFieldTypeIntersection", - "Types": Array [ + "Members": Array [ Object { - "ApiTypeKind": "basic", - "Flags": 32768, - "FlagsString": "Object", - "Generics": Array [ - Object { - "ApiTypeKind": "basic", - "Flags": 4, - "FlagsString": "Number", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, - "Text": "number", - }, - ], - "Name": "OneCommonField1", + "ApiTypeKind": "reference", "ReferenceId": "TypeAliasDeclaration-3", + "SymbolName": "OneCommonField1", "Text": "OneCommonField1", + "TypeParameters": undefined, + "_ts": Object { + "Kind": 159, + "KindString": "TypeReference", + }, }, Object { - "ApiTypeKind": "basic", - "Flags": 32768, - "FlagsString": "Object", - "Generics": Array [ - Object { - "ApiTypeKind": "basic", - "Flags": 4, - "FlagsString": "Number", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, - "Text": "number", - }, - ], - "Name": "OneCommonField2", + "ApiTypeKind": "reference", "ReferenceId": "TypeAliasDeclaration-4", + "SymbolName": "OneCommonField2", "Text": "OneCommonField2", + "TypeParameters": undefined, + "_ts": Object { + "Kind": 159, + "KindString": "TypeReference", + }, }, ], + "Text": "OneCommonFieldTypeIntersection", + "_ts": Object { + "Kind": 166, + "KindString": "UnionType", + }, }, "TypeParameters": Array [], "_ts": Object { @@ -586,7 +519,7 @@ Object { }, }, "TypeAliasDeclaration-6": Object { - "ApiKind": "type", + "ApiKind": "type-alias", "Location": Object { "Character": 0, "FileName": "./cases/TypeAliasDeclaration3.ts", @@ -600,51 +533,35 @@ Object { "Name": "OneCommonFieldTypeIntersectionWithDifferentTypes", "Type": Object { "ApiTypeKind": "intersection", - "Flags": 131072, - "FlagsString": "Intersection", - "Name": undefined, - "ReferenceId": undefined, - "Text": "OneCommonFieldTypeIntersectionWithDifferentTypes", - "Types": Array [ + "Members": Array [ Object { - "ApiTypeKind": "basic", - "Flags": 32768, - "FlagsString": "Object", - "Generics": Array [ - Object { - "ApiTypeKind": "basic", - "Flags": 4, - "FlagsString": "Number", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, - "Text": "number", - }, - ], - "Name": "OneCommonField1", + "ApiTypeKind": "reference", "ReferenceId": "TypeAliasDeclaration-3", + "SymbolName": "OneCommonField1", "Text": "OneCommonField1", + "TypeParameters": undefined, + "_ts": Object { + "Kind": 159, + "KindString": "TypeReference", + }, }, Object { - "ApiTypeKind": "basic", - "Flags": 32768, - "FlagsString": "Object", - "Generics": Array [ - Object { - "ApiTypeKind": "basic", - "Flags": 2, - "FlagsString": "String", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, - "Text": "string", - }, - ], - "Name": "OneCommonField2", + "ApiTypeKind": "reference", "ReferenceId": "TypeAliasDeclaration-4", + "SymbolName": "OneCommonField2", "Text": "OneCommonField2", + "TypeParameters": undefined, + "_ts": Object { + "Kind": 159, + "KindString": "TypeReference", + }, }, ], + "Text": "OneCommonFieldTypeIntersectionWithDifferentTypes", + "_ts": Object { + "Kind": 167, + "KindString": "IntersectionType", + }, }, "TypeParameters": Array [], "_ts": Object { diff --git a/tests/cases/__tests__/__snapshots__/TypeAliasDeclaration4.test.ts.snap b/tests/cases/__tests__/__snapshots__/TypeAliasDeclaration4.test.ts.snap index 8dd9b703..7dea4de1 100644 --- a/tests/cases/__tests__/__snapshots__/TypeAliasDeclaration4.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/TypeAliasDeclaration4.test.ts.snap @@ -23,12 +23,11 @@ Object { "Name": "Name", "Type": Object { "ApiTypeKind": "basic", - "Flags": 2, - "FlagsString": "String", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, }, "_ts": Object { "Kind": 148, @@ -68,7 +67,7 @@ Object { }, }, "TypeAliasDeclaration-0": Object { - "ApiKind": "type", + "ApiKind": "type-alias", "Location": Object { "Character": 0, "FileName": "./cases/TypeAliasDeclaration4.ts", @@ -81,13 +80,13 @@ Object { }, "Name": "User", "Type": Object { - "ApiTypeKind": "basic", - "Flags": 32768, - "FlagsString": "Object", - "Generics": undefined, - "Name": "__type", + "ApiTypeKind": "type-literal", "ReferenceId": "TypeLiteral-0", "Text": "User", + "_ts": Object { + "Kind": 163, + "KindString": "TypeLiteral", + }, }, "TypeParameters": Array [], "_ts": Object { @@ -96,7 +95,7 @@ Object { }, }, "TypeAliasDeclaration-1": Object { - "ApiKind": "type", + "ApiKind": "type-alias", "Location": Object { "Character": 0, "FileName": "./cases/TypeAliasDeclaration4.ts", @@ -109,23 +108,15 @@ Object { }, "Name": "ReadonlyUser", "Type": Object { - "ApiTypeKind": "basic", - "Flags": 32768, - "FlagsString": "Object", - "Generics": Array [ - Object { - "ApiTypeKind": "basic", - "Flags": 32768, - "FlagsString": "Object", - "Generics": undefined, - "Name": "User", - "ReferenceId": "TypeAliasDeclaration-0", - "Text": "User", - }, - ], - "Name": "Readonly", + "ApiTypeKind": "reference", "ReferenceId": undefined, + "SymbolName": "Readonly", "Text": "Readonly", + "TypeParameters": undefined, + "_ts": Object { + "Kind": 159, + "KindString": "TypeReference", + }, }, "TypeParameters": Array [], "_ts": Object { diff --git a/tests/cases/__tests__/__snapshots__/TypeAliasDeclaration5.test.ts.snap b/tests/cases/__tests__/__snapshots__/TypeAliasDeclaration5.test.ts.snap new file mode 100644 index 00000000..44e99ec1 --- /dev/null +++ b/tests/cases/__tests__/__snapshots__/TypeAliasDeclaration5.test.ts.snap @@ -0,0 +1,82 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`TypeAliasDeclaration5 1`] = ` +Object { + "EntryFiles": Array [ + "SourceFile-0", + ], + "Registry": Object { + "SourceFile-0": Object { + "ApiKind": "source-file", + "Location": Object { + "Character": 0, + "FileName": "./cases/TypeAliasDeclaration5.ts", + "IsExternalPackage": false, + "Line": 0, + }, + "Members": Array [ + Object { + "Alias": "FooTuple", + "Ids": Array [ + "TypeAliasDeclaration-0", + ], + }, + ], + "Metadata": Object { + "DocumentationComment": "", + "JSDocTags": Array [], + }, + "Name": "TypeAliasDeclaration5.ts", + "_ts": Object { + "Kind": 268, + "KindString": "SourceFile", + }, + }, + "TypeAliasDeclaration-0": Object { + "ApiKind": "type-alias", + "Location": Object { + "Character": 0, + "FileName": "./cases/TypeAliasDeclaration5.ts", + "IsExternalPackage": false, + "Line": 0, + }, + "Metadata": Object { + "DocumentationComment": "", + "JSDocTags": Array [], + }, + "Name": "FooTuple", + "Type": Object { + "ApiTypeKind": "tuple", + "Members": Array [ + Object { + "ApiTypeKind": "basic", + "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, + }, + Object { + "ApiTypeKind": "basic", + "Text": "number", + "_ts": Object { + "Kind": 133, + "KindString": "NumberKeyword", + }, + }, + ], + "Text": "[string, number]", + "_ts": Object { + "Kind": 165, + "KindString": "TupleType", + }, + }, + "TypeParameters": Array [], + "_ts": Object { + "Kind": 231, + "KindString": "TypeAliasDeclaration", + }, + }, + }, +} +`; diff --git a/tests/cases/__tests__/__snapshots__/TypeAliasDeclaration6.test.ts.snap b/tests/cases/__tests__/__snapshots__/TypeAliasDeclaration6.test.ts.snap new file mode 100644 index 00000000..5ac3d696 --- /dev/null +++ b/tests/cases/__tests__/__snapshots__/TypeAliasDeclaration6.test.ts.snap @@ -0,0 +1,251 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`TypeAliasDeclaration6 1`] = ` +Object { + "EntryFiles": Array [ + "SourceFile-0", + ], + "Registry": Object { + "InterfaceDeclaration-0": Object { + "ApiKind": "interface", + "Extends": Array [], + "Location": Object { + "Character": 0, + "FileName": "./cases/TypeAliasDeclaration6.ts", + "IsExternalPackage": false, + "Line": 0, + }, + "Members": Array [ + Object { + "Alias": "Name", + "Ids": Array [ + "PropertySignature-0", + ], + }, + Object { + "Alias": "LastName", + "Ids": Array [ + "PropertySignature-1", + ], + }, + ], + "Metadata": Object { + "DocumentationComment": "", + "JSDocTags": Array [], + }, + "Name": "Foo", + "TypeParameters": Array [], + "_ts": Object { + "Kind": 230, + "KindString": "InterfaceDeclaration", + }, + }, + "MappedType-0": Object { + "ApiKind": "mapped", + "IsOptional": false, + "IsReadonly": false, + "Location": Object { + "Character": 18, + "FileName": "./cases/TypeAliasDeclaration6.ts", + "IsExternalPackage": false, + "Line": 5, + }, + "Metadata": Object { + "DocumentationComment": "", + "JSDocTags": Array [], + }, + "Name": "__type", + "Type": Object { + "ApiTypeKind": "indexed-access", + "IndexType": Object { + "ApiTypeKind": "reference", + "ReferenceId": "TypeParameter-0", + "SymbolName": "TKey", + "Text": "TKey", + "TypeParameters": undefined, + "_ts": Object { + "Kind": 159, + "KindString": "TypeReference", + }, + }, + "ObjectType": Object { + "ApiTypeKind": "reference", + "ReferenceId": "InterfaceDeclaration-0", + "SymbolName": "Foo", + "Text": "Foo", + "TypeParameters": undefined, + "_ts": Object { + "Kind": 159, + "KindString": "TypeReference", + }, + }, + "Text": "Foo[TKey]", + "_ts": Object { + "Kind": 171, + "KindString": "IndexedAccessType", + }, + }, + "TypeParameter": "TypeParameter-0", + "_ts": Object { + "Kind": 172, + "KindString": "MappedType", + }, + }, + "PropertySignature-0": Object { + "ApiKind": "property", + "IsOptional": false, + "IsReadonly": false, + "Location": Object { + "Character": 4, + "FileName": "./cases/TypeAliasDeclaration6.ts", + "IsExternalPackage": false, + "Line": 1, + }, + "Metadata": Object { + "DocumentationComment": "", + "JSDocTags": Array [], + }, + "Name": "Name", + "Type": Object { + "ApiTypeKind": "basic", + "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, + }, + "_ts": Object { + "Kind": 148, + "KindString": "PropertySignature", + }, + }, + "PropertySignature-1": Object { + "ApiKind": "property", + "IsOptional": false, + "IsReadonly": false, + "Location": Object { + "Character": 4, + "FileName": "./cases/TypeAliasDeclaration6.ts", + "IsExternalPackage": false, + "Line": 2, + }, + "Metadata": Object { + "DocumentationComment": "", + "JSDocTags": Array [], + }, + "Name": "LastName", + "Type": Object { + "ApiTypeKind": "basic", + "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, + }, + "_ts": Object { + "Kind": 148, + "KindString": "PropertySignature", + }, + }, + "SourceFile-0": Object { + "ApiKind": "source-file", + "Location": Object { + "Character": 0, + "FileName": "./cases/TypeAliasDeclaration6.ts", + "IsExternalPackage": false, + "Line": 0, + }, + "Members": Array [ + Object { + "Alias": "Foo", + "Ids": Array [ + "InterfaceDeclaration-0", + ], + }, + Object { + "Alias": "Bar", + "Ids": Array [ + "TypeAliasDeclaration-0", + ], + }, + ], + "Metadata": Object { + "DocumentationComment": "", + "JSDocTags": Array [], + }, + "Name": "TypeAliasDeclaration6.ts", + "_ts": Object { + "Kind": 268, + "KindString": "SourceFile", + }, + }, + "TypeAliasDeclaration-0": Object { + "ApiKind": "type-alias", + "Location": Object { + "Character": 0, + "FileName": "./cases/TypeAliasDeclaration6.ts", + "IsExternalPackage": false, + "Line": 5, + }, + "Metadata": Object { + "DocumentationComment": "", + "JSDocTags": Array [], + }, + "Name": "Bar", + "Type": Object { + "ApiTypeKind": "mapped", + "ReferenceId": "MappedType-0", + "Text": "Bar", + "_ts": Object { + "Kind": 172, + "KindString": "MappedType", + }, + }, + "TypeParameters": Array [], + "_ts": Object { + "Kind": 231, + "KindString": "TypeAliasDeclaration", + }, + }, + "TypeParameter-0": Object { + "ApiKind": "type-parameter", + "ConstraintType": Object { + "ApiTypeKind": "type-operator", + "Keyword": "keyof", + "Text": "keyof Foo", + "Type": Object { + "ApiTypeKind": "reference", + "ReferenceId": "InterfaceDeclaration-0", + "SymbolName": "Foo", + "Text": "Foo", + "TypeParameters": undefined, + "_ts": Object { + "Kind": 159, + "KindString": "TypeReference", + }, + }, + "_ts": Object { + "Kind": 170, + "KindString": "TypeOperator", + }, + }, + "DefaultType": undefined, + "Location": Object { + "Character": 5, + "FileName": "./cases/TypeAliasDeclaration6.ts", + "IsExternalPackage": false, + "Line": 6, + }, + "Metadata": Object { + "DocumentationComment": "", + "JSDocTags": Array [], + }, + "Name": "TKey", + "_ts": Object { + "Kind": 145, + "KindString": "TypeParameter", + }, + }, + }, +} +`; diff --git a/tests/cases/__tests__/__snapshots__/TypeAliasDeclaration7.test.ts.snap b/tests/cases/__tests__/__snapshots__/TypeAliasDeclaration7.test.ts.snap new file mode 100644 index 00000000..9b4eb94d --- /dev/null +++ b/tests/cases/__tests__/__snapshots__/TypeAliasDeclaration7.test.ts.snap @@ -0,0 +1,98 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`TypeAliasDeclaration7 1`] = ` +Object { + "EntryFiles": Array [ + "SourceFile-0", + ], + "Registry": Object { + "SourceFile-0": Object { + "ApiKind": "source-file", + "Location": Object { + "Character": 0, + "FileName": "./cases/TypeAliasDeclaration7.ts", + "IsExternalPackage": false, + "Line": 0, + }, + "Members": Array [ + Object { + "Alias": "Foo", + "Ids": Array [ + "TypeAliasDeclaration-0", + ], + }, + ], + "Metadata": Object { + "DocumentationComment": "", + "JSDocTags": Array [], + }, + "Name": "TypeAliasDeclaration7.ts", + "_ts": Object { + "Kind": 268, + "KindString": "SourceFile", + }, + }, + "TypeAliasDeclaration-0": Object { + "ApiKind": "type-alias", + "Location": Object { + "Character": 0, + "FileName": "./cases/TypeAliasDeclaration7.ts", + "IsExternalPackage": false, + "Line": 0, + }, + "Metadata": Object { + "DocumentationComment": "", + "JSDocTags": Array [], + }, + "Name": "Foo", + "Type": Object { + "ApiTypeKind": "array", + "Text": "(string | number)[]", + "Type": Object { + "ApiTypeKind": "parenthesized", + "Text": "string | number", + "Type": Object { + "ApiTypeKind": "union", + "Members": Array [ + Object { + "ApiTypeKind": "basic", + "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, + }, + Object { + "ApiTypeKind": "basic", + "Text": "number", + "_ts": Object { + "Kind": 133, + "KindString": "NumberKeyword", + }, + }, + ], + "Text": "string | number", + "_ts": Object { + "Kind": 166, + "KindString": "UnionType", + }, + }, + "_ts": Object { + "Kind": 168, + "KindString": "ParenthesizedType", + }, + }, + "_ts": Object { + "Kind": 164, + "KindString": "ArrayType", + }, + }, + "TypeParameters": Array [], + "_ts": Object { + "Kind": 231, + "KindString": "TypeAliasDeclaration", + }, + }, + }, +} +`; diff --git a/tests/cases/__tests__/__snapshots__/TypeAliasDeclaration8.test.ts.snap b/tests/cases/__tests__/__snapshots__/TypeAliasDeclaration8.test.ts.snap new file mode 100644 index 00000000..4dfaadae --- /dev/null +++ b/tests/cases/__tests__/__snapshots__/TypeAliasDeclaration8.test.ts.snap @@ -0,0 +1,183 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`TypeAliasDeclaration8 1`] = ` +Object { + "EntryFiles": Array [ + "SourceFile-0", + ], + "Registry": Object { + "ConstructorType-0": Object { + "ApiKind": "construct", + "IsOverloadBase": false, + "Location": Object { + "Character": 18, + "FileName": "./cases/TypeAliasDeclaration8.ts", + "IsExternalPackage": false, + "Line": 0, + }, + "Metadata": Object { + "DocumentationComment": "", + "JSDocTags": Array [], + }, + "Name": "__type", + "Parameters": Array [], + "ReturnType": Object { + "ApiTypeKind": "type-literal", + "ReferenceId": "TypeLiteral-0", + "Text": "{ Name: string; Age: number; }", + "_ts": Object { + "Kind": 163, + "KindString": "TypeLiteral", + }, + }, + "TypeParameters": Array [], + "_ts": Object { + "Kind": 161, + "KindString": "ConstructorType", + }, + }, + "PropertySignature-0": Object { + "ApiKind": "property", + "IsOptional": false, + "IsReadonly": false, + "Location": Object { + "Character": 4, + "FileName": "./cases/TypeAliasDeclaration8.ts", + "IsExternalPackage": false, + "Line": 1, + }, + "Metadata": Object { + "DocumentationComment": "", + "JSDocTags": Array [], + }, + "Name": "Name", + "Type": Object { + "ApiTypeKind": "basic", + "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, + }, + "_ts": Object { + "Kind": 148, + "KindString": "PropertySignature", + }, + }, + "PropertySignature-1": Object { + "ApiKind": "property", + "IsOptional": false, + "IsReadonly": false, + "Location": Object { + "Character": 4, + "FileName": "./cases/TypeAliasDeclaration8.ts", + "IsExternalPackage": false, + "Line": 2, + }, + "Metadata": Object { + "DocumentationComment": "", + "JSDocTags": Array [], + }, + "Name": "Age", + "Type": Object { + "ApiTypeKind": "basic", + "Text": "number", + "_ts": Object { + "Kind": 133, + "KindString": "NumberKeyword", + }, + }, + "_ts": Object { + "Kind": 148, + "KindString": "PropertySignature", + }, + }, + "SourceFile-0": Object { + "ApiKind": "source-file", + "Location": Object { + "Character": 0, + "FileName": "./cases/TypeAliasDeclaration8.ts", + "IsExternalPackage": false, + "Line": 0, + }, + "Members": Array [ + Object { + "Alias": "Foo", + "Ids": Array [ + "TypeAliasDeclaration-0", + ], + }, + ], + "Metadata": Object { + "DocumentationComment": "", + "JSDocTags": Array [], + }, + "Name": "TypeAliasDeclaration8.ts", + "_ts": Object { + "Kind": 268, + "KindString": "SourceFile", + }, + }, + "TypeAliasDeclaration-0": Object { + "ApiKind": "type-alias", + "Location": Object { + "Character": 0, + "FileName": "./cases/TypeAliasDeclaration8.ts", + "IsExternalPackage": false, + "Line": 0, + }, + "Metadata": Object { + "DocumentationComment": "", + "JSDocTags": Array [], + }, + "Name": "Foo", + "Type": Object { + "ApiTypeKind": "constructor", + "ReferenceId": "ConstructorType-0", + "Text": "Foo", + "_ts": Object { + "Kind": 161, + "KindString": "ConstructorType", + }, + }, + "TypeParameters": Array [], + "_ts": Object { + "Kind": 231, + "KindString": "TypeAliasDeclaration", + }, + }, + "TypeLiteral-0": Object { + "ApiKind": "type-literal", + "Location": Object { + "Character": 28, + "FileName": "./cases/TypeAliasDeclaration8.ts", + "IsExternalPackage": false, + "Line": 0, + }, + "Members": Array [ + Object { + "Alias": "Name", + "Ids": Array [ + "PropertySignature-0", + ], + }, + Object { + "Alias": "Age", + "Ids": Array [ + "PropertySignature-1", + ], + }, + ], + "Metadata": Object { + "DocumentationComment": "", + "JSDocTags": Array [], + }, + "Name": "__type", + "_ts": Object { + "Kind": 163, + "KindString": "TypeLiteral", + }, + }, + }, +} +`; diff --git a/tests/cases/__tests__/__snapshots__/TypeParameterDeclaration1.test.ts.snap b/tests/cases/__tests__/__snapshots__/TypeParameterDeclaration1.test.ts.snap index a9905e6b..9bc738a9 100644 --- a/tests/cases/__tests__/__snapshots__/TypeParameterDeclaration1.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/TypeParameterDeclaration1.test.ts.snap @@ -31,12 +31,11 @@ Object { ], "ReturnType": Object { "ApiTypeKind": "basic", - "Flags": 1024, - "FlagsString": "Void", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "void", + "_ts": Object { + "Kind": 105, + "KindString": "VoidKeyword", + }, }, "TypeParameters": Array [ Object { @@ -68,13 +67,15 @@ Object { }, "Name": "a", "Type": Object { - "ApiTypeKind": "type-parameter", - "Flags": 16384, - "FlagsString": "TypeParameter", - "Generics": undefined, - "Name": "TValue", + "ApiTypeKind": "reference", "ReferenceId": "TypeParameter-0", + "SymbolName": "TValue", "Text": "TValue", + "TypeParameters": undefined, + "_ts": Object { + "Kind": 159, + "KindString": "TypeReference", + }, }, "_ts": Object { "Kind": 146, @@ -112,12 +113,11 @@ Object { "ConstraintType": undefined, "DefaultType": Object { "ApiTypeKind": "basic", - "Flags": 2, - "FlagsString": "String", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, }, "Location": Object { "Character": 20, diff --git a/tests/cases/__tests__/__snapshots__/TypeParameterDeclaration2.test.ts.snap b/tests/cases/__tests__/__snapshots__/TypeParameterDeclaration2.test.ts.snap index cb1125bf..35ee9fb2 100644 --- a/tests/cases/__tests__/__snapshots__/TypeParameterDeclaration2.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/TypeParameterDeclaration2.test.ts.snap @@ -31,12 +31,11 @@ Object { ], "ReturnType": Object { "ApiTypeKind": "basic", - "Flags": 1024, - "FlagsString": "Void", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "void", + "_ts": Object { + "Kind": 105, + "KindString": "VoidKeyword", + }, }, "TypeParameters": Array [ Object { @@ -68,13 +67,15 @@ Object { }, "Name": "a", "Type": Object { - "ApiTypeKind": "type-parameter", - "Flags": 16384, - "FlagsString": "TypeParameter", - "Generics": undefined, - "Name": "TValue", + "ApiTypeKind": "reference", "ReferenceId": "TypeParameter-0", + "SymbolName": "TValue", "Text": "TValue", + "TypeParameters": undefined, + "_ts": Object { + "Kind": 159, + "KindString": "TypeReference", + }, }, "_ts": Object { "Kind": 146, @@ -110,13 +111,15 @@ Object { "TypeParameter-0": Object { "ApiKind": "type-parameter", "ConstraintType": Object { - "ApiTypeKind": "basic", - "Flags": 32768, - "FlagsString": "Object", - "Generics": undefined, - "Name": "Date", + "ApiTypeKind": "reference", "ReferenceId": undefined, + "SymbolName": "Date", "Text": "Date", + "TypeParameters": undefined, + "_ts": Object { + "Kind": 159, + "KindString": "TypeReference", + }, }, "DefaultType": undefined, "Location": Object { diff --git a/tests/cases/__tests__/__snapshots__/TypeParameterDeclaration3.test.ts.snap b/tests/cases/__tests__/__snapshots__/TypeParameterDeclaration3.test.ts.snap index 175db776..cff61cf8 100644 --- a/tests/cases/__tests__/__snapshots__/TypeParameterDeclaration3.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/TypeParameterDeclaration3.test.ts.snap @@ -31,12 +31,11 @@ Object { ], "ReturnType": Object { "ApiTypeKind": "basic", - "Flags": 1024, - "FlagsString": "Void", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "void", + "_ts": Object { + "Kind": 105, + "KindString": "VoidKeyword", + }, }, "TypeParameters": Array [ Object { @@ -68,13 +67,15 @@ Object { }, "Name": "a", "Type": Object { - "ApiTypeKind": "type-parameter", - "Flags": 16384, - "FlagsString": "TypeParameter", - "Generics": undefined, - "Name": "TValue", + "ApiTypeKind": "reference", "ReferenceId": "TypeParameter-0", + "SymbolName": "TValue", "Text": "TValue", + "TypeParameters": undefined, + "_ts": Object { + "Kind": 159, + "KindString": "TypeReference", + }, }, "_ts": Object { "Kind": 146, @@ -110,22 +111,26 @@ Object { "TypeParameter-0": Object { "ApiKind": "type-parameter", "ConstraintType": Object { - "ApiTypeKind": "basic", - "Flags": 32768, - "FlagsString": "Object", - "Generics": undefined, - "Name": "Date", + "ApiTypeKind": "reference", "ReferenceId": undefined, + "SymbolName": "Date", "Text": "Date", + "TypeParameters": undefined, + "_ts": Object { + "Kind": 159, + "KindString": "TypeReference", + }, }, "DefaultType": Object { - "ApiTypeKind": "basic", - "Flags": 32768, - "FlagsString": "Object", - "Generics": undefined, - "Name": "Date", + "ApiTypeKind": "reference", "ReferenceId": undefined, + "SymbolName": "Date", "Text": "Date", + "TypeParameters": undefined, + "_ts": Object { + "Kind": 159, + "KindString": "TypeReference", + }, }, "Location": Object { "Character": 20, diff --git a/tests/cases/__tests__/__snapshots__/VariableDeclaration1.test.ts.snap b/tests/cases/__tests__/__snapshots__/VariableDeclaration1.test.ts.snap index 79ae3df3..24765df8 100644 --- a/tests/cases/__tests__/__snapshots__/VariableDeclaration1.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/VariableDeclaration1.test.ts.snap @@ -47,12 +47,11 @@ Object { "Name": "FOO", "Type": Object { "ApiTypeKind": "basic", - "Flags": 2048, - "FlagsString": "Undefined", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "undefined", + "_ts": Object { + "Kind": 139, + "KindString": "UndefinedKeyword", + }, }, "VariableDeclarationType": "const", "_ts": Object { diff --git a/tests/cases/__tests__/__snapshots__/VariableDeclaration2.test.ts.snap b/tests/cases/__tests__/__snapshots__/VariableDeclaration2.test.ts.snap index 9a3022af..2494616a 100644 --- a/tests/cases/__tests__/__snapshots__/VariableDeclaration2.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/VariableDeclaration2.test.ts.snap @@ -47,12 +47,11 @@ Object { "Name": "Foo", "Type": Object { "ApiTypeKind": "basic", - "Flags": 2, - "FlagsString": "String", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, }, "VariableDeclarationType": "const", "_ts": Object { diff --git a/tests/cases/__tests__/__snapshots__/VariableDeclaration3.test.ts.snap b/tests/cases/__tests__/__snapshots__/VariableDeclaration3.test.ts.snap index c4301cc7..ee114576 100644 --- a/tests/cases/__tests__/__snapshots__/VariableDeclaration3.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/VariableDeclaration3.test.ts.snap @@ -46,13 +46,14 @@ Object { }, "Name": "z", "Type": Object { - "ApiTypeKind": "basic", - "Flags": 2, - "FlagsString": "String", - "Generics": undefined, - "Name": undefined, + "ApiTypeKind": "type-query", + "Keyword": "typeof", "ReferenceId": undefined, "Text": "string", + "_ts": Object { + "Kind": 162, + "KindString": "TypeQuery", + }, }, "VariableDeclarationType": "const", "_ts": Object { diff --git a/tests/cases/__tests__/__snapshots__/VariableDeclaration4.test.ts.snap b/tests/cases/__tests__/__snapshots__/VariableDeclaration4.test.ts.snap index 6f16b134..98078e27 100644 --- a/tests/cases/__tests__/__snapshots__/VariableDeclaration4.test.ts.snap +++ b/tests/cases/__tests__/__snapshots__/VariableDeclaration4.test.ts.snap @@ -51,12 +51,11 @@ Object { "Name": "b", "Type": Object { "ApiTypeKind": "basic", - "Flags": 2, - "FlagsString": "String", - "Generics": undefined, - "Name": undefined, - "ReferenceId": undefined, "Text": "string", + "_ts": Object { + "Kind": 136, + "KindString": "StringKeyword", + }, }, "_ts": Object { "Kind": 148, @@ -115,13 +114,15 @@ Object { }, "Name": "a", "Type": Object { - "ApiTypeKind": "basic", - "Flags": 32768, - "FlagsString": "Object", - "Generics": undefined, - "Name": "A", + "ApiTypeKind": "reference", "ReferenceId": "InterfaceDeclaration-0", + "SymbolName": "A", "Text": "A", + "TypeParameters": undefined, + "_ts": Object { + "Kind": 159, + "KindString": "TypeReference", + }, }, "VariableDeclarationType": "const", "_ts": Object { @@ -143,13 +144,14 @@ Object { }, "Name": "z", "Type": Object { - "ApiTypeKind": "basic", - "Flags": 32768, - "FlagsString": "Object", - "Generics": undefined, - "Name": "A", + "ApiTypeKind": "type-query", + "Keyword": "typeof", "ReferenceId": "InterfaceDeclaration-0", "Text": "A", + "_ts": Object { + "Kind": 162, + "KindString": "TypeQuery", + }, }, "VariableDeclarationType": "const", "_ts": Object { From d5ef9fecf7e5427b34a90c543fde1905746ce135 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martynas=20=C5=BDilinskas?= Date: Fri, 12 Jan 2018 16:11:33 +0200 Subject: [PATCH 3/4] v4.0.0-beta --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 230e5604..d475282a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ts-extractor", - "version": "3.1.5", + "version": "4.0.0-beta", "description": "TypeScript AST extractor to useful JSON structure.", "keywords": [ "typescript", From c8a239a3fbc4dd724c585d50f40ec496eec544a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martynas=20=C5=BDilinskas?= Date: Fri, 12 Jan 2018 17:35:36 +0200 Subject: [PATCH 4/4] Added trav-srelease script. (#80) --- .travis.yml | 2 + package-lock.json | 936 ++++++++++++++++++++++++++++- package.json | 3 +- tools/travis-release/release.js | 46 ++ tools/travis-release/release.ts | 52 ++ tools/travis-release/tsconfig.json | 31 + tsconfig.json | 3 +- 7 files changed, 1069 insertions(+), 4 deletions(-) create mode 100644 tools/travis-release/release.js create mode 100644 tools/travis-release/release.ts create mode 100644 tools/travis-release/tsconfig.json diff --git a/.travis.yml b/.travis.yml index 06554504..2962f3d9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,6 +14,8 @@ script: - npm run test-ci after_script: - npm run coveralls +before_deploy: +- npm run travis-release deploy: provider: npm email: $SIMPLR_NPM_EMAIL diff --git a/package-lock.json b/package-lock.json index e1b23860..912b1f87 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "ts-extractor", - "version": "3.0.2", + "version": "4.0.0-beta", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -542,6 +542,13 @@ "integrity": "sha1-RqoXUftqL5PuXmibsQh9SxTGwgU=", "dev": true }, + "bindings": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.3.0.tgz", + "integrity": "sha512-DpLh5EzMR2kzvX1KIlVC0VkC3iZtHKTgdtZ0a3pglBZdaQFjt5S9g9xd1lE+YvXyfd6mtCeRnrUfOLYiTMlNSw==", + "dev": true, + "optional": true + }, "boom": { "version": "4.3.1", "resolved": "https://registry.npmjs.org/boom/-/boom-4.3.1.tgz", @@ -677,6 +684,7 @@ "requires": { "anymatch": "1.3.2", "async-each": "1.0.1", + "fsevents": "1.1.3", "glob-parent": "2.0.0", "inherits": "2.0.3", "is-binary-path": "1.0.1", @@ -1267,6 +1275,910 @@ "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" }, + "fsevents": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.1.3.tgz", + "integrity": "sha512-WIr7iDkdmdbxu/Gh6eKEZJL6KPE74/5MEsf2whTOFNxbIoIixogroLdKYqB6FDav4Wavh/lZdzzd3b2KxIXC5Q==", + "dev": true, + "optional": true, + "requires": { + "nan": "2.8.0", + "node-pre-gyp": "0.6.39" + }, + "dependencies": { + "abbrev": { + "version": "1.1.0", + "bundled": true, + "dev": true, + "optional": true + }, + "ajv": { + "version": "4.11.8", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "co": "4.6.0", + "json-stable-stringify": "1.0.1" + } + }, + "ansi-regex": { + "version": "2.1.1", + "bundled": true, + "dev": true + }, + "aproba": { + "version": "1.1.1", + "bundled": true, + "dev": true, + "optional": true + }, + "are-we-there-yet": { + "version": "1.1.4", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "delegates": "1.0.0", + "readable-stream": "2.2.9" + } + }, + "asn1": { + "version": "0.2.3", + "bundled": true, + "dev": true, + "optional": true + }, + "assert-plus": { + "version": "0.2.0", + "bundled": true, + "dev": true, + "optional": true + }, + "asynckit": { + "version": "0.4.0", + "bundled": true, + "dev": true, + "optional": true + }, + "aws-sign2": { + "version": "0.6.0", + "bundled": true, + "dev": true, + "optional": true + }, + "aws4": { + "version": "1.6.0", + "bundled": true, + "dev": true, + "optional": true + }, + "balanced-match": { + "version": "0.4.2", + "bundled": true, + "dev": true + }, + "bcrypt-pbkdf": { + "version": "1.0.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "tweetnacl": "0.14.5" + } + }, + "block-stream": { + "version": "0.0.9", + "bundled": true, + "dev": true, + "requires": { + "inherits": "2.0.3" + } + }, + "boom": { + "version": "2.10.1", + "bundled": true, + "dev": true, + "requires": { + "hoek": "2.16.3" + } + }, + "brace-expansion": { + "version": "1.1.7", + "bundled": true, + "dev": true, + "requires": { + "balanced-match": "0.4.2", + "concat-map": "0.0.1" + } + }, + "buffer-shims": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, + "caseless": { + "version": "0.12.0", + "bundled": true, + "dev": true, + "optional": true + }, + "co": { + "version": "4.6.0", + "bundled": true, + "dev": true, + "optional": true + }, + "code-point-at": { + "version": "1.1.0", + "bundled": true, + "dev": true + }, + "combined-stream": { + "version": "1.0.5", + "bundled": true, + "dev": true, + "requires": { + "delayed-stream": "1.0.0" + } + }, + "concat-map": { + "version": "0.0.1", + "bundled": true, + "dev": true + }, + "console-control-strings": { + "version": "1.1.0", + "bundled": true, + "dev": true + }, + "core-util-is": { + "version": "1.0.2", + "bundled": true, + "dev": true + }, + "cryptiles": { + "version": "2.0.5", + "bundled": true, + "dev": true, + "requires": { + "boom": "2.10.1" + } + }, + "dashdash": { + "version": "1.14.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "assert-plus": "1.0.0" + }, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "optional": true + } + } + }, + "debug": { + "version": "2.6.8", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "ms": "2.0.0" + } + }, + "deep-extend": { + "version": "0.4.2", + "bundled": true, + "dev": true, + "optional": true + }, + "delayed-stream": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, + "delegates": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "detect-libc": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "ecc-jsbn": { + "version": "0.1.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "jsbn": "0.1.1" + } + }, + "extend": { + "version": "3.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "extsprintf": { + "version": "1.0.2", + "bundled": true, + "dev": true + }, + "forever-agent": { + "version": "0.6.1", + "bundled": true, + "dev": true, + "optional": true + }, + "form-data": { + "version": "2.1.4", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "asynckit": "0.4.0", + "combined-stream": "1.0.5", + "mime-types": "2.1.15" + } + }, + "fs.realpath": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, + "fstream": { + "version": "1.0.11", + "bundled": true, + "dev": true, + "requires": { + "graceful-fs": "4.1.11", + "inherits": "2.0.3", + "mkdirp": "0.5.1", + "rimraf": "2.6.1" + } + }, + "fstream-ignore": { + "version": "1.0.5", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "fstream": "1.0.11", + "inherits": "2.0.3", + "minimatch": "3.0.4" + } + }, + "gauge": { + "version": "2.7.4", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "aproba": "1.1.1", + "console-control-strings": "1.1.0", + "has-unicode": "2.0.1", + "object-assign": "4.1.1", + "signal-exit": "3.0.2", + "string-width": "1.0.2", + "strip-ansi": "3.0.1", + "wide-align": "1.1.2" + } + }, + "getpass": { + "version": "0.1.7", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "assert-plus": "1.0.0" + }, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "optional": true + } + } + }, + "glob": { + "version": "7.1.2", + "bundled": true, + "dev": true, + "requires": { + "fs.realpath": "1.0.0", + "inflight": "1.0.6", + "inherits": "2.0.3", + "minimatch": "3.0.4", + "once": "1.4.0", + "path-is-absolute": "1.0.1" + } + }, + "graceful-fs": { + "version": "4.1.11", + "bundled": true, + "dev": true + }, + "har-schema": { + "version": "1.0.5", + "bundled": true, + "dev": true, + "optional": true + }, + "har-validator": { + "version": "4.2.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "ajv": "4.11.8", + "har-schema": "1.0.5" + } + }, + "has-unicode": { + "version": "2.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "hawk": { + "version": "3.1.3", + "bundled": true, + "dev": true, + "requires": { + "boom": "2.10.1", + "cryptiles": "2.0.5", + "hoek": "2.16.3", + "sntp": "1.0.9" + } + }, + "hoek": { + "version": "2.16.3", + "bundled": true, + "dev": true + }, + "http-signature": { + "version": "1.1.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "assert-plus": "0.2.0", + "jsprim": "1.4.0", + "sshpk": "1.13.0" + } + }, + "inflight": { + "version": "1.0.6", + "bundled": true, + "dev": true, + "requires": { + "once": "1.4.0", + "wrappy": "1.0.2" + } + }, + "inherits": { + "version": "2.0.3", + "bundled": true, + "dev": true + }, + "ini": { + "version": "1.3.4", + "bundled": true, + "dev": true, + "optional": true + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "number-is-nan": "1.0.1" + } + }, + "is-typedarray": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "isarray": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, + "isstream": { + "version": "0.1.2", + "bundled": true, + "dev": true, + "optional": true + }, + "jodid25519": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "jsbn": "0.1.1" + } + }, + "jsbn": { + "version": "0.1.1", + "bundled": true, + "dev": true, + "optional": true + }, + "json-schema": { + "version": "0.2.3", + "bundled": true, + "dev": true, + "optional": true + }, + "json-stable-stringify": { + "version": "1.0.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "jsonify": "0.0.0" + } + }, + "json-stringify-safe": { + "version": "5.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "jsonify": { + "version": "0.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "jsprim": { + "version": "1.4.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "assert-plus": "1.0.0", + "extsprintf": "1.0.2", + "json-schema": "0.2.3", + "verror": "1.3.6" + }, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "optional": true + } + } + }, + "mime-db": { + "version": "1.27.0", + "bundled": true, + "dev": true + }, + "mime-types": { + "version": "2.1.15", + "bundled": true, + "dev": true, + "requires": { + "mime-db": "1.27.0" + } + }, + "minimatch": { + "version": "3.0.4", + "bundled": true, + "dev": true, + "requires": { + "brace-expansion": "1.1.7" + } + }, + "minimist": { + "version": "0.0.8", + "bundled": true, + "dev": true + }, + "mkdirp": { + "version": "0.5.1", + "bundled": true, + "dev": true, + "requires": { + "minimist": "0.0.8" + } + }, + "ms": { + "version": "2.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "node-pre-gyp": { + "version": "0.6.39", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "detect-libc": "1.0.2", + "hawk": "3.1.3", + "mkdirp": "0.5.1", + "nopt": "4.0.1", + "npmlog": "4.1.0", + "rc": "1.2.1", + "request": "2.81.0", + "rimraf": "2.6.1", + "semver": "5.3.0", + "tar": "2.2.1", + "tar-pack": "3.4.0" + } + }, + "nopt": { + "version": "4.0.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "abbrev": "1.1.0", + "osenv": "0.1.4" + } + }, + "npmlog": { + "version": "4.1.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "are-we-there-yet": "1.1.4", + "console-control-strings": "1.1.0", + "gauge": "2.7.4", + "set-blocking": "2.0.0" + } + }, + "number-is-nan": { + "version": "1.0.1", + "bundled": true, + "dev": true + }, + "oauth-sign": { + "version": "0.8.2", + "bundled": true, + "dev": true, + "optional": true + }, + "object-assign": { + "version": "4.1.1", + "bundled": true, + "dev": true, + "optional": true + }, + "once": { + "version": "1.4.0", + "bundled": true, + "dev": true, + "requires": { + "wrappy": "1.0.2" + } + }, + "os-homedir": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "os-tmpdir": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "osenv": { + "version": "0.1.4", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "os-homedir": "1.0.2", + "os-tmpdir": "1.0.2" + } + }, + "path-is-absolute": { + "version": "1.0.1", + "bundled": true, + "dev": true + }, + "performance-now": { + "version": "0.2.0", + "bundled": true, + "dev": true, + "optional": true + }, + "process-nextick-args": { + "version": "1.0.7", + "bundled": true, + "dev": true + }, + "punycode": { + "version": "1.4.1", + "bundled": true, + "dev": true, + "optional": true + }, + "qs": { + "version": "6.4.0", + "bundled": true, + "dev": true, + "optional": true + }, + "rc": { + "version": "1.2.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "deep-extend": "0.4.2", + "ini": "1.3.4", + "minimist": "1.2.0", + "strip-json-comments": "2.0.1" + }, + "dependencies": { + "minimist": { + "version": "1.2.0", + "bundled": true, + "dev": true, + "optional": true + } + } + }, + "readable-stream": { + "version": "2.2.9", + "bundled": true, + "dev": true, + "requires": { + "buffer-shims": "1.0.0", + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "1.0.0", + "process-nextick-args": "1.0.7", + "string_decoder": "1.0.1", + "util-deprecate": "1.0.2" + } + }, + "request": { + "version": "2.81.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "aws-sign2": "0.6.0", + "aws4": "1.6.0", + "caseless": "0.12.0", + "combined-stream": "1.0.5", + "extend": "3.0.1", + "forever-agent": "0.6.1", + "form-data": "2.1.4", + "har-validator": "4.2.1", + "hawk": "3.1.3", + "http-signature": "1.1.1", + "is-typedarray": "1.0.0", + "isstream": "0.1.2", + "json-stringify-safe": "5.0.1", + "mime-types": "2.1.15", + "oauth-sign": "0.8.2", + "performance-now": "0.2.0", + "qs": "6.4.0", + "safe-buffer": "5.0.1", + "stringstream": "0.0.5", + "tough-cookie": "2.3.2", + "tunnel-agent": "0.6.0", + "uuid": "3.0.1" + } + }, + "rimraf": { + "version": "2.6.1", + "bundled": true, + "dev": true, + "requires": { + "glob": "7.1.2" + } + }, + "safe-buffer": { + "version": "5.0.1", + "bundled": true, + "dev": true + }, + "semver": { + "version": "5.3.0", + "bundled": true, + "dev": true, + "optional": true + }, + "set-blocking": { + "version": "2.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "signal-exit": { + "version": "3.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "sntp": { + "version": "1.0.9", + "bundled": true, + "dev": true, + "requires": { + "hoek": "2.16.3" + } + }, + "sshpk": { + "version": "1.13.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "asn1": "0.2.3", + "assert-plus": "1.0.0", + "bcrypt-pbkdf": "1.0.1", + "dashdash": "1.14.1", + "ecc-jsbn": "0.1.1", + "getpass": "0.1.7", + "jodid25519": "1.0.2", + "jsbn": "0.1.1", + "tweetnacl": "0.14.5" + }, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "optional": true + } + } + }, + "string-width": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "requires": { + "code-point-at": "1.1.0", + "is-fullwidth-code-point": "1.0.0", + "strip-ansi": "3.0.1" + } + }, + "string_decoder": { + "version": "1.0.1", + "bundled": true, + "dev": true, + "requires": { + "safe-buffer": "5.0.1" + } + }, + "stringstream": { + "version": "0.0.5", + "bundled": true, + "dev": true, + "optional": true + }, + "strip-ansi": { + "version": "3.0.1", + "bundled": true, + "dev": true, + "requires": { + "ansi-regex": "2.1.1" + } + }, + "strip-json-comments": { + "version": "2.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "tar": { + "version": "2.2.1", + "bundled": true, + "dev": true, + "requires": { + "block-stream": "0.0.9", + "fstream": "1.0.11", + "inherits": "2.0.3" + } + }, + "tar-pack": { + "version": "3.4.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "debug": "2.6.8", + "fstream": "1.0.11", + "fstream-ignore": "1.0.5", + "once": "1.4.0", + "readable-stream": "2.2.9", + "rimraf": "2.6.1", + "tar": "2.2.1", + "uid-number": "0.0.6" + } + }, + "tough-cookie": { + "version": "2.3.2", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "punycode": "1.4.1" + } + }, + "tunnel-agent": { + "version": "0.6.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "safe-buffer": "5.0.1" + } + }, + "tweetnacl": { + "version": "0.14.5", + "bundled": true, + "dev": true, + "optional": true + }, + "uid-number": { + "version": "0.0.6", + "bundled": true, + "dev": true, + "optional": true + }, + "util-deprecate": { + "version": "1.0.2", + "bundled": true, + "dev": true + }, + "uuid": { + "version": "3.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "verror": { + "version": "1.3.6", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "extsprintf": "1.0.2" + } + }, + "wide-align": { + "version": "1.1.2", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "string-width": "1.0.2" + } + }, + "wrappy": { + "version": "1.0.2", + "bundled": true, + "dev": true + } + } + }, "function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", @@ -2018,7 +2930,8 @@ "integrity": "sha512-xyVdAmcG8M3jWtVeadDUU6MAHLBrjkP4clz2UtTZ1gpe5bRLk27VjQOpzTwK20MkV/6iZQhSuRVuzHS5kD0HpA==", "dev": true, "requires": { - "pretty-format": "22.0.3" + "pretty-format": "22.0.3", + "weak": "1.0.1" } }, "jest-matcher-utils": { @@ -2540,6 +3453,13 @@ "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", "dev": true }, + "nan": { + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.8.0.tgz", + "integrity": "sha1-7XFfP+neArV6XmJS2QqWZ14fCFo=", + "dev": true, + "optional": true + }, "natural-compare": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", @@ -3203,6 +4123,7 @@ "anymatch": "1.3.2", "exec-sh": "0.2.1", "fb-watchman": "2.0.0", + "fsevents": "1.1.3", "minimatch": "3.0.4", "minimist": "1.2.0", "walker": "1.0.7", @@ -3836,6 +4757,17 @@ } } }, + "weak": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/weak/-/weak-1.0.1.tgz", + "integrity": "sha1-q5mqswcGlZqgIAy4z1RbucszuZ4=", + "dev": true, + "optional": true, + "requires": { + "bindings": "1.3.0", + "nan": "2.8.0" + } + }, "webidl-conversions": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-4.0.2.tgz", diff --git a/package.json b/package.json index d475282a..35b4fc64 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,8 @@ "build": "tsc -p .", "build-watch": "npm run build -- -w", "build-tests": "cd tests && ts-node ./build-tests.ts -p ./", - "prepublishOnly": "npm run build && rimraf dist/debug.*" + "prepublishOnly": "npm run build && rimraf dist/debug.*", + "travis-release": "node ./tools/travis-release/release.js" }, "author": "SimplrJS (https://github.com/simplrjs)", "contributors": [ diff --git a/tools/travis-release/release.js b/tools/travis-release/release.js new file mode 100644 index 00000000..f54637d7 --- /dev/null +++ b/tools/travis-release/release.js @@ -0,0 +1,46 @@ +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const fs = require("fs-extra"); +const path = require("path"); +const simplr_logger_1 = require("simplr-logger"); +const logger = new simplr_logger_1.LoggerBuilder(); +function Main() { + return __awaiter(this, void 0, void 0, function* () { + const travisTag = process.env["TRAVIS_TAG"]; + logger.Info("---- Travis-Release ----"); + logger.Info("TravisTag", travisTag); + if (travisTag == null) { + return undefined; + } + const packageJsonPath = path.join(process.cwd(), "./package.json"); + const packageJsonContents = yield fs.readJson(packageJsonPath); + const prereleaseTags = ["-alpha", "-beta", "-rc"]; + let isPrerelease = false; + for (const tag of prereleaseTags) { + if (packageJsonContents.version.indexOf(tag)) { + isPrerelease = true; + break; + } + } + if (!isPrerelease) { + return undefined; + } + // Pre-release + if (packageJsonContents.publishConfig == null) { + packageJsonContents.publishConfig = {}; + } + // Add tag next + packageJsonContents.publishConfig.tag = "next"; + yield fs.writeJson(packageJsonPath, packageJsonContents, { spaces: 4 }); + }); +} +Main(); +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmVsZWFzZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbInJlbGVhc2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7OztBQUFBLCtCQUErQjtBQUMvQiw2QkFBNkI7QUFDN0IsaURBQThDO0FBRTlDLE1BQU0sTUFBTSxHQUFHLElBQUksNkJBQWEsRUFBRSxDQUFDO0FBV25DOztRQUNJLE1BQU0sU0FBUyxHQUFHLE9BQU8sQ0FBQyxHQUFHLENBQUMsWUFBWSxDQUFDLENBQUM7UUFDNUMsTUFBTSxDQUFDLElBQUksQ0FBQywwQkFBMEIsQ0FBQyxDQUFDO1FBQ3hDLE1BQU0sQ0FBQyxJQUFJLENBQUMsV0FBVyxFQUFFLFNBQVMsQ0FBQyxDQUFDO1FBRXBDLEVBQUUsQ0FBQyxDQUFDLFNBQVMsSUFBSSxJQUFJLENBQUMsQ0FBQyxDQUFDO1lBQ3BCLE1BQU0sQ0FBQyxTQUFTLENBQUM7UUFDckIsQ0FBQztRQUVELE1BQU0sZUFBZSxHQUFHLElBQUksQ0FBQyxJQUFJLENBQUMsT0FBTyxDQUFDLEdBQUcsRUFBRSxFQUFFLGdCQUFnQixDQUFDLENBQUM7UUFDbkUsTUFBTSxtQkFBbUIsR0FBRyxNQUFNLEVBQUUsQ0FBQyxRQUFRLENBQUMsZUFBZSxDQUFnQixDQUFDO1FBRTlFLE1BQU0sY0FBYyxHQUFHLENBQUMsUUFBUSxFQUFFLE9BQU8sRUFBRSxLQUFLLENBQUMsQ0FBQztRQUVsRCxJQUFJLFlBQVksR0FBWSxLQUFLLENBQUM7UUFDbEMsR0FBRyxDQUFDLENBQUMsTUFBTSxHQUFHLElBQUksY0FBYyxDQUFDLENBQUMsQ0FBQztZQUMvQixFQUFFLENBQUMsQ0FBQyxtQkFBbUIsQ0FBQyxPQUFPLENBQUMsT0FBTyxDQUFDLEdBQUcsQ0FBQyxDQUFDLENBQUMsQ0FBQztnQkFDM0MsWUFBWSxHQUFHLElBQUksQ0FBQztnQkFDcEIsS0FBSyxDQUFDO1lBQ1YsQ0FBQztRQUNMLENBQUM7UUFFRCxFQUFFLENBQUMsQ0FBQyxDQUFDLFlBQVksQ0FBQyxDQUFDLENBQUM7WUFDaEIsTUFBTSxDQUFDLFNBQVMsQ0FBQztRQUNyQixDQUFDO1FBRUQsY0FBYztRQUNkLEVBQUUsQ0FBQyxDQUFDLG1CQUFtQixDQUFDLGFBQWEsSUFBSSxJQUFJLENBQUMsQ0FBQyxDQUFDO1lBQzVDLG1CQUFtQixDQUFDLGFBQWEsR0FBRyxFQUFFLENBQUM7UUFDM0MsQ0FBQztRQUVELGVBQWU7UUFDZixtQkFBbUIsQ0FBQyxhQUFhLENBQUMsR0FBRyxHQUFHLE1BQU0sQ0FBQztRQUMvQyxNQUFNLEVBQUUsQ0FBQyxTQUFTLENBQUMsZUFBZSxFQUFFLG1CQUFtQixFQUFFLEVBQUUsTUFBTSxFQUFFLENBQUMsRUFBRSxDQUFDLENBQUM7SUFDNUUsQ0FBQztDQUFBO0FBRUQsSUFBSSxFQUFFLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgKiBhcyBmcyBmcm9tIFwiZnMtZXh0cmFcIjtcclxuaW1wb3J0ICogYXMgcGF0aCBmcm9tIFwicGF0aFwiO1xyXG5pbXBvcnQgeyBMb2dnZXJCdWlsZGVyIH0gZnJvbSBcInNpbXBsci1sb2dnZXJcIjtcclxuXHJcbmNvbnN0IGxvZ2dlciA9IG5ldyBMb2dnZXJCdWlsZGVyKCk7XHJcblxyXG5pbnRlcmZhY2UgUGFja2FnZUpzb24ge1xyXG4gICAgdmVyc2lvbjogc3RyaW5nO1xyXG4gICAgcHVibGlzaENvbmZpZz86IHtcclxuICAgICAgICB0YWc/OiBzdHJpbmc7XHJcbiAgICAgICAgcmVnaXN0cnk/OiBzdHJpbmc7XHJcbiAgICAgICAgYWNjZXNzPzogc3RyaW5nO1xyXG4gICAgfTtcclxufVxyXG5cclxuYXN5bmMgZnVuY3Rpb24gTWFpbigpOiBQcm9taXNlPHZvaWQ+IHtcclxuICAgIGNvbnN0IHRyYXZpc1RhZyA9IHByb2Nlc3MuZW52W1wiVFJBVklTX1RBR1wiXTtcclxuICAgIGxvZ2dlci5JbmZvKFwiLS0tLSBUcmF2aXMtUmVsZWFzZSAtLS0tXCIpO1xyXG4gICAgbG9nZ2VyLkluZm8oXCJUcmF2aXNUYWdcIiwgdHJhdmlzVGFnKTtcclxuXHJcbiAgICBpZiAodHJhdmlzVGFnID09IG51bGwpIHtcclxuICAgICAgICByZXR1cm4gdW5kZWZpbmVkO1xyXG4gICAgfVxyXG5cclxuICAgIGNvbnN0IHBhY2thZ2VKc29uUGF0aCA9IHBhdGguam9pbihwcm9jZXNzLmN3ZCgpLCBcIi4vcGFja2FnZS5qc29uXCIpO1xyXG4gICAgY29uc3QgcGFja2FnZUpzb25Db250ZW50cyA9IGF3YWl0IGZzLnJlYWRKc29uKHBhY2thZ2VKc29uUGF0aCkgYXMgUGFja2FnZUpzb247XHJcblxyXG4gICAgY29uc3QgcHJlcmVsZWFzZVRhZ3MgPSBbXCItYWxwaGFcIiwgXCItYmV0YVwiLCBcIi1yY1wiXTtcclxuXHJcbiAgICBsZXQgaXNQcmVyZWxlYXNlOiBib29sZWFuID0gZmFsc2U7XHJcbiAgICBmb3IgKGNvbnN0IHRhZyBvZiBwcmVyZWxlYXNlVGFncykge1xyXG4gICAgICAgIGlmIChwYWNrYWdlSnNvbkNvbnRlbnRzLnZlcnNpb24uaW5kZXhPZih0YWcpKSB7XHJcbiAgICAgICAgICAgIGlzUHJlcmVsZWFzZSA9IHRydWU7XHJcbiAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgIH1cclxuICAgIH1cclxuXHJcbiAgICBpZiAoIWlzUHJlcmVsZWFzZSkge1xyXG4gICAgICAgIHJldHVybiB1bmRlZmluZWQ7XHJcbiAgICB9XHJcblxyXG4gICAgLy8gUHJlLXJlbGVhc2VcclxuICAgIGlmIChwYWNrYWdlSnNvbkNvbnRlbnRzLnB1Ymxpc2hDb25maWcgPT0gbnVsbCkge1xyXG4gICAgICAgIHBhY2thZ2VKc29uQ29udGVudHMucHVibGlzaENvbmZpZyA9IHt9O1xyXG4gICAgfVxyXG5cclxuICAgIC8vIEFkZCB0YWcgbmV4dFxyXG4gICAgcGFja2FnZUpzb25Db250ZW50cy5wdWJsaXNoQ29uZmlnLnRhZyA9IFwibmV4dFwiO1xyXG4gICAgYXdhaXQgZnMud3JpdGVKc29uKHBhY2thZ2VKc29uUGF0aCwgcGFja2FnZUpzb25Db250ZW50cywgeyBzcGFjZXM6IDQgfSk7XHJcbn1cclxuXHJcbk1haW4oKTtcclxuIl19 \ No newline at end of file diff --git a/tools/travis-release/release.ts b/tools/travis-release/release.ts new file mode 100644 index 00000000..b7d2a2c1 --- /dev/null +++ b/tools/travis-release/release.ts @@ -0,0 +1,52 @@ +import * as fs from "fs-extra"; +import * as path from "path"; +import { LoggerBuilder } from "simplr-logger"; + +const logger = new LoggerBuilder(); + +interface PackageJson { + version: string; + publishConfig?: { + tag?: string; + registry?: string; + access?: string; + }; +} + +async function Main(): Promise { + const travisTag = process.env["TRAVIS_TAG"]; + logger.Info("---- Travis-Release ----"); + logger.Info("TravisTag", travisTag); + + if (travisTag == null) { + return undefined; + } + + const packageJsonPath = path.join(process.cwd(), "./package.json"); + const packageJsonContents = await fs.readJson(packageJsonPath) as PackageJson; + + const prereleaseTags = ["-alpha", "-beta", "-rc"]; + + let isPrerelease: boolean = false; + for (const tag of prereleaseTags) { + if (packageJsonContents.version.indexOf(tag)) { + isPrerelease = true; + break; + } + } + + if (!isPrerelease) { + return undefined; + } + + // Pre-release + if (packageJsonContents.publishConfig == null) { + packageJsonContents.publishConfig = {}; + } + + // Add tag next + packageJsonContents.publishConfig.tag = "next"; + await fs.writeJson(packageJsonPath, packageJsonContents, { spaces: 4 }); +} + +Main(); diff --git a/tools/travis-release/tsconfig.json b/tools/travis-release/tsconfig.json new file mode 100644 index 00000000..5975c761 --- /dev/null +++ b/tools/travis-release/tsconfig.json @@ -0,0 +1,31 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "removeComments": false, + "noUnusedLocals": true, + "inlineSourceMap": true, + "inlineSources": true, + "skipDefaultLibCheck": true, + "pretty": true, + "strict": true, + "forceConsistentCasingInFileNames": true, + "lib": [ + "es6", + "es2017.object" + ], + "types": [ + "node" + ], + "typeRoots": [ + "./node_modules/@types" + ] + }, + "exclude": [ + "node_modules", + "dist", + "@types", + "tests", + "examples" + ] +} diff --git a/tsconfig.json b/tsconfig.json index 70b6f3df..89af2b31 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -29,6 +29,7 @@ "dist", "@types", "tests", - "examples" + "examples", + "tools" ] }