@microsoft/api-documenter 7.28.8 → 7.29.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.json +41 -0
- package/CHANGELOG.md +13 -1
- package/bin/api-documenter +1 -1
- package/dist/tsdoc-metadata.json +1 -1
- package/lib-esm/cli/ApiDocumenterCommandLine.js +22 -0
- package/lib-esm/cli/ApiDocumenterCommandLine.js.map +1 -0
- package/lib-esm/cli/BaseAction.js +93 -0
- package/lib-esm/cli/BaseAction.js.map +1 -0
- package/lib-esm/cli/GenerateAction.js +45 -0
- package/lib-esm/cli/GenerateAction.js.map +1 -0
- package/lib-esm/cli/MarkdownAction.js +24 -0
- package/lib-esm/cli/MarkdownAction.js.map +1 -0
- package/lib-esm/cli/YamlAction.js +43 -0
- package/lib-esm/cli/YamlAction.js.map +1 -0
- package/lib-esm/documenters/DocumenterConfig.js +43 -0
- package/lib-esm/documenters/DocumenterConfig.js.map +1 -0
- package/lib-esm/documenters/ExperimentalYamlDocumenter.js +136 -0
- package/lib-esm/documenters/ExperimentalYamlDocumenter.js.map +1 -0
- package/lib-esm/documenters/IConfigFile.js +4 -0
- package/lib-esm/documenters/IConfigFile.js.map +1 -0
- package/lib-esm/documenters/MarkdownDocumenter.js +987 -0
- package/lib-esm/documenters/MarkdownDocumenter.js.map +1 -0
- package/lib-esm/documenters/OfficeYamlDocumenter.js +101 -0
- package/lib-esm/documenters/OfficeYamlDocumenter.js.map +1 -0
- package/lib-esm/documenters/YamlDocumenter.js +804 -0
- package/lib-esm/documenters/YamlDocumenter.js.map +1 -0
- package/lib-esm/index.js +6 -0
- package/lib-esm/index.js.map +1 -0
- package/lib-esm/markdown/CustomMarkdownEmitter.js +146 -0
- package/lib-esm/markdown/CustomMarkdownEmitter.js.map +1 -0
- package/lib-esm/markdown/MarkdownEmitter.js +190 -0
- package/lib-esm/markdown/MarkdownEmitter.js.map +1 -0
- package/lib-esm/nodes/CustomDocNodeKind.js +51 -0
- package/lib-esm/nodes/CustomDocNodeKind.js.map +1 -0
- package/lib-esm/nodes/DocEmphasisSpan.js +20 -0
- package/lib-esm/nodes/DocEmphasisSpan.js.map +1 -0
- package/lib-esm/nodes/DocHeading.js +26 -0
- package/lib-esm/nodes/DocHeading.js.map +1 -0
- package/lib-esm/nodes/DocNoteBox.js +22 -0
- package/lib-esm/nodes/DocNoteBox.js.map +1 -0
- package/lib-esm/nodes/DocTable.js +56 -0
- package/lib-esm/nodes/DocTable.js.map +1 -0
- package/lib-esm/nodes/DocTableCell.js +18 -0
- package/lib-esm/nodes/DocTableCell.js.map +1 -0
- package/lib-esm/nodes/DocTableRow.js +47 -0
- package/lib-esm/nodes/DocTableRow.js.map +1 -0
- package/lib-esm/plugin/IApiDocumenterPluginManifest.js +4 -0
- package/lib-esm/plugin/IApiDocumenterPluginManifest.js.map +1 -0
- package/lib-esm/plugin/MarkdownDocumenterAccessor.js +26 -0
- package/lib-esm/plugin/MarkdownDocumenterAccessor.js.map +1 -0
- package/lib-esm/plugin/MarkdownDocumenterFeature.js +47 -0
- package/lib-esm/plugin/MarkdownDocumenterFeature.js.map +1 -0
- package/lib-esm/plugin/PluginFeature.js +54 -0
- package/lib-esm/plugin/PluginFeature.js.map +1 -0
- package/lib-esm/plugin/PluginLoader.js +78 -0
- package/lib-esm/plugin/PluginLoader.js.map +1 -0
- package/lib-esm/schemas/api-documenter-template.json +99 -0
- package/lib-esm/schemas/api-documenter.schema.json +47 -0
- package/lib-esm/start.js +12 -0
- package/lib-esm/start.js.map +1 -0
- package/lib-esm/utils/IndentedWriter.js +235 -0
- package/lib-esm/utils/IndentedWriter.js.map +1 -0
- package/lib-esm/utils/ToSdpConvertHelper.js +338 -0
- package/lib-esm/utils/ToSdpConvertHelper.js.map +1 -0
- package/lib-esm/utils/Utilities.js +24 -0
- package/lib-esm/utils/Utilities.js.map +1 -0
- package/lib-esm/yaml/ISDPYamlFile.js +4 -0
- package/lib-esm/yaml/ISDPYamlFile.js.map +1 -0
- package/lib-esm/yaml/IYamlApiFile.js +4 -0
- package/lib-esm/yaml/IYamlApiFile.js.map +1 -0
- package/lib-esm/yaml/IYamlTocFile.js +4 -0
- package/lib-esm/yaml/IYamlTocFile.js.map +1 -0
- package/lib-esm/yaml/typescript.schema.json +643 -0
- package/package.json +35 -9
- /package/{lib → lib-commonjs}/cli/ApiDocumenterCommandLine.js +0 -0
- /package/{lib → lib-commonjs}/cli/ApiDocumenterCommandLine.js.map +0 -0
- /package/{lib → lib-commonjs}/cli/BaseAction.js +0 -0
- /package/{lib → lib-commonjs}/cli/BaseAction.js.map +0 -0
- /package/{lib → lib-commonjs}/cli/GenerateAction.js +0 -0
- /package/{lib → lib-commonjs}/cli/GenerateAction.js.map +0 -0
- /package/{lib → lib-commonjs}/cli/MarkdownAction.js +0 -0
- /package/{lib → lib-commonjs}/cli/MarkdownAction.js.map +0 -0
- /package/{lib → lib-commonjs}/cli/YamlAction.js +0 -0
- /package/{lib → lib-commonjs}/cli/YamlAction.js.map +0 -0
- /package/{lib → lib-commonjs}/documenters/DocumenterConfig.js +0 -0
- /package/{lib → lib-commonjs}/documenters/DocumenterConfig.js.map +0 -0
- /package/{lib → lib-commonjs}/documenters/ExperimentalYamlDocumenter.js +0 -0
- /package/{lib → lib-commonjs}/documenters/ExperimentalYamlDocumenter.js.map +0 -0
- /package/{lib → lib-commonjs}/documenters/IConfigFile.js +0 -0
- /package/{lib → lib-commonjs}/documenters/IConfigFile.js.map +0 -0
- /package/{lib → lib-commonjs}/documenters/MarkdownDocumenter.js +0 -0
- /package/{lib → lib-commonjs}/documenters/MarkdownDocumenter.js.map +0 -0
- /package/{lib → lib-commonjs}/documenters/OfficeYamlDocumenter.js +0 -0
- /package/{lib → lib-commonjs}/documenters/OfficeYamlDocumenter.js.map +0 -0
- /package/{lib → lib-commonjs}/documenters/YamlDocumenter.js +0 -0
- /package/{lib → lib-commonjs}/documenters/YamlDocumenter.js.map +0 -0
- /package/{lib → lib-commonjs}/index.js +0 -0
- /package/{lib → lib-commonjs}/index.js.map +0 -0
- /package/{lib → lib-commonjs}/markdown/CustomMarkdownEmitter.js +0 -0
- /package/{lib → lib-commonjs}/markdown/CustomMarkdownEmitter.js.map +0 -0
- /package/{lib → lib-commonjs}/markdown/MarkdownEmitter.js +0 -0
- /package/{lib → lib-commonjs}/markdown/MarkdownEmitter.js.map +0 -0
- /package/{lib → lib-commonjs}/nodes/CustomDocNodeKind.js +0 -0
- /package/{lib → lib-commonjs}/nodes/CustomDocNodeKind.js.map +0 -0
- /package/{lib → lib-commonjs}/nodes/DocEmphasisSpan.js +0 -0
- /package/{lib → lib-commonjs}/nodes/DocEmphasisSpan.js.map +0 -0
- /package/{lib → lib-commonjs}/nodes/DocHeading.js +0 -0
- /package/{lib → lib-commonjs}/nodes/DocHeading.js.map +0 -0
- /package/{lib → lib-commonjs}/nodes/DocNoteBox.js +0 -0
- /package/{lib → lib-commonjs}/nodes/DocNoteBox.js.map +0 -0
- /package/{lib → lib-commonjs}/nodes/DocTable.js +0 -0
- /package/{lib → lib-commonjs}/nodes/DocTable.js.map +0 -0
- /package/{lib → lib-commonjs}/nodes/DocTableCell.js +0 -0
- /package/{lib → lib-commonjs}/nodes/DocTableCell.js.map +0 -0
- /package/{lib → lib-commonjs}/nodes/DocTableRow.js +0 -0
- /package/{lib → lib-commonjs}/nodes/DocTableRow.js.map +0 -0
- /package/{lib → lib-commonjs}/plugin/IApiDocumenterPluginManifest.js +0 -0
- /package/{lib → lib-commonjs}/plugin/IApiDocumenterPluginManifest.js.map +0 -0
- /package/{lib → lib-commonjs}/plugin/MarkdownDocumenterAccessor.js +0 -0
- /package/{lib → lib-commonjs}/plugin/MarkdownDocumenterAccessor.js.map +0 -0
- /package/{lib → lib-commonjs}/plugin/MarkdownDocumenterFeature.js +0 -0
- /package/{lib → lib-commonjs}/plugin/MarkdownDocumenterFeature.js.map +0 -0
- /package/{lib → lib-commonjs}/plugin/PluginFeature.js +0 -0
- /package/{lib → lib-commonjs}/plugin/PluginFeature.js.map +0 -0
- /package/{lib → lib-commonjs}/plugin/PluginLoader.js +0 -0
- /package/{lib → lib-commonjs}/plugin/PluginLoader.js.map +0 -0
- /package/{lib → lib-commonjs}/schemas/api-documenter-template.json +0 -0
- /package/{lib → lib-commonjs}/schemas/api-documenter.schema.json +0 -0
- /package/{lib → lib-commonjs}/start.js +0 -0
- /package/{lib → lib-commonjs}/start.js.map +0 -0
- /package/{lib → lib-commonjs}/utils/IndentedWriter.js +0 -0
- /package/{lib → lib-commonjs}/utils/IndentedWriter.js.map +0 -0
- /package/{lib → lib-commonjs}/utils/ToSdpConvertHelper.js +0 -0
- /package/{lib → lib-commonjs}/utils/ToSdpConvertHelper.js.map +0 -0
- /package/{lib → lib-commonjs}/utils/Utilities.js +0 -0
- /package/{lib → lib-commonjs}/utils/Utilities.js.map +0 -0
- /package/{lib → lib-commonjs}/yaml/ISDPYamlFile.js +0 -0
- /package/{lib → lib-commonjs}/yaml/ISDPYamlFile.js.map +0 -0
- /package/{lib → lib-commonjs}/yaml/IYamlApiFile.js +0 -0
- /package/{lib → lib-commonjs}/yaml/IYamlApiFile.js.map +0 -0
- /package/{lib → lib-commonjs}/yaml/IYamlTocFile.js +0 -0
- /package/{lib → lib-commonjs}/yaml/IYamlTocFile.js.map +0 -0
- /package/{lib → lib-commonjs}/yaml/typescript.schema.json +0 -0
- /package/{lib → lib-dts}/cli/ApiDocumenterCommandLine.d.ts +0 -0
- /package/{lib → lib-dts}/cli/ApiDocumenterCommandLine.d.ts.map +0 -0
- /package/{lib → lib-dts}/cli/BaseAction.d.ts +0 -0
- /package/{lib → lib-dts}/cli/BaseAction.d.ts.map +0 -0
- /package/{lib → lib-dts}/cli/GenerateAction.d.ts +0 -0
- /package/{lib → lib-dts}/cli/GenerateAction.d.ts.map +0 -0
- /package/{lib → lib-dts}/cli/MarkdownAction.d.ts +0 -0
- /package/{lib → lib-dts}/cli/MarkdownAction.d.ts.map +0 -0
- /package/{lib → lib-dts}/cli/YamlAction.d.ts +0 -0
- /package/{lib → lib-dts}/cli/YamlAction.d.ts.map +0 -0
- /package/{lib → lib-dts}/documenters/DocumenterConfig.d.ts +0 -0
- /package/{lib → lib-dts}/documenters/DocumenterConfig.d.ts.map +0 -0
- /package/{lib → lib-dts}/documenters/ExperimentalYamlDocumenter.d.ts +0 -0
- /package/{lib → lib-dts}/documenters/ExperimentalYamlDocumenter.d.ts.map +0 -0
- /package/{lib → lib-dts}/documenters/IConfigFile.d.ts +0 -0
- /package/{lib → lib-dts}/documenters/IConfigFile.d.ts.map +0 -0
- /package/{lib → lib-dts}/documenters/MarkdownDocumenter.d.ts +0 -0
- /package/{lib → lib-dts}/documenters/MarkdownDocumenter.d.ts.map +0 -0
- /package/{lib → lib-dts}/documenters/OfficeYamlDocumenter.d.ts +0 -0
- /package/{lib → lib-dts}/documenters/OfficeYamlDocumenter.d.ts.map +0 -0
- /package/{lib → lib-dts}/documenters/YamlDocumenter.d.ts +0 -0
- /package/{lib → lib-dts}/documenters/YamlDocumenter.d.ts.map +0 -0
- /package/{lib → lib-dts}/index.d.ts +0 -0
- /package/{lib → lib-dts}/index.d.ts.map +0 -0
- /package/{lib → lib-dts}/markdown/CustomMarkdownEmitter.d.ts +0 -0
- /package/{lib → lib-dts}/markdown/CustomMarkdownEmitter.d.ts.map +0 -0
- /package/{lib → lib-dts}/markdown/MarkdownEmitter.d.ts +0 -0
- /package/{lib → lib-dts}/markdown/MarkdownEmitter.d.ts.map +0 -0
- /package/{lib → lib-dts}/nodes/CustomDocNodeKind.d.ts +0 -0
- /package/{lib → lib-dts}/nodes/CustomDocNodeKind.d.ts.map +0 -0
- /package/{lib → lib-dts}/nodes/DocEmphasisSpan.d.ts +0 -0
- /package/{lib → lib-dts}/nodes/DocEmphasisSpan.d.ts.map +0 -0
- /package/{lib → lib-dts}/nodes/DocHeading.d.ts +0 -0
- /package/{lib → lib-dts}/nodes/DocHeading.d.ts.map +0 -0
- /package/{lib → lib-dts}/nodes/DocNoteBox.d.ts +0 -0
- /package/{lib → lib-dts}/nodes/DocNoteBox.d.ts.map +0 -0
- /package/{lib → lib-dts}/nodes/DocTable.d.ts +0 -0
- /package/{lib → lib-dts}/nodes/DocTable.d.ts.map +0 -0
- /package/{lib → lib-dts}/nodes/DocTableCell.d.ts +0 -0
- /package/{lib → lib-dts}/nodes/DocTableCell.d.ts.map +0 -0
- /package/{lib → lib-dts}/nodes/DocTableRow.d.ts +0 -0
- /package/{lib → lib-dts}/nodes/DocTableRow.d.ts.map +0 -0
- /package/{lib → lib-dts}/plugin/IApiDocumenterPluginManifest.d.ts +0 -0
- /package/{lib → lib-dts}/plugin/IApiDocumenterPluginManifest.d.ts.map +0 -0
- /package/{lib → lib-dts}/plugin/MarkdownDocumenterAccessor.d.ts +0 -0
- /package/{lib → lib-dts}/plugin/MarkdownDocumenterAccessor.d.ts.map +0 -0
- /package/{lib → lib-dts}/plugin/MarkdownDocumenterFeature.d.ts +0 -0
- /package/{lib → lib-dts}/plugin/MarkdownDocumenterFeature.d.ts.map +0 -0
- /package/{lib → lib-dts}/plugin/PluginFeature.d.ts +0 -0
- /package/{lib → lib-dts}/plugin/PluginFeature.d.ts.map +0 -0
- /package/{lib → lib-dts}/plugin/PluginLoader.d.ts +0 -0
- /package/{lib → lib-dts}/plugin/PluginLoader.d.ts.map +0 -0
- /package/{lib → lib-dts}/start.d.ts +0 -0
- /package/{lib → lib-dts}/start.d.ts.map +0 -0
- /package/{lib → lib-dts}/utils/IndentedWriter.d.ts +0 -0
- /package/{lib → lib-dts}/utils/IndentedWriter.d.ts.map +0 -0
- /package/{lib → lib-dts}/utils/ToSdpConvertHelper.d.ts +0 -0
- /package/{lib → lib-dts}/utils/ToSdpConvertHelper.d.ts.map +0 -0
- /package/{lib → lib-dts}/utils/Utilities.d.ts +0 -0
- /package/{lib → lib-dts}/utils/Utilities.d.ts.map +0 -0
- /package/{lib → lib-dts}/yaml/ISDPYamlFile.d.ts +0 -0
- /package/{lib → lib-dts}/yaml/ISDPYamlFile.d.ts.map +0 -0
- /package/{lib → lib-dts}/yaml/IYamlApiFile.d.ts +0 -0
- /package/{lib → lib-dts}/yaml/IYamlApiFile.d.ts.map +0 -0
- /package/{lib → lib-dts}/yaml/IYamlTocFile.d.ts +0 -0
- /package/{lib → lib-dts}/yaml/IYamlTocFile.d.ts.map +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToSdpConvertHelper.js","sourceRoot":"","sources":["../../src/utils/ToSdpConvertHelper.ts"],"names":[],"mappings":"AAAA,4FAA4F;AAC5F,2DAA2D;AAE3D,OAAO,IAAI,MAAM,WAAW,CAAC;AAI7B,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAmBjF,MAAM,UAAU,mBAAmB,CAAC,UAAkB;IACpD,OAAO,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;AAClC,CAAC;AAED,SAAS,OAAO,CAAC,SAAiB,EAAE,UAAkB;IACpD,OAAO,CAAC,GAAG,EAAE,CAAC;IACd,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE,CAAC;QAClC,OAAO,CAAC,KAAK,CAAC,eAAe,SAAS,eAAe,CAAC,CAAC;QACvD,OAAO;IACT,CAAC;IAED,UAAU,CAAC,mBAAmB,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;QACzD,MAAM,KAAK,GAAW,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;QACjD,IAAI,UAAU,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC;YAC7C,oBAAoB;YACpB,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;gBAC3B,OAAO;YACT,CAAC;YACD,aAAa;YACb,MAAM,WAAW,GAAW,UAAU,CAAC,QAAQ,CAAC,KAAK,EAAE,EA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,CAAC;QACH,CAAC;IACH,CAAC;SAAM,IAAI,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;QAClC,2BAA2B;QAC3B,eAAe;QACf,8DAA8D;QAC9D,MAAM,GAAG,GAA+B,MAAA,gBAAgB,CAAC,UAAU,0CAAE,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE;YACjF,OAAO,IAAI,CAAC,GAAG,KAAK,IAAI,CAAC;QAC3B,CAAC,CAAC,CAAC;QACH,IAAI,GAAG,IAAI,GAAG,CAAC,IAAI,EAAE,CAAC;YACpB,MAAM,GAAG,GAAG,CAAC,IAAI,CAAC;QACpB,CAAC;IACH,CAAC;IACD,YAAY;IACZ,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IAC5D,MAAM,QAAQ,GAAW,mCAAmC,CAAC;IAE7D,OAAO,MAAM,CAAC,OAAO,CAAC,QAAQ,EAAE,mBAAmB,CAAC,CAAC;AACvD,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\nimport path from 'node:path';\n\nimport yaml = require('js-yaml');\n\nimport { FileSystem, Encoding, NewlineKind } from '@rushstack/node-core-library';\n\nimport type {\n IYamlItem,\n IYamlApiFile,\n IYamlSyntax,\n IYamlReferenceSpec,\n IYamlReference\n} from '../yaml/IYamlApiFile';\nimport type {\n PackageYamlModel,\n EnumYamlModel,\n TypeAliasYamlModel,\n TypeYamlModel,\n FieldYamlModel,\n FunctionYamlModel,\n CommonYamlModel\n} from '../yaml/ISDPYamlFile';\n\nexport function convertUDPYamlToSDP(folderPath: string): void {\n convert(folderPath, folderPath);\n}\n\nfunction convert(inputPath: string, outputPath: string): void {\n console.log();\n if (!FileSystem.exists(inputPath)) {\n console.error(`input path: ${inputPath} is not exist`);\n return;\n }\n\n FileSystem.readFolderItemNames(inputPath).forEach((name) => {\n const fpath: string = path.join(inputPath, name);\n if (FileSystem.getStatistics(fpath).isFile()) {\n // only convert yaml\n if (!name.endsWith('.yml')) {\n return;\n }\n // parse file\n const yamlContent: string = FileSystem.readFile(fpath, { encoding: Encoding.Utf8 });\n // only convert universalreference yaml\n const isLegacyYaml: boolean = yamlContent.startsWith('### YamlMime:UniversalReference');\n if (!isLegacyYaml) {\n return;\n }\n\n console.log(`convert file ${fpath} from udp to sdp`);\n\n const file: IYamlApiFile = yaml.load(yamlContent) as IYamlApiFile;\n const result: { model: CommonYamlModel; type: string } | undefined = convertToSDP(file);\n if (result && result.model) {\n const stringified: string = `### YamlMime:TS${result.type}\\n${yaml.dump(result.model, {\n lineWidth: 120\n })}`;\n FileSystem.writeFile(`${outputPath}/${name}`, stringified, {\n convertLineEndings: NewlineKind.CrLf,\n ensureFolderExists: true\n });\n } else {\n console.log('not target file ', fpath);\n }\n } else {\n // read contents\n convert(fpath, path.join(outputPath, name));\n }\n });\n}\n\nfunction convertToPackageSDP(transfomredClass: IYamlApiFile): PackageYamlModel {\n const element: IYamlItem = transfomredClass.items[0];\n const packageModel: PackageYamlModel = {\n uid: element.uid,\n name: element.name!,\n type: 'package'\n };\n if (element.summary) {\n packageModel.summary = element.summary;\n } else {\n packageModel.summary = '';\n }\n\n // search in children\n if (element.children) {\n element.children.forEach((child) => {\n if (child.endsWith(':class')) {\n assignPackageModelFields(packageModel, 'classes', child);\n } else if (child.endsWith(':interface')) {\n assignPackageModelFields(packageModel, 'interfaces', child);\n } else if (child.endsWith(':enum')) {\n assignPackageModelFields(packageModel, 'enums', child);\n } else if (child.endsWith(':type')) {\n assignPackageModelFields(packageModel, 'typeAliases', child);\n } else {\n // console.log(\"other type: \", child)\n }\n });\n }\n\n for (let i: number = 1; i < transfomredClass.items.length; i++) {\n const ele: IYamlItem = transfomredClass.items[i];\n switch (ele.type) {\n case 'typealias':\n // need generate typeAlias file for this\n break;\n case 'function':\n if (!packageModel.functions) {\n packageModel.functions = [];\n }\n packageModel.functions.push(convertToFunctionSDP(ele, element.uid, transfomredClass));\n break;\n default:\n // console.log(transfomredClass.items[0].name)\n console.log('[warning] not applied type(package): ', ele.type);\n }\n }\n\n return packageModel;\n}\n\nfunction assignPackageModelFields(\n packageModel: PackageYamlModel,\n name: 'classes' | 'interfaces' | 'enums' | 'typeAliases',\n uid: string\n): void {\n if (!packageModel[name]) {\n packageModel[name] = [];\n }\n packageModel[name]!.push(uid);\n}\n\nfunction convertToSDP(transfomredClass: IYamlApiFile): { model: CommonYamlModel; type: string } | undefined {\n const element: IYamlItem = transfomredClass.items[0];\n switch (element.type) {\n case 'class':\n case 'interface':\n return {\n model: convertToTypeSDP(transfomredClass, element.type === 'class'),\n type: 'Type'\n };\n case 'enum':\n if (transfomredClass.items.length < 2) {\n console.log(`[warning] enum ${element.uid}/${element.name} does not have fields`);\n return undefined;\n }\n return { model: convertToEnumSDP(transfomredClass), type: 'Enum' };\n case 'typealias':\n return { model: convertToTypeAliasSDP(element, transfomredClass), type: 'TypeAlias' };\n case 'package':\n return {\n model: convertToPackageSDP(transfomredClass),\n type: 'Package'\n };\n default:\n console.log('not applied type: ', element.type);\n return undefined;\n }\n}\n\nfunction convertToEnumSDP(transfomredClass: IYamlApiFile): EnumYamlModel {\n const element: IYamlItem = transfomredClass.items[0];\n const fields: FieldYamlModel[] = [];\n for (let i: number = 1; i < transfomredClass.items.length; i++) {\n const ele: IYamlItem = transfomredClass.items[i];\n const field: FieldYamlModel = {\n name: ele.name!,\n uid: ele.uid,\n package: element.package!\n };\n\n if (ele.summary) {\n field.summary = ele.summary;\n } else {\n field.summary = '';\n }\n\n if (ele.numericValue) {\n field.value = ele.numericValue;\n }\n fields.push(field);\n }\n\n const result: EnumYamlModel = {\n ...convertCommonYamlModel(element, element.package!, transfomredClass),\n fields: fields\n };\n return result;\n}\n\nfunction convertToTypeAliasSDP(element: IYamlItem, transfomredClass: IYamlApiFile): TypeAliasYamlModel {\n const result: TypeAliasYamlModel = {\n ...convertCommonYamlModel(element, element.package!, transfomredClass)\n } as TypeAliasYamlModel;\n\n if (element.syntax) {\n result.syntax = element.syntax.content!;\n }\n return result;\n}\n\nfunction convertToTypeSDP(transfomredClass: IYamlApiFile, isClass: boolean): TypeYamlModel {\n const element: IYamlItem = transfomredClass.items[0];\n const constructors: CommonYamlModel[] = [];\n const properties: CommonYamlModel[] = [];\n const methods: CommonYamlModel[] = [];\n const events: CommonYamlModel[] = [];\n for (let i: number = 1; i < transfomredClass.items.length; i++) {\n const ele: IYamlItem = transfomredClass.items[i];\n const item: CommonYamlModel = convertCommonYamlModel(ele, element.package!, transfomredClass);\n if (ele.type === 'constructor') {\n // interface does not need this field\n if (isClass) {\n constructors.push(item);\n }\n } else if (ele.type === 'property') {\n properties.push(item);\n } else if (ele.type === 'method') {\n methods.push(item);\n } else if (ele.type === 'event') {\n events.push(item);\n } else {\n console.log(`[warning] ${ele.uid}#${ele.name} is not applied sub type ${ele.type} for type yaml`);\n }\n }\n const result: TypeYamlModel = {\n ...convertCommonYamlModel(element, element.package!, transfomredClass),\n type: isClass ? 'class' : 'interface'\n };\n delete result.syntax;\n\n if (constructors.length > 0) {\n result.constructors = constructors;\n }\n\n if (properties.length > 0) {\n result.properties = properties;\n }\n\n if (methods.length > 0) {\n result.methods = methods;\n }\n\n if (events.length > 0) {\n result.events = events;\n }\n\n if (element.extends && element.extends.length > 0) {\n result.extends = convertSelfTypeToXref(element.extends[0] as string, transfomredClass);\n }\n return result;\n}\n\nfunction convertToFunctionSDP(\n element: IYamlItem,\n packageName: string,\n transfomredClass: IYamlApiFile\n): FunctionYamlModel {\n const model: CommonYamlModel = convertCommonYamlModel(element, packageName, transfomredClass);\n // don't need these fields\n delete model.fullName;\n return model;\n}\n\nfunction convertCommonYamlModel(\n element: IYamlItem,\n packageName: string,\n transfomredClass: IYamlApiFile\n): CommonYamlModel {\n const result: CommonYamlModel = {\n name: element.name!,\n uid: element.uid,\n package: packageName\n };\n\n if (element.fullName) {\n result.fullName = element.fullName;\n }\n\n if (element.summary) {\n result.summary = element.summary;\n } else {\n result.summary = '';\n }\n\n // because mustache meet same variable in different level\n // such as: { \"pre\": true, \"list\": [{}]}\n // if item in list wants to use pre but the pre is not assigned, it will use outer pre field.\n // so, there need to set below variable explict\n\n if (element.remarks) {\n result.remarks = element.remarks;\n } else {\n result.remarks = '';\n }\n\n if (element.example) {\n result.example = element.example;\n } else {\n result.example = [];\n }\n\n result.isPreview = element.isPreview;\n if (!result.isPreview) {\n result.isPreview = false;\n }\n\n if (element.deprecated) {\n result.isDeprecated = true;\n result.customDeprecatedMessage = element.deprecated.content;\n } else {\n result.isDeprecated = false;\n }\n\n if (element.syntax) {\n result.syntax = {};\n\n const syntax: IYamlSyntax = element.syntax;\n result.syntax.content = syntax.content;\n if (syntax.parameters && syntax.parameters.length > 0) {\n syntax.parameters?.forEach((it) => {\n delete it.optional;\n delete it.defaultValue;\n });\n result.syntax.parameters = syntax.parameters.map((it) => {\n return {\n ...it,\n id: it.id!,\n type: convertSelfTypeToXref(escapeMarkdown(it.type![0] as string), transfomredClass)\n };\n });\n }\n\n if (syntax.return) {\n result.syntax.return = {\n ...syntax.return,\n type: convertSelfTypeToXref(escapeMarkdown(syntax.return.type![0] as string), transfomredClass)\n };\n }\n }\n\n return result;\n}\n\nfunction escapeMarkdown(name: string): string {\n // eg: [key: string]: string\n const markdownLinkRegEx: RegExp = /^\\s*(\\[.+\\]):(.+)/g;\n return name.replace(markdownLinkRegEx, `$1\\\\:$2`);\n}\n\nfunction convertSelfTypeToXref(name: string, transfomredClass: IYamlApiFile): string {\n let result: string = name;\n\n // if complex type, need to get real type from references\n if (result.endsWith(':complex')) {\n const specs: IYamlReferenceSpec[] | undefined = transfomredClass.references?.find((item) => {\n return item.uid === name;\n })?.['spec.typeScript'];\n\n if (specs && specs.length > 0) {\n result = '';\n for (const spec of specs) {\n // start with ! will be node base type\n if (spec.uid && !spec.uid.startsWith('!')) {\n result += spec.uid;\n } else {\n result += spec.name;\n }\n }\n }\n } else if (result.startsWith('!')) {\n // uid: '!Object:interface'\n // name: Object\n // start with !, not complex type, use reference name directly\n const ref: IYamlReference | undefined = transfomredClass.references?.find((item) => {\n return item.uid === name;\n });\n if (ref && ref.name) {\n result = ref.name;\n }\n }\n // parse < >\n result = result.replace(/</g, '<').replace(/>/g, '>');\n const uidRegEx: RegExp = /(@?[\\w\\d\\-/!~\\.]+\\:[\\w\\d\\-\\(/]+)/g;\n\n return result.replace(uidRegEx, `<xref uid=\"$1\" />`);\n}\n"]}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
|
|
2
|
+
// See LICENSE in the project root for license information.
|
|
3
|
+
import { ApiParameterListMixin } from '@microsoft/api-extractor-model';
|
|
4
|
+
export class Utilities {
|
|
5
|
+
/**
|
|
6
|
+
* Generates a concise signature for a function. Example: "getArea(width, height)"
|
|
7
|
+
*/
|
|
8
|
+
static getConciseSignature(apiItem) {
|
|
9
|
+
if (ApiParameterListMixin.isBaseClassOf(apiItem)) {
|
|
10
|
+
return apiItem.displayName + '(' + apiItem.parameters.map((x) => x.name).join(', ') + ')';
|
|
11
|
+
}
|
|
12
|
+
return apiItem.displayName;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Converts bad filename characters to underscores.
|
|
16
|
+
*/
|
|
17
|
+
static getSafeFilenameForName(name) {
|
|
18
|
+
// TODO: This can introduce naming collisions.
|
|
19
|
+
// We will fix that as part of https://github.com/microsoft/rushstack/issues/1308
|
|
20
|
+
return name.replace(Utilities._badFilenameCharsRegExp, '_').toLowerCase();
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
Utilities._badFilenameCharsRegExp = /[^a-z0-9_\-\.]/gi;
|
|
24
|
+
//# sourceMappingURL=Utilities.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Utilities.js","sourceRoot":"","sources":["../../src/utils/Utilities.ts"],"names":[],"mappings":"AAAA,4FAA4F;AAC5F,2DAA2D;AAE3D,OAAO,EAAE,qBAAqB,EAAgB,MAAM,gCAAgC,CAAC;AAErF,MAAM,OAAO,SAAS;IAEpB;;OAEG;IACI,MAAM,CAAC,mBAAmB,CAAC,OAAgB;QAChD,IAAI,qBAAqB,CAAC,aAAa,CAAC,OAAO,CAAC,EAAE,CAAC;YACjD,OAAO,OAAO,CAAC,WAAW,GAAG,GAAG,GAAG,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC;QAC5F,CAAC;QACD,OAAO,OAAO,CAAC,WAAW,CAAC;IAC7B,CAAC;IAED;;OAEG;IACI,MAAM,CAAC,sBAAsB,CAAC,IAAY;QAC/C,8CAA8C;QAC9C,iFAAiF;QACjF,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,uBAAuB,EAAE,GAAG,CAAC,CAAC,WAAW,EAAE,CAAC;IAC5E,CAAC;;AAlBuB,iCAAuB,GAAW,kBAAkB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\nimport { ApiParameterListMixin, type ApiItem } from '@microsoft/api-extractor-model';\n\nexport class Utilities {\n private static readonly _badFilenameCharsRegExp: RegExp = /[^a-z0-9_\\-\\.]/gi;\n /**\n * Generates a concise signature for a function. Example: \"getArea(width, height)\"\n */\n public static getConciseSignature(apiItem: ApiItem): string {\n if (ApiParameterListMixin.isBaseClassOf(apiItem)) {\n return apiItem.displayName + '(' + apiItem.parameters.map((x) => x.name).join(', ') + ')';\n }\n return apiItem.displayName;\n }\n\n /**\n * Converts bad filename characters to underscores.\n */\n public static getSafeFilenameForName(name: string): string {\n // TODO: This can introduce naming collisions.\n // We will fix that as part of https://github.com/microsoft/rushstack/issues/1308\n return name.replace(Utilities._badFilenameCharsRegExp, '_').toLowerCase();\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ISDPYamlFile.js","sourceRoot":"","sources":["../../src/yaml/ISDPYamlFile.ts"],"names":[],"mappings":"AAAA,4FAA4F;AAC5F,2DAA2D","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\ninterface IBaseYamlModel {\n uid: string;\n name: string;\n package?: string;\n summary?: string;\n}\n\nexport type CommonYamlModel = IBaseYamlModel & {\n syntax?: ISyntax;\n fullName?: string;\n isPreview?: boolean;\n isDeprecated?: boolean;\n remarks?: string;\n example?: string[];\n customDeprecatedMessage?: string;\n};\n\nexport type PackageYamlModel = CommonYamlModel & {\n classes?: Array<string>;\n interfaces?: Array<string>;\n enums?: Array<string>;\n typeAliases?: Array<string>;\n properties?: Array<FunctionYamlModel>;\n type?: 'package' | 'module';\n functions?: Array<FunctionYamlModel>;\n};\n\nexport type FunctionYamlModel = CommonYamlModel;\n\nexport type TypeAliasYamlModel = CommonYamlModel & {\n syntax: string;\n};\n\nexport type TypeYamlModel = CommonYamlModel & {\n constructors?: Array<FunctionYamlModel>;\n properties?: Array<FunctionYamlModel>;\n methods?: Array<FunctionYamlModel>;\n events?: Array<FunctionYamlModel>;\n type: 'class' | 'interface';\n extends?: IType | string;\n};\n\nexport type EnumYamlModel = CommonYamlModel & {\n fields: Array<FieldYamlModel>;\n};\n\nexport type FieldYamlModel = IBaseYamlModel & {\n numericValue?: number;\n value?: string;\n};\n\nexport interface ISyntax {\n parameters?: Array<IYamlParameter>;\n content?: string;\n return?: IReturn;\n}\n\nexport interface IYamlParameter {\n id: string;\n type: IType | string;\n description?: string;\n}\n\ninterface IReturn {\n type: IType | string;\n description?: string;\n}\n\nexport interface IType {\n typeName?: string;\n typeId?: number;\n reflectedType?: IReflectedType;\n genericType?: IGenericType;\n intersectionType?: IIntersectionType;\n unionType?: IUnionType;\n arrayType?: IType | string;\n}\n\nexport interface IUnionType {\n types: Types;\n}\n\nexport interface IIntersectionType {\n types: Types;\n}\n\nexport interface IGenericType {\n outter: IType | string;\n inner: Types;\n}\n\nexport interface IReflectedType {\n key: IType | string;\n value: IType | string;\n}\n\nexport interface IException {\n type: string;\n description: string;\n}\n\ntype Types = IType[] | string[];\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IYamlApiFile.js","sourceRoot":"","sources":["../../src/yaml/IYamlApiFile.ts"],"names":[],"mappings":"AAAA,4FAA4F;AAC5F,2DAA2D","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\n/**\n * TypeScript interface describing a Universal Reference YAML documentation file,\n * as defined by typescript.schema.json.\n *\n * NOTE: Corresponds to `Microsoft.DocAsCode.DataContracts.UniversalReference.PageViewModel` in DocFX.\n */\nexport interface IYamlApiFile {\n /**\n * The items contained in this file.\n *\n * NOTE: Corresponds to `ExceptionInfo.Items` in DocFX.\n */\n items: IYamlItem[];\n\n /**\n * References to other items.\n *\n * NOTE: Corresponds to `ExceptionInfo.References` in DocFX.\n */\n references?: IYamlReference[];\n\n /**\n * NOTE: Corresponds to `ExceptionInfo.ShouldSkipMarkup` in DocFX.\n */\n shouldSkipMarkup?: boolean;\n}\n\n/**\n * Part of the IYamlApiFile structure. Represents basic API elements such as\n * classes, interfaces, members, etc.\n *\n * NOTE: Corresponds to `Microsoft.DocAsCode.DataContracts.UniversalReference.ItemViewModel` in DocFX.\n */\nexport interface IYamlItem {\n /**\n * The Unique Identifier (UID) for this item.\n *\n * NOTE: Corresponds to `ItemViewModel.Uid` in DocFX.\n */\n uid: string;\n\n /**\n * A Roslyn comment ID (unused).\n *\n * NOTE: Corresponds to `ItemViewModel.CommentId` in DocFX.\n */\n commentId?: string;\n\n /**\n * The ID for this item.\n *\n * NOTE: Corresponds to `ItemViewModel.Id` in DocFX.\n */\n id?: string;\n\n /**\n * The Unique Identifier (UID) of the parent item. This value can vary by development language\n * by setting the relevant `parent.${lang}` property.\n *\n * NOTE: Corresponds to `ItemViewModel.Parent` in DocFX.\n * NOTE: Corresponds to `ItemViewModel.ParentInDevLangs` in DocFX when `parent.${lang}` is used.\n */\n parent?: string;\n 'parent.typeScript'?: string;\n\n /**\n * The Unique Identifiers (UID) of the children of this item. This value can vary by development language\n * by setting the relevant `children.${lang}` property.\n *\n * NOTE: Corresponds to `ItemViewModel.Children` in DocFX.\n * NOTE: Corresponds to `ItemViewModel.ChildrenInDevLangs` in DocFX when `children.${lang}` is used.\n */\n children?: string[];\n 'children.typeScript'?: string[];\n\n /**\n * Item's link URL. An item can only have a single link in cross references, so varying `href` by development\n * languages is not supported.\n *\n * NOTE: Corresponds to `ItemViewModel.Href` in DocFX.\n */\n href?: string;\n\n /**\n * The development languages supported by this item.\n *\n * NOTE: Corresponds to `ItemViewModel.SupportedLanguages` in DocFX.\n */\n langs?: YamlDevLangs[];\n\n /**\n * The local name of this item. This name should generally not be namespace qualified or include\n * parent type information. This value can vary by development language by setting the relevant\n * `name.${lang}` property.\n *\n * NOTE: Corresponds to `ItemViewModel.Name` in DocFX.\n * NOTE: Corresponds to `ItemViewModel.Names` in DocFX when `name.${lang}` is used.\n */\n name?: string;\n 'name.typeScript'?: string;\n\n /**\n * The name of this item including its parent type, if it has one. This name should generally not be namespace\n * qualified. This value can vary by development language by setting the relevant `nameWithType.${lang}` property.\n *\n * NOTE: Corresponds to `ItemViewModel.NameWithType` in DocFX.\n * NOTE: Corresponds to `ItemViewModel.NamesWithType` in DocFX when `nameWithType.${lang}` is used.\n */\n nameWithType?: string;\n 'nameWithType.typeScript'?: string;\n\n /**\n * The namespace-qualified name of this item including its parent type. This value can vary by development language\n * by setting the relevant `fullName.${lang}` property.\n *\n * NOTE: Corresponds to `ItemViewModel.FullName` in DocFX.\n * NOTE: Corresponds to `ItemViewModel.FullNames` in DocFX when `fullName.${lang}` is used.\n */\n fullName?: string;\n 'fullName.typeScript'?: string;\n\n /**\n * The type of source element this item represents. This value cannot vary by development language.\n *\n * NOTE: Corresponds to `ItemViewModel.Type` in DocFX.\n */\n type: YamlTypeId;\n\n /**\n * The location of the item's source. This value can vary by development language by setting the relevant\n * `source.${lang}` property.\n *\n * NOTE: Corresponds to `ItemViewModel.Source` in DocFX.\n * NOTE: Corresponds to `ItemViewModel.SourceInDevLangs` in DocFX when `source.${lang}` is used.\n */\n source?: IYamlSource;\n 'source.typeScript'?: IYamlSource;\n\n /**\n * The location of the item's documentation overrides. This value cannot vary by development language.\n *\n * NOTE: Corresponds to `ItemViewModel.Documentation` in DocFX.\n */\n documentation?: IYamlSource;\n\n /**\n * The names of managed assemblies that contain this item. This value can vary by development language by setting\n * the relevant `assemblies.${lang}` property.\n *\n * NOTE: Corresponds to `ItemViewModel.AssemblyNameList` in DocFX.\n * NOTE: Corresponds to `ItemViewModel.AssemblyNameListInDevLangs` in DocFX when `assemblies.${lang}` is used.\n */\n assemblies?: string[];\n 'assemblies.typeScript'?: string[];\n\n /**\n * The Unique Identifier (UID) of the namespace that contains this item. This value can vary by development language\n * by setting the relevant `namespace.${lang}` property.\n *\n * NOTE: Corresponds to `ItemViewModel.NamespaceName` in DocFX.\n * NOTE: Corresponds to `ItemViewModel.NamespaceNameInDevLangs` in DocFX.\n */\n namespace?: string;\n 'namespace.typeScript'?: string;\n\n /**\n * The summary for the item. This value cannot vary by development language.\n * Markdown is permitted.\n *\n * NOTE: Corresponds to `ItemViewModel.Summary` in DocFX.\n */\n summary?: string;\n\n /**\n * The remarks for the item. This value cannot vary by development language.\n * Markdown is permitted.\n *\n * NOTE: Corresponds to `ItemViewModel.Remarks` in DocFX.\n */\n remarks?: string;\n\n /**\n * The examples for the item. This value cannot vary by development language.\n * Markdown is permitted.\n *\n * NOTE: Corresponds to `ItemViewModel.Examples` in DocFX.\n */\n example?: string[];\n\n /**\n * The syntax for this item. This value itself cannot vary by development language, but\n * instead contains properties that may vary by development language.\n *\n * NOTE: Corresponds to `ItemViewModel.Syntax` in DocFX.\n */\n syntax?: IYamlSyntax;\n\n /**\n * The Unique Identifier (UID) of the member this item overrides. This value can vary by development language\n * by setting the relevant `overridden.${lang}` property.\n *\n * NOTE: Corresponds to `ItemViewModel.Overridden` in DocFX.\n * NOTE: Corresponds to `ItemViewModel.OverriddenInDevLangs` in DocFX when `overriden.${lang}` is used.\n */\n overridden?: string;\n 'overridden.typeScript'?: string;\n\n /**\n * The Unique Identifier (UID) of the member this item overloads. This value can vary by development language\n * by setting the relevant `overload.${lang}` property.\n *\n * NOTE: Corresponds to `ItemViewModel.Overload` in DocFX.\n * NOTE: Corresponds to `ItemViewModel.OverloadInDevLangs` in DocFX when `overload.${lang}` is used.\n */\n overload?: string;\n 'overload.typeScript'?: string;\n\n /**\n * The exceptions thrown by this item. This value can vary by development language by setting the relevant\n * `exceptions.${lang}` property.\n *\n * NOTE: Corresponds to `ItemViewModel.Exceptions` in DocFX.\n * NOTE: Corresponds to `ItemViewModel.ExceptionsInDevLangs` in DocFX when `exceptions.${lang}` is used.\n */\n exceptions?: IYamlException[];\n 'exceptions.typeScript'?: IYamlException[];\n\n /**\n * Links to additional content related to this item.\n *\n * NOTE: Corresponds to `ItemViewModel.SeeAlsos` in DocFX.\n */\n seealso?: IYamlLink[];\n\n /**\n * Additional information about other content related to this item.\n * Markdown is permitted.\n *\n * NOTE: Corresponds to `ItemViewModel.SeeAlsoContent` in DocFX.\n */\n seealsoContent?: string;\n\n /**\n * Links to additional content related to this item.\n *\n * NOTE: Corresponds to `ItemViewModel.Sees` in DocFX.\n */\n see?: IYamlLink[];\n\n /**\n * The inheritance tree for this item. Multiple inheritance is permitted for languages like Python.\n *\n * NOTE: Corresponds to `ItemViewModel.Inheritance` in DocFX.\n * NOTE: Corresponds to `ItemViewModel.InheritanceInDevLangs` in DocFX when `inheritance.${lang}` is used.\n */\n inheritance?: IYamlInheritanceTree[];\n 'inheritance.typeScript'?: IYamlInheritanceTree[];\n\n /**\n * NOTE: Corresponds to `ItemViewModel.DerivedClassses` in DocFX.\n * NOTE: Corresponds to `ItemViewModel.DerivedClasssesInDevLangs` in DocFX when `derivedClasses.${lang}` is used.\n */\n derivedClasses?: string[];\n 'derivedClasses.typeScript'?: string[];\n\n /**\n * NOTE: Corresponds to `ItemViewModel.Implements` in DocFX.\n * NOTE: Corresponds to `ItemViewModel.ImplementsInDevLangs` in DocFX when `implements.${lang}` is used.\n */\n implements?: string[];\n 'implements.typeScript'?: string[];\n\n /**\n * NOTE: Corresponds to `ItemViewModel.InheritedMembers` in DocFX.\n * NOTE: Corresponds to `ItemViewModel.InheritedMembersInDevLangs` in DocFX when `inheritedMembers.${lang}` is used.\n */\n inheritedMembers?: string[];\n 'inheritedMembers.typeScript'?: string[];\n\n /**\n * NOTE: Corresponds to `ItemViewModel.ExtensionMethods` in DocFX.\n * NOTE: Corresponds to `ItemViewModel.ExtensionMethodsInDevLangs` in DocFX when `extensionMethods.${lang}` is used.\n */\n extensionMethods?: string[];\n 'extensionMethods.typeScript'?: string[];\n\n /**\n * NOTE: Corresponds to `ItemViewModel.Conceptual` in DocFX.\n */\n conceptual?: string;\n\n /**\n * NOTE: Corresponds to `ItemViewModel.Platform` in DocFX.\n * NOTE: Corresponds to `ItemViewModel.PlatformInDevLangs` in DocFX when `platform.${lang}` is used.\n */\n platform?: string[];\n 'platform.typeScript'?: string[];\n\n /**\n * NOTE: This is an extension and corresponds to `ItemViewModel.Metadata` in DocFX.\n */\n deprecated?: IYamlDeprecatedNotice;\n\n /**\n * NOTE: This is an extension and corresponds to `ItemViewModel.Metadata` in DocFX.\n */\n extends?: string[];\n\n /**\n * NOTE: This is an extension and corresponds to `ItemViewModel.Metadata` in DocFX.\n */\n isPreview?: boolean;\n\n /**\n * NOTE: In TypeScript, enum members can be strings or integers.\n * If it is an integer, then enumMember.value will be a string representation of the integer.\n * If it is a string, then enumMember.value will include the quotation marks.\n *\n * NOTE: This is an extension and corresponds to `ItemViewModel.Metadata` in DocFX.\n */\n numericValue?: string;\n\n /**\n * NOTE: This is an extension and corresponds to `ItemViewModel.Metadata` in DocFX.\n */\n package?: string;\n}\n\n/**\n * Part of the IYamlApiFile structure. Represents the type of an IYamlItem.\n */\nexport type YamlTypeId =\n | 'class'\n | 'constructor'\n | 'enum'\n | 'field'\n | 'function'\n | 'interface'\n | 'method'\n | 'package'\n | 'property'\n | 'event'\n | 'typealias'\n | 'variable'\n | 'namespace';\n\n/**\n * Development languages supported by the Universal Reference file format, as defined by typescript.schema.json.\n */\nexport type YamlDevLangs = 'typeScript';\n\n/**\n * Part of the IYamlApiFile structure. Documents the source file where an IYamlItem is defined.\n *\n * NOTE: Corresponds to `Microsoft.DocAsCode.DataContracts.Common.SourceDetail` in DocFX.\n */\nexport interface IYamlSource {\n /**\n * Information about the Git repository where this source can be found.\n *\n * NOTE: Corresponds to `SourceDetail.Remote` in DocFX.\n */\n remote?: IYamlRemote;\n\n /**\n * The base path for the source for this item.\n *\n * NOTE: Corresponds to `SourceDetail.BasePath` in DocFX.\n */\n basePath?: string;\n\n /**\n * The name of the item.\n *\n * NOTE: Corresponds to `SourceDetail.Name` in DocFX.\n */\n id?: string;\n\n /**\n * A link to the source for this item.\n *\n * NOTE: Corresponds to `SourceDetail.Href` in DocFX.\n */\n href?: string;\n\n /**\n * The path to the source for this item. This path will be made relative to `basePath` in the documentation.\n *\n * NOTE: Corresponds to `SourceDetail.Path` in DocFX.\n */\n path?: string;\n\n /**\n * The starting line of the source for this item.\n *\n * NOTE: Corresponds to `SourceDetail.StartLine` in DocFX.\n */\n startLine?: number;\n\n /**\n * The ending line of the source for this item.\n *\n * NOTE: Corresponds to `SourceDetail.EndLine` in DocFX.\n */\n endLine?: number;\n\n /**\n * The content of the source for this item.\n *\n * NOTE: Corresponds to `SourceDetail.Content` in DocFX.\n */\n content?: string;\n\n /**\n * Indicates whether the path to the source is not locally available.\n *\n * NOTE: Corresponds to `SourceDetail.IsExternal` in DocFX.\n */\n isExternal?: boolean;\n}\n\n/**\n * Part of the IYamlApiFile structure. Indicates the open source Git repository\n * where an IYamlItem is defined.\n *\n * NOTE: Corresponds to `Microsoft.DocAsCode.DataContracts.Common.GitDetail` in DocFX.\n */\nexport interface IYamlRemote {\n /**\n * The relative path of the current item to the Git repository root directory.\n *\n * NOTE: Corresponds to `GitDetail.RelativePath` in DocFX.\n */\n path?: string;\n\n /**\n * The Git branch in which this item can be found.\n *\n * NOTE: Corresponds to `GitDetail.RemoteBranch` in DocFX.\n */\n branch?: string;\n\n /**\n * The Git repository in which this item can be found.\n *\n * NOTE: Corresponds to `GitDetail.RemoteRepositoryUrl` in DocFX.\n */\n repo?: string;\n}\n\n/**\n * Part of the IYamlApiFile structure. Documents the type signature for an IYamlItem.\n *\n * NOTE: Corresponds to `Microsoft.DocAsCode.DataContracts.UniversalReference.SyntaxDetailViewModel` in DocFX.\n */\nexport interface IYamlSyntax {\n /**\n * The content for the syntax of this item.\n *\n * NOTE: Corresponds to `SyntaxDetailViewModel.Content` in DocFX.\n * NOTE: Corresponds to `SyntaxDetailViewModel.Contents` in DocFX when `content.${lang}` is used.\n */\n content?: string;\n 'content.typeScript'?: string;\n\n /**\n * The parameters for this item.\n *\n * NOTE: Corresponds to `SyntaxDetailViewModel.Parameters` in DocFX.\n */\n parameters?: IYamlParameter[];\n\n /**\n * The type parameters for this item.\n *\n * NOTE: Corresponds to `SyntaxDetailViewModel.TypeParameters` in DocFX.\n */\n typeParameters?: IYamlParameter[];\n\n /**\n * The return type for this item.\n *\n * NOTE: Corresponds to `SyntaxDetailViewModel.Return` in DocFX.\n * NOTE: Corresponds to `SyntaxDetailViewModel.ReturnInDevLangs` in DocFX when `return.${lang}` is used.\n */\n return?: IYamlReturn;\n 'return.typeScript'?: IYamlReturn;\n}\n\n/**\n * Part of the IYamlApiFile structure. Represents a method or function parameter.\n *\n * NOTE: Corresponds to `Microsoft.DocAsCode.DataContracts.UniversalReference.ApiParameter` in DocFX.\n */\nexport interface IYamlParameter {\n /**\n * The name of the parameter.\n *\n * NOTE: Corresponds to `ApiParameter.Name` in DocFX.\n */\n id?: string;\n\n /**\n * The Unique Identifiers (UIDs) of the types for this parameter.\n *\n * NOTE: Corresponds to `ApiParameter.Type` in DocFX.\n */\n type?: string[];\n\n /**\n * The description for this parameter.\n * Markdown is permitted.\n *\n * NOTE: Corresponds to `ApiParameter.Description` in DocFX.\n */\n description?: string;\n\n /**\n * Indicates whether the parameter is optional.\n *\n * NOTE: Corresponds to `ApiParameter.Optional` in DocFX.\n */\n optional?: boolean;\n\n /**\n * The default value for the parameter.\n *\n * NOTE: Corresponds to `ApiParameter.DefaultValue` in DocFX.\n */\n defaultValue?: string;\n}\n\n/**\n * Part of the IYamlApiFile structure. Documents the return value of a function\n * or method.\n *\n * NOTE: Corresponds to `Microsoft.DocAsCode.DataContracts.UniversalReference.ApiParameter` in DocFX.\n */\nexport interface IYamlReturn {\n /**\n * The Unique Identifiers (UIDs) of the types for this parameter.\n *\n * NOTE: Corresponds to `ApiParameter.Type` in DocFX.\n */\n type?: string[];\n\n /**\n * The description for this parameter.\n * Markdown is permitted.\n *\n * NOTE: Corresponds to `ApiParameter.Description` in DocFX.\n */\n description?: string;\n}\n\n/**\n * Part of the IYamlApiFile structure. Used to document exceptions that can be thrown\n * by a method, property, function, or constructor.\n *\n * NOTE: Corresponds to `Microsoft.DocAsCode.DataContracts.UniversalReference.ExceptionInfo` in DocFX.\n */\nexport interface IYamlException {\n /**\n * The Unique Identifier (UID) of the type for this exception.\n *\n * NOTE: Corresponds to `ExceptionInfo.Type` in DocFX.\n */\n type?: string;\n\n /**\n * The description for this exception.\n *\n * NOTE: Corresponds to `ExceptionInfo.Description` in DocFX.\n */\n description?: string;\n}\n\n/**\n * Part of the IYamlApiFile structure. Used to indicate links to external content or other documentation.\n *\n * NOTE: Corresponds to `Microsoft.DocAsCode.DataContracts.UniversalReference.LinkInfo` in DocFX.\n */\nexport interface IYamlLink {\n /**\n * The type of link.\n *\n * The value `\"CRef\"` indicates that `linkId` is a Unique Identifier (UID) reference to\n * another documentation entry.\n *\n * The value `\"HRef\"` indicates that `linkId` is a link to external documentation.\n * NOTE: Corresponds to `LinkInfo.LinkType` in DocFX.\n */\n linkType: 'CRef' | 'HRef';\n\n /**\n * When `linkType` is `\"CRef\"`, this is a Unique Identifier (UID) reference to another documentation entry.\n *\n * When `linkType` is `\"HRef\"`, this is a link to external documentation.\n *\n * NOTE: Corresponds to `LinkInfo.LinkId` in DocFX.\n */\n linkId: string;\n\n /**\n * A Roslyn comment ID for this link.\n *\n * NOTE: Corresponds to `LinkInfo.CommentId` in DocFX.\n */\n commentId?: string;\n\n /**\n * Alternate text to display for thie link.\n *\n * NOTE: Corresponds to `LinkInfo.AltText` in DocFX.\n */\n altText?: string;\n}\n\n/**\n * Part of the IYamlApiFile structure. Represents the inheritance hierarchy of an item.\n *\n * NOTE: Corresponds to `Microsoft.DocAsCode.DataContracts.UniversalReference.InheritanceTree` in DocFX.\n */\nexport interface IYamlInheritanceTree {\n /**\n * The Unique Identifier (UID) of the type from which an item or type inherits.\n *\n * NOTE: Corresponds to `InheritanceTree.Type` in DocFX.\n */\n type: string;\n\n /**\n * The inheritance tree for the specified type. Multiple inheritance is permitted for languages like Python.\n *\n * NOTE: Corresponds to `InheritanceTree.Inheritance` in DocFX.\n */\n inheritance?: IYamlInheritanceTree[];\n}\n\n/**\n * Part of the IYamlApiFile structure. Represents a reference to an item that is\n * declared in a separate YAML file.\n *\n * NOTE: Corresponds to `Microsoft.DocAsCode.DataContracts.Common.ReferenceViewModel` in DocFX.\n */\nexport interface IYamlReference {\n /**\n * NOTE: Corresponds to `ReferenceViewModel.Uid` in DocFX.\n */\n uid?: string;\n\n /**\n * NOTE: Corresponds to `ReferenceViewModel.CommentId` in DocFX.\n */\n commentId?: string;\n\n /**\n * NOTE: Corresponds to `ReferenceViewModel.Parent` in DocFX.\n */\n parent?: string;\n\n /**\n * NOTE: Corresponds to `ReferenceViewModel.Definition` in DocFX.\n */\n definition?: string;\n\n /**\n * NOTE: Corresponds to `ReferenceViewModel.IsExternal` in DocFX.\n */\n isExternal?: boolean;\n\n /**\n * NOTE: Corresponds to `ReferenceViewModel.Href` in DocFX.\n */\n href?: string;\n\n /**\n * NOTE: Corresponds to `ReferenceViewModel.Name` in DocFX.\n * NOTE: Corresponds to `ReferenceViewModel.NameInDevLangs` in DocFX when `name.${lang}` is used.\n */\n name?: string;\n 'name.typeScript'?: string;\n\n /**\n * NOTE: Corresponds to `ReferenceViewModel.NameWithType` in DocFX.\n * NOTE: Corresponds to `ReferenceViewModel.NameWithTypeInDevLangs` in DocFX when `nameWithType.${lang}` is used.\n */\n nameWithType?: string;\n 'nameWithType.typeScript'?: string;\n\n /**\n * NOTE: Corresponds to `ReferenceViewModel.FullName` in DocFX.\n * NOTE: Corresponds to `ReferenceViewModel.FullNameInDevLangs` in DocFX when `fullName.${lang}` is used.\n */\n fullName?: string;\n 'fullName.typeScript'?: string;\n\n /**\n * NOTE: Corresponds to `ReferenceViewModel.Spec` in DocFX.\n */\n 'spec.typeScript'?: IYamlReferenceSpec[];\n}\n\n/**\n * Part of the IYamlApiFile structure. Represents a text specification for a reference.\n *\n * NOTE: Corresponds to `Microsoft.DocAsCode.DataContracts.Common.SpecViewModel` in DocFX.\n */\nexport interface IYamlReferenceSpec {\n /**\n * NOTE: Corresponds to `SpecViewModel.Uid` in DocFX.\n */\n uid?: string;\n\n /**\n * NOTE: Corresponds to `SpecViewModel.Name` in DocFX.\n */\n name?: string;\n\n /**\n * NOTE: Corresponds to `SpecViewModel.NameWithType` in DocFX.\n */\n nameWithType?: string;\n\n /**\n * NOTE: Corresponds to `SpecViewModel.FullName` in DocFX.\n */\n fullName?: string;\n\n /**\n * NOTE: Corresponds to `SpecViewModel.IsExternal` in DocFX.\n */\n isExternal?: boolean;\n\n /**\n * NOTE: Corresponds to `SpecViewModel.Href` in DocFX.\n */\n href?: string;\n}\n\n/**\n * NOTE: This is an extension to the Universal Reference format and does not correspond to\n * a known type in DocFX.\n */\nexport interface IYamlDeprecatedNotice {\n content: string;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IYamlTocFile.js","sourceRoot":"","sources":["../../src/yaml/IYamlTocFile.ts"],"names":[],"mappings":"AAAA,4FAA4F;AAC5F,2DAA2D","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\n/**\n * A node in the navigation hierarchy for the table of contents.\n */\nexport interface IYamlTocItem {\n /**\n * The title to display\n */\n name: string;\n\n /**\n * If specified, the hyperlink will point to the API with this UID\n */\n uid?: string;\n\n /**\n * IF specified, the hyperlink will point to this URL, which may be a relative URL path\n */\n href?: string;\n\n /**\n * Child nodes in the hierarchy\n */\n items?: IYamlTocItem[];\n}\n\n/**\n * TypeScript interface describing the toc.yml file format, used to represent\n * the table of contents for a Universal Reference YAML documentation file.\n */\nexport interface IYamlTocFile {\n items: IYamlTocItem[];\n metadata?: { [key: string]: string };\n}\n"]}
|