@microsoft/api-documenter 7.23.3 → 7.23.4

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.
Files changed (81) hide show
  1. package/dist/rollup.d.ts +2 -2
  2. package/lib/cli/BaseAction.js.map +1 -1
  3. package/lib/cli/GenerateAction.d.ts +1 -1
  4. package/lib/cli/GenerateAction.d.ts.map +1 -1
  5. package/lib/cli/GenerateAction.js.map +1 -1
  6. package/lib/cli/MarkdownAction.d.ts +1 -1
  7. package/lib/cli/MarkdownAction.d.ts.map +1 -1
  8. package/lib/cli/MarkdownAction.js.map +1 -1
  9. package/lib/cli/YamlAction.d.ts +1 -1
  10. package/lib/cli/YamlAction.d.ts.map +1 -1
  11. package/lib/cli/YamlAction.js.map +1 -1
  12. package/lib/documenters/DocumenterConfig.d.ts +1 -1
  13. package/lib/documenters/DocumenterConfig.d.ts.map +1 -1
  14. package/lib/documenters/DocumenterConfig.js.map +1 -1
  15. package/lib/documenters/ExperimentalYamlDocumenter.d.ts +3 -3
  16. package/lib/documenters/ExperimentalYamlDocumenter.d.ts.map +1 -1
  17. package/lib/documenters/ExperimentalYamlDocumenter.js.map +1 -1
  18. package/lib/documenters/IConfigFile.d.ts +1 -1
  19. package/lib/documenters/IConfigFile.d.ts.map +1 -1
  20. package/lib/documenters/IConfigFile.js.map +1 -1
  21. package/lib/documenters/MarkdownDocumenter.d.ts +2 -2
  22. package/lib/documenters/MarkdownDocumenter.d.ts.map +1 -1
  23. package/lib/documenters/MarkdownDocumenter.js.map +1 -1
  24. package/lib/documenters/OfficeYamlDocumenter.d.ts +3 -3
  25. package/lib/documenters/OfficeYamlDocumenter.d.ts.map +1 -1
  26. package/lib/documenters/OfficeYamlDocumenter.js.map +1 -1
  27. package/lib/documenters/YamlDocumenter.d.ts +4 -4
  28. package/lib/documenters/YamlDocumenter.d.ts.map +1 -1
  29. package/lib/documenters/YamlDocumenter.js.map +1 -1
  30. package/lib/markdown/CustomMarkdownEmitter.d.ts +3 -3
  31. package/lib/markdown/CustomMarkdownEmitter.d.ts.map +1 -1
  32. package/lib/markdown/CustomMarkdownEmitter.js.map +1 -1
  33. package/lib/markdown/MarkdownEmitter.d.ts +1 -1
  34. package/lib/markdown/MarkdownEmitter.d.ts.map +1 -1
  35. package/lib/markdown/MarkdownEmitter.js.map +1 -1
  36. package/lib/nodes/CustomDocNodeKind.d.ts.map +1 -1
  37. package/lib/nodes/CustomDocNodeKind.js +2 -0
  38. package/lib/nodes/CustomDocNodeKind.js.map +1 -1
  39. package/lib/nodes/DocEmphasisSpan.d.ts +1 -1
  40. package/lib/nodes/DocEmphasisSpan.d.ts.map +1 -1
  41. package/lib/nodes/DocEmphasisSpan.js.map +1 -1
  42. package/lib/nodes/DocHeading.d.ts +1 -1
  43. package/lib/nodes/DocHeading.d.ts.map +1 -1
  44. package/lib/nodes/DocHeading.js.map +1 -1
  45. package/lib/nodes/DocNoteBox.d.ts +1 -1
  46. package/lib/nodes/DocNoteBox.d.ts.map +1 -1
  47. package/lib/nodes/DocNoteBox.js.map +1 -1
  48. package/lib/nodes/DocTable.d.ts +2 -2
  49. package/lib/nodes/DocTable.d.ts.map +1 -1
  50. package/lib/nodes/DocTable.js.map +1 -1
  51. package/lib/nodes/DocTableCell.d.ts +1 -1
  52. package/lib/nodes/DocTableCell.d.ts.map +1 -1
  53. package/lib/nodes/DocTableCell.js.map +1 -1
  54. package/lib/nodes/DocTableRow.d.ts +1 -1
  55. package/lib/nodes/DocTableRow.d.ts.map +1 -1
  56. package/lib/nodes/DocTableRow.js.map +1 -1
  57. package/lib/plugin/IApiDocumenterPluginManifest.d.ts +2 -2
  58. package/lib/plugin/IApiDocumenterPluginManifest.d.ts.map +1 -1
  59. package/lib/plugin/IApiDocumenterPluginManifest.js.map +1 -1
  60. package/lib/plugin/MarkdownDocumenterAccessor.d.ts +1 -1
  61. package/lib/plugin/MarkdownDocumenterAccessor.d.ts.map +1 -1
  62. package/lib/plugin/MarkdownDocumenterAccessor.js.map +1 -1
  63. package/lib/plugin/MarkdownDocumenterFeature.d.ts +2 -2
  64. package/lib/plugin/MarkdownDocumenterFeature.d.ts.map +1 -1
  65. package/lib/plugin/MarkdownDocumenterFeature.js.map +1 -1
  66. package/lib/plugin/PluginLoader.d.ts +2 -2
  67. package/lib/plugin/PluginLoader.d.ts.map +1 -1
  68. package/lib/plugin/PluginLoader.js.map +1 -1
  69. package/lib/utils/IndentedWriter.d.ts +1 -1
  70. package/lib/utils/IndentedWriter.d.ts.map +1 -1
  71. package/lib/utils/IndentedWriter.js.map +1 -1
  72. package/lib/utils/ToSdpConvertHelper.d.ts.map +1 -1
  73. package/lib/utils/ToSdpConvertHelper.js +2 -0
  74. package/lib/utils/ToSdpConvertHelper.js.map +1 -1
  75. package/lib/utils/Utilities.d.ts +1 -1
  76. package/lib/utils/Utilities.d.ts.map +1 -1
  77. package/lib/utils/Utilities.js.map +1 -1
  78. package/lib/yaml/ISDPYamlFile.d.ts.map +1 -1
  79. package/lib/yaml/ISDPYamlFile.js +2 -0
  80. package/lib/yaml/ISDPYamlFile.js.map +1 -1
  81. package/package.json +5 -6
@@ -1 +1 @@
1
- {"version":3,"file":"DocTable.d.ts","sourceRoot":"","sources":["../../src/nodes/DocTable.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,kBAAkB,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAE/D,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C;;GAEG;AACH,MAAM,WAAW,mBAAoB,SAAQ,kBAAkB;IAC7D,WAAW,CAAC,EAAE,aAAa,CAAC,YAAY,CAAC,CAAC;IAC1C,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;CACzB;AAED;;GAEG;AACH,qBAAa,QAAS,SAAQ,OAAO;IACnC,SAAgB,MAAM,EAAE,WAAW,CAAC;IAEpC,OAAO,CAAC,KAAK,CAAgB;g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AAC;IAEM,eAAe;QACpB,MAAM,GAAG,GAAgB,IAAI,yBAAW,CAAC,EAAE,aAAa,EAAE,IAAI,CAAC,aAAa,EAAE,CAAC,CAAC;QAChF,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QACjB,OAAO,GAAG,CAAC;IACb,CAAC;IAED,gBAAgB;IACN,eAAe;QACvB,OAAO,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC;IACtC,CAAC;CACF;AA3DD,4BA2DC","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 { IDocNodeParameters, DocNode } from '@microsoft/tsdoc';\nimport { CustomDocNodeKind } from './CustomDocNodeKind';\nimport { DocTableRow } from './DocTableRow';\nimport { DocTableCell } from './DocTableCell';\n\n/**\n * Constructor parameters for {@link DocTable}.\n */\nexport interface IDocTableParameters extends IDocNodeParameters {\n headerCells?: ReadonlyArray<DocTableCell>;\n headerTitles?: string[];\n}\n\n/**\n * Represents table, similar to an HTML `<table>` element.\n */\nexport class DocTable extends DocNode {\n public readonly header: DocTableRow;\n\n private _rows: DocTableRow[];\n\n public constructor(parameters: IDocTableParameters, rows?: ReadonlyArray<DocTableRow>) {\n super(parameters);\n\n this.header = new DocTableRow({ configuration: this.configuration });\n this._rows = [];\n\n if (parameters) {\n if (parameters.headerTitles) {\n if (parameters.headerCells) {\n throw new Error(\n 'IDocTableParameters.headerCells and IDocTableParameters.headerTitles' +\n ' cannot both be specified'\n );\n }\n for (const cellText of parameters.headerTitles) {\n this.header.addPlainTextCell(cellText);\n }\n } else if (parameters.headerCells) {\n for (const cell of parameters.headerCells) {\n this.header.addCell(cell);\n }\n }\n }\n\n if (rows) {\n for (const row of rows) {\n this.addRow(row);\n }\n }\n }\n\n /** @override */\n public get kind(): string {\n return CustomDocNodeKind.Table;\n }\n\n public get rows(): ReadonlyArray<DocTableRow> {\n return this._rows;\n }\n\n public addRow(row: DocTableRow): void {\n this._rows.push(row);\n }\n\n public createAndAddRow(): DocTableRow {\n const row: DocTableRow = new DocTableRow({ configuration: this.configuration });\n this.addRow(row);\n return row;\n }\n\n /** @override */\n protected onGetChildNodes(): ReadonlyArray<DocNode | undefined> {\n return [this.header, ...this._rows];\n }\n}\n"]}
1
+ {"version":3,"file":"DocTable.js","sourceRoot":"","sources":["../../src/nodes/DocTable.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAE3D,4CAAoE;AAEpE,+CAA4C;AAW5C;;GAEG;AACH,MAAa,QAAS,SAAQ,eAAO;IAKnC,YAAmB,UAA+B,EAAE,IAAiC;QACnF,KAAK,CAAC,UAAU,CAAC,CAAC;QAElB,IAAI,CAAC,MAAM,GAAG,IAAI,yBAAW,CAAC,EAAE,aAAa,EAAE,IAAI,CAAC,aAAa,EAAE,CAAC,CAAC;QACrE,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;QAEhB,IAAI,UAAU,EAAE;YACd,IAAI,UAAU,CAAC,YAAY,EAAE;gBAC3B,IAAI,UAAU,CAAC,WAAW,EAAE;oBAC1B,MAAM,IAAI,KAAK,CACb,sEAAsE;wBACpE,2BAA2B,CAC9B,CAAC;iBACH;gBACD,KAAK,MAAM,QAAQ,IAAI,UAAU,CAAC,YAAY,EAAE;oBAC9C,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC;iBACxC;aACF;iBAAM,IAAI,UAAU,CAAC,WAAW,EAAE;gBACjC,KAAK,MAAM,IAAI,IAAI,UAAU,CAAC,WAAW,EAAE;oBACzC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;iBAC3B;aACF;SACF;QAED,IAAI,IAAI,EAAE;YACR,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE;gBACtB,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;aAClB;SACF;IACH,CAAC;IAED,gBAAgB;IAChB,IAAW,IAAI;QACb,6CAA+B;IACjC,CAAC;IAED,IAAW,IAAI;QACb,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IAEM,MAAM,CAAC,GAAgB;QAC5B,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACvB,CAAC;IAEM,eAAe;QACpB,MAAM,GAAG,GAAgB,IAAI,yBAAW,CAAC,EAAE,aAAa,EAAE,IAAI,CAAC,aAAa,EAAE,CAAC,CAAC;QAChF,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QACjB,OAAO,GAAG,CAAC;IACb,CAAC;IAED,gBAAgB;IACN,eAAe;QACvB,OAAO,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC;IACtC,CAAC;CACF;AA3DD,4BA2DC","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 { type IDocNodeParameters, DocNode } from '@microsoft/tsdoc';\nimport { CustomDocNodeKind } from './CustomDocNodeKind';\nimport { DocTableRow } from './DocTableRow';\nimport type { DocTableCell } from './DocTableCell';\n\n/**\n * Constructor parameters for {@link DocTable}.\n */\nexport interface IDocTableParameters extends IDocNodeParameters {\n headerCells?: ReadonlyArray<DocTableCell>;\n headerTitles?: string[];\n}\n\n/**\n * Represents table, similar to an HTML `<table>` element.\n */\nexport class DocTable extends DocNode {\n public readonly header: DocTableRow;\n\n private _rows: DocTableRow[];\n\n public constructor(parameters: IDocTableParameters, rows?: ReadonlyArray<DocTableRow>) {\n super(parameters);\n\n this.header = new DocTableRow({ configuration: this.configuration });\n this._rows = [];\n\n if (parameters) {\n if (parameters.headerTitles) {\n if (parameters.headerCells) {\n throw new Error(\n 'IDocTableParameters.headerCells and IDocTableParameters.headerTitles' +\n ' cannot both be specified'\n );\n }\n for (const cellText of parameters.headerTitles) {\n this.header.addPlainTextCell(cellText);\n }\n } else if (parameters.headerCells) {\n for (const cell of parameters.headerCells) {\n this.header.addCell(cell);\n }\n }\n }\n\n if (rows) {\n for (const row of rows) {\n this.addRow(row);\n }\n }\n }\n\n /** @override */\n public get kind(): string {\n return CustomDocNodeKind.Table;\n }\n\n public get rows(): ReadonlyArray<DocTableRow> {\n return this._rows;\n }\n\n public addRow(row: DocTableRow): void {\n this._rows.push(row);\n }\n\n public createAndAddRow(): DocTableRow {\n const row: DocTableRow = new DocTableRow({ configuration: this.configuration });\n this.addRow(row);\n return row;\n }\n\n /** @override */\n protected onGetChildNodes(): ReadonlyArray<DocNode | undefined> {\n return [this.header, ...this._rows];\n }\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { IDocNodeParameters, DocNode, DocSection } from '@microsoft/tsdoc';
1
+ import { type IDocNodeParameters, DocNode, DocSection } from '@microsoft/tsdoc';
2
2
  /**
3
3
  * Constructor parameters for {@link DocTableCell}.
4
4
  */
@@ -1 +1 @@
1
- {"version":3,"file":"DocTableCell.d.ts","sourceRoot":"","sources":["../../src/nodes/DocTableCell.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,kBAAkB,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAG3E;;GAEG;AACH,MAAM,WAAW,uBAAwB,SAAQ,kBAAkB;CAAG;AAEtE;;GAEG;AACH,qBAAa,YAAa,SAAQ,OAAO;IACvC,SAAgB,OAAO,EAAE,UAAU,CAAC;gBAEjB,UAAU,EAAE,uBAAuB,EAAE,iBAAiB,CAAC,EAAE,aAAa,CAAC,OAAO,CAAC;IAMlG,gBAAgB;IAChB,IAAW,IAAI,IAAI,MAAM,CAExB;CACF"}
1
+ {"version":3,"file":"DocTableCell.d.ts","sourceRoot":"","sources":["../../src/nodes/DocTableCell.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,kBAAkB,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAGhF;;GAEG;AACH,MAAM,WAAW,uBAAwB,SAAQ,kBAAkB;CAAG;AAEtE;;GAEG;AACH,qBAAa,YAAa,SAAQ,OAAO;IACvC,SAAgB,OAAO,EAAE,UAAU,CAAC;gBAEjB,UAAU,EAAE,uBAAuB,EAAE,iBAAiB,CAAC,EAAE,aAAa,CAAC,OAAO,CAAC;IAMlG,gBAAgB;IAChB,IAAW,IAAI,IAAI,MAAM,CAExB;CACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"DocTableCell.js","sourceRoot":"","sources":["../../src/nodes/DocTableCell.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAE3D,4CAA2E;AAQ3E;;GAEG;AACH,MAAa,YAAa,SAAQ,eAAO;IAGvC,YAAmB,UAAmC,EAAE,iBAA0C;QAChG,KAAK,CAAC,UAAU,CAAC,CAAC;QAElB,IAAI,CAAC,OAAO,GAAG,IAAI,kBAAU,CAAC,EAAE,aAAa,EAAE,IAAI,CAAC,aAAa,EAAE,EAAE,iBAAiB,CAAC,CAAC;IAC1F,CAAC;IAED,gBAAgB;IAChB,IAAW,IAAI;QACb,qDAAmC;IACrC,CAAC;CACF;AAbD,oCAaC","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 { IDocNodeParameters, DocNode, DocSection } from '@microsoft/tsdoc';\nimport { CustomDocNodeKind } from './CustomDocNodeKind';\n\n/**\n * Constructor parameters for {@link DocTableCell}.\n */\nexport interface IDocTableCellParameters extends IDocNodeParameters {}\n\n/**\n * Represents table cell, similar to an HTML `<td>` element.\n */\nexport class DocTableCell extends DocNode {\n public readonly content: DocSection;\n\n public constructor(parameters: IDocTableCellParameters, sectionChildNodes?: ReadonlyArray<DocNode>) {\n super(parameters);\n\n this.content = new DocSection({ configuration: this.configuration }, sectionChildNodes);\n }\n\n /** @override */\n public get kind(): string {\n return CustomDocNodeKind.TableCell;\n }\n}\n"]}
1
+ {"version":3,"file":"DocTableCell.js","sourceRoot":"","sources":["../../src/nodes/DocTableCell.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAE3D,4CAAgF;AAQhF;;GAEG;AACH,MAAa,YAAa,SAAQ,eAAO;IAGvC,YAAmB,UAAmC,EAAE,iBAA0C;QAChG,KAAK,CAAC,UAAU,CAAC,CAAC;QAElB,IAAI,CAAC,OAAO,GAAG,IAAI,kBAAU,CAAC,EAAE,aAAa,EAAE,IAAI,CAAC,aAAa,EAAE,EAAE,iBAAiB,CAAC,CAAC;IAC1F,CAAC;IAED,gBAAgB;IAChB,IAAW,IAAI;QACb,qDAAmC;IACrC,CAAC;CACF;AAbD,oCAaC","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 { type IDocNodeParameters, DocNode, DocSection } from '@microsoft/tsdoc';\nimport { CustomDocNodeKind } from './CustomDocNodeKind';\n\n/**\n * Constructor parameters for {@link DocTableCell}.\n */\nexport interface IDocTableCellParameters extends IDocNodeParameters {}\n\n/**\n * Represents table cell, similar to an HTML `<td>` element.\n */\nexport class DocTableCell extends DocNode {\n public readonly content: DocSection;\n\n public constructor(parameters: IDocTableCellParameters, sectionChildNodes?: ReadonlyArray<DocNode>) {\n super(parameters);\n\n this.content = new DocSection({ configuration: this.configuration }, sectionChildNodes);\n }\n\n /** @override */\n public get kind(): string {\n return CustomDocNodeKind.TableCell;\n }\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { IDocNodeParameters, DocNode } from '@microsoft/tsdoc';
1
+ import { type IDocNodeParameters, DocNode } from '@microsoft/tsdoc';
2
2
  import { DocTableCell } from './DocTableCell';
3
3
  /**
4
4
  * Constructor parameters for {@link DocTableRow}.
@@ -1 +1 @@
1
- {"version":3,"file":"DocTableRow.d.ts","sourceRoot":"","sources":["../../src/nodes/DocTableRow.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,kBAAkB,EAAE,OAAO,EAAgB,MAAM,kBAAkB,CA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,OAAO,IAAI,CAAC;IACd,CAAC;IAED,gBAAgB;IACN,eAAe;QACvB,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;CACF;AAhDD,kCAgDC","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 { IDocNodeParameters, DocNode, DocPlainText } from '@microsoft/tsdoc';\nimport { CustomDocNodeKind } from './CustomDocNodeKind';\nimport { DocTableCell } from './DocTableCell';\n\n/**\n * Constructor parameters for {@link DocTableRow}.\n */\nexport interface IDocTableRowParameters extends IDocNodeParameters {}\n\n/**\n * Represents table row, similar to an HTML `<tr>` element.\n */\nexport class DocTableRow extends DocNode {\n private readonly _cells: DocTableCell[];\n\n public constructor(parameters: IDocTableRowParameters, cells?: ReadonlyArray<DocTableCell>) {\n super(parameters);\n\n this._cells = [];\n if (cells) {\n for (const cell of cells) {\n this.addCell(cell);\n }\n }\n }\n\n /** @override */\n public get kind(): string {\n return CustomDocNodeKind.TableRow;\n }\n\n public get cells(): ReadonlyArray<DocTableCell> {\n return this._cells;\n }\n\n public addCell(cell: DocTableCell): void {\n this._cells.push(cell);\n }\n\n public createAndAddCell(): DocTableCell {\n const newCell: DocTableCell = new DocTableCell({ configuration: this.configuration });\n this.addCell(newCell);\n return newCell;\n }\n\n public addPlainTextCell(cellContent: string): DocTableCell {\n const cell: DocTableCell = this.createAndAddCell();\n cell.content.appendNodeInParagraph(\n new DocPlainText({\n configuration: this.configuration,\n text: cellContent\n })\n );\n return cell;\n }\n\n /** @override */\n protected onGetChildNodes(): ReadonlyArray<DocNode | undefined> {\n return this._cells;\n }\n}\n"]}
1
+ {"version":3,"file":"DocTableRow.js","sourceRoot":"","sources":["../../src/nodes/DocTableRow.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAE3D,4CAAkF;AAElF,iDAA8C;AAO9C;;GAEG;AACH,MAAa,WAAY,SAAQ,eAAO;IAGtC,YAAmB,UAAkC,EAAE,KAAmC;QACxF,KAAK,CAAC,UAAU,CAAC,CAAC;QAElB,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC;QACjB,IAAI,KAAK,EAAE;YACT,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE;gBACxB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;aACpB;SACF;IACH,CAAC;IAED,gBAAgB;IAChB,IAAW,IAAI;QACb,mDAAkC;IACpC,CAAC;IAED,IAAW,KAAK;QACd,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAEM,OAAO,CAAC,IAAkB;QAC/B,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACzB,CAAC;IAEM,gBAAgB;QACrB,MAAM,OAAO,GAAiB,IAAI,2BAAY,CAAC,EAAE,aAAa,EAAE,IAAI,CAAC,aAAa,EAAE,CAAC,CAAC;QACtF,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QACtB,OAAO,OAAO,CAAC;IACjB,CAAC;IAEM,gBAAgB,CAAC,WAAmB;QACzC,MAAM,IAAI,GAAiB,IAAI,CAAC,gBAAgB,EAAE,CAAC;QACnD,IAAI,CAAC,OAAO,CAAC,qBAAqB,CAChC,IAAI,oBAAY,CAAC;YACf,aAAa,EAAE,IAAI,CAAC,aAAa;YACjC,IAAI,EAAE,WAAW;SAClB,CAAC,CACH,CAAC;QACF,OAAO,IAAI,CAAC;IACd,CAAC;IAED,gBAAgB;IACN,eAAe;QACvB,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;CACF;AAhDD,kCAgDC","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 { type IDocNodeParameters, DocNode, DocPlainText } from '@microsoft/tsdoc';\nimport { CustomDocNodeKind } from './CustomDocNodeKind';\nimport { DocTableCell } from './DocTableCell';\n\n/**\n * Constructor parameters for {@link DocTableRow}.\n */\nexport interface IDocTableRowParameters extends IDocNodeParameters {}\n\n/**\n * Represents table row, similar to an HTML `<tr>` element.\n */\nexport class DocTableRow extends DocNode {\n private readonly _cells: DocTableCell[];\n\n public constructor(parameters: IDocTableRowParameters, cells?: ReadonlyArray<DocTableCell>) {\n super(parameters);\n\n this._cells = [];\n if (cells) {\n for (const cell of cells) {\n this.addCell(cell);\n }\n }\n }\n\n /** @override */\n public get kind(): string {\n return CustomDocNodeKind.TableRow;\n }\n\n public get cells(): ReadonlyArray<DocTableCell> {\n return this._cells;\n }\n\n public addCell(cell: DocTableCell): void {\n this._cells.push(cell);\n }\n\n public createAndAddCell(): DocTableCell {\n const newCell: DocTableCell = new DocTableCell({ configuration: this.configuration });\n this.addCell(newCell);\n return newCell;\n }\n\n public addPlainTextCell(cellContent: string): DocTableCell {\n const cell: DocTableCell = this.createAndAddCell();\n cell.content.appendNodeInParagraph(\n new DocPlainText({\n configuration: this.configuration,\n text: cellContent\n })\n );\n return cell;\n }\n\n /** @override */\n protected onGetChildNodes(): ReadonlyArray<DocNode | undefined> {\n return this._cells;\n }\n}\n"]}
@@ -1,5 +1,5 @@
1
- import { MarkdownDocumenterFeature } from './MarkdownDocumenterFeature';
2
- import { PluginFeatureInitialization } from './PluginFeature';
1
+ import type { MarkdownDocumenterFeature } from './MarkdownDocumenterFeature';
2
+ import type { PluginFeatureInitialization } from './PluginFeature';
3
3
  /**
4
4
  * Defines a "feature" that is provided by an API Documenter plugin. A feature is a user-defined module
5
5
  * that customizes the behavior of API Documenter.
@@ -1 +1 @@
1
- {"version":3,"file":"IApiDocumenterPluginManifest.d.ts","sourceRoot":"","sources":["../../src/plugin/IApiDocumenterPluginManifest.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,EAAE,2BAA2B,EAAE,MAAM,iBAAiB,CAAC;AAE9D;;;;;GAKG;AACH,MAAM,WAAW,kBAAkB;IACjC;;;;;OAKG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;;;;OAKG;IACH,IAAI,EAAE,2BAA2B,CAAC;IAElC;;OAEG;IACH,QAAQ,EAAE;QAAE,KAAK,cAAc,EAAE,2BAA2B,GAAG,yBAAyB,CAAA;KAAE,CAAC;CAC5F;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,MAAM,WAAW,4BAA4B;IAC3C;;OAEG;IACH,eAAe,EAAE,IAAI,CAAC;IAEtB;;OAEG;IACH,QAAQ,EAAE,kBAAkB,EAAE,CAAC;CAChC"}
1
+ {"version":3,"file":"IApiDocumenterPluginManifest.d.ts","sourceRoot":"","sources":["../../src/plugin/IApiDocumenterPluginManifest.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AAC7E,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,iBAAiB,CAAC;AAEnE;;;;;GAKG;AACH,MAAM,WAAW,kBAAkB;IACjC;;;;;OAKG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;;;;OAKG;IACH,IAAI,EAAE,2BAA2B,CAAC;IAElC;;OAEG;IACH,QAAQ,EAAE;QAAE,KAAK,cAAc,EAAE,2BAA2B,GAAG,yBAAyB,CAAA;KAAE,CAAC;CAC5F;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,MAAM,WAAW,4BAA4B;IAC3C;;OAEG;IACH,eAAe,EAAE,IAAI,CAAC;IAEtB;;OAEG;IACH,QAAQ,EAAE,kBAAkB,EAAE,CAAC;CAChC"}
@@ -1 +1 @@
1
- {"version":3,"file":"IApiDocumenterPluginManifest.js","sourceRoot":"","sources":["../../src/plugin/IApiDocumenterPluginManifest.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\nimport { MarkdownDocumenterFeature } from './MarkdownDocumenterFeature';\nimport { PluginFeatureInitialization } from './PluginFeature';\n\n/**\n * Defines a \"feature\" that is provided by an API Documenter plugin. A feature is a user-defined module\n * that customizes the behavior of API Documenter.\n *\n * @public\n */\nexport interface IFeatureDefinition {\n /**\n * The name of this feature, as it will appear in the config file.\n *\n * The name should consist of one or more words separated by hyphens. Each word should consist of lower case\n * letters and numbers. Example: `my-feature`\n */\n featureName: string;\n\n /**\n * Determines the kind of feature. The specified value is the name of the base class that `subclass` inherits from.\n *\n * @remarks\n * For now, `MarkdownDocumenterFeature` is the only supported value.\n */\n kind: 'MarkdownDocumenterFeature';\n\n /**\n * Your subclass that extends from the base class.\n */\n subclass: { new (initialization: PluginFeatureInitialization): MarkdownDocumenterFeature };\n}\n\n/**\n * The manifest for an API Documenter plugin.\n *\n * @remarks\n * An API documenter plugin is an NPM package. By convention, the NPM package name should have the prefix\n * `doc-plugin-`. Its main entry point should export an object named `apiDocumenterPluginManifest` which implements\n * the `IApiDocumenterPluginManifest` interface.\n *\n * For example:\n * ```ts\n * class MyMarkdownDocumenter extends MarkdownDocumenterFeature {\n * public onInitialized(): void {\n * console.log('MyMarkdownDocumenter: onInitialized()');\n * }\n * }\n *\n * export const apiDocumenterPluginManifest: IApiDocumenterPluginManifest = {\n * manifestVersion: 1000,\n * features: [\n * {\n * featureName: 'my-markdown-documenter',\n * kind: 'MarkdownDocumenterFeature',\n * subclass: MyMarkdownDocumenter\n * }\n * ]\n * };\n * ```\n * @public\n */\nexport interface IApiDocumenterPluginManifest {\n /**\n * The manifest version number. For now, this must always be `1000`.\n */\n manifestVersion: 1000;\n\n /**\n * The list of features provided by this plugin.\n */\n features: IFeatureDefinition[];\n}\n"]}
1
+ {"version":3,"file":"IApiDocumenterPluginManifest.js","sourceRoot":"","sources":["../../src/plugin/IApiDocumenterPluginManifest.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\nimport type { MarkdownDocumenterFeature } from './MarkdownDocumenterFeature';\nimport type { PluginFeatureInitialization } from './PluginFeature';\n\n/**\n * Defines a \"feature\" that is provided by an API Documenter plugin. A feature is a user-defined module\n * that customizes the behavior of API Documenter.\n *\n * @public\n */\nexport interface IFeatureDefinition {\n /**\n * The name of this feature, as it will appear in the config file.\n *\n * The name should consist of one or more words separated by hyphens. Each word should consist of lower case\n * letters and numbers. Example: `my-feature`\n */\n featureName: string;\n\n /**\n * Determines the kind of feature. The specified value is the name of the base class that `subclass` inherits from.\n *\n * @remarks\n * For now, `MarkdownDocumenterFeature` is the only supported value.\n */\n kind: 'MarkdownDocumenterFeature';\n\n /**\n * Your subclass that extends from the base class.\n */\n subclass: { new (initialization: PluginFeatureInitialization): MarkdownDocumenterFeature };\n}\n\n/**\n * The manifest for an API Documenter plugin.\n *\n * @remarks\n * An API documenter plugin is an NPM package. By convention, the NPM package name should have the prefix\n * `doc-plugin-`. Its main entry point should export an object named `apiDocumenterPluginManifest` which implements\n * the `IApiDocumenterPluginManifest` interface.\n *\n * For example:\n * ```ts\n * class MyMarkdownDocumenter extends MarkdownDocumenterFeature {\n * public onInitialized(): void {\n * console.log('MyMarkdownDocumenter: onInitialized()');\n * }\n * }\n *\n * export const apiDocumenterPluginManifest: IApiDocumenterPluginManifest = {\n * manifestVersion: 1000,\n * features: [\n * {\n * featureName: 'my-markdown-documenter',\n * kind: 'MarkdownDocumenterFeature',\n * subclass: MyMarkdownDocumenter\n * }\n * ]\n * };\n * ```\n * @public\n */\nexport interface IApiDocumenterPluginManifest {\n /**\n * The manifest version number. For now, this must always be `1000`.\n */\n manifestVersion: 1000;\n\n /**\n * The list of features provided by this plugin.\n */\n features: IFeatureDefinition[];\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { ApiItem } from '@microsoft/api-extractor-model';
1
+ import type { ApiItem } from '@microsoft/api-extractor-model';
2
2
  /** @internal */
3
3
  export interface IMarkdownDocumenterAccessorImplementation {
4
4
  getLinkForApiItem(apiItem: ApiItem): string | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"MarkdownDocumenterAccessor.d.ts","sourceRoot":"","sources":["../../src/plugin/MarkdownDocumenterAccessor.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAC;AAEzD,gBAAgB;AAChB,MAAM,WAAW,yCAAyC;IACxD,iBAAiB,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAAC;CACzD;AAED;;;;;;;;GAQG;AACH,qBAAa,0BAA0B;IACrC,OAAO,CAAC,eAAe,CAA4C;IAEnE,gBAAgB;gBACG,cAAc,EAAE,yCAAyC;IAI5E;;;;OAIG;IACI,iBAAiB,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS;CAG/D"}
1
+ {"version":3,"file":"MarkdownDocumenterAccessor.d.ts","sourceRoot":"","sources":["../../src/plugin/MarkdownDocumenterAccessor.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAC;AAE9D,gBAAgB;AAChB,MAAM,WAAW,yCAAyC;IACxD,iBAAiB,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAAC;CACzD;AAED;;;;;;;;GAQG;AACH,qBAAa,0BAA0B;IACrC,OAAO,CAAC,eAAe,CAA4C;IAEnE,gBAAgB;gBACG,cAAc,EAAE,yCAAyC;IAI5E;;;;OAIG;IACI,iBAAiB,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS;CAG/D"}
@@ -1 +1 @@
1
- {"version":3,"file":"MarkdownDocumenterAccessor.js","sourceRoot":"","sources":["../../src/plugin/MarkdownDocumenterAccessor.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAS3D;;;;;;;;GAQG;AACH,MAAa,0BAA0B;IAGrC,gBAAgB;IAChB,YAAmB,cAAyD;QAC1E,IAAI,CAAC,eAAe,GAAG,cAAc,CAAC;IACxC,CAAC;IAED;;;;OAIG;IACI,iBAAiB,CAAC,OAAgB;QACvC,OAAO,IAAI,CAAC,eAAe,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC;IACzD,CAAC;CACF;AAhBD,gEAgBC","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 { ApiItem } from '@microsoft/api-extractor-model';\n\n/** @internal */\nexport interface IMarkdownDocumenterAccessorImplementation {\n getLinkForApiItem(apiItem: ApiItem): string | undefined;\n}\n\n/**\n * Provides access to the documenter that is generating the output.\n *\n * @privateRemarks\n * This class is wrapper that provides access to the underlying MarkdownDocumenter, while hiding the implementation\n * details to ensure that the plugin API contract is stable.\n *\n * @public\n */\nexport class MarkdownDocumenterAccessor {\n private _implementation: IMarkdownDocumenterAccessorImplementation;\n\n /** @internal */\n public constructor(implementation: IMarkdownDocumenterAccessorImplementation) {\n this._implementation = implementation;\n }\n\n /**\n * For a given `ApiItem`, return its markdown hyperlink.\n *\n * @returns The hyperlink, or `undefined` if the `ApiItem` object does not have a hyperlink.\n */\n public getLinkForApiItem(apiItem: ApiItem): string | undefined {\n return this._implementation.getLinkForApiItem(apiItem);\n }\n}\n"]}
1
+ {"version":3,"file":"MarkdownDocumenterAccessor.js","sourceRoot":"","sources":["../../src/plugin/MarkdownDocumenterAccessor.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAS3D;;;;;;;;GAQG;AACH,MAAa,0BAA0B;IAGrC,gBAAgB;IAChB,YAAmB,cAAyD;QAC1E,IAAI,CAAC,eAAe,GAAG,cAAc,CAAC;IACxC,CAAC;IAED;;;;OAIG;IACI,iBAAiB,CAAC,OAAgB;QACvC,OAAO,IAAI,CAAC,eAAe,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC;IACzD,CAAC;CACF;AAhBD,gEAgBC","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 type { ApiItem } from '@microsoft/api-extractor-model';\n\n/** @internal */\nexport interface IMarkdownDocumenterAccessorImplementation {\n getLinkForApiItem(apiItem: ApiItem): string | undefined;\n}\n\n/**\n * Provides access to the documenter that is generating the output.\n *\n * @privateRemarks\n * This class is wrapper that provides access to the underlying MarkdownDocumenter, while hiding the implementation\n * details to ensure that the plugin API contract is stable.\n *\n * @public\n */\nexport class MarkdownDocumenterAccessor {\n private _implementation: IMarkdownDocumenterAccessorImplementation;\n\n /** @internal */\n public constructor(implementation: IMarkdownDocumenterAccessorImplementation) {\n this._implementation = implementation;\n }\n\n /**\n * For a given `ApiItem`, return its markdown hyperlink.\n *\n * @returns The hyperlink, or `undefined` if the `ApiItem` object does not have a hyperlink.\n */\n public getLinkForApiItem(apiItem: ApiItem): string | undefined {\n return this._implementation.getLinkForApiItem(apiItem);\n }\n}\n"]}
@@ -1,6 +1,6 @@
1
- import { ApiItem, ApiModel } from '@microsoft/api-extractor-model';
1
+ import type { ApiItem, ApiModel } from '@microsoft/api-extractor-model';
2
2
  import { PluginFeature } from './PluginFeature';
3
- import { MarkdownDocumenterAccessor } from './MarkdownDocumenterAccessor';
3
+ import type { MarkdownDocumenterAccessor } from './MarkdownDocumenterAccessor';
4
4
  /**
5
5
  * Context object for {@link MarkdownDocumenterFeature}.
6
6
  * Exposes various services that can be used by a plugin.
@@ -1 +1 @@
1
- {"version":3,"file":"MarkdownDocumenterFeature.d.ts","sourceRoot":"","sources":["../../src/plugin/MarkdownDocumenterFeature.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAEnE,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAE1E;;;;;GAKG;AACH,qBAAa,gCAAgC;IAC3C;;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;IACI,UAAU,CAAC,SAAmD;QACnE,+BAA+B;IACjC,CAAC;IAEM,MAAM,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,QAAgB;QACjD,OAAO,4BAAQ,CAAC,YAAY,CAAC,QAAQ,EAAE,6BAA6B,CAAC,CAAC;IACxE,CAAC;CACF;AAxBD,8DAwBC;AAED,4BAAQ,CAAC,aAAa,CAAC,yBAAyB,EAAE,6BAA6B,CAAC,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 { ApiItem, ApiModel } from '@microsoft/api-extractor-model';\nimport { TypeUuid } from '@rushstack/node-core-library';\nimport { PluginFeature } from './PluginFeature';\nimport { MarkdownDocumenterAccessor } from './MarkdownDocumenterAccessor';\n\n/**\n * Context object for {@link MarkdownDocumenterFeature}.\n * Exposes various services that can be used by a plugin.\n *\n * @public\n */\nexport class MarkdownDocumenterFeatureContext {\n /**\n * Provides access to the `ApiModel` for the documentation being generated.\n */\n public readonly apiModel: ApiModel;\n\n /**\n * The full path to the output folder.\n */\n public readonly outputFolder: string;\n\n /**\n * Exposes functionality of the documenter.\n */\n public readonly documenter: MarkdownDocumenterAccessor;\n\n /** @internal */\n public constructor(options: MarkdownDocumenterFeatureContext) {\n this.apiModel = options.apiModel;\n this.outputFolder = options.outputFolder;\n this.documenter = options.documenter;\n }\n}\n\n/**\n * Event arguments for MarkdownDocumenterFeature.onBeforeWritePage()\n * @public\n */\nexport interface IMarkdownDocumenterFeatureOnBeforeWritePageArgs {\n /**\n * The API item corresponding to this page.\n */\n readonly apiItem: ApiItem;\n\n /**\n * The page content. The {@link MarkdownDocumenterFeature.onBeforeWritePage} handler can reassign this\n * string to customize the page appearance.\n */\n pageContent: string;\n\n /**\n * The filename where the output will be written.\n */\n readonly outputFilename: string;\n}\n\n/**\n * Event arguments for MarkdownDocumenterFeature.onFinished()\n * @public\n */\nexport interface IMarkdownDocumenterFeatureOnFinishedArgs {}\n\nconst uuidMarkdownDocumenterFeature: string = '34196154-9eb3-4de0-a8c8-7e9539dfe216';\n\n/**\n * Inherit from this base class to implement an API Documenter plugin feature that customizes\n * the generation of markdown output.\n *\n * @public\n */\nexport class MarkdownDocumenterFeature extends PluginFeature {\n /** {@inheritdoc PluginFeature.context} */\n public context!: MarkdownDocumenterFeatureContext;\n\n /**\n * This event occurs before each markdown file is written. It provides an opportunity to customize the\n * content of the file.\n * @virtual\n */\n public onBeforeWritePage(eventArgs: IMarkdownDocumenterFeatureOnBeforeWritePageArgs): void {\n // (implemented by child class)\n }\n\n /**\n * This event occurs after all output files have been written.\n * @virtual\n */\n public onFinished(eventArgs: IMarkdownDocumenterFeatureOnFinishedArgs): void {\n // (implemented by child class)\n }\n\n public static [Symbol.hasInstance](instance: object): boolean {\n return TypeUuid.isInstanceOf(instance, uuidMarkdownDocumenterFeature);\n }\n}\n\nTypeUuid.registerClass(MarkdownDocumenterFeature, uuidMarkdownDocumenterFeature);\n"]}
1
+ {"version":3,"file":"MarkdownDocumenterFeature.js","sourceRoot":"","sources":["../../src/plugin/MarkdownDocumenterFeature.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAG3D,oEAAwD;AACxD,mDAAgD;AAGhD;;;;;GAKG;AACH,MAAa,gCAAgC;IAgB3C,gBAAgB;IAChB,YAAmB,OAAyC;QAC1D,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC;QACjC,IAAI,CAAC,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC;QACzC,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;IACvC,CAAC;CACF;AAtBD,4EAsBC;AA8BD,MAAM,6BAA6B,GAAW,sCAAsC,CAAC;AAErF;;;;;GAKG;AACH,MAAa,yBAA0B,SAAQ,6BAAa;IAI1D;;;;OAIG;IACI,iBAAiB,CAAC,SAA0D;QACjF,+BAA+B;IACjC,CAAC;IAED;;;OAGG;IACI,UAAU,CAAC,SAAmD;QACnE,+BAA+B;IACjC,CAAC;IAEM,MAAM,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,QAAgB;QACjD,OAAO,4BAAQ,CAAC,YAAY,CAAC,QAAQ,EAAE,6BAA6B,CAAC,CAAC;IACxE,CAAC;CACF;AAxBD,8DAwBC;AAED,4BAAQ,CAAC,aAAa,CAAC,yBAAyB,EAAE,6BAA6B,CAAC,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 type { ApiItem, ApiModel } from '@microsoft/api-extractor-model';\nimport { TypeUuid } from '@rushstack/node-core-library';\nimport { PluginFeature } from './PluginFeature';\nimport type { MarkdownDocumenterAccessor } from './MarkdownDocumenterAccessor';\n\n/**\n * Context object for {@link MarkdownDocumenterFeature}.\n * Exposes various services that can be used by a plugin.\n *\n * @public\n */\nexport class MarkdownDocumenterFeatureContext {\n /**\n * Provides access to the `ApiModel` for the documentation being generated.\n */\n public readonly apiModel: ApiModel;\n\n /**\n * The full path to the output folder.\n */\n public readonly outputFolder: string;\n\n /**\n * Exposes functionality of the documenter.\n */\n public readonly documenter: MarkdownDocumenterAccessor;\n\n /** @internal */\n public constructor(options: MarkdownDocumenterFeatureContext) {\n this.apiModel = options.apiModel;\n this.outputFolder = options.outputFolder;\n this.documenter = options.documenter;\n }\n}\n\n/**\n * Event arguments for MarkdownDocumenterFeature.onBeforeWritePage()\n * @public\n */\nexport interface IMarkdownDocumenterFeatureOnBeforeWritePageArgs {\n /**\n * The API item corresponding to this page.\n */\n readonly apiItem: ApiItem;\n\n /**\n * The page content. The {@link MarkdownDocumenterFeature.onBeforeWritePage} handler can reassign this\n * string to customize the page appearance.\n */\n pageContent: string;\n\n /**\n * The filename where the output will be written.\n */\n readonly outputFilename: string;\n}\n\n/**\n * Event arguments for MarkdownDocumenterFeature.onFinished()\n * @public\n */\nexport interface IMarkdownDocumenterFeatureOnFinishedArgs {}\n\nconst uuidMarkdownDocumenterFeature: string = '34196154-9eb3-4de0-a8c8-7e9539dfe216';\n\n/**\n * Inherit from this base class to implement an API Documenter plugin feature that customizes\n * the generation of markdown output.\n *\n * @public\n */\nexport class MarkdownDocumenterFeature extends PluginFeature {\n /** {@inheritdoc PluginFeature.context} */\n public context!: MarkdownDocumenterFeatureContext;\n\n /**\n * This event occurs before each markdown file is written. It provides an opportunity to customize the\n * content of the file.\n * @virtual\n */\n public onBeforeWritePage(eventArgs: IMarkdownDocumenterFeatureOnBeforeWritePageArgs): void {\n // (implemented by child class)\n }\n\n /**\n * This event occurs after all output files have been written.\n * @virtual\n */\n public onFinished(eventArgs: IMarkdownDocumenterFeatureOnFinishedArgs): void {\n // (implemented by child class)\n }\n\n public static [Symbol.hasInstance](instance: object): boolean {\n return TypeUuid.isInstanceOf(instance, uuidMarkdownDocumenterFeature);\n }\n}\n\nTypeUuid.registerClass(MarkdownDocumenterFeature, uuidMarkdownDocumenterFeature);\n"]}
@@ -1,5 +1,5 @@
1
- import { MarkdownDocumenterFeature, MarkdownDocumenterFeatureContext } from './MarkdownDocumenterFeature';
2
- import { DocumenterConfig } from '../documenters/DocumenterConfig';
1
+ import { MarkdownDocumenterFeature, type MarkdownDocumenterFeatureContext } from './MarkdownDocumenterFeature';
2
+ import type { DocumenterConfig } from '../documenters/DocumenterConfig';
3
3
  export declare class PluginLoader {
4
4
  markdownDocumenterFeature: MarkdownDocumenterFeature | undefined;
5
5
  load(documenterConfig: DocumenterConfig, createContext: () => MarkdownDocumenterFeatureContext): void;
@@ -1 +1 @@
1
- {"version":3,"file":"PluginLoader.d.ts","sourceRoot":"","sources":["../../src/plugin/PluginLoader.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,yBAAyB,EAAE,gCAAgC,EAAE,MAAM,6BAA6B,CAAC;AAE1G,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAOnE,qBAAa,YAAY;IAChB,yBAAyB,EAAE,yBAAyB,GAAG,SAAS,CAAC;IAEjE,IAAI,CACT,gBAAgB,EAAE,gBAAgB,EAClC,aAAa,EAAE,MAAM,gCAAgC,GACpD,IAAI;CAyFR"}
1
+ {"version":3,"file":"PluginLoader.d.ts","sourceRoot":"","sources":["../../src/plugin/PluginLoader.ts"],"names":[],"mappings":"AAOA,OAAO,EACL,yBAAyB,EACzB,KAAK,gCAAgC,EACtC,MAAM,6BAA6B,CAAC;AAErC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAOxE,qBAAa,YAAY;IAChB,yBAAyB,EAAE,yBAAyB,GAAG,SAAS,CAAC;IAEjE,IAAI,CACT,gBAAgB,EAAE,gBAAgB,EAClC,aAAa,EAAE,MAAM,gCAAgC,GACpD,IAAI;CAyFR"}
@@ -1 +1 @@
1
- {"version":3,"file":"PluginLoader.js","sourceRoot":"","sources":["../../src/plugin/PluginLoader.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;;;;;;;;;;;;;;;;;;;;;;;;AAE3D,2CAA6B;AAC7B,iDAAmC;AAGnC,2EAA0G;AAC1G,mDAA8D;AAQ9D,MAAa,YAAY;IAGhB,IAAI,CACT,gBAAkC,EAClC,aAAqD;QAErD,MAAM,gBAAgB,GAAW,IAAI,CAAC,OAAO,CAAC,gBAAgB,CAAC,cAAc,CAAC,CAAC;QAC/E,KAAK,MAAM,YAAY,IAAI,gBAAgB,CAAC,UAAU,CAAC,OAAO,IAAI,EAAE,EAAE;YACpE,IAAI;gBACF,iEAAiE;gBACjE,MAAM,sBAAsB,GAAW,OAAO,CAAC,IAAI,CAAC,YAAY,CAAC,WAAW,EAAE;oBAC5E,OAAO,EAAE,gBAAgB;iBAC1B,CAAC,CAAC;gBAEH,mBAAmB;gBACnB,MAAM,UAAU,GAEA,OAAO,CAAC,sBAAsB,CAAC,CAAC;gBAEhD,IAAI,CAAC,UAAU,EAAE;oBACf,MAAM,IAAI,KAAK,CAAC,qBAAqB,CAAC,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AAC,CAAC;yBAC5E;wBAAC,OAAO,CAAC,EAAE;4BACV,MAAM,IAAI,KAAK,CAAC,yCAAyC,GAAI,CAAW,CAAC,QAAQ,EAAE,CAAC,CAAC;yBACtF;wBACD,IAAI,CAAC,CAAC,yBAAyB,YAAY,qDAAyB,CAAC,EAAE;4BACrE,MAAM,IAAI,KAAK,CAAC,2EAA2E,CAAC,CAAC;yBAC9F;wBAED,IAAI;4BACF,yBAAyB,CAAC,aAAa,EAAE,CAAC;yBAC3C;wBAAC,OAAO,CAAC,EAAE;4BACV,MAAM,IAAI,KAAK,CAAC,mDAAmD,GAAI,CAAW,CAAC,QAAQ,EAAE,CAAC,CAAC;yBAChG;wBAED,IAAI,CAAC,yBAAyB,GAAG,yBAAyB,CAAC;qBAC5D;yBAAM;wBACL,MAAM,IAAI,KAAK,CAAC,qCAAqC,iBAAiB,CAAC,IAAI,GAAG,CAAC,CAAC;qBACjF;iBACF;aACF;YAAC,OAAO,CAAC,EAAE;gBACV,MAAM,IAAI,KAAK,CAAC,wBAAwB,YAAY,CAAC,WAAW,IAAI,GAAI,CAAW,CAAC,OAAO,CAAC,CAAC;aAC9F;SACF;IACH,CAAC;CACF;AA/FD,oCA+FC","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 * as path from 'path';\nimport * as resolve from 'resolve';\n\nimport { IApiDocumenterPluginManifest, IFeatureDefinition } from './IApiDocumenterPluginManifest';\nimport { MarkdownDocumenterFeature, MarkdownDocumenterFeatureContext } from './MarkdownDocumenterFeature';\nimport { PluginFeatureInitialization } from './PluginFeature';\nimport { DocumenterConfig } from '../documenters/DocumenterConfig';\n\ninterface ILoadedPlugin {\n packageName: string;\n manifest: IApiDocumenterPluginManifest;\n}\n\nexport class PluginLoader {\n public markdownDocumenterFeature: MarkdownDocumenterFeature | undefined;\n\n public load(\n documenterConfig: DocumenterConfig,\n createContext: () => MarkdownDocumenterFeatureContext\n ): void {\n const configFileFolder: string = path.dirname(documenterConfig.configFilePath);\n for (const configPlugin of documenterConfig.configFile.plugins || []) {\n try {\n // Look for the package name in the same place as the config file\n const resolvedEntryPointPath: string = resolve.sync(configPlugin.packageName, {\n basedir: configFileFolder\n });\n\n // Load the package\n const entryPoint:\n | { apiDocumenterPluginManifest?: IApiDocumenterPluginManifest }\n | undefined = require(resolvedEntryPointPath);\n\n if (!entryPoint) {\n throw new Error('Invalid entry point');\n }\n\n if (!entryPoint.apiDocumenterPluginManifest) {\n throw new Error(\n `The package is not an API documenter plugin;` +\n ` the \"apiDocumenterPluginManifest\" export was not found`\n );\n }\n\n const manifest: IApiDocumenterPluginManifest = entryPoint.apiDocumenterPluginManifest;\n\n if (manifest.manifestVersion !== 1000) {\n throw new Error(\n `The plugin is not compatible with this version of API Documenter;` +\n ` unsupported manifestVersion`\n );\n }\n\n const loadedPlugin: ILoadedPlugin = {\n packageName: configPlugin.packageName,\n manifest\n };\n\n const featureDefinitionsByName: Map<string, IFeatureDefinition> = new Map<\n string,\n IFeatureDefinition\n >();\n for (const featureDefinition of manifest.features) {\n featureDefinitionsByName.set(featureDefinition.featureName, featureDefinition);\n }\n\n for (const featureName of configPlugin.enabledFeatureNames) {\n const featureDefinition: IFeatureDefinition | undefined = featureDefinitionsByName.get(featureName);\n if (!featureDefinition) {\n throw new Error(\n `The plugin ${loadedPlugin.packageName} does not have a feature with name \"${featureName}\"`\n );\n }\n\n if (featureDefinition.kind === 'MarkdownDocumenterFeature') {\n if (this.markdownDocumenterFeature) {\n throw new Error('A MarkdownDocumenterFeature is already loaded');\n }\n\n const initialization: PluginFeatureInitialization = new PluginFeatureInitialization();\n initialization._context = createContext();\n\n let markdownDocumenterFeature: MarkdownDocumenterFeature | undefined = undefined;\n try {\n markdownDocumenterFeature = new featureDefinition.subclass(initialization);\n } catch (e) {\n throw new Error(`Failed to construct feature subclass:\\n` + (e as Error).toString());\n }\n if (!(markdownDocumenterFeature instanceof MarkdownDocumenterFeature)) {\n throw new Error('The constructed subclass was not an instance of MarkdownDocumenterFeature');\n }\n\n try {\n markdownDocumenterFeature.onInitialized();\n } catch (e) {\n throw new Error('Error occurred during the onInitialized() event: ' + (e as Error).toString());\n }\n\n this.markdownDocumenterFeature = markdownDocumenterFeature;\n } else {\n throw new Error(`Unknown feature definition kind: \"${featureDefinition.kind}\"`);\n }\n }\n } catch (e) {\n throw new Error(`Error loading plugin ${configPlugin.packageName}: ` + (e as Error).message);\n }\n }\n }\n}\n"]}
1
+ {"version":3,"file":"PluginLoader.js","sourceRoot":"","sources":["../../src/plugin/PluginLoader.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;;;;;;;;;;;;;;;;;;;;;;;;AAE3D,2CAA6B;AAC7B,iDAAmC;AAGnC,2EAGqC;AACrC,mDAA8D;AAQ9D,MAAa,YAAY;IAGhB,IAAI,CACT,gBAAkC,EAClC,aAAqD;QAErD,MAAM,gBAAgB,GAAW,IAAI,CAAC,OAAO,CAAC,gBAAgB,CAAC,cAAc,CAAC,CAAC;QAC/E,KAAK,MAAM,YAAY,IAAI,gBAAgB,CAAC,UAAU,CAAC,OAAO,IAAI,EAAE,EAAE;YACpE,IAAI;gBACF,iEAAiE;gBACjE,MAAM,sBAAsB,GAAW,OAAO,CAAC,IAAI,CAAC,YAAY,CAAC,WAAW,EAAE;oBAC5E,OAAO,EAAE,gBAAgB;iBAC1B,CAAC,CAAC;gBAEH,mBAAmB;gBACnB,MAAM,UAAU,GAEA,OAAO,CAAC,sBAAsB,CAAC,CAAC;gBAEhD,IAAI,CAAC,UAAU,EAAE;oBACf,MAAM,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAAC;iBACxC;gBAED,IAAI,CAAC,UAAU,CAAC,2BAA2B,EAAE;oBAC3C,MAAM,IAAI,KAAK,CACb,8CAA8C;wBAC5C,yDAAyD,CAC5D,CAAC;iBACH;gBAED,MAAM,QAAQ,GAAiC,UAAU,CAAC,2BAA2B,CAAC;gBAEtF,IAAI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MAAM,IAAI,KAAK,CAAC,2EAA2E,CAAC,CAAC;yBAC9F;wBAED,IAAI;4BACF,yBAAyB,CAAC,aAAa,EAAE,CAAC;yBAC3C;wBAAC,OAAO,CAAC,EAAE;4BACV,MAAM,IAAI,KAAK,CAAC,mDAAmD,GAAI,CAAW,CAAC,QAAQ,EAAE,CAAC,CAAC;yBAChG;wBAED,IAAI,CAAC,yBAAyB,GAAG,yBAAyB,CAAC;qBAC5D;yBAAM;wBACL,MAAM,IAAI,KAAK,CAAC,qCAAqC,iBAAiB,CAAC,IAAI,GAAG,CAAC,CAAC;qBACjF;iBACF;aACF;YAAC,OAAO,CAAC,EAAE;gBACV,MAAM,IAAI,KAAK,CAAC,wBAAwB,YAAY,CAAC,WAAW,IAAI,GAAI,CAAW,CAAC,OAAO,CAAC,CAAC;aAC9F;SACF;IACH,CAAC;CACF;AA/FD,oCA+FC","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 * as path from 'path';\nimport * as resolve from 'resolve';\n\nimport type { IApiDocumenterPluginManifest, IFeatureDefinition } from './IApiDocumenterPluginManifest';\nimport {\n MarkdownDocumenterFeature,\n type MarkdownDocumenterFeatureContext\n} from './MarkdownDocumenterFeature';\nimport { PluginFeatureInitialization } from './PluginFeature';\nimport type { DocumenterConfig } from '../documenters/DocumenterConfig';\n\ninterface ILoadedPlugin {\n packageName: string;\n manifest: IApiDocumenterPluginManifest;\n}\n\nexport class PluginLoader {\n public markdownDocumenterFeature: MarkdownDocumenterFeature | undefined;\n\n public load(\n documenterConfig: DocumenterConfig,\n createContext: () => MarkdownDocumenterFeatureContext\n ): void {\n const configFileFolder: string = path.dirname(documenterConfig.configFilePath);\n for (const configPlugin of documenterConfig.configFile.plugins || []) {\n try {\n // Look for the package name in the same place as the config file\n const resolvedEntryPointPath: string = resolve.sync(configPlugin.packageName, {\n basedir: configFileFolder\n });\n\n // Load the package\n const entryPoint:\n | { apiDocumenterPluginManifest?: IApiDocumenterPluginManifest }\n | undefined = require(resolvedEntryPointPath);\n\n if (!entryPoint) {\n throw new Error('Invalid entry point');\n }\n\n if (!entryPoint.apiDocumenterPluginManifest) {\n throw new Error(\n `The package is not an API documenter plugin;` +\n ` the \"apiDocumenterPluginManifest\" export was not found`\n );\n }\n\n const manifest: IApiDocumenterPluginManifest = entryPoint.apiDocumenterPluginManifest;\n\n if (manifest.manifestVersion !== 1000) {\n throw new Error(\n `The plugin is not compatible with this version of API Documenter;` +\n ` unsupported manifestVersion`\n );\n }\n\n const loadedPlugin: ILoadedPlugin = {\n packageName: configPlugin.packageName,\n manifest\n };\n\n const featureDefinitionsByName: Map<string, IFeatureDefinition> = new Map<\n string,\n IFeatureDefinition\n >();\n for (const featureDefinition of manifest.features) {\n featureDefinitionsByName.set(featureDefinition.featureName, featureDefinition);\n }\n\n for (const featureName of configPlugin.enabledFeatureNames) {\n const featureDefinition: IFeatureDefinition | undefined = featureDefinitionsByName.get(featureName);\n if (!featureDefinition) {\n throw new Error(\n `The plugin ${loadedPlugin.packageName} does not have a feature with name \"${featureName}\"`\n );\n }\n\n if (featureDefinition.kind === 'MarkdownDocumenterFeature') {\n if (this.markdownDocumenterFeature) {\n throw new Error('A MarkdownDocumenterFeature is already loaded');\n }\n\n const initialization: PluginFeatureInitialization = new PluginFeatureInitialization();\n initialization._context = createContext();\n\n let markdownDocumenterFeature: MarkdownDocumenterFeature | undefined = undefined;\n try {\n markdownDocumenterFeature = new featureDefinition.subclass(initialization);\n } catch (e) {\n throw new Error(`Failed to construct feature subclass:\\n` + (e as Error).toString());\n }\n if (!(markdownDocumenterFeature instanceof MarkdownDocumenterFeature)) {\n throw new Error('The constructed subclass was not an instance of MarkdownDocumenterFeature');\n }\n\n try {\n markdownDocumenterFeature.onInitialized();\n } catch (e) {\n throw new Error('Error occurred during the onInitialized() event: ' + (e as Error).toString());\n }\n\n this.markdownDocumenterFeature = markdownDocumenterFeature;\n } else {\n throw new Error(`Unknown feature definition kind: \"${featureDefinition.kind}\"`);\n }\n }\n } catch (e) {\n throw new Error(`Error loading plugin ${configPlugin.packageName}: ` + (e as Error).message);\n }\n }\n }\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { IStringBuilder } from '@rushstack/node-core-library';
1
+ import { type IStringBuilder } from '@rushstack/node-core-library';
2
2
  /**
3
3
  * A utility for writing indented text.
4
4
  *
@@ -1 +1 @@
1
- {"version":3,"file":"IndentedWriter.d.ts","sourceRoot":"","sources":["../../src/utils/IndentedWriter.ts"],"names":[],"mappings":"AAGA,OAAO,EAAiB,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAE7E;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,qBAAa,cAAc;IACzB;;;OAGG;IACI,mBAAmB,EAAE,MAAM,CAAQ;IAE1C,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAiB;IAE1C,OAAO,CAAC,YAAY,CAAqB;IACzC,OAAO,CAAC,cAAc,CAAqB;IAC3C,OAAO,CAAC,cAAc,CAAU;IAEhC,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAW;IACxC,OAAO,CAAC,WAAW,CAAS;IAE5B,OAAO,CAAC,YAAY,CAAW;IAC/B,OAAO,CAAC,qBAAqB,CAAU;gBAEpB,OAAO,CAAC,EAAE,cAAc;IAc3C;;OAEG;IACI,OAAO,IAAI,MAAM;IAIjB,QAAQ,IAAI,MAAM;IAIzB;;;;;;OAMG;IACI,cAAc,CAAC,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI;IAKlD;;;OAGG;IACI,cAAc,IAAI,IAAI;IAK7B;;;OAGG;IACI,WAAW,CAAC,KAAK,EAAE,MAAM,IAAI,EAAE,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI;IAMlE;;OAEG;IACI,aAAa,IAAI,IAAI;IAO5B;;OAEG;IACI,iBAAiB,IAAI,IAAI;IAWhC;;OAEG;IACI,iBAAiB,IAAI,MAAM;IAOlC;;;OAGG;IACI,uBAAu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AM,GAAG,CAAC,EAAE;YACtD,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;SAC/B;QAED,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QAClB,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC;IAC7B,CAAC;IAEO,MAAM,CAAC,CAAS;QACtB,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,YAAY,CAAC;QACxC,IAAI,CAAC,YAAY,GAAG,CAAC,CAAC;QACtB,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;IAC1B,CAAC;IAED;;;OAGG;IACK,iBAAiB;QACvB,IAAI,CAAC,qBAAqB,GAAG,IAAI,CAAC;QAElC,KAAK,MAAM,OAAO,IAAI,IAAI,CAAC,YAAY,EAAE;YACvC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;SACrB;QAED,IAAI,CAAC,qBAAqB,GAAG,KAAK,CAAC;QACnC,IAAI,CAAC,YAAY,GAAG,EAAE,CAAC;IACzB,CAAC;IAEO,iBAAiB;QACvB,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAChD,CAAC;CACF;AAnPD,wCAmPC","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 { StringBuilder, IStringBuilder } from '@rushstack/node-core-library';\n\n/**\n * A utility for writing indented text.\n *\n * @remarks\n *\n * Note that the indentation is inserted at the last possible opportunity.\n * For example, this code...\n *\n * ```ts\n * writer.write('begin\\n');\n * writer.increaseIndent();\n * writer.write('one\\ntwo\\n');\n * writer.decreaseIndent();\n * writer.increaseIndent();\n * writer.decreaseIndent();\n * writer.write('end');\n * ```\n *\n * ...would produce this output:\n *\n * ```\n * begin\n * one\n * two\n * end\n * ```\n */\nexport class IndentedWriter {\n /**\n * The text characters used to create one level of indentation.\n * Two spaces by default.\n */\n public defaultIndentPrefix: string = ' ';\n\n private readonly _builder: IStringBuilder;\n\n private _latestChunk: string | undefined;\n private _previousChunk: string | undefined;\n private _atStartOfLine: boolean;\n\n private readonly _indentStack: string[];\n private _indentText: string;\n\n private _beforeStack: string[];\n private _isWritingBeforeStack: boolean;\n\n public constructor(builder?: IStringBuilder) {\n this._builder = builder === undefined ? new StringBuilder() : builder;\n\n this._latestChunk = undefined;\n this._previousChunk = undefined;\n this._atStartOfLine = true;\n\n this._indentStack = [];\n this._indentText = '';\n\n this._beforeStack = [];\n this._isWritingBeforeStack = false;\n }\n\n /**\n * Retrieves the output that was built so far.\n */\n public getText(): string {\n return this._builder.toString();\n }\n\n public toString(): string {\n return this.getText();\n }\n\n /**\n * Increases the indentation. Normally the indentation is two spaces,\n * however an arbitrary prefix can optional be specified. (For example,\n * the prefix could be \"// \" to indent and comment simultaneously.)\n * Each call to IndentedWriter.increaseIndent() must be followed by a\n * corresponding call to IndentedWriter.decreaseIndent().\n */\n public increaseIndent(indentPrefix?: string): void {\n this._indentStack.push(indentPrefix !== undefined ? indentPrefix : this.defaultIndentPrefix);\n this._updateIndentText();\n }\n\n /**\n * Decreases the indentation, reverting the effect of the corresponding call\n * to IndentedWriter.increaseIndent().\n */\n public decreaseIndent(): void {\n this._indentStack.pop();\n this._updateIndentText();\n }\n\n /**\n * A shorthand for ensuring that increaseIndent()/decreaseIndent() occur\n * in pairs.\n */\n public indentScope(scope: () => void, indentPrefix?: string): void {\n this.increaseIndent(indentPrefix);\n scope();\n this.decreaseIndent();\n }\n\n /**\n * Adds a newline if the file pointer is not already at the start of the line (or start of the stream).\n */\n public ensureNewLine(): void {\n const lastCharacter: string = this.peekLastCharacter();\n if (lastCharacter !== '\\n' && lastCharacter !== '') {\n this._writeNewLine();\n }\n }\n\n /**\n * Adds up to two newlines to ensure that there is a blank line above the current line.\n */\n public ensureSkippedLine(): void {\n if (this.peekLastCharacter() !== '\\n') {\n this._writeNewLine();\n }\n\n const secondLastCharacter: string = this.peekSecondLastCharacter();\n if (secondLastCharacter !== '\\n' && secondLastCharacter !== '') {\n this._writeNewLine();\n }\n }\n\n /**\n * Returns the last character that was written, or an empty string if no characters have been written yet.\n */\n public peekLastCharacter(): string {\n if (this._latestChunk !== undefined) {\n return this._latestChunk.substr(-1, 1);\n }\n return '';\n }\n\n /**\n * Returns the second to last character that was written, or an empty string if less than one characters\n * have been written yet.\n */\n public peekSecondLastCharacter(): string {\n if (this._latestChunk !== undefined) {\n if (this._latestChunk.length > 1) {\n return this._latestChunk.substr(-2, 1);\n }\n if (this._previousChunk !== undefined) {\n return this._previousChunk.substr(-1, 1);\n }\n }\n return '';\n }\n\n /**\n * Writes `before` and `after` messages if and only if `mayWrite` writes anything.\n *\n * If `mayWrite` writes \"CONTENT\", this method will write \"<before>CONTENT<after>\".\n * If `mayWrite` writes nothing, this method will write nothing.\n */\n public writeTentative(before: string, after: string, mayWrite: () => void): void {\n this._beforeStack.push(before);\n\n // If this function writes anything, then _all_ messages in the \"before stack\" will also be\n // written. This means that the stack will be empty (as when we write a message from the stack,\n // we remove it from the stack).\n mayWrite();\n\n // If the stack is not empty, it means that `mayWrite` didn't write anything. Pop the last-\n // added message from the stack, we'll never write it. Otherwise, if the stack is empty, then\n // write the \"after\" message.\n if (this._beforeStack.length > 0) {\n this._beforeStack.pop();\n } else {\n this.write(after);\n }\n }\n\n /**\n * Writes some text to the internal string buffer, applying indentation according\n * to the current indentation level. If the string contains multiple newlines,\n * each line will be indented separately.\n */\n public write(message: string): void {\n if (message.length === 0) {\n return;\n }\n\n if (!this._isWritingBeforeStack) {\n this._writeBeforeStack();\n }\n\n // If there are no newline characters, then append the string verbatim\n if (!/[\\r\\n]/.test(message)) {\n this._writeLinePart(message);\n return;\n }\n\n // Otherwise split the lines and write each one individually\n let first: boolean = true;\n for (const linePart of message.split('\\n')) {\n if (!first) {\n this._writeNewLine();\n } else {\n first = false;\n }\n if (linePart) {\n this._writeLinePart(linePart.replace(/[\\r]/g, ''));\n }\n }\n }\n\n /**\n * A shorthand for writing an optional message, followed by a newline.\n * Indentation is applied following the semantics of IndentedWriter.write().\n */\n public writeLine(message: string = ''): void {\n if (message.length > 0) {\n this.write(message);\n } else if (!this._isWritingBeforeStack) {\n this._writeBeforeStack();\n }\n\n this._writeNewLine();\n }\n\n /**\n * Writes a string that does not contain any newline characters.\n */\n private _writeLinePart(message: string): void {\n if (message.length > 0) {\n if (this._atStartOfLine && this._indentText.length > 0) {\n this._write(this._indentText);\n }\n this._write(message);\n this._atStartOfLine = false;\n }\n }\n\n private _writeNewLine(): void {\n if (this._atStartOfLine && this._indentText.length > 0) {\n this._write(this._indentText);\n }\n\n this._write('\\n');\n this._atStartOfLine = true;\n }\n\n private _write(s: string): void {\n this._previousChunk = this._latestChunk;\n this._latestChunk = s;\n this._builder.append(s);\n }\n\n /**\n * Writes all messages in our before stack, processing them in FIFO order. This stack is\n * populated by the `writeTentative` method.\n */\n private _writeBeforeStack(): void {\n this._isWritingBeforeStack = true;\n\n for (const message of this._beforeStack) {\n this.write(message);\n }\n\n this._isWritingBeforeStack = false;\n this._beforeStack = [];\n }\n\n private _updateIndentText(): void {\n this._indentText = this._indentStack.join('');\n }\n}\n"]}
1
+ {"version":3,"file":"IndentedWriter.js","sourceRoot":"","sources":["../../src/utils/IndentedWriter.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAE3D,oEAAkF;AAElF;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAa,cAAc;IAmBzB,YAAmB,OAAwB;QAlB3C;;;WAGG;QACI,wBAAmB,GAAW,IAAI,CAAC;QAexC,IAAI,CAAC,QAAQ,GAAG,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,iCAAa,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC;QAEtE,IAAI,CAAC,YAAY,GAAG,SAAS,CAAC;QAC9B,IAAI,CAAC,cAAc,GAAG,SAAS,CAAC;QAChC,IAAI,CAAC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YACrB,IAAI,CAAC,cAAc,GAAG,KAAK,CAAC;SAC7B;IACH,CAAC;IAEO,aAAa;QACnB,IAAI,IAAI,CAAC,cAAc,IAAI,IAAI,CAAC,WAAW,CAAC,MAAM,GAAG,CAAC,EAAE;YACtD,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;SAC/B;QAED,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QAClB,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC;IAC7B,CAAC;IAEO,MAAM,CAAC,CAAS;QACtB,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,YAAY,CAAC;QACxC,IAAI,CAAC,YAAY,GAAG,CAAC,CAAC;QACtB,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;IAC1B,CAAC;IAED;;;OAGG;IACK,iBAAiB;QACvB,IAAI,CAAC,qBAAqB,GAAG,IAAI,CAAC;QAElC,KAAK,MAAM,OAAO,IAAI,IAAI,CAAC,YAAY,EAAE;YACvC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;SACrB;QAED,IAAI,CAAC,qBAAqB,GAAG,KAAK,CAAC;QACnC,IAAI,CAAC,YAAY,GAAG,EAAE,CAAC;IACzB,CAAC;IAEO,iBAAiB;QACvB,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAChD,CAAC;CACF;AAnPD,wCAmPC","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 { StringBuilder, type IStringBuilder } from '@rushstack/node-core-library';\n\n/**\n * A utility for writing indented text.\n *\n * @remarks\n *\n * Note that the indentation is inserted at the last possible opportunity.\n * For example, this code...\n *\n * ```ts\n * writer.write('begin\\n');\n * writer.increaseIndent();\n * writer.write('one\\ntwo\\n');\n * writer.decreaseIndent();\n * writer.increaseIndent();\n * writer.decreaseIndent();\n * writer.write('end');\n * ```\n *\n * ...would produce this output:\n *\n * ```\n * begin\n * one\n * two\n * end\n * ```\n */\nexport class IndentedWriter {\n /**\n * The text characters used to create one level of indentation.\n * Two spaces by default.\n */\n public defaultIndentPrefix: string = ' ';\n\n private readonly _builder: IStringBuilder;\n\n private _latestChunk: string | undefined;\n private _previousChunk: string | undefined;\n private _atStartOfLine: boolean;\n\n private readonly _indentStack: string[];\n private _indentText: string;\n\n private _beforeStack: string[];\n private _isWritingBeforeStack: boolean;\n\n public constructor(builder?: IStringBuilder) {\n this._builder = builder === undefined ? new StringBuilder() : builder;\n\n this._latestChunk = undefined;\n this._previousChunk = undefined;\n this._atStartOfLine = true;\n\n this._indentStack = [];\n this._indentText = '';\n\n this._beforeStack = [];\n this._isWritingBeforeStack = false;\n }\n\n /**\n * Retrieves the output that was built so far.\n */\n public getText(): string {\n return this._builder.toString();\n }\n\n public toString(): string {\n return this.getText();\n }\n\n /**\n * Increases the indentation. Normally the indentation is two spaces,\n * however an arbitrary prefix can optional be specified. (For example,\n * the prefix could be \"// \" to indent and comment simultaneously.)\n * Each call to IndentedWriter.increaseIndent() must be followed by a\n * corresponding call to IndentedWriter.decreaseIndent().\n */\n public increaseIndent(indentPrefix?: string): void {\n this._indentStack.push(indentPrefix !== undefined ? indentPrefix : this.defaultIndentPrefix);\n this._updateIndentText();\n }\n\n /**\n * Decreases the indentation, reverting the effect of the corresponding call\n * to IndentedWriter.increaseIndent().\n */\n public decreaseIndent(): void {\n this._indentStack.pop();\n this._updateIndentText();\n }\n\n /**\n * A shorthand for ensuring that increaseIndent()/decreaseIndent() occur\n * in pairs.\n */\n public indentScope(scope: () => void, indentPrefix?: string): void {\n this.increaseIndent(indentPrefix);\n scope();\n this.decreaseIndent();\n }\n\n /**\n * Adds a newline if the file pointer is not already at the start of the line (or start of the stream).\n */\n public ensureNewLine(): void {\n const lastCharacter: string = this.peekLastCharacter();\n if (lastCharacter !== '\\n' && lastCharacter !== '') {\n this._writeNewLine();\n }\n }\n\n /**\n * Adds up to two newlines to ensure that there is a blank line above the current line.\n */\n public ensureSkippedLine(): void {\n if (this.peekLastCharacter() !== '\\n') {\n this._writeNewLine();\n }\n\n const secondLastCharacter: string = this.peekSecondLastCharacter();\n if (secondLastCharacter !== '\\n' && secondLastCharacter !== '') {\n this._writeNewLine();\n }\n }\n\n /**\n * Returns the last character that was written, or an empty string if no characters have been written yet.\n */\n public peekLastCharacter(): string {\n if (this._latestChunk !== undefined) {\n return this._latestChunk.substr(-1, 1);\n }\n return '';\n }\n\n /**\n * Returns the second to last character that was written, or an empty string if less than one characters\n * have been written yet.\n */\n public peekSecondLastCharacter(): string {\n if (this._latestChunk !== undefined) {\n if (this._latestChunk.length > 1) {\n return this._latestChunk.substr(-2, 1);\n }\n if (this._previousChunk !== undefined) {\n return this._previousChunk.substr(-1, 1);\n }\n }\n return '';\n }\n\n /**\n * Writes `before` and `after` messages if and only if `mayWrite` writes anything.\n *\n * If `mayWrite` writes \"CONTENT\", this method will write \"<before>CONTENT<after>\".\n * If `mayWrite` writes nothing, this method will write nothing.\n */\n public writeTentative(before: string, after: string, mayWrite: () => void): void {\n this._beforeStack.push(before);\n\n // If this function writes anything, then _all_ messages in the \"before stack\" will also be\n // written. This means that the stack will be empty (as when we write a message from the stack,\n // we remove it from the stack).\n mayWrite();\n\n // If the stack is not empty, it means that `mayWrite` didn't write anything. Pop the last-\n // added message from the stack, we'll never write it. Otherwise, if the stack is empty, then\n // write the \"after\" message.\n if (this._beforeStack.length > 0) {\n this._beforeStack.pop();\n } else {\n this.write(after);\n }\n }\n\n /**\n * Writes some text to the internal string buffer, applying indentation according\n * to the current indentation level. If the string contains multiple newlines,\n * each line will be indented separately.\n */\n public write(message: string): void {\n if (message.length === 0) {\n return;\n }\n\n if (!this._isWritingBeforeStack) {\n this._writeBeforeStack();\n }\n\n // If there are no newline characters, then append the string verbatim\n if (!/[\\r\\n]/.test(message)) {\n this._writeLinePart(message);\n return;\n }\n\n // Otherwise split the lines and write each one individually\n let first: boolean = true;\n for (const linePart of message.split('\\n')) {\n if (!first) {\n this._writeNewLine();\n } else {\n first = false;\n }\n if (linePart) {\n this._writeLinePart(linePart.replace(/[\\r]/g, ''));\n }\n }\n }\n\n /**\n * A shorthand for writing an optional message, followed by a newline.\n * Indentation is applied following the semantics of IndentedWriter.write().\n */\n public writeLine(message: string = ''): void {\n if (message.length > 0) {\n this.write(message);\n } else if (!this._isWritingBeforeStack) {\n this._writeBeforeStack();\n }\n\n this._writeNewLine();\n }\n\n /**\n * Writes a string that does not contain any newline characters.\n */\n private _writeLinePart(message: string): void {\n if (message.length > 0) {\n if (this._atStartOfLine && this._indentText.length > 0) {\n this._write(this._indentText);\n }\n this._write(message);\n this._atStartOfLine = false;\n }\n }\n\n private _writeNewLine(): void {\n if (this._atStartOfLine && this._indentText.length > 0) {\n this._write(this._indentText);\n }\n\n this._write('\\n');\n this._atStartOfLine = true;\n }\n\n private _write(s: string): void {\n this._previousChunk = this._latestChunk;\n this._latestChunk = s;\n this._builder.append(s);\n }\n\n /**\n * Writes all messages in our before stack, processing them in FIFO order. This stack is\n * populated by the `writeTentative` method.\n */\n private _writeBeforeStack(): void {\n this._isWritingBeforeStack = true;\n\n for (const message of this._beforeStack) {\n this.write(message);\n }\n\n this._isWritingBeforeStack = false;\n this._beforeStack = [];\n }\n\n private _updateIndentText(): void {\n this._indentText = this._indentStack.join('');\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"ToSdpConvertHelper.d.ts","sourceRoot":"","sources":["../../src/utils/ToSdpConvertHelper.ts"],"names":[],"mappings":"AAoBA,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAE5D"}
1
+ {"version":3,"file":"ToSdpConvertHelper.d.ts","sourceRoot":"","sources":["../../src/utils/ToSdpConvertHelper.ts"],"names":[],"mappings":"AAuBA,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAE5D"}
@@ -1,4 +1,6 @@
1
1
  "use strict";
2
+ // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
3
+ // See LICENSE in the project root for license information.
2
4
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
5
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
6
  };
@@ -1 +1 @@
1
- {"version":3,"file":"ToSdpConvertHelper.js","sourceRoot":"","sources":["../../src/utils/ToSdpConvertHelper.ts"],"names":[],"mappings":";;;;;;AAgBA,gDAAwB;AACxB,oEAAiF;AACjF,gCAAiC;AAEjC,SAAgB,mBAAmB,CAAC,UAAkB;IACpD,OAAO,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;AAClC,CAAC;AAFD,kDAEC;AAED,SAAS,OAAO,CAAC,SAAiB,EAAE,UAAkB;IACpD,OAAO,CAAC,GAAG,EAAE,CAAC;IACd,IAAI,CAAC,8BAAU,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE;QACjC,OAAO,CAAC,KAAK,CAAC,eAAe,SAAS,eAAe,CAAC,CAAC;QACvD,OAAO;KACR;IAED,8BAAU,CAAC,mBAAmB,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;QACzD,MAAM,KAAK,GAAW,cAAI,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;QACjD,IAAI,8BAAU,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,MAAM,EAAE,EAAE;YAC5C,oBAAoB;YACpB,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE;gBAC1B,OAAO;aACR;YACD,aAAa;YACb,MAAM,WAAW,GAAW,8BAAU,CAAC,QAAQ,CAAC,KAAK,EAAE,EAAE,QAAQ,EAAE,4BAAQ,CAAC,IAAI,EAAE,CAAC,CAAC;YACpF,uCAAuC;YACvC,MAAM,YAAY,GAAY,WAAW,CAAC,UAAU,CAAC,iCAAiC,CAAC,CAAC;YACxF,IAAI,CAAC,Y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AAG,iBAAiB,CAAC,CAAC;QAExB,IAAI,KAAK,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE;YAC7B,MAAM,GAAG,EAAE,CAAC;YACZ,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE;gBACxB,sCAAsC;gBACtC,IAAI,IAAI,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE;oBACzC,MAAM,IAAI,IAAI,CAAC,GAAG,CAAC;iBACpB;qBAAM;oBACL,MAAM,IAAI,IAAI,CAAC,IAAI,CAAC;iBACrB;aACF;SACF;KACF;SAAM,IAAI,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE;QACjC,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;YACnB,MAAM,GAAG,GAAG,CAAC,IAAI,CAAC;SACnB;KACF;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":["import {\n IYamlItem,\n IYamlApiFile,\n IYamlSyntax,\n IYamlReferenceSpec,\n IYamlReference\n} from '../yaml/IYamlApiFile';\nimport {\n PackageYamlModel,\n EnumYamlModel,\n TypeAliasYamlModel,\n TypeYamlModel,\n FieldYamlModel,\n FunctionYamlModel,\n CommonYamlModel\n} from '../yaml/ISDPYamlFile';\nimport path from 'path';\nimport { FileSystem, Encoding, NewlineKind } from '@rushstack/node-core-library';\nimport yaml = require('js-yaml');\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.safeLoad(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.safeDump(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, '&lt;').replace(/>/g, '&gt;');\n const uidRegEx: RegExp = /(@?[\\w\\d\\-/!~\\.]+\\:[\\w\\d\\-\\(/]+)/g;\n\n return result.replace(uidRegEx, `<xref uid=\"$1\" />`);\n}\n"]}
1
+ {"version":3,"file":"ToSdpConvertHelper.js","sourceRoot":"","sources":["../../src/utils/ToSdpConvertHelper.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;;;;AAkB3D,gDAAwB;AACxB,oEAAiF;AACjF,gCAAiC;AAEjC,SAAgB,mBAAmB,CAAC,UAAkB;IACpD,OAAO,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;AAClC,CAAC;AAFD,kDAEC;AAED,SAAS,OAAO,CAAC,SAAiB,EAAE,UAAkB;IACpD,OAAO,CAAC,GAAG,EAAE,CAAC;IACd,IAAI,CAAC,8BAAU,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE;QACjC,OAAO,CAAC,KAAK,CAAC,eAAe,SAAS,eAAe,CAAC,CAAC;QACvD,OAAO;KACR;IAED,8BAAU,CAAC,mBAAmB,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;QACzD,MAAM,KAAK,GAAW,cAAI,CAAC,IAAI,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AAC,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 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';\nimport path from 'path';\nimport { FileSystem, Encoding, NewlineKind } from '@rushstack/node-core-library';\nimport yaml = require('js-yaml');\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.safeLoad(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.safeDump(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, '&lt;').replace(/>/g, '&gt;');\n const uidRegEx: RegExp = /(@?[\\w\\d\\-/!~\\.]+\\:[\\w\\d\\-\\(/]+)/g;\n\n return result.replace(uidRegEx, `<xref uid=\"$1\" />`);\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { ApiItem } from '@microsoft/api-extractor-model';
1
+ import { type ApiItem } from '@microsoft/api-extractor-model';
2
2
  export declare class Utilities {
3
3
  private static readonly _badFilenameCharsRegExp;
4
4
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"Utilities.d.ts","sourceRoot":"","sources":["../../src/utils/Utilities.ts"],"names":[],"mappings":"AAGA,OAAO,EAAyB,OAAO,EAAE,MAAM,gCAAgC,CAAC;AAEhF,qBAAa,SAAS;IACpB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,uBAAuB,CAA8B;IAC7E;;OAEG;WACW,mBAAmB,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM;IAO3D;;OAEG;WACW,sBAAsB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;CAK3D"}
1
+ {"version":3,"file":"Utilities.d.ts","sourceRoot":"","sources":["../../src/utils/Utilities.ts"],"names":[],"mappings":"AAGA,OAAO,EAAyB,KAAK,OAAO,EAAE,MAAM,gCAAgC,CAAC;AAErF,qBAAa,SAAS;IACpB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,uBAAuB,CAA8B;IAC7E;;OAEG;WACW,mBAAmB,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM;IAO3D;;OAEG;WACW,sBAAsB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;CAK3D"}
@@ -1 +1 @@
1
- {"version":3,"file":"Utilities.js","sourceRoot":"","sources":["../../src/utils/Utilities.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAE3D,wEAAgF;AAEhF,MAAa,SAAS;IAEpB;;OAEG;IACI,MAAM,CAAC,mBAAmB,CAAC,OAAgB;QAChD,IAAI,2CAAqB,CAAC,aAAa,CAAC,OAAO,CAAC,EAAE;YAChD,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;SAC3F;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;AADlE,8BAAS","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, 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"]}
1
+ {"version":3,"file":"Utilities.js","sourceRoot":"","sources":["../../src/utils/Utilities.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAE3D,wEAAqF;AAErF,MAAa,SAAS;IAEpB;;OAEG;IACI,MAAM,CAAC,mBAAmB,CAAC,OAAgB;QAChD,IAAI,2CAAqB,CAAC,aAAa,CAAC,OAAO,CAAC,EAAE;YAChD,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;SAC3F;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;AADlE,8BAAS","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"]}
@@ -1 +1 @@
1
- {"version":3,"file":"ISDPYamlFile.d.ts","sourceRoot":"","sources":["../../src/yaml/ISDPYamlFile.ts"],"names":[],"mappings":"AAAA,UAAU,cAAc;IACtB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,MAAM,eAAe,GAAG,cAAc,GAAG;IAC7C,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM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C,EAAE,UAAU,CAAC;IACvB,SAAS,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC;CAC5B;AAED,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,KAAK,CAAC;CACd;AAED,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,KAAK,CAAC;CACd;AAED,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,KAAK,GAAG,MAAM,CAAC;IACvB,KAAK,EAAE,KAAK,CAAC;CACd;AAED,MAAM,WAAW,cAAc;IAC7B,GAAG,EAAE,KAAK,GAAG,MAAM,CAAC;IACpB,KAAK,EAAE,KAAK,GAAG,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,KAAK,KAAK,GAAG,KAAK,EAAE,GAAG,MAAM,EAAE,CAAC"}
@@ -1,3 +1,5 @@
1
1
  "use strict";
2
+ // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
3
+ // See LICENSE in the project root for license information.
2
4
  Object.defineProperty(exports, "__esModule", { value: true });
3
5
  //# sourceMappingURL=ISDPYamlFile.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ISDPYamlFile.js","sourceRoot":"","sources":["../../src/yaml/ISDPYamlFile.ts"],"names":[],"mappings":"","sourcesContent":["interface 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"]}
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"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@microsoft/api-documenter",
3
- "version": "7.23.3",
3
+ "version": "7.23.4",
4
4
  "description": "Read JSON files from api-extractor, generate documentation pages",
5
5
  "repository": {
6
6
  "type": "git",
@@ -19,15 +19,14 @@
19
19
  "colors": "~1.2.1",
20
20
  "js-yaml": "~3.13.1",
21
21
  "resolve": "~1.22.1",
22
- "@microsoft/api-extractor-model": "7.28.0",
23
- "@rushstack/node-core-library": "3.60.0",
24
- "@rushstack/ts-command-line": "4.16.0"
22
+ "@microsoft/api-extractor-model": "7.28.1",
23
+ "@rushstack/node-core-library": "3.60.1",
24
+ "@rushstack/ts-command-line": "4.16.1"
25
25
  },
26
26
  "devDependencies": {
27
27
  "@types/js-yaml": "3.12.1",
28
28
  "@types/resolve": "1.20.2",
29
- "@rushstack/eslint-config": "3.3.4",
30
- "@rushstack/heft": "0.61.1",
29
+ "@rushstack/heft": "0.61.2",
31
30
  "local-node-rig": "1.0.0"
32
31
  },
33
32
  "scripts": {