diff --git a/packages/ts-docs-gen/examples/simple/docs/api/index.md b/packages/ts-docs-gen/examples/simple/docs/api/index.md index b028f9f1..a4736fe9 100644 --- a/packages/ts-docs-gen/examples/simple/docs/api/index.md +++ b/packages/ts-docs-gen/examples/simple/docs/api/index.md @@ -1,22 +1,5 @@ -[ModuleDeclaration-0]: index\foonamespace.md#foonamespace +[ClassDeclaration-0]: index/hello.md#hello # index -## MyFunction() - -```typescript -function MyFunction(): T -``` - -### Type parameters - -| Name | Constraint type | Default type | -| ---- | -------------------------------------------------------------- | ------------------------- | -| T | \{ myProperty: string; myPropertyTwo?: number \| undefined; \} | \{ myProperty: string; \} | - -### Return type - -T - - -## [FooNamespace][ModuleDeclaration-0] +## [Hello][ClassDeclaration-0] diff --git a/packages/ts-docs-gen/examples/simple/docs/api/index/hello.md b/packages/ts-docs-gen/examples/simple/docs/api/index/hello.md new file mode 100644 index 00000000..cc6438ea --- /dev/null +++ b/packages/ts-docs-gen/examples/simple/docs/api/index/hello.md @@ -0,0 +1,71 @@ +# Hello + +```typescript +class Hello +``` +## Constructor + +### constructor(arg) + +This is a constructor + +```typescript +constructor(arg: string) +``` +#### Parameters + +| Name | Type | Description | +| ---- | ------ | ---------------------- | +| arg | string | This is an argument ;) | + + +## Methods + +### GetFoo(arg) + +```typescript +public GetFoo(arg: number): string +``` +#### Parameters + +| Name | Type | +| ---- | ------ | +| arg | number | + + +### GetFoo(arg) + +```typescript +public GetFoo(arg: string): string +``` +#### Parameters + +| Name | Type | +| ---- | ------ | +| arg | string | + + +### GetFoo(arg) + +```typescript +public GetFoo(arg: string | number): string +``` +#### Parameters + +| Name | Type | +| ---- | ---------------- | +| arg | string \| number | + + +## Properties + +### Foo + +```typescript +public Foo: string; +``` + +### Type + +string + diff --git a/packages/ts-docs-gen/examples/simple/index.ts b/packages/ts-docs-gen/examples/simple/index.ts index e01fe1db..724fafda 100644 --- a/packages/ts-docs-gen/examples/simple/index.ts +++ b/packages/ts-docs-gen/examples/simple/index.ts @@ -79,11 +79,11 @@ // anotherProperty: number; // } -export function MyFunction(): T { - return { - myProperty: "sampleString" - } as T; -} +// export function MyFunction(): T { +// return { +// myProperty: "sampleString" +// } as T; +// } // export interface MyInterface { // (param1: TValue, param2: TValue): boolean; @@ -203,10 +203,26 @@ export function MyFunction { IsPluginResultExists: IsPluginResultExistsHandler; } -export interface PluginResult { - Reference: ApiItemReference; - ApiItem: TKind; +export interface PluginResultData { /** * All headings used in `Result` with ApiItemIds. */ @@ -47,6 +45,11 @@ export interface PluginResult { Members?: PluginMember[]; } +export interface PluginResult extends PluginResultData { + Reference: ApiItemReference; + ApiItem: TKind; +} + export interface Plugin { SupportedApiItemKinds(): SupportedApiItemKindType[]; CheckApiItem(item: TKind): boolean; diff --git a/packages/ts-docs-gen/src/default-plugins.ts b/packages/ts-docs-gen/src/default-plugins.ts index d7541d65..cf90c6a7 100644 --- a/packages/ts-docs-gen/src/default-plugins.ts +++ b/packages/ts-docs-gen/src/default-plugins.ts @@ -4,6 +4,10 @@ import { ApiEnumPlugin } from "./plugins/api-enum-plugin"; import { ApiFunctionPlugin } from "./plugins/api-function-plugin"; import { ApiTypePlugin } from "./plugins/api-type-plugin"; import { ApiNamespacePlugin } from "./plugins/api-namespace-plugin"; +import { ApiClassPlugin } from "./plugins/api-class-plugin"; +import { ApiClassConstructorPlugin } from "./plugins/api-class-constructor-plugin"; +import { ApiClassMethodPlugin } from "./plugins/api-class-method-plugin"; +import { ApiClassPropertyPlugin } from "./plugins/api-class-property-plugin"; export const DefaultPlugins = [ new ApiSourceFilePlugin(), @@ -11,5 +15,9 @@ export const DefaultPlugins = [ new ApiEnumPlugin(), new ApiFunctionPlugin(), new ApiTypePlugin(), - new ApiNamespacePlugin() + new ApiNamespacePlugin(), + new ApiClassPlugin(), + new ApiClassConstructorPlugin(), + new ApiClassMethodPlugin(), + new ApiClassPropertyPlugin() ]; diff --git a/packages/ts-docs-gen/src/generator-helpers.ts b/packages/ts-docs-gen/src/generator-helpers.ts index 53eb754d..8b018276 100644 --- a/packages/ts-docs-gen/src/generator-helpers.ts +++ b/packages/ts-docs-gen/src/generator-helpers.ts @@ -4,7 +4,7 @@ import { MarkdownGenerator, MarkdownBuilder, Contracts as MarkdownContracts } fr import * as path from "path"; import { ApiItemReference } from "./contracts/api-item-reference"; -import { ApiItemKindsAdditional } from "./contracts/plugin"; +import { ApiItemKindsAdditional, PluginResultData } from "./contracts/plugin"; import { Logger } from "./utils/logger"; export namespace GeneratorHelpers { @@ -306,6 +306,43 @@ export namespace GeneratorHelpers { return `${apiItem.Name}${$extends}${defaultType}`; } + export function ClassToString( + apiItem: Contracts.ApiClassDto, + typeParameters?: Contracts.ApiTypeParameterDto[], + alias?: string + ): string { + const name = alias || apiItem.Name; + // Abstract + const abstract = apiItem.IsAbstract ? "abstract " : ""; + + // TypeParameters + let typeParametersString: string; + if (typeParameters != null && typeParameters.length > 0) { + const params: string[] = typeParameters.map(TypeParameterToString); + typeParametersString = `<${params.join(", ")}>`; + } else { + typeParametersString = ""; + } + + // Extends + let extendsString: string; + if (apiItem.Extends != null) { + extendsString = ` extends ${apiItem.Extends.Text}`; + } else { + extendsString = ""; + } + + // Implements + let implementsString: string; + if (apiItem.Implements != null && apiItem.Implements.length > 0) { + implementsString = ` implements ${apiItem.Implements.map(x => x.Text).join(", ")}`; + } else { + implementsString = ""; + } + + return `${abstract}class ${name}${typeParametersString}${extendsString}${implementsString}`; + } + export function ApiFunctionToSimpleString( alias: string, apiItem: Contracts.ApiFunctionDto, @@ -319,6 +356,66 @@ export namespace GeneratorHelpers { return `${name}(${parametersString})`; } + export function ApiClassMethodToString( + apiItem: Contracts.ApiClassMethodDto, + parameters: Contracts.ApiParameterDto[], + alias?: string + ): string { + const name = alias || apiItem.Name; + + const optional = apiItem.IsOptional ? "?" : ""; + const abstract = apiItem.IsAbstract ? " abstract" : ""; + const async = apiItem.IsAsync ? " async" : ""; + const $static = apiItem.IsStatic ? " static" : ""; + const functionHeader = CallableParametersToString(`${name}${optional}`, parameters, apiItem.ReturnType); + + return `${apiItem.AccessModifier}${$static}${abstract}${async} ${functionHeader}`.trim(); + } + + export function ApiClassPropertyToString(apiItem: Contracts.ApiClassPropertyDto, alias?: string): string { + const name = alias || apiItem.Name; + + const optional = apiItem.IsOptional ? "?" : ""; + const abstract = apiItem.IsAbstract ? " abstract" : ""; + const $static = apiItem.IsStatic ? " static" : ""; + + return `${apiItem.AccessModifier}${$static}${abstract} ${name}${optional}: ${apiItem.Type.Text};`; + } + + export function CallableParametersToSimpleString(text: string, parameters: Contracts.ApiParameterDto[]): string { + const parametersString = parameters + .map(x => x.Name) + .join(", "); + + return `${text}(${parametersString})`; + } + + export function CallableParametersToString( + text: string, + parameters: Contracts.ApiParameterDto[], + returnType?: Contracts.TypeDto + ): string { + // Parameters + let parametersString: string; + if (parameters != null && parameters.length > 0) { + parametersString = parameters + .map(x => `${x.Name}: ${x.Type.Text}`) + .join(", "); + } else { + parametersString = ""; + } + + // ReturnType + let returnTypeString: string; + if (returnType != null) { + returnTypeString = `: ${returnType.Text}`; + } else { + returnTypeString = ""; + } + + return `${text}(${parametersString})${returnTypeString}`; + } + export function GetApiItemsFromReference( items: Contracts.ApiItemReference[], extractedData: ExtractDto @@ -344,4 +441,21 @@ export namespace GeneratorHelpers { export function StandardisePath(pathString: string): string { return pathString.split(path.sep).join("/"); } + + export function MergePluginResultData(a: T, b: Partial): T { + a.Headings = a.Headings.concat(b.Headings || []); + a.Members = (a.Members || []).concat(b.Members || []); + a.Result = a.Result.concat(b.Result || []); + a.UsedReferences = a.UsedReferences.concat(b.UsedReferences || []); + + return a; + } + + export function GetDefaultPluginResultData(): PluginResultData { + return { + Headings: [], + Result: [], + UsedReferences: [] + }; + } } diff --git a/packages/ts-docs-gen/src/plugins/api-class-constructor-plugin.ts b/packages/ts-docs-gen/src/plugins/api-class-constructor-plugin.ts new file mode 100644 index 00000000..8d432fe0 --- /dev/null +++ b/packages/ts-docs-gen/src/plugins/api-class-constructor-plugin.ts @@ -0,0 +1,73 @@ +import { Contracts } from "ts-extractor"; +import { MarkdownBuilder, MarkdownGenerator } from "@simplrjs/markdown"; +import { Plugin, SupportedApiItemKindType, PluginOptions, PluginResult, PluginResultData } from "../contracts/plugin"; +import { GeneratorHelpers } from "../generator-helpers"; + +export class ApiClassConstructorPlugin implements Plugin { + public SupportedApiItemKinds(): SupportedApiItemKindType[] { + return [GeneratorHelpers.ApiItemKinds.ClassConstructor]; + } + + public CheckApiItem(item: Contracts.ApiItemDto): boolean { + return true; + } + + private renderParameters(parameters: Contracts.ApiParameterDto[]): PluginResultData { + const pluginResult = GeneratorHelpers.GetDefaultPluginResultData(); + if (parameters.length === 0) { + return pluginResult; + } + + let referenceIds: string[] = []; + const header = ["Name", "Type", "Description"]; + + const content = parameters.map(parameter => { + const parameterTypeDto = GeneratorHelpers.TypeDtoToMarkdownString(parameter.Type); + + referenceIds = referenceIds.concat(parameterTypeDto.References); + + return [parameter.Name, MarkdownGenerator.EscapeString(parameterTypeDto.Text), parameter.Metadata.DocumentationComment]; + }); + + const builder = new MarkdownBuilder() + .Header("Parameters", 4) + .EmptyLine() + .Table(header, content, GeneratorHelpers.DEFAULT_TABLE_OPTIONS) + .EmptyLine(); + + pluginResult.UsedReferences = referenceIds; + pluginResult.Result = builder.GetOutput(); + + return pluginResult; + } + + public Render(options: PluginOptions): PluginResult { + const pluginResult = GeneratorHelpers.GetDefaultPluginResultData(); + const builder = new MarkdownBuilder(); + + // Parameters + const apiParameters = GeneratorHelpers + .GetApiItemsFromReference(options.ApiItem.Parameters, options.ExtractedData); + const parameters = this.renderParameters(apiParameters); + + const heading = GeneratorHelpers.CallableParametersToSimpleString("constructor", apiParameters); + + pluginResult.Headings.push({ ApiItemId: options.Reference.Id, Heading: heading }); + + builder + .Header(heading, 3) + .EmptyLine() + .Text(GeneratorHelpers.RenderApiItemMetadata(options.ApiItem)) + .Code(GeneratorHelpers.CallableParametersToString("constructor", apiParameters), GeneratorHelpers.DEFAULT_CODE_OPTIONS) + .Text(parameters.Result); + + GeneratorHelpers.MergePluginResultData(pluginResult, parameters); + pluginResult.Result = builder.GetOutput(); + + return { + ApiItem: options.ApiItem, + Reference: options.Reference, + ...pluginResult + }; + } +} diff --git a/packages/ts-docs-gen/src/plugins/api-class-method-plugin.ts b/packages/ts-docs-gen/src/plugins/api-class-method-plugin.ts new file mode 100644 index 00000000..3f12685b --- /dev/null +++ b/packages/ts-docs-gen/src/plugins/api-class-method-plugin.ts @@ -0,0 +1,77 @@ +import { Contracts } from "ts-extractor"; +import { MarkdownBuilder, MarkdownGenerator } from "@simplrjs/markdown"; +import { Plugin, SupportedApiItemKindType, PluginOptions, PluginResult, PluginResultData } from "../contracts/plugin"; +import { GeneratorHelpers } from "../generator-helpers"; + +export class ApiClassMethodPlugin implements Plugin { + public SupportedApiItemKinds(): SupportedApiItemKindType[] { + return [GeneratorHelpers.ApiItemKinds.ClassMethod]; + } + + public CheckApiItem(item: Contracts.ApiItemDto): boolean { + return true; + } + + private renderParameters(parameters: Contracts.ApiParameterDto[]): PluginResultData { + const pluginResult = GeneratorHelpers.GetDefaultPluginResultData(); + if (parameters.length === 0) { + return pluginResult; + } + + let referenceIds: string[] = []; + const header = ["Name", "Type", "Description"]; + + const content = parameters.map(parameter => { + const parameterTypeDto = GeneratorHelpers.TypeDtoToMarkdownString(parameter.Type); + + referenceIds = referenceIds.concat(parameterTypeDto.References); + + return [parameter.Name, MarkdownGenerator.EscapeString(parameterTypeDto.Text), parameter.Metadata.DocumentationComment]; + }); + + const builder = new MarkdownBuilder() + .Header("Parameters", 4) + .EmptyLine() + .Table(header, content, GeneratorHelpers.DEFAULT_TABLE_OPTIONS) + .EmptyLine(); + + pluginResult.UsedReferences = referenceIds; + pluginResult.Result = builder.GetOutput(); + + return pluginResult; + } + + public Render(options: PluginOptions): PluginResult { + const pluginResult = GeneratorHelpers.GetDefaultPluginResultData(); + const builder = new MarkdownBuilder(); + + // Parameters + const apiParameters = GeneratorHelpers + .GetApiItemsFromReference(options.ApiItem.Parameters, options.ExtractedData); + const parameters = this.renderParameters(apiParameters); + + const heading = GeneratorHelpers.CallableParametersToSimpleString(options.Reference.Alias, apiParameters); + + pluginResult.Headings.push({ ApiItemId: options.Reference.Id, Heading: heading }); + + builder + .Header(heading, 3) + .EmptyLine() + .Text(GeneratorHelpers.RenderApiItemMetadata(options.ApiItem)) + .Code(GeneratorHelpers.ApiClassMethodToString( + options.ApiItem, + apiParameters, + options.Reference.Alias + ), GeneratorHelpers.DEFAULT_CODE_OPTIONS) + .Text(parameters.Result); + + GeneratorHelpers.MergePluginResultData(pluginResult, parameters); + pluginResult.Result = builder.GetOutput(); + + return { + ApiItem: options.ApiItem, + Reference: options.Reference, + ...pluginResult + }; + } +} diff --git a/packages/ts-docs-gen/src/plugins/api-class-plugin.ts b/packages/ts-docs-gen/src/plugins/api-class-plugin.ts new file mode 100644 index 00000000..f69311c3 --- /dev/null +++ b/packages/ts-docs-gen/src/plugins/api-class-plugin.ts @@ -0,0 +1,93 @@ +import { Contracts } from "ts-extractor"; +import { MarkdownBuilder } from "@simplrjs/markdown"; +import * as path from "path"; + +import { GeneratorHelpers } from "../generator-helpers"; +import { + Plugin, + SupportedApiItemKindType, + PluginOptions, + PluginResult, + PluginResultData +} from "../contracts/plugin"; + +export class ApiClassPlugin implements Plugin { + public SupportedApiItemKinds(): SupportedApiItemKindType[] { + return [GeneratorHelpers.ApiItemKinds.Class]; + } + + public CheckApiItem(item: Contracts.ApiItemDto): boolean { + return true; + } + + private renderMembers(data: PluginOptions): PluginResultData { + const references = GeneratorHelpers.GetApiItemReferences(data.ExtractedData, data.ApiItem.Members); + const renderedItems = references.map(x => data.GetItemPluginResult(x)); + const pluginResultData = GeneratorHelpers.GetDefaultPluginResultData(); + const builder = new MarkdownBuilder(); + + const list: Array<[Contracts.ApiItemKinds, string]> = [ + [Contracts.ApiItemKinds.Index, "Index"], + [Contracts.ApiItemKinds.ClassConstructor, "Constructor"], + [Contracts.ApiItemKinds.ClassMethod, "Methods"], + [Contracts.ApiItemKinds.ClassProperty, "Properties"] + ]; + + for (const [kind, heading] of list) { + const pluginResultsByKind = renderedItems.filter(x => x.ApiItem.ApiKind === kind); + + if (pluginResultsByKind.length > 0) { + builder + .Header(heading, 2) + .EmptyLine(); + + for (const item of pluginResultsByKind) { + GeneratorHelpers.MergePluginResultData(pluginResultData, item); + + builder + .Text(item.Result) + .EmptyLine(); + } + } + } + + pluginResultData.Result = builder.GetOutput(); + return pluginResultData; + } + + public Render(data: PluginOptions): PluginResult { + const typeParameters = GeneratorHelpers + .GetApiItemsFromReference(data.ApiItem.TypeParameters, data.ExtractedData); + + const pluginResult: PluginResult = { + ApiItem: data.ApiItem, + Reference: data.Reference, + ...GeneratorHelpers.GetDefaultPluginResultData() + }; + const heading = path.basename(data.ApiItem.Name, path.extname(data.ApiItem.Name)); + pluginResult.Headings = [ + { + Heading: heading, + ApiItemId: data.Reference.Id + } + ]; + + // Header + const builder = new MarkdownBuilder() + .Header(heading, 1) + .EmptyLine() + .Text(GeneratorHelpers.RenderApiItemMetadata(data.ApiItem)) + .Code(GeneratorHelpers.ClassToString( + data.ApiItem, + typeParameters, + data.Reference.Alias + ), GeneratorHelpers.DEFAULT_CODE_OPTIONS); + pluginResult.Result = builder.GetOutput(); + + // ApiMembers + const members = this.renderMembers(data); + GeneratorHelpers.MergePluginResultData(pluginResult, members); + + return pluginResult; + } +} diff --git a/packages/ts-docs-gen/src/plugins/api-class-property-plugin.ts b/packages/ts-docs-gen/src/plugins/api-class-property-plugin.ts new file mode 100644 index 00000000..1df3b160 --- /dev/null +++ b/packages/ts-docs-gen/src/plugins/api-class-property-plugin.ts @@ -0,0 +1,46 @@ +import { Contracts } from "ts-extractor"; +import { MarkdownBuilder } from "@simplrjs/markdown"; +import { Plugin, SupportedApiItemKindType, PluginOptions, PluginResult } from "../contracts/plugin"; +import { GeneratorHelpers } from "../generator-helpers"; + +export class ApiClassPropertyPlugin implements Plugin { + public SupportedApiItemKinds(): SupportedApiItemKindType[] { + return [GeneratorHelpers.ApiItemKinds.ClassProperty]; + } + + public CheckApiItem(item: Contracts.ApiItemDto): boolean { + return true; + } + + public Render(options: PluginOptions): PluginResult { + const pluginResultData = GeneratorHelpers.GetDefaultPluginResultData(); + const builder = new MarkdownBuilder(); + + const heading = options.Reference.Alias; + pluginResultData.Headings.push({ ApiItemId: options.Reference.Id, Heading: heading }); + + const typeStringDto = GeneratorHelpers.TypeDtoToMarkdownString(options.ApiItem.Type); + pluginResultData.UsedReferences = pluginResultData.UsedReferences.concat(typeStringDto.References); + + builder + .Header(heading, 3) + .EmptyLine() + .Text(GeneratorHelpers.RenderApiItemMetadata(options.ApiItem)) + .Code(GeneratorHelpers.ApiClassPropertyToString( + options.ApiItem, + options.Reference.Alias + ), GeneratorHelpers.DEFAULT_CODE_OPTIONS) + .EmptyLine() + .Header("Type", 3) + .EmptyLine() + .Text(typeStringDto.Text); + + pluginResultData.Result = builder.GetOutput(); + + return { + ApiItem: options.ApiItem, + Reference: options.Reference, + ...pluginResultData + }; + } +} diff --git a/packages/ts-docs-gen/tests/cases/__tests__/__snapshots__/simple-project-1.test.ts.snap b/packages/ts-docs-gen/tests/cases/__tests__/__snapshots__/simple-project-1.test.ts.snap index 53bab2b8..3af0b655 100644 --- a/packages/ts-docs-gen/tests/cases/__tests__/__snapshots__/simple-project-1.test.ts.snap +++ b/packages/ts-docs-gen/tests/cases/__tests__/__snapshots__/simple-project-1.test.ts.snap @@ -5,11 +5,11 @@ Array [ Object { "FileLocation": "index.md", "Result": Array [ - "[ClassDeclaration-0]: index/foo.md#class-foo", - "[ClassDeclaration-1]: index/world.md#class-world", - "[ClassDeclaration-2]: index/earth.md#class-earth", - "[ClassDeclaration-2]: index/earth.md#class-earth", - "[ClassDeclaration-1]: index/world.md#class-world", + "[ClassDeclaration-0]: index/foo.md#foo", + "[ClassDeclaration-1]: index/world.md#world", + "[ClassDeclaration-2]: index/earth.md#earth", + "[ClassDeclaration-2]: index/earth.md#earth", + "[ClassDeclaration-1]: index/world.md#world", "# index", "", "## EnumList", @@ -364,21 +364,47 @@ Array [ Object { "FileLocation": "index/foo.md", "Result": Array [ - "## class: Foo", + "# Foo", + "", + "\`\`\`typescript", + "class Foo", + "\`\`\`", + "## Methods", + "", + "### HandleMessage(message)", + "", + "\`\`\`typescript", + "public HandleMessage(message: string): string", + "\`\`\`", + "#### Parameters", + "", + "| Name | Type |", + "| ------- | ------ |", + "| message | string |", + "", + "", "", ], }, Object { "FileLocation": "index/world.md", "Result": Array [ - "## class: World", + "# World", + "", + "\`\`\`typescript", + "class World", + "\`\`\`", "", ], }, Object { "FileLocation": "index/earth.md", "Result": Array [ - "## class: Earth", + "# Earth", + "", + "\`\`\`typescript", + "class Earth", + "\`\`\`", "", ], }, diff --git a/packages/ts-docs-gen/tests/cases/__tests__/__snapshots__/simple-project-2.test.ts.snap b/packages/ts-docs-gen/tests/cases/__tests__/__snapshots__/simple-project-2.test.ts.snap index 64b34875..8897f5c1 100644 --- a/packages/ts-docs-gen/tests/cases/__tests__/__snapshots__/simple-project-2.test.ts.snap +++ b/packages/ts-docs-gen/tests/cases/__tests__/__snapshots__/simple-project-2.test.ts.snap @@ -5,8 +5,8 @@ Array [ Object { "FileLocation": "index.md", "Result": Array [ - "[ClassDeclaration-0]: index/foo.md#class-foo", - "[ClassDeclaration-1]: index/foostart.md#class-foostart", + "[ClassDeclaration-0]: index/foo.md#foo", + "[ClassDeclaration-1]: index/foostart.md#foostart", "# index", "", "## [Foo][ClassDeclaration-0]", @@ -19,21 +19,57 @@ Array [ Object { "FileLocation": "index/foo.md", "Result": Array [ - "## class: Foo", + "# Foo", + "", + "\`\`\`typescript", + "class Foo", + "\`\`\`", + "## Methods", + "", + "### GetMessage(message)", + "", + "\`\`\`typescript", + "public GetMessage(message: string): string", + "\`\`\`", + "#### Parameters", + "", + "| Name | Type |", + "| ------- | ------ |", + "| message | string |", + "", + "", "", ], }, Object { "FileLocation": "index/foostart.md", "Result": Array [ - "## class: FooStart", + "# FooStart", + "", + "\`\`\`typescript", + "class FooStart", + "\`\`\`", + "## Methods", + "", + "### HandleMessage(message)", + "", + "\`\`\`typescript", + "public HandleMessage(message: string): string", + "\`\`\`", + "#### Parameters", + "", + "| Name | Type |", + "| ------- | ------ |", + "| message | string |", + "", + "", "", ], }, Object { "FileLocation": "foo.md", "Result": Array [ - "[ClassDeclaration-0]: index/foo.md#class-foo", + "[ClassDeclaration-0]: index/foo.md#foo", "# foo", "", "## [Foo][ClassDeclaration-0]",