@microsoft/api-extractor 7.19.0 → 7.19.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 (57) hide show
  1. package/CHANGELOG.json +5671 -5605
  2. package/CHANGELOG.md +2295 -2275
  3. package/README.md +51 -51
  4. package/dist/tsdoc-metadata.json +1 -1
  5. package/extends/tsdoc-base.json +72 -72
  6. package/lib/aedoc/PackageDocComment.js.map +1 -1
  7. package/lib/analyzer/AstDeclaration.js.map +1 -1
  8. package/lib/analyzer/AstEntity.js.map +1 -1
  9. package/lib/analyzer/AstImport.js.map +1 -1
  10. package/lib/analyzer/AstModule.js.map +1 -1
  11. package/lib/analyzer/AstNamespaceImport.js.map +1 -1
  12. package/lib/analyzer/AstReferenceResolver.js.map +1 -1
  13. package/lib/analyzer/AstSymbol.js.map +1 -1
  14. package/lib/analyzer/AstSymbolTable.js.map +1 -1
  15. package/lib/analyzer/ExportAnalyzer.js.map +1 -1
  16. package/lib/analyzer/PackageMetadataManager.js.map +1 -1
  17. package/lib/analyzer/SourceFileLocationFormatter.js.map +1 -1
  18. package/lib/analyzer/Span.js.map +1 -1
  19. package/lib/analyzer/SyntaxHelpers.js.map +1 -1
  20. package/lib/analyzer/TypeScriptHelpers.js.map +1 -1
  21. package/lib/analyzer/TypeScriptInternals.js.map +1 -1
  22. package/lib/api/CompilerState.js.map +1 -1
  23. package/lib/api/ConsoleMessageId.js.map +1 -1
  24. package/lib/api/Extractor.js.map +1 -1
  25. package/lib/api/ExtractorConfig.js.map +1 -1
  26. package/lib/api/ExtractorLogLevel.js.map +1 -1
  27. package/lib/api/ExtractorMessage.js.map +1 -1
  28. package/lib/api/ExtractorMessageId.js.map +1 -1
  29. package/lib/api/IConfigFile.js.map +1 -1
  30. package/lib/cli/ApiExtractorCommandLine.js.map +1 -1
  31. package/lib/cli/InitAction.js.map +1 -1
  32. package/lib/cli/RunAction.js.map +1 -1
  33. package/lib/collector/ApiItemMetadata.js.map +1 -1
  34. package/lib/collector/Collector.js.map +1 -1
  35. package/lib/collector/CollectorEntity.js.map +1 -1
  36. package/lib/collector/DeclarationMetadata.js.map +1 -1
  37. package/lib/collector/MessageRouter.js.map +1 -1
  38. package/lib/collector/SourceMapper.js.map +1 -1
  39. package/lib/collector/SymbolMetadata.js.map +1 -1
  40. package/lib/collector/VisitorState.js.map +1 -1
  41. package/lib/collector/WorkingPackage.js.map +1 -1
  42. package/lib/enhancers/DocCommentEnhancer.js.map +1 -1
  43. package/lib/enhancers/ValidationEnhancer.js.map +1 -1
  44. package/lib/generators/ApiModelGenerator.js.map +1 -1
  45. package/lib/generators/ApiReportGenerator.js.map +1 -1
  46. package/lib/generators/DeclarationReferenceGenerator.js.map +1 -1
  47. package/lib/generators/DtsEmitHelpers.js.map +1 -1
  48. package/lib/generators/DtsRollupGenerator.js.map +1 -1
  49. package/lib/generators/ExcerptBuilder.js +10 -9
  50. package/lib/generators/ExcerptBuilder.js.map +1 -1
  51. package/lib/generators/IndentedWriter.js.map +1 -1
  52. package/lib/index.js.map +1 -1
  53. package/lib/schemas/api-extractor-defaults.json +84 -84
  54. package/lib/schemas/api-extractor-template.json +364 -364
  55. package/lib/schemas/api-extractor.schema.json +205 -205
  56. package/lib/start.js.map +1 -1
  57. package/package.json +9 -10
@@ -1 +1 @@
1
- {"version":3,"file":"IConfigFile.js","sourceRoot":"","sources":["../../src/api/IConfigFile.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\r\n// See LICENSE in the project root for license information.\r\n\r\nimport { ExtractorLogLevel } from './ExtractorLogLevel';\r\n\r\n/**\r\n * Determines how the TypeScript compiler engine will be invoked by API Extractor.\r\n *\r\n * @remarks\r\n * This is part of the {@link IConfigFile} structure.\r\n *\r\n * @public\r\n */\r\nexport interface IConfigCompiler {\r\n /**\r\n * Specifies the path to the tsconfig.json file to be used by API Extractor when analyzing the project.\r\n *\r\n * @remarks\r\n * The path is resolved relative to the folder of the config file that contains the setting; to change this,\r\n * prepend a folder token such as `<projectFolder>`.\r\n *\r\n * Note: This setting will be ignored if `overrideTsconfig` is used.\r\n */\r\n tsconfigFilePath?: string;\r\n\r\n /**\r\n * Provides a compiler configuration that will be used instead of reading the tsconfig.json file from disk.\r\n *\r\n * @remarks\r\n * The value must conform to the TypeScript tsconfig schema:\r\n *\r\n * http://json.schemastore.org/tsconfig\r\n *\r\n * If omitted, then the tsconfig.json file will instead be read from the projectFolder.\r\n */\r\n overrideTsconfig?: {};\r\n\r\n /**\r\n * This option causes the compiler to be invoked with the `--skipLibCheck` option.\r\n *\r\n * @remarks\r\n * This option is not recommended and may cause API Extractor to produce incomplete or incorrect declarations,\r\n * but it may be required when dependencies contain declarations that are incompatible with the TypeScript engine\r\n * that API Extractor uses for its analysis. Where possible, the underlying issue should be fixed rather than\r\n * relying on skipLibCheck.\r\n */\r\n skipLibCheck?: boolean;\r\n}\r\n\r\n/**\r\n * Configures how the API report files (*.api.md) will be generated.\r\n *\r\n * @remarks\r\n * This is part of the {@link IConfigFile} structure.\r\n *\r\n * @public\r\n */\r\nexport interface IConfigApiReport {\r\n /**\r\n * Whether to generate an API report.\r\n */\r\n enabled: boolean;\r\n\r\n /**\r\n * The filename for the API report files. It will be combined with `reportFolder` or `reportTempFolder` to produce\r\n * a full output filename.\r\n *\r\n * @remarks\r\n * The file extension should be \".api.md\", and the string should not contain a path separator such as `\\` or `/`.\r\n */\r\n reportFileName?: string;\r\n\r\n /**\r\n * Specifies the folder where the API report file is written. The file name portion is determined by\r\n * the `reportFileName` setting.\r\n *\r\n * @remarks\r\n * The API report file is normally tracked by Git. Changes to it can be used to trigger a branch policy,\r\n * e.g. for an API review.\r\n *\r\n * The path is resolved relative to the folder of the config file that contains the setting; to change this,\r\n * prepend a folder token such as `<projectFolder>`.\r\n */\r\n reportFolder?: string;\r\n\r\n /**\r\n * Specifies the folder where the temporary report file is written. The file name portion is determined by\r\n * the `reportFileName` setting.\r\n *\r\n * @remarks\r\n * After the temporary file is written to disk, it is compared with the file in the `reportFolder`.\r\n * If they are different, a production build will fail.\r\n *\r\n * The path is resolved relative to the folder of the config file that contains the setting; to change this,\r\n * prepend a folder token such as `<projectFolder>`.\r\n */\r\n reportTempFolder?: string;\r\n}\r\n\r\n/**\r\n * Configures how the doc model file (*.api.json) will be generated.\r\n *\r\n * @remarks\r\n * This is part of the {@link IConfigFile} structure.\r\n *\r\n * @public\r\n */\r\nexport interface IConfigDocModel {\r\n /**\r\n * Whether to generate a doc model file.\r\n */\r\n enabled: boolean;\r\n\r\n /**\r\n * The output path for the doc model file. The file extension should be \".api.json\".\r\n *\r\n * @remarks\r\n * The path is resolved relative to the folder of the config file that contains the setting; to change this,\r\n * prepend a folder token such as `<projectFolder>`.\r\n */\r\n apiJsonFilePath?: string;\r\n}\r\n\r\n/**\r\n * Configures how the .d.ts rollup file will be generated.\r\n *\r\n * @remarks\r\n * This is part of the {@link IConfigFile} structure.\r\n *\r\n * @public\r\n */\r\nexport interface IConfigDtsRollup {\r\n /**\r\n * Whether to generate the .d.ts rollup file.\r\n */\r\n enabled: boolean;\r\n\r\n /**\r\n * Specifies the output path for a .d.ts rollup file to be generated without any trimming.\r\n *\r\n * @remarks\r\n * This file will include all declarations that are exported by the main entry point.\r\n *\r\n * If the path is an empty string, then this file will not be written.\r\n *\r\n * The path is resolved relative to the folder of the config file that contains the setting; to change this,\r\n * prepend a folder token such as `<projectFolder>`.\r\n */\r\n untrimmedFilePath?: string;\r\n\r\n /**\r\n * Specifies the output path for a .d.ts rollup file to be generated with trimming for a \"beta\" release.\r\n *\r\n * @remarks\r\n * This file will include only declarations that are marked as `@public` or `@beta`.\r\n *\r\n * The path is resolved relative to the folder of the config file that contains the setting; to change this,\r\n * prepend a folder token such as `<projectFolder>`.\r\n */\r\n betaTrimmedFilePath?: string;\r\n\r\n /**\r\n * Specifies the output path for a .d.ts rollup file to be generated with trimming for a \"public\" release.\r\n *\r\n * @remarks\r\n * This file will include only declarations that are marked as `@public`.\r\n *\r\n * If the path is an empty string, then this file will not be written.\r\n *\r\n * The path is resolved relative to the folder of the config file that contains the setting; to change this,\r\n * prepend a folder token such as `<projectFolder>`.\r\n */\r\n publicTrimmedFilePath?: string;\r\n\r\n /**\r\n * When a declaration is trimmed, by default it will be replaced by a code comment such as\r\n * \"Excluded from this release type: exampleMember\". Set \"omitTrimmingComments\" to true to remove the\r\n * declaration completely.\r\n */\r\n omitTrimmingComments?: boolean;\r\n}\r\n\r\n/**\r\n * Configures how the tsdoc-metadata.json file will be generated.\r\n *\r\n * @remarks\r\n * This is part of the {@link IConfigFile} structure.\r\n *\r\n * @public\r\n */\r\nexport interface IConfigTsdocMetadata {\r\n /**\r\n * Whether to generate the tsdoc-metadata.json file.\r\n */\r\n enabled: boolean;\r\n\r\n /**\r\n * Specifies where the TSDoc metadata file should be written.\r\n *\r\n * @remarks\r\n * The path is resolved relative to the folder of the config file that contains the setting; to change this,\r\n * prepend a folder token such as `<projectFolder>`.\r\n *\r\n * The default value is `<lookup>`, which causes the path to be automatically inferred from the `tsdocMetadata`,\r\n * `typings` or `main` fields of the project's package.json. If none of these fields are set, the lookup\r\n * falls back to `tsdoc-metadata.json` in the package folder.\r\n */\r\n tsdocMetadataFilePath?: string;\r\n}\r\n\r\n/**\r\n * Configures reporting for a given message identifier.\r\n *\r\n * @remarks\r\n * This is part of the {@link IConfigFile} structure.\r\n *\r\n * @public\r\n */\r\nexport interface IConfigMessageReportingRule {\r\n /**\r\n * Specifies whether the message should be written to the the tool's output log.\r\n *\r\n * @remarks\r\n * Note that the `addToApiReportFile` property may supersede this option.\r\n */\r\n logLevel: ExtractorLogLevel;\r\n\r\n /**\r\n * When `addToApiReportFile` is true: If API Extractor is configured to write an API report file (.api.md),\r\n * then the message will be written inside that file; otherwise, the message is instead logged according to\r\n * the `logLevel` option.\r\n */\r\n addToApiReportFile?: boolean;\r\n}\r\n\r\n/**\r\n * Specifies a table of reporting rules for different message identifiers, and also the default rule used for\r\n * identifiers that do not appear in the table.\r\n *\r\n * @remarks\r\n * This is part of the {@link IConfigFile} structure.\r\n *\r\n * @public\r\n */\r\nexport interface IConfigMessageReportingTable {\r\n /**\r\n * The key is a message identifier for the associated type of message, or \"default\" to specify the default policy.\r\n * For example, the key might be `TS2551` (a compiler message), `tsdoc-link-tag-unescaped-text` (a TSDOc message),\r\n * or `ae-extra-release-tag` (a message related to the API Extractor analysis).\r\n */\r\n [messageId: string]: IConfigMessageReportingRule;\r\n}\r\n\r\n/**\r\n * Configures how API Extractor reports error and warning messages produced during analysis.\r\n *\r\n * @remarks\r\n * This is part of the {@link IConfigFile} structure.\r\n *\r\n * @public\r\n */\r\nexport interface IExtractorMessagesConfig {\r\n /**\r\n * Configures handling of diagnostic messages generating the TypeScript compiler while analyzing the\r\n * input .d.ts files.\r\n */\r\n compilerMessageReporting?: IConfigMessageReportingTable;\r\n\r\n /**\r\n * Configures handling of messages reported by API Extractor during its analysis.\r\n */\r\n extractorMessageReporting?: IConfigMessageReportingTable;\r\n\r\n /**\r\n * Configures handling of messages reported by the TSDoc parser when analyzing code comments.\r\n */\r\n tsdocMessageReporting?: IConfigMessageReportingTable;\r\n}\r\n\r\n/**\r\n * Configuration options for the API Extractor tool. These options can be constructed programmatically\r\n * or loaded from the api-extractor.json config file using the {@link ExtractorConfig} class.\r\n *\r\n * @public\r\n */\r\nexport interface IConfigFile {\r\n /**\r\n * Optionally specifies another JSON config file that this file extends from. This provides a way for\r\n * standard settings to be shared across multiple projects.\r\n *\r\n * @remarks\r\n * If the path starts with `./` or `../`, the path is resolved relative to the folder of the file that contains\r\n * the `extends` field. Otherwise, the first path segment is interpreted as an NPM package name, and will be\r\n * resolved using NodeJS `require()`.\r\n */\r\n extends?: string;\r\n\r\n /**\r\n * Determines the `<projectFolder>` token that can be used with other config file settings. The project folder\r\n * typically contains the tsconfig.json and package.json config files, but the path is user-defined.\r\n *\r\n * @remarks\r\n *\r\n * The path is resolved relative to the folder of the config file that contains the setting.\r\n *\r\n * The default value for `projectFolder` is the token `<lookup>`, which means the folder is determined using\r\n * the following heuristics:\r\n *\r\n * If the config/rig.json system is used (as defined by {@link https://www.npmjs.com/package/@rushstack/rig-package\r\n * | @rushstack/rig-package}), then the `<lookup>` value will be the package folder that referenced the rig.\r\n *\r\n * Otherwise, the `<lookup>` value is determined by traversing parent folders, starting from the folder containing\r\n * api-extractor.json, and stopping at the first folder that contains a tsconfig.json file. If a tsconfig.json file\r\n * cannot be found in this way, then an error will be reported.\r\n */\r\n projectFolder?: string;\r\n\r\n /**\r\n * Specifies the .d.ts file to be used as the starting point for analysis. API Extractor\r\n * analyzes the symbols exported by this module.\r\n *\r\n * @remarks\r\n *\r\n * The file extension must be \".d.ts\" and not \".ts\".\r\n * The path is resolved relative to the \"projectFolder\" location.\r\n */\r\n mainEntryPointFilePath: string;\r\n\r\n /**\r\n * A list of NPM package names whose exports should be treated as part of this package.\r\n *\r\n * @remarks\r\n *\r\n * For example, suppose that Webpack is used to generate a distributed bundle for the project `library1`,\r\n * and another NPM package `library2` is embedded in this bundle. Some types from `library2` may become part\r\n * of the exported API for `library1`, but by default API Extractor would generate a .d.ts rollup that explicitly\r\n * imports `library2`. To avoid this, we can specify:\r\n *\r\n * ```js\r\n * \"bundledPackages\": [ \"library2\" ],\r\n * ```\r\n *\r\n * This would direct API Extractor to embed those types directly in the .d.ts rollup, as if they had been\r\n * local files for `library1`.\r\n */\r\n bundledPackages?: string[];\r\n\r\n /**\r\n * {@inheritDoc IConfigCompiler}\r\n */\r\n compiler?: IConfigCompiler;\r\n\r\n /**\r\n * {@inheritDoc IConfigApiReport}\r\n */\r\n apiReport?: IConfigApiReport;\r\n\r\n /**\r\n * {@inheritDoc IConfigDocModel}\r\n */\r\n docModel?: IConfigDocModel;\r\n\r\n /**\r\n * {@inheritDoc IConfigDtsRollup}\r\n * @beta\r\n */\r\n dtsRollup?: IConfigDtsRollup;\r\n\r\n /**\r\n * {@inheritDoc IConfigTsdocMetadata}\r\n * @beta\r\n */\r\n tsdocMetadata?: IConfigTsdocMetadata;\r\n\r\n /**\r\n * Specifies what type of newlines API Extractor should use when writing output files.\r\n *\r\n * @remarks\r\n * By default, the output files will be written with Windows-style newlines.\r\n * To use POSIX-style newlines, specify \"lf\" instead.\r\n * To use the OS's default newline kind, specify \"os\".\r\n */\r\n newlineKind?: 'crlf' | 'lf' | 'os';\r\n\r\n /**\r\n * {@inheritDoc IExtractorMessagesConfig}\r\n */\r\n messages?: IExtractorMessagesConfig;\r\n\r\n /**\r\n * Set to true when invoking API Extractor's test harness.\r\n * @remarks\r\n * When `testMode` is true, the `toolVersion` field in the .api.json file is assigned an empty string\r\n * to prevent spurious diffs in output files tracked for tests.\r\n */\r\n testMode?: boolean;\r\n}\r\n"]}
1
+ {"version":3,"file":"IConfigFile.js","sourceRoot":"","sources":["../../src/api/IConfigFile.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 { ExtractorLogLevel } from './ExtractorLogLevel';\n\n/**\n * Determines how the TypeScript compiler engine will be invoked by API Extractor.\n *\n * @remarks\n * This is part of the {@link IConfigFile} structure.\n *\n * @public\n */\nexport interface IConfigCompiler {\n /**\n * Specifies the path to the tsconfig.json file to be used by API Extractor when analyzing the project.\n *\n * @remarks\n * The path is resolved relative to the folder of the config file that contains the setting; to change this,\n * prepend a folder token such as `<projectFolder>`.\n *\n * Note: This setting will be ignored if `overrideTsconfig` is used.\n */\n tsconfigFilePath?: string;\n\n /**\n * Provides a compiler configuration that will be used instead of reading the tsconfig.json file from disk.\n *\n * @remarks\n * The value must conform to the TypeScript tsconfig schema:\n *\n * http://json.schemastore.org/tsconfig\n *\n * If omitted, then the tsconfig.json file will instead be read from the projectFolder.\n */\n overrideTsconfig?: {};\n\n /**\n * This option causes the compiler to be invoked with the `--skipLibCheck` option.\n *\n * @remarks\n * This option is not recommended and may cause API Extractor to produce incomplete or incorrect declarations,\n * but it may be required when dependencies contain declarations that are incompatible with the TypeScript engine\n * that API Extractor uses for its analysis. Where possible, the underlying issue should be fixed rather than\n * relying on skipLibCheck.\n */\n skipLibCheck?: boolean;\n}\n\n/**\n * Configures how the API report files (*.api.md) will be generated.\n *\n * @remarks\n * This is part of the {@link IConfigFile} structure.\n *\n * @public\n */\nexport interface IConfigApiReport {\n /**\n * Whether to generate an API report.\n */\n enabled: boolean;\n\n /**\n * The filename for the API report files. It will be combined with `reportFolder` or `reportTempFolder` to produce\n * a full output filename.\n *\n * @remarks\n * The file extension should be \".api.md\", and the string should not contain a path separator such as `\\` or `/`.\n */\n reportFileName?: string;\n\n /**\n * Specifies the folder where the API report file is written. The file name portion is determined by\n * the `reportFileName` setting.\n *\n * @remarks\n * The API report file is normally tracked by Git. Changes to it can be used to trigger a branch policy,\n * e.g. for an API review.\n *\n * The path is resolved relative to the folder of the config file that contains the setting; to change this,\n * prepend a folder token such as `<projectFolder>`.\n */\n reportFolder?: string;\n\n /**\n * Specifies the folder where the temporary report file is written. The file name portion is determined by\n * the `reportFileName` setting.\n *\n * @remarks\n * After the temporary file is written to disk, it is compared with the file in the `reportFolder`.\n * If they are different, a production build will fail.\n *\n * The path is resolved relative to the folder of the config file that contains the setting; to change this,\n * prepend a folder token such as `<projectFolder>`.\n */\n reportTempFolder?: string;\n}\n\n/**\n * Configures how the doc model file (*.api.json) will be generated.\n *\n * @remarks\n * This is part of the {@link IConfigFile} structure.\n *\n * @public\n */\nexport interface IConfigDocModel {\n /**\n * Whether to generate a doc model file.\n */\n enabled: boolean;\n\n /**\n * The output path for the doc model file. The file extension should be \".api.json\".\n *\n * @remarks\n * The path is resolved relative to the folder of the config file that contains the setting; to change this,\n * prepend a folder token such as `<projectFolder>`.\n */\n apiJsonFilePath?: string;\n}\n\n/**\n * Configures how the .d.ts rollup file will be generated.\n *\n * @remarks\n * This is part of the {@link IConfigFile} structure.\n *\n * @public\n */\nexport interface IConfigDtsRollup {\n /**\n * Whether to generate the .d.ts rollup file.\n */\n enabled: boolean;\n\n /**\n * Specifies the output path for a .d.ts rollup file to be generated without any trimming.\n *\n * @remarks\n * This file will include all declarations that are exported by the main entry point.\n *\n * If the path is an empty string, then this file will not be written.\n *\n * The path is resolved relative to the folder of the config file that contains the setting; to change this,\n * prepend a folder token such as `<projectFolder>`.\n */\n untrimmedFilePath?: string;\n\n /**\n * Specifies the output path for a .d.ts rollup file to be generated with trimming for a \"beta\" release.\n *\n * @remarks\n * This file will include only declarations that are marked as `@public` or `@beta`.\n *\n * The path is resolved relative to the folder of the config file that contains the setting; to change this,\n * prepend a folder token such as `<projectFolder>`.\n */\n betaTrimmedFilePath?: string;\n\n /**\n * Specifies the output path for a .d.ts rollup file to be generated with trimming for a \"public\" release.\n *\n * @remarks\n * This file will include only declarations that are marked as `@public`.\n *\n * If the path is an empty string, then this file will not be written.\n *\n * The path is resolved relative to the folder of the config file that contains the setting; to change this,\n * prepend a folder token such as `<projectFolder>`.\n */\n publicTrimmedFilePath?: string;\n\n /**\n * When a declaration is trimmed, by default it will be replaced by a code comment such as\n * \"Excluded from this release type: exampleMember\". Set \"omitTrimmingComments\" to true to remove the\n * declaration completely.\n */\n omitTrimmingComments?: boolean;\n}\n\n/**\n * Configures how the tsdoc-metadata.json file will be generated.\n *\n * @remarks\n * This is part of the {@link IConfigFile} structure.\n *\n * @public\n */\nexport interface IConfigTsdocMetadata {\n /**\n * Whether to generate the tsdoc-metadata.json file.\n */\n enabled: boolean;\n\n /**\n * Specifies where the TSDoc metadata file should be written.\n *\n * @remarks\n * The path is resolved relative to the folder of the config file that contains the setting; to change this,\n * prepend a folder token such as `<projectFolder>`.\n *\n * The default value is `<lookup>`, which causes the path to be automatically inferred from the `tsdocMetadata`,\n * `typings` or `main` fields of the project's package.json. If none of these fields are set, the lookup\n * falls back to `tsdoc-metadata.json` in the package folder.\n */\n tsdocMetadataFilePath?: string;\n}\n\n/**\n * Configures reporting for a given message identifier.\n *\n * @remarks\n * This is part of the {@link IConfigFile} structure.\n *\n * @public\n */\nexport interface IConfigMessageReportingRule {\n /**\n * Specifies whether the message should be written to the the tool's output log.\n *\n * @remarks\n * Note that the `addToApiReportFile` property may supersede this option.\n */\n logLevel: ExtractorLogLevel;\n\n /**\n * When `addToApiReportFile` is true: If API Extractor is configured to write an API report file (.api.md),\n * then the message will be written inside that file; otherwise, the message is instead logged according to\n * the `logLevel` option.\n */\n addToApiReportFile?: boolean;\n}\n\n/**\n * Specifies a table of reporting rules for different message identifiers, and also the default rule used for\n * identifiers that do not appear in the table.\n *\n * @remarks\n * This is part of the {@link IConfigFile} structure.\n *\n * @public\n */\nexport interface IConfigMessageReportingTable {\n /**\n * The key is a message identifier for the associated type of message, or \"default\" to specify the default policy.\n * For example, the key might be `TS2551` (a compiler message), `tsdoc-link-tag-unescaped-text` (a TSDOc message),\n * or `ae-extra-release-tag` (a message related to the API Extractor analysis).\n */\n [messageId: string]: IConfigMessageReportingRule;\n}\n\n/**\n * Configures how API Extractor reports error and warning messages produced during analysis.\n *\n * @remarks\n * This is part of the {@link IConfigFile} structure.\n *\n * @public\n */\nexport interface IExtractorMessagesConfig {\n /**\n * Configures handling of diagnostic messages generating the TypeScript compiler while analyzing the\n * input .d.ts files.\n */\n compilerMessageReporting?: IConfigMessageReportingTable;\n\n /**\n * Configures handling of messages reported by API Extractor during its analysis.\n */\n extractorMessageReporting?: IConfigMessageReportingTable;\n\n /**\n * Configures handling of messages reported by the TSDoc parser when analyzing code comments.\n */\n tsdocMessageReporting?: IConfigMessageReportingTable;\n}\n\n/**\n * Configuration options for the API Extractor tool. These options can be constructed programmatically\n * or loaded from the api-extractor.json config file using the {@link ExtractorConfig} class.\n *\n * @public\n */\nexport interface IConfigFile {\n /**\n * Optionally specifies another JSON config file that this file extends from. This provides a way for\n * standard settings to be shared across multiple projects.\n *\n * @remarks\n * If the path starts with `./` or `../`, the path is resolved relative to the folder of the file that contains\n * the `extends` field. Otherwise, the first path segment is interpreted as an NPM package name, and will be\n * resolved using NodeJS `require()`.\n */\n extends?: string;\n\n /**\n * Determines the `<projectFolder>` token that can be used with other config file settings. The project folder\n * typically contains the tsconfig.json and package.json config files, but the path is user-defined.\n *\n * @remarks\n *\n * The path is resolved relative to the folder of the config file that contains the setting.\n *\n * The default value for `projectFolder` is the token `<lookup>`, which means the folder is determined using\n * the following heuristics:\n *\n * If the config/rig.json system is used (as defined by {@link https://www.npmjs.com/package/@rushstack/rig-package\n * | @rushstack/rig-package}), then the `<lookup>` value will be the package folder that referenced the rig.\n *\n * Otherwise, the `<lookup>` value is determined by traversing parent folders, starting from the folder containing\n * api-extractor.json, and stopping at the first folder that contains a tsconfig.json file. If a tsconfig.json file\n * cannot be found in this way, then an error will be reported.\n */\n projectFolder?: string;\n\n /**\n * Specifies the .d.ts file to be used as the starting point for analysis. API Extractor\n * analyzes the symbols exported by this module.\n *\n * @remarks\n *\n * The file extension must be \".d.ts\" and not \".ts\".\n * The path is resolved relative to the \"projectFolder\" location.\n */\n mainEntryPointFilePath: string;\n\n /**\n * A list of NPM package names whose exports should be treated as part of this package.\n *\n * @remarks\n *\n * For example, suppose that Webpack is used to generate a distributed bundle for the project `library1`,\n * and another NPM package `library2` is embedded in this bundle. Some types from `library2` may become part\n * of the exported API for `library1`, but by default API Extractor would generate a .d.ts rollup that explicitly\n * imports `library2`. To avoid this, we can specify:\n *\n * ```js\n * \"bundledPackages\": [ \"library2\" ],\n * ```\n *\n * This would direct API Extractor to embed those types directly in the .d.ts rollup, as if they had been\n * local files for `library1`.\n */\n bundledPackages?: string[];\n\n /**\n * {@inheritDoc IConfigCompiler}\n */\n compiler?: IConfigCompiler;\n\n /**\n * {@inheritDoc IConfigApiReport}\n */\n apiReport?: IConfigApiReport;\n\n /**\n * {@inheritDoc IConfigDocModel}\n */\n docModel?: IConfigDocModel;\n\n /**\n * {@inheritDoc IConfigDtsRollup}\n * @beta\n */\n dtsRollup?: IConfigDtsRollup;\n\n /**\n * {@inheritDoc IConfigTsdocMetadata}\n * @beta\n */\n tsdocMetadata?: IConfigTsdocMetadata;\n\n /**\n * Specifies what type of newlines API Extractor should use when writing output files.\n *\n * @remarks\n * By default, the output files will be written with Windows-style newlines.\n * To use POSIX-style newlines, specify \"lf\" instead.\n * To use the OS's default newline kind, specify \"os\".\n */\n newlineKind?: 'crlf' | 'lf' | 'os';\n\n /**\n * {@inheritDoc IExtractorMessagesConfig}\n */\n messages?: IExtractorMessagesConfig;\n\n /**\n * Set to true when invoking API Extractor's test harness.\n * @remarks\n * When `testMode` is true, the `toolVersion` field in the .api.json file is assigned an empty string\n * to prevent spurious diffs in output files tracked for tests.\n */\n testMode?: boolean;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"ApiExtractorCommandLine.js","sourceRoot":"","sources":["../../src/cli/ApiExtractorCommandLine.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;;;;;;;;;;;;;;;;;;;;;;;AAE3D,oDAA4B;AAC5B,uCAAyB;AAEzB,gEAAyF;AACzF,oEAA6D;AAE7D,2CAAwC;AACxC,6CAA0C;AAE1C,MAAa,uBAAwB,SAAQ,mCAAiB;IAG5D;QACE,KAAK,CAAC;YACJ,YAAY,EAAE,eAAe;YAC7B,eAAe,EACb,wFAAwF;gBACxF,0GAA0G;gBAC1G,qGAAqG;gBACrG,oGAAoG;gBACpG,wEAAwE;SAC3E,CAAC,CAAC;QACH,IAAI,CAAC,gBAAgB,EAAE,CAAC;IAC1B,CAAC;IAES,kBAAkB;QAC1B,WAAW;QACX,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC,mBAAmB,CAAC;YAC9C,iBAAiB,EAAE,SAAS;YAC5B,kBAAkB,EAAE,IAAI;YACxB,WAAW,EAAE,sEAAsE;SACpF,CAAC,CAAC;IACL,CAAC;IAES,SAAS;QACjB,WAAW;QACX,IAAI,IAAI,CAAC,eAAe,CAAC,KAAK,EAAE;YAC9B,iCAAa,CAAC,eAAe,GAAG,IAAI,CAAC;SACtC;QAED,OAAO,KAAK,CAAC,SAAS,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;YACvC,IAAI,IAAI,CAAC,eAAe,CAAC,KAAK,EAAE;gBAC9B,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,GAAG,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC;aACrC;iBAAM;gBACL,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,GAAG,GAAG,gBAAM,CAAC,GAAG,CAAC,SAAS,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;aACtE;YAED,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;QACvB,CAAC,CAAC,CAAC;IACL,CAAC;IAEO,gBAAgB;QACtB,IAAI,CAAC,SAAS,CAAC,IAAI,uBAAU,CAAC,IAAI,CAAC,CAAC,CAAC;QACrC,IAAI,CAAC,SAAS,CAAC,IAAI,qBAAS,CAAC,IAAI,CAAC,CAAC,CAAC;IACtC,CAAC;CACF;AA9CD,0DA8CC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\r\n// See LICENSE in the project root for license information.\r\n\r\nimport colors from 'colors';\r\nimport * as os from 'os';\r\n\r\nimport { CommandLineParser, CommandLineFlagParameter } from '@rushstack/ts-command-line';\r\nimport { InternalError } from '@rushstack/node-core-library';\r\n\r\nimport { RunAction } from './RunAction';\r\nimport { InitAction } from './InitAction';\r\n\r\nexport class ApiExtractorCommandLine extends CommandLineParser {\r\n private _debugParameter!: CommandLineFlagParameter;\r\n\r\n public constructor() {\r\n super({\r\n toolFilename: 'api-extractor',\r\n toolDescription:\r\n 'API Extractor helps you build better TypeScript libraries. It analyzes the main entry' +\r\n ' point for your package, collects the inventory of exported declarations, and then generates three kinds' +\r\n ' of output: an API report file (.api.md) to facilitate reviews, a declaration rollup (.d.ts) to be' +\r\n ' published with your NPM package, and a doc model file (.api.json) to be used with a documentation' +\r\n ' tool such as api-documenter. For details, please visit the web site.'\r\n });\r\n this._populateActions();\r\n }\r\n\r\n protected onDefineParameters(): void {\r\n // override\r\n this._debugParameter = this.defineFlagParameter({\r\n parameterLongName: '--debug',\r\n parameterShortName: '-d',\r\n description: 'Show the full call stack if an error occurs while executing the tool'\r\n });\r\n }\r\n\r\n protected onExecute(): Promise<void> {\r\n // override\r\n if (this._debugParameter.value) {\r\n InternalError.breakInDebugger = true;\r\n }\r\n\r\n return super.onExecute().catch((error) => {\r\n if (this._debugParameter.value) {\r\n console.error(os.EOL + error.stack);\r\n } else {\r\n console.error(os.EOL + colors.red('ERROR: ' + error.message.trim()));\r\n }\r\n\r\n process.exitCode = 1;\r\n });\r\n }\r\n\r\n private _populateActions(): void {\r\n this.addAction(new InitAction(this));\r\n this.addAction(new RunAction(this));\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"ApiExtractorCommandLine.js","sourceRoot":"","sources":["../../src/cli/ApiExtractorCommandLine.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;;;;;;;;;;;;;;;;;;;;;;;AAE3D,oDAA4B;AAC5B,uCAAyB;AAEzB,gEAAyF;AACzF,oEAA6D;AAE7D,2CAAwC;AACxC,6CAA0C;AAE1C,MAAa,uBAAwB,SAAQ,mCAAiB;IAG5D;QACE,KAAK,CAAC;YACJ,YAAY,EAAE,eAAe;YAC7B,eAAe,EACb,wFAAwF;gBACxF,0GAA0G;gBAC1G,qGAAqG;gBACrG,oGAAoG;gBACpG,wEAAwE;SAC3E,CAAC,CAAC;QACH,IAAI,CAAC,gBAAgB,EAAE,CAAC;IAC1B,CAAC;IAES,kBAAkB;QAC1B,WAAW;QACX,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC,mBAAmB,CAAC;YAC9C,iBAAiB,EAAE,SAAS;YAC5B,kBAAkB,EAAE,IAAI;YACxB,WAAW,EAAE,sEAAsE;SACpF,CAAC,CAAC;IACL,CAAC;IAES,SAAS;QACjB,WAAW;QACX,IAAI,IAAI,CAAC,eAAe,CAAC,KAAK,EAAE;YAC9B,iCAAa,CAAC,eAAe,GAAG,IAAI,CAAC;SACtC;QAED,OAAO,KAAK,CAAC,SAAS,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;YACvC,IAAI,IAAI,CAAC,eAAe,CAAC,KAAK,EAAE;gBAC9B,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,GAAG,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC;aACrC;iBAAM;gBACL,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,GAAG,GAAG,gBAAM,CAAC,GAAG,CAAC,SAAS,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;aACtE;YAED,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;QACvB,CAAC,CAAC,CAAC;IACL,CAAC;IAEO,gBAAgB;QACtB,IAAI,CAAC,SAAS,CAAC,IAAI,uBAAU,CAAC,IAAI,CAAC,CAAC,CAAC;QACrC,IAAI,CAAC,SAAS,CAAC,IAAI,qBAAS,CAAC,IAAI,CAAC,CAAC,CAAC;IACtC,CAAC;CACF;AA9CD,0DA8CC","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 colors from 'colors';\nimport * as os from 'os';\n\nimport { CommandLineParser, CommandLineFlagParameter } from '@rushstack/ts-command-line';\nimport { InternalError } from '@rushstack/node-core-library';\n\nimport { RunAction } from './RunAction';\nimport { InitAction } from './InitAction';\n\nexport class ApiExtractorCommandLine extends CommandLineParser {\n private _debugParameter!: CommandLineFlagParameter;\n\n public constructor() {\n super({\n toolFilename: 'api-extractor',\n toolDescription:\n 'API Extractor helps you build better TypeScript libraries. It analyzes the main entry' +\n ' point for your package, collects the inventory of exported declarations, and then generates three kinds' +\n ' of output: an API report file (.api.md) to facilitate reviews, a declaration rollup (.d.ts) to be' +\n ' published with your NPM package, and a doc model file (.api.json) to be used with a documentation' +\n ' tool such as api-documenter. For details, please visit the web site.'\n });\n this._populateActions();\n }\n\n protected onDefineParameters(): void {\n // override\n this._debugParameter = this.defineFlagParameter({\n parameterLongName: '--debug',\n parameterShortName: '-d',\n description: 'Show the full call stack if an error occurs while executing the tool'\n });\n }\n\n protected onExecute(): Promise<void> {\n // override\n if (this._debugParameter.value) {\n InternalError.breakInDebugger = true;\n }\n\n return super.onExecute().catch((error) => {\n if (this._debugParameter.value) {\n console.error(os.EOL + error.stack);\n } else {\n console.error(os.EOL + colors.red('ERROR: ' + error.message.trim()));\n }\n\n process.exitCode = 1;\n });\n }\n\n private _populateActions(): void {\n this.addAction(new InitAction(this));\n this.addAction(new RunAction(this));\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"InitAction.js","sourceRoot":"","sources":["../../src/cli/InitAction.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;;;;;;;;;;;;;;;;;;;;;;;AAE3D,oDAA4B;AAC5B,2CAA6B;AAC7B,oEAA0D;AAC1D,gEAA+D;AAG/D,4DAAyD;AAEzD,MAAa,UAAW,SAAQ,mCAAiB;IAC/C,YAAmB,MAA+B;QAChD,KAAK,CAAC;YACJ,UAAU,EAAE,MAAM;YAClB,OAAO,EAAE,aAAa,iCAAe,CAAC,QAAQ,cAAc;YAC5D,aAAa,EACX,iFAAiF;gBACjF,IAAI,iCAAe,CAAC,QAAQ,0EAA0E;gBACtG,qDAAqD;SACxD,CAAC,CAAC;IACL,CAAC;IAES,kBAAkB;QAC1B,WAAW;QACX,oBAAoB;IACtB,CAAC;IAES,KAAK,CAAC,SAAS;QACvB,WAAW;QACX,MAAM,aAAa,GAAW,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,wCAAwC,CAAC,CAAC;QAChG,MAAM,cAAc,GAAW,IAAI,CAAC,OAAO,CAAC,iCAAe,CAAC,QAAQ,CAAC,CAAC;QAEtE,IAAI,8BAAU,CAAC,MAAM,CAAC,cAAc,CAAC,EAAE;YACrC,OAAO,CAAC,GAAG,CAAC,gBAAM,CAAC,GAAG,CAAC,iCAAiC,CAAC,CAAC,CAAC;YAC3D,OAAO,CAAC,GAAG,CAAC,MAAM,GAAG,cAAc,GAAG,IAAI,CAAC,CAAC;YAC5C,MAAM,IAAI,KAAK,CAAC,6BAA6B,CAAC,CAAC;SAChD;QAED,OAAO,CAAC,GAAG,CAAC,gBAAM,CAAC,KAAK,CAAC,gBAAgB,CAAC,GAAG,cAAc,CAAC,CAAC;QAC7D,8BAAU,CAAC,QAAQ,CAAC;YAClB,UAAU,EAAE,aAAa;YACzB,eAAe,EAAE,cAAc;SAChC,CAAC,CAAC;QAEH,OAAO,CAAC,GAAG,CACT,qFAAqF;YACnF,oDAAoD,CACvD,CAAC;IACJ,CAAC;CACF;AAvCD,gCAuCC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\r\n// See LICENSE in the project root for license information.\r\n\r\nimport colors from 'colors';\r\nimport * as path from 'path';\r\nimport { FileSystem } from '@rushstack/node-core-library';\r\nimport { CommandLineAction } from '@rushstack/ts-command-line';\r\n\r\nimport { ApiExtractorCommandLine } from './ApiExtractorCommandLine';\r\nimport { ExtractorConfig } from '../api/ExtractorConfig';\r\n\r\nexport class InitAction extends CommandLineAction {\r\n public constructor(parser: ApiExtractorCommandLine) {\r\n super({\r\n actionName: 'init',\r\n summary: `Create an ${ExtractorConfig.FILENAME} config file`,\r\n documentation:\r\n `Use this command when setting up API Extractor for a new project. It writes an` +\r\n ` ${ExtractorConfig.FILENAME} config file template with code comments that describe all the settings.` +\r\n ` The file will be written in the current directory.`\r\n });\r\n }\r\n\r\n protected onDefineParameters(): void {\r\n // override\r\n // No parameters yet\r\n }\r\n\r\n protected async onExecute(): Promise<void> {\r\n // override\r\n const inputFilePath: string = path.resolve(__dirname, '../schemas/api-extractor-template.json');\r\n const outputFilePath: string = path.resolve(ExtractorConfig.FILENAME);\r\n\r\n if (FileSystem.exists(outputFilePath)) {\r\n console.log(colors.red('The output file already exists:'));\r\n console.log('\\n ' + outputFilePath + '\\n');\r\n throw new Error('Unable to write output file');\r\n }\r\n\r\n console.log(colors.green('Writing file: ') + outputFilePath);\r\n FileSystem.copyFile({\r\n sourcePath: inputFilePath,\r\n destinationPath: outputFilePath\r\n });\r\n\r\n console.log(\r\n '\\nThe recommended location for this file is in the project\\'s \"config\" subfolder,\\n' +\r\n 'or else in the top-level folder with package.json.'\r\n );\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"InitAction.js","sourceRoot":"","sources":["../../src/cli/InitAction.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;;;;;;;;;;;;;;;;;;;;;;;AAE3D,oDAA4B;AAC5B,2CAA6B;AAC7B,oEAA0D;AAC1D,gEAA+D;AAG/D,4DAAyD;AAEzD,MAAa,UAAW,SAAQ,mCAAiB;IAC/C,YAAmB,MAA+B;QAChD,KAAK,CAAC;YACJ,UAAU,EAAE,MAAM;YAClB,OAAO,EAAE,aAAa,iCAAe,CAAC,QAAQ,cAAc;YAC5D,aAAa,EACX,iFAAiF;gBACjF,IAAI,iCAAe,CAAC,QAAQ,0EAA0E;gBACtG,qDAAqD;SACxD,CAAC,CAAC;IACL,CAAC;IAES,kBAAkB;QAC1B,WAAW;QACX,oBAAoB;IACtB,CAAC;IAES,KAAK,CAAC,SAAS;QACvB,WAAW;QACX,MAAM,aAAa,GAAW,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,wCAAwC,CAAC,CAAC;QAChG,MAAM,cAAc,GAAW,IAAI,CAAC,OAAO,CAAC,iCAAe,CAAC,QAAQ,CAAC,CAAC;QAEtE,IAAI,8BAAU,CAAC,MAAM,CAAC,cAAc,CAAC,EAAE;YACrC,OAAO,CAAC,GAAG,CAAC,gBAAM,CAAC,GAAG,CAAC,iCAAiC,CAAC,CAAC,CAAC;YAC3D,OAAO,CAAC,GAAG,CAAC,MAAM,GAAG,cAAc,GAAG,IAAI,CAAC,CAAC;YAC5C,MAAM,IAAI,KAAK,CAAC,6BAA6B,CAAC,CAAC;SAChD;QAED,OAAO,CAAC,GAAG,CAAC,gBAAM,CAAC,KAAK,CAAC,gBAAgB,CAAC,GAAG,cAAc,CAAC,CAAC;QAC7D,8BAAU,CAAC,QAAQ,CAAC;YAClB,UAAU,EAAE,aAAa;YACzB,eAAe,EAAE,cAAc;SAChC,CAAC,CAAC;QAEH,OAAO,CAAC,GAAG,CACT,qFAAqF;YACnF,oDAAoD,CACvD,CAAC;IACJ,CAAC;CACF;AAvCD,gCAuCC","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 colors from 'colors';\nimport * as path from 'path';\nimport { FileSystem } from '@rushstack/node-core-library';\nimport { CommandLineAction } from '@rushstack/ts-command-line';\n\nimport { ApiExtractorCommandLine } from './ApiExtractorCommandLine';\nimport { ExtractorConfig } from '../api/ExtractorConfig';\n\nexport class InitAction extends CommandLineAction {\n public constructor(parser: ApiExtractorCommandLine) {\n super({\n actionName: 'init',\n summary: `Create an ${ExtractorConfig.FILENAME} config file`,\n documentation:\n `Use this command when setting up API Extractor for a new project. It writes an` +\n ` ${ExtractorConfig.FILENAME} config file template with code comments that describe all the settings.` +\n ` The file will be written in the current directory.`\n });\n }\n\n protected onDefineParameters(): void {\n // override\n // No parameters yet\n }\n\n protected async onExecute(): Promise<void> {\n // override\n const inputFilePath: string = path.resolve(__dirname, '../schemas/api-extractor-template.json');\n const outputFilePath: string = path.resolve(ExtractorConfig.FILENAME);\n\n if (FileSystem.exists(outputFilePath)) {\n console.log(colors.red('The output file already exists:'));\n console.log('\\n ' + outputFilePath + '\\n');\n throw new Error('Unable to write output file');\n }\n\n console.log(colors.green('Writing file: ') + outputFilePath);\n FileSystem.copyFile({\n sourcePath: inputFilePath,\n destinationPath: outputFilePath\n });\n\n console.log(\n '\\nThe recommended location for this file is in the project\\'s \"config\" subfolder,\\n' +\n 'or else in the top-level folder with package.json.'\n );\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"RunAction.js","sourceRoot":"","sources":["../../src/cli/RunAction.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;;;;;;;;;;;;;;;;;;;;;;;AAE3D,oDAA4B;AAC5B,uCAAyB;AACzB,2CAA6B;AAC7B,oEAAiG;AAEjG,gEAIoC;AAEpC,gDAA8D;AAG9D,4DAAyF;AAEzF,MAAa,SAAU,SAAQ,mCAAiB;IAO9C,YAAmB,MAA+B;QAChD,KAAK,CAAC;YACJ,UAAU,EAAE,KAAK;YACjB,OAAO,EAAE,mCAAmC;YAC5C,aAAa,EAAE,mCAAmC;SACnD,CAAC,CAAC;IACL,CAAC;IAES,kBAAkB;QAC1B,WAAW;QACX,IAAI,CAAC,oBAAoB,GAAG,IAAI,CAAC,qBAAqB,CAAC;YACrD,iBAAiB,EAAE,UAAU;YAC7B,kBAAkB,EAAE,IAAI;YACxB,YAAY,EAAE,MAAM;YACpB,WAAW,EAAE,qBAAqB,iCAAe,CAAC,QAAQ,+CAA+C;SAC1G,CAAC,CAAC;QAEH,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC,mBAAmB,CAAC;YAC9C,iBAAiB,EAAE,SAAS;YAC5B,kBAAkB,EAAE,IAAI;YACxB,WAAW,EACT,mEAAmE;gBACnE,6EAA6E;gBAC7E,+EAA+E;gBAC/E,wDAAwD;SAC3D,CAAC,CAAC;QAEH,IAAI,CAAC,iBAAiB,GAAG,IAAI,CAAC,mBAAmB,CAAC;YAChD,iBAAiB,EAAE,WAAW;YAC9B,kBAAkB,EAAE,IAAI;YACxB,WAAW,EAAE,uDAAuD;SACrE,CAAC,CAAC;QAEH,IAAI,CAAC,qBAAqB,GAAG,IAAI,CAAC,mBAAmB,CAAC;YACpD,iBAAiB,EAAE,eAAe;YAClC,WAAW,EACT,gFAAgF;gBAChF,gDAAgD;SACnD,CAAC,CA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C,CAAC;SAC9D;aAAM;YACL,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;YAErB,IAAI,eAAe,CAAC,UAAU,GAAG,CAAC,EAAE;gBAClC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,gBAAM,CAAC,GAAG,CAAC,qCAAqC,CAAC,CAAC,CAAC;aACzE;iBAAM;gBACL,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,gBAAM,CAAC,MAAM,CAAC,uCAAuC,CAAC,CAAC,CAAC;aAC9E;SACF;IACH,CAAC;CACF;AAxID,8BAwIC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\r\n// See LICENSE in the project root for license information.\r\n\r\nimport colors from 'colors';\r\nimport * as os from 'os';\r\nimport * as path from 'path';\r\nimport { PackageJsonLookup, FileSystem, IPackageJson, Path } from '@rushstack/node-core-library';\r\n\r\nimport {\r\n CommandLineAction,\r\n CommandLineStringParameter,\r\n CommandLineFlagParameter\r\n} from '@rushstack/ts-command-line';\r\n\r\nimport { Extractor, ExtractorResult } from '../api/Extractor';\r\n\r\nimport { ApiExtractorCommandLine } from './ApiExtractorCommandLine';\r\nimport { ExtractorConfig, IExtractorConfigPrepareOptions } from '../api/ExtractorConfig';\r\n\r\nexport class RunAction extends CommandLineAction {\r\n private _configFileParameter!: CommandLineStringParameter;\r\n private _localParameter!: CommandLineFlagParameter;\r\n private _verboseParameter!: CommandLineFlagParameter;\r\n private _diagnosticsParameter!: CommandLineFlagParameter;\r\n private _typescriptCompilerFolder!: CommandLineStringParameter;\r\n\r\n public constructor(parser: ApiExtractorCommandLine) {\r\n super({\r\n actionName: 'run',\r\n summary: 'Invoke API Extractor on a project',\r\n documentation: 'Invoke API Extractor on a project'\r\n });\r\n }\r\n\r\n protected onDefineParameters(): void {\r\n // override\r\n this._configFileParameter = this.defineStringParameter({\r\n parameterLongName: '--config',\r\n parameterShortName: '-c',\r\n argumentName: 'FILE',\r\n description: `Use the specified ${ExtractorConfig.FILENAME} file path, rather than guessing its location`\r\n });\r\n\r\n this._localParameter = this.defineFlagParameter({\r\n parameterLongName: '--local',\r\n parameterShortName: '-l',\r\n description:\r\n 'Indicates that API Extractor is running as part of a local build,' +\r\n \" e.g. on a developer's machine. This disables certain validation that would\" +\r\n ' normally be performed for a ship/production build. For example, the *.api.md' +\r\n ' report file is automatically copied in a local build.'\r\n });\r\n\r\n this._verboseParameter = this.defineFlagParameter({\r\n parameterLongName: '--verbose',\r\n parameterShortName: '-v',\r\n description: 'Show additional informational messages in the output.'\r\n });\r\n\r\n this._diagnosticsParameter = this.defineFlagParameter({\r\n parameterLongName: '--diagnostics',\r\n description:\r\n 'Show diagnostic messages used for troubleshooting problems with API Extractor.' +\r\n ' This flag also enables the \"--verbose\" flag.'\r\n });\r\n\r\n this._typescriptCompilerFolder = this.defineStringParameter({\r\n parameterLongName: '--typescript-compiler-folder',\r\n argumentName: 'PATH',\r\n description:\r\n 'API Extractor uses its own TypeScript compiler engine to analyze your project. If your project' +\r\n ' is built with a significantly different TypeScript version, sometimes API Extractor may report compilation' +\r\n ' errors due to differences in the system typings (e.g. lib.dom.d.ts). You can use the' +\r\n ' \"--typescriptCompilerFolder\" option to specify the folder path where you installed the TypeScript package,' +\r\n \" and API Extractor's compiler will use those system typings instead.\"\r\n });\r\n }\r\n\r\n protected async onExecute(): Promise<void> {\r\n // override\r\n const lookup: PackageJsonLookup = new PackageJsonLookup();\r\n let configFilename: string;\r\n\r\n let typescriptCompilerFolder: string | undefined = this._typescriptCompilerFolder.value;\r\n if (typescriptCompilerFolder) {\r\n typescriptCompilerFolder = path.normalize(typescriptCompilerFolder);\r\n\r\n if (FileSystem.exists(typescriptCompilerFolder)) {\r\n typescriptCompilerFolder = lookup.tryGetPackageFolderFor(typescriptCompilerFolder);\r\n const typescriptCompilerPackageJson: IPackageJson | undefined = typescriptCompilerFolder\r\n ? lookup.tryLoadPackageJsonFor(typescriptCompilerFolder)\r\n : undefined;\r\n if (!typescriptCompilerPackageJson) {\r\n throw new Error(\r\n `The path specified in the ${this._typescriptCompilerFolder.longName} parameter is not a package.`\r\n );\r\n } else if (typescriptCompilerPackageJson.name !== 'typescript') {\r\n throw new Error(\r\n `The path specified in the ${this._typescriptCompilerFolder.longName} parameter is not a TypeScript` +\r\n ' compiler package.'\r\n );\r\n }\r\n } else {\r\n throw new Error(\r\n `The path specified in the ${this._typescriptCompilerFolder.longName} parameter does not exist.`\r\n );\r\n }\r\n }\r\n\r\n let extractorConfig: ExtractorConfig;\r\n\r\n if (this._configFileParameter.value) {\r\n configFilename = path.normalize(this._configFileParameter.value);\r\n if (!FileSystem.exists(configFilename)) {\r\n throw new Error('Config file not found: ' + this._configFileParameter.value);\r\n }\r\n\r\n extractorConfig = ExtractorConfig.loadFileAndPrepare(configFilename);\r\n } else {\r\n const prepareOptions: IExtractorConfigPrepareOptions | undefined = ExtractorConfig.tryLoadForFolder({\r\n startingFolder: '.'\r\n });\r\n\r\n if (!prepareOptions || !prepareOptions.configObjectFullPath) {\r\n throw new Error(`Unable to find an ${ExtractorConfig.FILENAME} file`);\r\n }\r\n\r\n const configObjectShortPath: string = Path.formatConcisely({\r\n pathToConvert: prepareOptions.configObjectFullPath,\r\n baseFolder: process.cwd()\r\n });\r\n console.log(`Using configuration from ${configObjectShortPath}`);\r\n\r\n extractorConfig = ExtractorConfig.prepare(prepareOptions);\r\n }\r\n\r\n const extractorResult: ExtractorResult = Extractor.invoke(extractorConfig, {\r\n localBuild: this._localParameter.value,\r\n showVerboseMessages: this._verboseParameter.value,\r\n showDiagnostics: this._diagnosticsParameter.value,\r\n typescriptCompilerFolder: typescriptCompilerFolder\r\n });\r\n\r\n if (extractorResult.succeeded) {\r\n console.log(os.EOL + 'API Extractor completed successfully');\r\n } else {\r\n process.exitCode = 1;\r\n\r\n if (extractorResult.errorCount > 0) {\r\n console.log(os.EOL + colors.red('API Extractor completed with errors'));\r\n } else {\r\n console.log(os.EOL + colors.yellow('API Extractor completed with warnings'));\r\n }\r\n }\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"RunAction.js","sourceRoot":"","sources":["../../src/cli/RunAction.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;;;;;;;;;;;;;;;;;;;;;;;AAE3D,oDAA4B;AAC5B,uCAAyB;AACzB,2CAA6B;AAC7B,oEAAiG;AAEjG,gEAIoC;AAEpC,gDAA8D;AAG9D,4DAAyF;AAEzF,MAAa,SAAU,SAAQ,mCAAiB;IAO9C,YAAmB,MAA+B;QAChD,KAAK,CAAC;YACJ,UAAU,EAAE,KAAK;YACjB,OAAO,EAAE,mCAAmC;YAC5C,aAAa,EAAE,mCAAmC;SACnD,CAAC,CAAC;IACL,CAAC;IAES,kBAAkB;QAC1B,WAAW;QACX,IAAI,CAAC,oBAAoB,GAAG,IAAI,CAAC,qBAAqB,CAAC;YACrD,iBAAiB,EAAE,UAAU;YAC7B,kBAAkB,EAAE,IAAI;YACxB,YAAY,EAAE,MAAM;YACpB,WAAW,EAAE,qBAAqB,iCAAe,CAAC,QAAQ,+CAA+C;SAC1G,CAAC,CAAC;QAEH,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC,mBAAmB,CAAC;YAC9C,iBAAiB,EAAE,SAAS;YAC5B,kBAAkB,EAAE,IAAI;YACxB,WAAW,EACT,mEAAmE;gBACnE,6EAA6E;gBAC7E,+EAA+E;gBAC/E,wDAAwD;SAC3D,CAAC,CAAC;QAEH,IAAI,CAAC,iBAAiB,GAAG,IAAI,CAAC,mBAAmB,CAAC;YAChD,iBAAiB,EAAE,WAAW;YAC9B,kBAAkB,EAAE,IAAI;YACxB,WAAW,EAAE,uDAAuD;SACrE,CAAC,CAAC;QAEH,IAAI,CAAC,qBAAqB,GAAG,IAAI,CAAC,mBAAmB,CAAC;YACpD,iBAAiB,EAAE,eAAe;YAClC,WAAW,EACT,gFAAgF;gBAChF,gDAAgD;SACnD,CAAC,CAAC;QAEH,IAAI,CAAC,y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ACL,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;YAErB,IAAI,eAAe,CAAC,UAAU,GAAG,CAAC,EAAE;gBAClC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,gBAAM,CAAC,GAAG,CAAC,qCAAqC,CAAC,CAAC,CAAC;aACzE;iBAAM;gBACL,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,gBAAM,CAAC,MAAM,CAAC,uCAAuC,CAAC,CAAC,CAAC;aAC9E;SACF;IACH,CAAC;CACF;AAxID,8BAwIC","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 colors from 'colors';\nimport * as os from 'os';\nimport * as path from 'path';\nimport { PackageJsonLookup, FileSystem, IPackageJson, Path } from '@rushstack/node-core-library';\n\nimport {\n CommandLineAction,\n CommandLineStringParameter,\n CommandLineFlagParameter\n} from '@rushstack/ts-command-line';\n\nimport { Extractor, ExtractorResult } from '../api/Extractor';\n\nimport { ApiExtractorCommandLine } from './ApiExtractorCommandLine';\nimport { ExtractorConfig, IExtractorConfigPrepareOptions } from '../api/ExtractorConfig';\n\nexport class RunAction extends CommandLineAction {\n private _configFileParameter!: CommandLineStringParameter;\n private _localParameter!: CommandLineFlagParameter;\n private _verboseParameter!: CommandLineFlagParameter;\n private _diagnosticsParameter!: CommandLineFlagParameter;\n private _typescriptCompilerFolder!: CommandLineStringParameter;\n\n public constructor(parser: ApiExtractorCommandLine) {\n super({\n actionName: 'run',\n summary: 'Invoke API Extractor on a project',\n documentation: 'Invoke API Extractor on a project'\n });\n }\n\n protected onDefineParameters(): void {\n // override\n this._configFileParameter = this.defineStringParameter({\n parameterLongName: '--config',\n parameterShortName: '-c',\n argumentName: 'FILE',\n description: `Use the specified ${ExtractorConfig.FILENAME} file path, rather than guessing its location`\n });\n\n this._localParameter = this.defineFlagParameter({\n parameterLongName: '--local',\n parameterShortName: '-l',\n description:\n 'Indicates that API Extractor is running as part of a local build,' +\n \" e.g. on a developer's machine. This disables certain validation that would\" +\n ' normally be performed for a ship/production build. For example, the *.api.md' +\n ' report file is automatically copied in a local build.'\n });\n\n this._verboseParameter = this.defineFlagParameter({\n parameterLongName: '--verbose',\n parameterShortName: '-v',\n description: 'Show additional informational messages in the output.'\n });\n\n this._diagnosticsParameter = this.defineFlagParameter({\n parameterLongName: '--diagnostics',\n description:\n 'Show diagnostic messages used for troubleshooting problems with API Extractor.' +\n ' This flag also enables the \"--verbose\" flag.'\n });\n\n this._typescriptCompilerFolder = this.defineStringParameter({\n parameterLongName: '--typescript-compiler-folder',\n argumentName: 'PATH',\n description:\n 'API Extractor uses its own TypeScript compiler engine to analyze your project. If your project' +\n ' is built with a significantly different TypeScript version, sometimes API Extractor may report compilation' +\n ' errors due to differences in the system typings (e.g. lib.dom.d.ts). You can use the' +\n ' \"--typescriptCompilerFolder\" option to specify the folder path where you installed the TypeScript package,' +\n \" and API Extractor's compiler will use those system typings instead.\"\n });\n }\n\n protected async onExecute(): Promise<void> {\n // override\n const lookup: PackageJsonLookup = new PackageJsonLookup();\n let configFilename: string;\n\n let typescriptCompilerFolder: string | undefined = this._typescriptCompilerFolder.value;\n if (typescriptCompilerFolder) {\n typescriptCompilerFolder = path.normalize(typescriptCompilerFolder);\n\n if (FileSystem.exists(typescriptCompilerFolder)) {\n typescriptCompilerFolder = lookup.tryGetPackageFolderFor(typescriptCompilerFolder);\n const typescriptCompilerPackageJson: IPackageJson | undefined = typescriptCompilerFolder\n ? lookup.tryLoadPackageJsonFor(typescriptCompilerFolder)\n : undefined;\n if (!typescriptCompilerPackageJson) {\n throw new Error(\n `The path specified in the ${this._typescriptCompilerFolder.longName} parameter is not a package.`\n );\n } else if (typescriptCompilerPackageJson.name !== 'typescript') {\n throw new Error(\n `The path specified in the ${this._typescriptCompilerFolder.longName} parameter is not a TypeScript` +\n ' compiler package.'\n );\n }\n } else {\n throw new Error(\n `The path specified in the ${this._typescriptCompilerFolder.longName} parameter does not exist.`\n );\n }\n }\n\n let extractorConfig: ExtractorConfig;\n\n if (this._configFileParameter.value) {\n configFilename = path.normalize(this._configFileParameter.value);\n if (!FileSystem.exists(configFilename)) {\n throw new Error('Config file not found: ' + this._configFileParameter.value);\n }\n\n extractorConfig = ExtractorConfig.loadFileAndPrepare(configFilename);\n } else {\n const prepareOptions: IExtractorConfigPrepareOptions | undefined = ExtractorConfig.tryLoadForFolder({\n startingFolder: '.'\n });\n\n if (!prepareOptions || !prepareOptions.configObjectFullPath) {\n throw new Error(`Unable to find an ${ExtractorConfig.FILENAME} file`);\n }\n\n const configObjectShortPath: string = Path.formatConcisely({\n pathToConvert: prepareOptions.configObjectFullPath,\n baseFolder: process.cwd()\n });\n console.log(`Using configuration from ${configObjectShortPath}`);\n\n extractorConfig = ExtractorConfig.prepare(prepareOptions);\n }\n\n const extractorResult: ExtractorResult = Extractor.invoke(extractorConfig, {\n localBuild: this._localParameter.value,\n showVerboseMessages: this._verboseParameter.value,\n showDiagnostics: this._diagnosticsParameter.value,\n typescriptCompilerFolder: typescriptCompilerFolder\n });\n\n if (extractorResult.succeeded) {\n console.log(os.EOL + 'API Extractor completed successfully');\n } else {\n process.exitCode = 1;\n\n if (extractorResult.errorCount > 0) {\n console.log(os.EOL + colors.red('API Extractor completed with errors'));\n } else {\n console.log(os.EOL + colors.yellow('API Extractor completed with warnings'));\n }\n }\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"ApiItemMetadata.js","sourceRoot":"","sources":["../../src/collector/ApiItemMetadata.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAI3D,iDAA8C;AAgB9C;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAa,eAAe;IAqC1B,YAAmB,OAAgC;QALnD,iCAAiC;QAC1B,uBAAkB,GAAY,IAAI,CAAC;QAEnC,mCAA8B,GAAiB,2BAAY,CAAC,SAAS,CAAC;QAG3E,IAAI,CAAC,kBAAkB,GAAG,OAAO,CAAC,kBAAkB,CAAC;QACrD,IAAI,CAAC,mBAAmB,GAAG,OAAO,CAAC,mBAAmB,CAAC;QACvD,IAAI,CAAC,sBAAsB,GAAG,OAAO,CAAC,sBAAsB,CAAC;QAC7D,IAAI,CAAC,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC;QAC/C,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;QACrC,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC;QACjC,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC;QACnC,IAAI,CAAC,aAAa,GAAG,OAAO,CAAC,aAAa,CAAC;IAC7C,CAAC;CACF;AA/CD,0CA+CC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\r\n// See LICENSE in the project root for license information.\r\n\r\nimport * as tsdoc from '@microsoft/tsdoc';\r\nimport { ReleaseTag } from '@microsoft/api-extractor-model';\r\nimport { VisitorState } from './VisitorState';\r\n\r\n/**\r\n * Constructor parameters for `ApiItemMetadata`.\r\n */\r\nexport interface IApiItemMetadataOptions {\r\n declaredReleaseTag: ReleaseTag;\r\n effectiveReleaseTag: ReleaseTag;\r\n releaseTagSameAsParent: boolean;\r\n isEventProperty: boolean;\r\n isOverride: boolean;\r\n isSealed: boolean;\r\n isVirtual: boolean;\r\n isPreapproved: boolean;\r\n}\r\n\r\n/**\r\n * Stores the Collector's additional analysis for an `AstDeclaration`. This object is assigned to\r\n * `AstDeclaration.apiItemMetadata` but consumers must always obtain it by calling `Collector.fetchApiItemMetadata()`.\r\n *\r\n * @remarks\r\n * Note that ancillary declarations share their `ApiItemMetadata` with the main declaration,\r\n * whereas a separate `DeclarationMetadata` object is created for each declaration.\r\n *\r\n * Consider this example:\r\n * ```ts\r\n * export declare class A {\r\n * get b(): string;\r\n * set b(value: string);\r\n * }\r\n * export declare namespace A { }\r\n * ```\r\n *\r\n * In this example, there are two \"symbols\": `A` and `b`\r\n *\r\n * There are four \"declarations\": `A` class, `A` namespace, `b` getter, `b` setter\r\n *\r\n * There are three \"API items\": `A` class, `A` namespace, `b` property. The property getter is the main declaration\r\n * for `b`, and the setter is the \"ancillary\" declaration.\r\n */\r\nexport class ApiItemMetadata {\r\n /**\r\n * This is the release tag that was explicitly specified in the original doc comment, if any.\r\n */\r\n public readonly declaredReleaseTag: ReleaseTag;\r\n\r\n /**\r\n * The \"effective\" release tag is a normalized value that is based on `declaredReleaseTag`,\r\n * but may be inherited from a parent, or corrected if the declared value was somehow invalid.\r\n * When actually trimming .d.ts files or generating docs, API Extractor uses the \"effective\" value\r\n * instead of the \"declared\" value.\r\n */\r\n public readonly effectiveReleaseTag: ReleaseTag;\r\n\r\n // If true, then it would be redundant to show this release tag\r\n public readonly releaseTagSameAsParent: boolean;\r\n\r\n // NOTE: In the future, the Collector may infer or error-correct some of these states.\r\n // Generators should rely on these instead of tsdocComment.modifierTagSet.\r\n public readonly isEventProperty: boolean;\r\n public readonly isOverride: boolean;\r\n public readonly isSealed: boolean;\r\n public readonly isVirtual: boolean;\r\n\r\n public readonly isPreapproved: boolean;\r\n\r\n /**\r\n * This is the TSDoc comment for the declaration. It may be modified (or constructed artificially) by\r\n * the DocCommentEnhancer.\r\n */\r\n public tsdocComment: tsdoc.DocComment | undefined;\r\n\r\n // Assigned by DocCommentEnhancer\r\n public needsDocumentation: boolean = true;\r\n\r\n public docCommentEnhancerVisitorState: VisitorState = VisitorState.Unvisited;\r\n\r\n public constructor(options: IApiItemMetadataOptions) {\r\n this.declaredReleaseTag = options.declaredReleaseTag;\r\n this.effectiveReleaseTag = options.effectiveReleaseTag;\r\n this.releaseTagSameAsParent = options.releaseTagSameAsParent;\r\n this.isEventProperty = options.isEventProperty;\r\n this.isOverride = options.isOverride;\r\n this.isSealed = options.isSealed;\r\n this.isVirtual = options.isVirtual;\r\n this.isPreapproved = options.isPreapproved;\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"ApiItemMetadata.js","sourceRoot":"","sources":["../../src/collector/ApiItemMetadata.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAI3D,iDAA8C;AAgB9C;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAa,eAAe;IAqC1B,YAAmB,OAAgC;QALnD,iCAAiC;QAC1B,uBAAkB,GAAY,IAAI,CAAC;QAEnC,mCAA8B,GAAiB,2BAAY,CAAC,SAAS,CAAC;QAG3E,IAAI,CAAC,kBAAkB,GAAG,OAAO,CAAC,kBAAkB,CAAC;QACrD,IAAI,CAAC,mBAAmB,GAAG,OAAO,CAAC,mBAAmB,CAAC;QACvD,IAAI,CAAC,sBAAsB,GAAG,OAAO,CAAC,sBAAsB,CAAC;QAC7D,IAAI,CAAC,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC;QAC/C,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;QACrC,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC;QACjC,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC;QACnC,IAAI,CAAC,aAAa,GAAG,OAAO,CAAC,aAAa,CAAC;IAC7C,CAAC;CACF;AA/CD,0CA+CC","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 tsdoc from '@microsoft/tsdoc';\nimport { ReleaseTag } from '@microsoft/api-extractor-model';\nimport { VisitorState } from './VisitorState';\n\n/**\n * Constructor parameters for `ApiItemMetadata`.\n */\nexport interface IApiItemMetadataOptions {\n declaredReleaseTag: ReleaseTag;\n effectiveReleaseTag: ReleaseTag;\n releaseTagSameAsParent: boolean;\n isEventProperty: boolean;\n isOverride: boolean;\n isSealed: boolean;\n isVirtual: boolean;\n isPreapproved: boolean;\n}\n\n/**\n * Stores the Collector's additional analysis for an `AstDeclaration`. This object is assigned to\n * `AstDeclaration.apiItemMetadata` but consumers must always obtain it by calling `Collector.fetchApiItemMetadata()`.\n *\n * @remarks\n * Note that ancillary declarations share their `ApiItemMetadata` with the main declaration,\n * whereas a separate `DeclarationMetadata` object is created for each declaration.\n *\n * Consider this example:\n * ```ts\n * export declare class A {\n * get b(): string;\n * set b(value: string);\n * }\n * export declare namespace A { }\n * ```\n *\n * In this example, there are two \"symbols\": `A` and `b`\n *\n * There are four \"declarations\": `A` class, `A` namespace, `b` getter, `b` setter\n *\n * There are three \"API items\": `A` class, `A` namespace, `b` property. The property getter is the main declaration\n * for `b`, and the setter is the \"ancillary\" declaration.\n */\nexport class ApiItemMetadata {\n /**\n * This is the release tag that was explicitly specified in the original doc comment, if any.\n */\n public readonly declaredReleaseTag: ReleaseTag;\n\n /**\n * The \"effective\" release tag is a normalized value that is based on `declaredReleaseTag`,\n * but may be inherited from a parent, or corrected if the declared value was somehow invalid.\n * When actually trimming .d.ts files or generating docs, API Extractor uses the \"effective\" value\n * instead of the \"declared\" value.\n */\n public readonly effectiveReleaseTag: ReleaseTag;\n\n // If true, then it would be redundant to show this release tag\n public readonly releaseTagSameAsParent: boolean;\n\n // NOTE: In the future, the Collector may infer or error-correct some of these states.\n // Generators should rely on these instead of tsdocComment.modifierTagSet.\n public readonly isEventProperty: boolean;\n public readonly isOverride: boolean;\n public readonly isSealed: boolean;\n public readonly isVirtual: boolean;\n\n public readonly isPreapproved: boolean;\n\n /**\n * This is the TSDoc comment for the declaration. It may be modified (or constructed artificially) by\n * the DocCommentEnhancer.\n */\n public tsdocComment: tsdoc.DocComment | undefined;\n\n // Assigned by DocCommentEnhancer\n public needsDocumentation: boolean = true;\n\n public docCommentEnhancerVisitorState: VisitorState = VisitorState.Unvisited;\n\n public constructor(options: IApiItemMetadataOptions) {\n this.declaredReleaseTag = options.declaredReleaseTag;\n this.effectiveReleaseTag = options.effectiveReleaseTag;\n this.releaseTagSameAsParent = options.releaseTagSameAsParent;\n this.isEventProperty = options.isEventProperty;\n this.isOverride = options.isOverride;\n this.isSealed = options.isSealed;\n this.isVirtual = options.isVirtual;\n this.isPreapproved = options.isPreapproved;\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"Collector.js","sourceRoot":"","sources":["../../src/collector/Collector.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;;;;;;;;;;;;;;;;;;;;AAE3D,+CAAiC;AACjC,wDAA0C;AAC1C,oEAAsF;AACtF,wEAA4D;AAI5D,uDAAoD;AACpD,+DAA4D;AAG5D,qDAAkD;AAElD,qEAAkE;AAClE,qDAAkD;AAClD,kEAA+D;AAC/D,+DAAyF;AACzF,uDAA6E;AAC7E,qDAAkD;AAClD,yEAA+F;AAE/F,2EAAwE;AAExE,uEAAoE;AACpE,qDAAkD;AAqBlD;;;;;GAKG;AACH,MAAa,SAAS;IAuCpB,YAAmB,OAA0B;QAd5B,cAAS,GAAsB,EAAE,CAAC;QAClC,yBAAoB,GAAoC,IAAI,GAAG,EAG7E,CAAC;QAEa,qCAAgC,GAAa,EAAE,CAAC;QAEhD,gCAA2B,GAAgB,IAAI,GAAG,EAAU,CAAC;QAC7D,+BAA0B,GAAgB,IAAI,GAAG,EAAU,CAAC;QAM3E,IAAI,CAAC,iBAAiB,GAAG,IAAI,qCAAiB,EAAE,CAAC;QAEjD,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC;QAChC,IAAI,CAAC,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC;QAE/C,MAAM,oBAAoB,GAA8B,OAAO,CAAC,OAAO,CAAC,aAAa,CACnF,IAAI,CAAC,eAAe,CAAC,sBAAsB,CAC5C,CAAC;QAEF,IAAI,CAAC,oBAAoB,EAAE;YACzB,MAAM,IAAI,KAAK,CAAC,uBAAuB,GAAG,IAAI,CAAC,eAAe,CAAC,sBAAsB,CAAC,CAAC;SACxF;QAED,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,aAAa,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,WAAW,EAAE;YAC5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AC;CACF;AAz2BD,8BAy2BC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\r\n// See LICENSE in the project root for license information.\r\n\r\nimport * as ts from 'typescript';\r\nimport * as tsdoc from '@microsoft/tsdoc';\r\nimport { PackageJsonLookup, Sort, InternalError } from '@rushstack/node-core-library';\r\nimport { ReleaseTag } from '@microsoft/api-extractor-model';\r\n\r\nimport { ExtractorMessageId } from '../api/ExtractorMessageId';\r\n\r\nimport { CollectorEntity } from './CollectorEntity';\r\nimport { AstSymbolTable } from '../analyzer/AstSymbolTable';\r\nimport { AstEntity } from '../analyzer/AstEntity';\r\nimport { AstModule, AstModuleExportInfo } from '../analyzer/AstModule';\r\nimport { AstSymbol } from '../analyzer/AstSymbol';\r\nimport { AstDeclaration } from '../analyzer/AstDeclaration';\r\nimport { TypeScriptHelpers } from '../analyzer/TypeScriptHelpers';\r\nimport { WorkingPackage } from './WorkingPackage';\r\nimport { PackageDocComment } from '../aedoc/PackageDocComment';\r\nimport { DeclarationMetadata, InternalDeclarationMetadata } from './DeclarationMetadata';\r\nimport { ApiItemMetadata, IApiItemMetadataOptions } from './ApiItemMetadata';\r\nimport { SymbolMetadata } from './SymbolMetadata';\r\nimport { TypeScriptInternals, IGlobalVariableAnalyzer } from '../analyzer/TypeScriptInternals';\r\nimport { MessageRouter } from './MessageRouter';\r\nimport { AstReferenceResolver } from '../analyzer/AstReferenceResolver';\r\nimport { ExtractorConfig } from '../api/ExtractorConfig';\r\nimport { AstNamespaceImport } from '../analyzer/AstNamespaceImport';\r\nimport { AstImport } from '../analyzer/AstImport';\r\n\r\n/**\r\n * Options for Collector constructor.\r\n */\r\nexport interface ICollectorOptions {\r\n /**\r\n * Configuration for the TypeScript compiler. The most important options to set are:\r\n *\r\n * - target: ts.ScriptTarget.ES5\r\n * - module: ts.ModuleKind.CommonJS\r\n * - moduleResolution: ts.ModuleResolutionKind.NodeJs\r\n * - rootDir: inputFolder\r\n */\r\n program: ts.Program;\r\n\r\n messageRouter: MessageRouter;\r\n\r\n extractorConfig: ExtractorConfig;\r\n}\r\n\r\n/**\r\n * The `Collector` manages the overall data set that is used by `ApiModelGenerator`,\r\n * `DtsRollupGenerator`, and `ApiReportGenerator`. Starting from the working package's entry point,\r\n * the `Collector` collects all exported symbols, determines how to import any symbols they reference,\r\n * assigns unique names, and sorts everything into a normalized alphabetical ordering.\r\n */\r\nexport class Collector {\r\n public readonly program: ts.Program;\r\n public readonly typeChecker: ts.TypeChecker;\r\n public readonly globalVariableAnalyzer: IGlobalVariableAnalyzer;\r\n public readonly astSymbolTable: AstSymbolTable;\r\n public readonly astReferenceResolver: AstReferenceResolver;\r\n\r\n public readonly packageJsonLookup: PackageJsonLookup;\r\n public readonly messageRouter: MessageRouter;\r\n\r\n public readonly workingPackage: WorkingPackage;\r\n\r\n public readonly extractorConfig: ExtractorConfig;\r\n\r\n /**\r\n * The `ExtractorConfig.bundledPackages` names in a set.\r\n */\r\n public readonly bundledPackageNames: ReadonlySet<string>;\r\n\r\n private readonly _program: ts.Program;\r\n\r\n private readonly _tsdocParser: tsdoc.TSDocParser;\r\n\r\n private _astEntryPoint: AstModule | undefined;\r\n\r\n private readonly _entities: CollectorEntity[] = [];\r\n private readonly _entitiesByAstEntity: Map<AstEntity, CollectorEntity> = new Map<\r\n AstEntity,\r\n CollectorEntity\r\n >();\r\n\r\n private readonly _starExportedExternalModulePaths: string[] = [];\r\n\r\n private readonly _dtsTypeReferenceDirectives: Set<string> = new Set<string>();\r\n private readonly _dtsLibReferenceDirectives: Set<string> = new Set<string>();\r\n\r\n // Used by getOverloadIndex()\r\n private readonly _cachedOverloadIndexesByDeclaration: Map<AstDeclaration, number>;\r\n\r\n public constructor(options: ICollectorOptions) {\r\n this.packageJsonLookup = new PackageJsonLookup();\r\n\r\n this._program = options.program;\r\n this.extractorConfig = options.extractorConfig;\r\n\r\n const entryPointSourceFile: ts.SourceFile | undefined = options.program.getSourceFile(\r\n this.extractorConfig.mainEntryPointFilePath\r\n );\r\n\r\n if (!entryPointSourceFile) {\r\n throw new Error('Unable to load file: ' + this.extractorConfig.mainEntryPointFilePath);\r\n }\r\n\r\n if (!this.extractorConfig.packageFolder || !this.extractorConfig.packageJson) {\r\n // TODO: We should be able to analyze projects that don't have any package.json.\r\n // The ExtractorConfig class is already designed to allow this.\r\n throw new Error('Unable to find a package.json file for the project being analyzed');\r\n }\r\n\r\n this.workingPackage = new WorkingPackage({\r\n packageFolder: this.extractorConfig.packageFolder,\r\n packageJson: this.extractorConfig.packageJson,\r\n entryPointSourceFile\r\n });\r\n\r\n this.messageRouter = options.messageRouter;\r\n\r\n this.program = options.program;\r\n this.typeChecker = options.program.getTypeChecker();\r\n this.globalVariableAnalyzer = TypeScriptInternals.getGlobalVariableAnalyzer(this.program);\r\n\r\n this._tsdocParser = new tsdoc.TSDocParser(this.extractorConfig.tsdocConfiguration);\r\n\r\n this.bundledPackageNames = new Set<string>(this.extractorConfig.bundledPackages);\r\n\r\n this.astSymbolTable = new AstSymbolTable(\r\n this.program,\r\n this.typeChecker,\r\n this.packageJsonLookup,\r\n this.bundledPackageNames,\r\n this.messageRouter\r\n );\r\n this.astReferenceResolver = new AstReferenceResolver(this);\r\n\r\n this._cachedOverloadIndexesByDeclaration = new Map<AstDeclaration, number>();\r\n }\r\n\r\n /**\r\n * Returns a list of names (e.g. \"example-library\") that should appear in a reference like this:\r\n *\r\n * ```\r\n * /// <reference types=\"example-library\" />\r\n * ```\r\n */\r\n public get dtsTypeReferenceDirectives(): ReadonlySet<string> {\r\n return this._dtsTypeReferenceDirectives;\r\n }\r\n\r\n /**\r\n * A list of names (e.g. \"runtime-library\") that should appear in a reference like this:\r\n *\r\n * ```\r\n * /// <reference lib=\"runtime-library\" />\r\n * ```\r\n */\r\n public get dtsLibReferenceDirectives(): ReadonlySet<string> {\r\n return this._dtsLibReferenceDirectives;\r\n }\r\n\r\n public get entities(): ReadonlyArray<CollectorEntity> {\r\n return this._entities;\r\n }\r\n\r\n /**\r\n * A list of module specifiers (e.g. `\"@rushstack/node-core-library/lib/FileSystem\"`) that should be emitted\r\n * as star exports (e.g. `export * from \"@rushstack/node-core-library/lib/FileSystem\"`).\r\n */\r\n public get starExportedExternalModulePaths(): ReadonlyArray<string> {\r\n return this._starExportedExternalModulePaths;\r\n }\r\n\r\n /**\r\n * Perform the analysis.\r\n */\r\n public analyze(): void {\r\n if (this._astEntryPoint) {\r\n throw new Error('DtsRollupGenerator.analyze() was already called');\r\n }\r\n\r\n // This runs a full type analysis, and then augments the Abstract Syntax Tree (i.e. declarations)\r\n // with semantic information (i.e. symbols). The \"diagnostics\" are a subset of the everyday\r\n // compile errors that would result from a full compilation.\r\n for (const diagnostic of this._program.getSemanticDiagnostics()) {\r\n this.messageRouter.addCompilerDiagnostic(diagnostic);\r\n }\r\n\r\n if (this.messageRouter.showDiagnostics) {\r\n this.messageRouter.logDiagnosticHeader('Root filenames');\r\n for (const fileName of this.program.getRootFileNames()) {\r\n this.messageRouter.logDiagnostic(fileName);\r\n }\r\n this.messageRouter.logDiagnosticFooter();\r\n\r\n this.messageRouter.logDiagnosticHeader('Files analyzed by compiler');\r\n for (const sourceFile of this.program.getSourceFiles()) {\r\n this.messageRouter.logDiagnostic(sourceFile.fileName);\r\n }\r\n this.messageRouter.logDiagnosticFooter();\r\n }\r\n\r\n // Build the entry point\r\n const entryPointSourceFile: ts.SourceFile = this.workingPackage.entryPointSourceFile;\r\n\r\n const astEntryPoint: AstModule =\r\n this.astSymbolTable.fetchAstModuleFromWorkingPackage(entryPointSourceFile);\r\n this._astEntryPoint = astEntryPoint;\r\n\r\n const packageDocCommentTextRange: ts.TextRange | undefined = PackageDocComment.tryFindInSourceFile(\r\n entryPointSourceFile,\r\n this\r\n );\r\n\r\n if (packageDocCommentTextRange) {\r\n const range: tsdoc.TextRange = tsdoc.TextRange.fromStringRange(\r\n entryPointSourceFile.text,\r\n packageDocCommentTextRange.pos,\r\n packageDocCommentTextRange.end\r\n );\r\n\r\n this.workingPackage.tsdocParserContext = this._tsdocParser.parseRange(range);\r\n\r\n this.messageRouter.addTsdocMessages(this.workingPackage.tsdocParserContext, entryPointSourceFile);\r\n\r\n this.workingPackage.tsdocComment = this.workingPackage.tsdocParserContext!.docComment;\r\n }\r\n\r\n const exportedAstEntities: AstEntity[] = [];\r\n\r\n // Create a CollectorEntity for each top-level export\r\n\r\n const astModuleExportInfo: AstModuleExportInfo =\r\n this.astSymbolTable.fetchAstModuleExportInfo(astEntryPoint);\r\n\r\n for (const [exportName, astEntity] of astModuleExportInfo.exportedLocalEntities) {\r\n this._createCollectorEntity(astEntity, exportName);\r\n\r\n exportedAstEntities.push(astEntity);\r\n }\r\n\r\n // Create a CollectorEntity for each indirectly referenced export.\r\n // Note that we do this *after* the above loop, so that references to exported AstSymbols\r\n // are encountered first as exports.\r\n const alreadySeenAstSymbols: Set<AstSymbol> = new Set<AstSymbol>();\r\n for (const exportedAstEntity of exportedAstEntities) {\r\n this._createEntityForIndirectReferences(exportedAstEntity, alreadySeenAstSymbols);\r\n\r\n if (exportedAstEntity instanceof AstSymbol) {\r\n this.fetchSymbolMetadata(exportedAstEntity);\r\n }\r\n }\r\n\r\n this._makeUniqueNames();\r\n\r\n for (const starExportedExternalModule of astModuleExportInfo.starExportedExternalModules) {\r\n if (starExportedExternalModule.externalModulePath !== undefined) {\r\n this._starExportedExternalModulePaths.push(starExportedExternalModule.externalModulePath);\r\n }\r\n }\r\n\r\n Sort.sortBy(this._entities, (x) => x.getSortKey());\r\n Sort.sortSet(this._dtsTypeReferenceDirectives);\r\n Sort.sortSet(this._dtsLibReferenceDirectives);\r\n this._starExportedExternalModulePaths.sort();\r\n }\r\n\r\n /**\r\n * For a given ts.Identifier that is part of an AstSymbol that we analyzed, return the CollectorEntity that\r\n * it refers to. Returns undefined if it doesn't refer to anything interesting.\r\n * @remarks\r\n * Throws an Error if the ts.Identifier is not part of node tree that was analyzed.\r\n */\r\n public tryGetEntityForNode(identifier: ts.Identifier | ts.ImportTypeNode): CollectorEntity | undefined {\r\n const astEntity: AstEntity | undefined = this.astSymbolTable.tryGetEntityForNode(identifier);\r\n if (astEntity) {\r\n return this._entitiesByAstEntity.get(astEntity);\r\n }\r\n return undefined;\r\n }\r\n\r\n /**\r\n * Returns the associated `CollectorEntity` for the given `astEntity`, if one was created during analysis.\r\n */\r\n public tryGetCollectorEntity(astEntity: AstEntity): CollectorEntity | undefined {\r\n return this._entitiesByAstEntity.get(astEntity);\r\n }\r\n\r\n public fetchSymbolMetadata(astSymbol: AstSymbol): SymbolMetadata {\r\n if (astSymbol.symbolMetadata === undefined) {\r\n this._fetchSymbolMetadata(astSymbol);\r\n }\r\n return astSymbol.symbolMetadata as SymbolMetadata;\r\n }\r\n\r\n public fetchDeclarationMetadata(astDeclaration: AstDeclaration): DeclarationMetadata {\r\n if (astDeclaration.declarationMetadata === undefined) {\r\n // Fetching the SymbolMetadata always constructs the DeclarationMetadata\r\n this._fetchSymbolMetadata(astDeclaration.astSymbol);\r\n }\r\n return astDeclaration.declarationMetadata as DeclarationMetadata;\r\n }\r\n\r\n public fetchApiItemMetadata(astDeclaration: AstDeclaration): ApiItemMetadata {\r\n if (astDeclaration.apiItemMetadata === undefined) {\r\n // Fetching the SymbolMetadata always constructs the ApiItemMetadata\r\n this._fetchSymbolMetadata(astDeclaration.astSymbol);\r\n }\r\n return astDeclaration.apiItemMetadata as ApiItemMetadata;\r\n }\r\n\r\n public tryFetchMetadataForAstEntity(astEntity: AstEntity): SymbolMetadata | undefined {\r\n if (astEntity instanceof AstSymbol) {\r\n return this.fetchSymbolMetadata(astEntity);\r\n }\r\n if (astEntity instanceof AstImport) {\r\n if (astEntity.astSymbol) {\r\n return this.fetchSymbolMetadata(astEntity.astSymbol);\r\n }\r\n }\r\n return undefined;\r\n }\r\n\r\n public isAncillaryDeclaration(astDeclaration: AstDeclaration): boolean {\r\n const declarationMetadata: DeclarationMetadata = this.fetchDeclarationMetadata(astDeclaration);\r\n return declarationMetadata.isAncillary;\r\n }\r\n\r\n public getNonAncillaryDeclarations(astSymbol: AstSymbol): ReadonlyArray<AstDeclaration> {\r\n const result: AstDeclaration[] = [];\r\n for (const astDeclaration of astSymbol.astDeclarations) {\r\n const declarationMetadata: DeclarationMetadata = this.fetchDeclarationMetadata(astDeclaration);\r\n if (!declarationMetadata.isAncillary) {\r\n result.push(astDeclaration);\r\n }\r\n }\r\n return result;\r\n }\r\n\r\n /**\r\n * Removes the leading underscore, for example: \"_Example\" --> \"example*Example*_\"\r\n *\r\n * @remarks\r\n * This causes internal definitions to sort alphabetically case-insensitive, then case-sensitive, and\r\n * initially ignoring the underscore prefix, while still deterministically comparing it.\r\n * The star is used as a delimiter because it is not a legal identifier character.\r\n */\r\n public static getSortKeyIgnoringUnderscore(identifier: string | undefined): string {\r\n if (!identifier) return '';\r\n\r\n let parts: string[];\r\n\r\n if (identifier[0] === '_') {\r\n const withoutUnderscore: string = identifier.substr(1);\r\n parts = [withoutUnderscore.toLowerCase(), '*', withoutUnderscore, '*', '_'];\r\n } else {\r\n parts = [identifier.toLowerCase(), '*', identifier];\r\n }\r\n\r\n return parts.join('');\r\n }\r\n\r\n /**\r\n * For function-like signatures, this returns the TSDoc \"overload index\" which can be used to identify\r\n * a specific overload.\r\n */\r\n public getOverloadIndex(astDeclaration: AstDeclaration): number {\r\n const allDeclarations: ReadonlyArray<AstDeclaration> = astDeclaration.astSymbol.astDeclarations;\r\n if (allDeclarations.length === 1) {\r\n return 1; // trivial case\r\n }\r\n\r\n let overloadIndex: number | undefined = this._cachedOverloadIndexesByDeclaration.get(astDeclaration);\r\n\r\n if (overloadIndex === undefined) {\r\n // TSDoc index selectors are positive integers counting from 1\r\n let nextIndex: number = 1;\r\n for (const other of allDeclarations) {\r\n // Filter out other declarations that are not overloads. For example, an overloaded function can also\r\n // be a namespace.\r\n if (other.declaration.kind === astDeclaration.declaration.kind) {\r\n this._cachedOverloadIndexesByDeclaration.set(other, nextIndex);\r\n ++nextIndex;\r\n }\r\n }\r\n overloadIndex = this._cachedOverloadIndexesByDeclaration.get(astDeclaration);\r\n }\r\n\r\n if (overloadIndex === undefined) {\r\n // This should never happen\r\n throw new InternalError('Error calculating overload index for declaration');\r\n }\r\n\r\n return overloadIndex;\r\n }\r\n\r\n private _createCollectorEntity(astEntity: AstEntity, exportedName: string | undefined): CollectorEntity {\r\n let entity: CollectorEntity | undefined = this._entitiesByAstEntity.get(astEntity);\r\n\r\n if (!entity) {\r\n entity = new CollectorEntity(astEntity);\r\n\r\n this._entitiesByAstEntity.set(astEntity, entity);\r\n this._entities.push(entity);\r\n this._collectReferenceDirectives(astEntity);\r\n }\r\n\r\n if (exportedName) {\r\n entity.addExportName(exportedName);\r\n }\r\n\r\n return entity;\r\n }\r\n\r\n private _createEntityForIndirectReferences(\r\n astEntity: AstEntity,\r\n alreadySeenAstEntities: Set<AstEntity>\r\n ): void {\r\n if (alreadySeenAstEntities.has(astEntity)) {\r\n return;\r\n }\r\n alreadySeenAstEntities.add(astEntity);\r\n\r\n if (astEntity instanceof AstSymbol) {\r\n astEntity.forEachDeclarationRecursive((astDeclaration: AstDeclaration) => {\r\n for (const referencedAstEntity of astDeclaration.referencedAstEntities) {\r\n if (referencedAstEntity instanceof AstSymbol) {\r\n // We only create collector entities for root-level symbols.\r\n // For example, if a symbols is nested inside a namespace, only the root-level namespace\r\n // get a collector entity\r\n if (referencedAstEntity.parentAstSymbol === undefined) {\r\n this._createCollectorEntity(referencedAstEntity, undefined);\r\n }\r\n } else {\r\n this._createCollectorEntity(referencedAstEntity, undefined);\r\n }\r\n\r\n this._createEntityForIndirectReferences(referencedAstEntity, alreadySeenAstEntities);\r\n }\r\n });\r\n }\r\n\r\n if (astEntity instanceof AstNamespaceImport) {\r\n const astModuleExportInfo: AstModuleExportInfo = astEntity.fetchAstModuleExportInfo(this);\r\n\r\n for (const exportedEntity of astModuleExportInfo.exportedLocalEntities.values()) {\r\n // Create a CollectorEntity for each top-level export of AstImportInternal entity\r\n const entity: CollectorEntity = this._createCollectorEntity(exportedEntity, undefined);\r\n entity.addAstNamespaceImports(astEntity);\r\n\r\n this._createEntityForIndirectReferences(exportedEntity, alreadySeenAstEntities);\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Ensures a unique name for each item in the package typings file.\r\n */\r\n private _makeUniqueNames(): void {\r\n // The following examples illustrate the nameForEmit heuristics:\r\n //\r\n // Example 1:\r\n // class X { } <--- nameForEmit should be \"A\" to simplify things and reduce possibility of conflicts\r\n // export { X as A };\r\n //\r\n // Example 2:\r\n // class X { } <--- nameForEmit should be \"X\" because choosing A or B would be nondeterministic\r\n // export { X as A };\r\n // export { X as B };\r\n //\r\n // Example 3:\r\n // class X { } <--- nameForEmit should be \"X_1\" because Y has a stronger claim to the name\r\n // export { X as A };\r\n // export { X as B };\r\n // class Y { } <--- nameForEmit should be \"X\"\r\n // export { Y as X };\r\n\r\n // Set of names that should NOT be used when generating a unique nameForEmit\r\n const usedNames: Set<string> = new Set<string>();\r\n\r\n // First collect the names of explicit package exports, and perform a sanity check.\r\n for (const entity of this._entities) {\r\n for (const exportName of entity.exportNames) {\r\n if (usedNames.has(exportName)) {\r\n // This should be impossible\r\n throw new InternalError(`A package cannot have two exports with the name \"${exportName}\"`);\r\n }\r\n usedNames.add(exportName);\r\n }\r\n }\r\n\r\n // Ensure that each entity has a unique nameForEmit\r\n for (const entity of this._entities) {\r\n // What name would we ideally want to emit it as?\r\n let idealNameForEmit: string;\r\n\r\n // If this entity is exported exactly once, then we prefer the exported name\r\n if (\r\n entity.singleExportName !== undefined &&\r\n entity.singleExportName !== ts.InternalSymbolName.Default\r\n ) {\r\n idealNameForEmit = entity.singleExportName;\r\n } else {\r\n // otherwise use the local name\r\n idealNameForEmit = entity.astEntity.localName;\r\n }\r\n\r\n if (idealNameForEmit.includes('.')) {\r\n // For an ImportType with a namespace chain, only the top namespace is imported.\r\n idealNameForEmit = idealNameForEmit.split('.')[0];\r\n }\r\n\r\n // If the idealNameForEmit happens to be the same as one of the exports, then we're safe to use that...\r\n if (entity.exportNames.has(idealNameForEmit)) {\r\n // ...except that if it conflicts with a global name, then the global name wins\r\n if (!this.globalVariableAnalyzer.hasGlobalName(idealNameForEmit)) {\r\n // ...also avoid \"default\" which can interfere with \"export { default } from 'some-module;'\"\r\n if (idealNameForEmit !== 'default') {\r\n entity.nameForEmit = idealNameForEmit;\r\n continue;\r\n }\r\n }\r\n }\r\n\r\n // Generate a unique name based on idealNameForEmit\r\n let suffix: number = 1;\r\n let nameForEmit: string = idealNameForEmit;\r\n\r\n // Choose a name that doesn't conflict with usedNames or a global name\r\n while (\r\n nameForEmit === 'default' ||\r\n usedNames.has(nameForEmit) ||\r\n this.globalVariableAnalyzer.hasGlobalName(nameForEmit)\r\n ) {\r\n nameForEmit = `${idealNameForEmit}_${++suffix}`;\r\n }\r\n entity.nameForEmit = nameForEmit;\r\n usedNames.add(nameForEmit);\r\n }\r\n }\r\n\r\n private _fetchSymbolMetadata(astSymbol: AstSymbol): void {\r\n if (astSymbol.symbolMetadata) {\r\n return;\r\n }\r\n\r\n // When we solve an astSymbol, then we always also solve all of its parents and all of its declarations.\r\n // The parent is solved first.\r\n if (astSymbol.parentAstSymbol && astSymbol.parentAstSymbol.symbolMetadata === undefined) {\r\n this._fetchSymbolMetadata(astSymbol.parentAstSymbol);\r\n }\r\n\r\n // Construct the DeclarationMetadata objects, and detect any ancillary declarations\r\n this._calculateDeclarationMetadataForDeclarations(astSymbol);\r\n\r\n // Calculate the ApiItemMetadata objects\r\n for (const astDeclaration of astSymbol.astDeclarations) {\r\n this._calculateApiItemMetadata(astDeclaration);\r\n }\r\n\r\n // The most public effectiveReleaseTag for all declarations\r\n let maxEffectiveReleaseTag: ReleaseTag = ReleaseTag.None;\r\n\r\n for (const astDeclaration of astSymbol.astDeclarations) {\r\n // We know we solved this above\r\n const apiItemMetadata: ApiItemMetadata = astDeclaration.apiItemMetadata as ApiItemMetadata;\r\n\r\n const effectiveReleaseTag: ReleaseTag = apiItemMetadata.effectiveReleaseTag;\r\n\r\n if (effectiveReleaseTag > maxEffectiveReleaseTag) {\r\n maxEffectiveReleaseTag = effectiveReleaseTag;\r\n }\r\n }\r\n\r\n // Update this last when we're sure no exceptions were thrown\r\n astSymbol.symbolMetadata = new SymbolMetadata({\r\n maxEffectiveReleaseTag\r\n });\r\n }\r\n\r\n private _calculateDeclarationMetadataForDeclarations(astSymbol: AstSymbol): void {\r\n // Initialize DeclarationMetadata for each declaration\r\n for (const astDeclaration of astSymbol.astDeclarations) {\r\n if (astDeclaration.declarationMetadata) {\r\n throw new InternalError(\r\n 'AstDeclaration.declarationMetadata is not expected to have been initialized yet'\r\n );\r\n }\r\n\r\n const metadata: InternalDeclarationMetadata = new InternalDeclarationMetadata();\r\n metadata.tsdocParserContext = this._parseTsdocForAstDeclaration(astDeclaration);\r\n\r\n astDeclaration.declarationMetadata = metadata;\r\n }\r\n\r\n // Detect ancillary declarations\r\n for (const astDeclaration of astSymbol.astDeclarations) {\r\n // For a getter/setter pair, make the setter ancillary to the getter\r\n if (astDeclaration.declaration.kind === ts.SyntaxKind.SetAccessor) {\r\n let foundGetter: boolean = false;\r\n for (const getterAstDeclaration of astDeclaration.astSymbol.astDeclarations) {\r\n if (getterAstDeclaration.declaration.kind === ts.SyntaxKind.GetAccessor) {\r\n // Associate it with the getter\r\n this._addAncillaryDeclaration(getterAstDeclaration, astDeclaration);\r\n\r\n foundGetter = true;\r\n }\r\n }\r\n\r\n if (!foundGetter) {\r\n this.messageRouter.addAnalyzerIssue(\r\n ExtractorMessageId.MissingGetter,\r\n `The property \"${astDeclaration.astSymbol.localName}\" has a setter but no getter.`,\r\n astDeclaration\r\n );\r\n }\r\n }\r\n }\r\n }\r\n\r\n private _addAncillaryDeclaration(\r\n mainAstDeclaration: AstDeclaration,\r\n ancillaryAstDeclaration: AstDeclaration\r\n ): void {\r\n const mainMetadata: InternalDeclarationMetadata =\r\n mainAstDeclaration.declarationMetadata as InternalDeclarationMetadata;\r\n const ancillaryMetadata: InternalDeclarationMetadata =\r\n ancillaryAstDeclaration.declarationMetadata as InternalDeclarationMetadata;\r\n\r\n if (mainMetadata.ancillaryDeclarations.indexOf(ancillaryAstDeclaration) >= 0) {\r\n return; // already added\r\n }\r\n\r\n if (mainAstDeclaration.astSymbol !== ancillaryAstDeclaration.astSymbol) {\r\n throw new InternalError(\r\n 'Invalid call to _addAncillaryDeclaration() because declarations do not' +\r\n ' belong to the same symbol'\r\n );\r\n }\r\n\r\n if (mainMetadata.isAncillary) {\r\n throw new InternalError(\r\n 'Invalid call to _addAncillaryDeclaration() because the target is ancillary itself'\r\n );\r\n }\r\n\r\n if (ancillaryMetadata.isAncillary) {\r\n throw new InternalError(\r\n 'Invalid call to _addAncillaryDeclaration() because source is already ancillary' +\r\n ' to another declaration'\r\n );\r\n }\r\n\r\n if (mainAstDeclaration.apiItemMetadata || ancillaryAstDeclaration.apiItemMetadata) {\r\n throw new InternalError(\r\n 'Invalid call to _addAncillaryDeclaration() because the API item metadata' +\r\n ' has already been constructed'\r\n );\r\n }\r\n\r\n ancillaryMetadata.isAncillary = true;\r\n mainMetadata.ancillaryDeclarations.push(ancillaryAstDeclaration);\r\n }\r\n\r\n private _calculateApiItemMetadata(astDeclaration: AstDeclaration): void {\r\n const declarationMetadata: InternalDeclarationMetadata =\r\n astDeclaration.declarationMetadata as InternalDeclarationMetadata;\r\n if (declarationMetadata.isAncillary) {\r\n if (astDeclaration.declaration.kind === ts.SyntaxKind.SetAccessor) {\r\n if (declarationMetadata.tsdocParserContext) {\r\n this.messageRouter.addAnalyzerIssue(\r\n ExtractorMessageId.SetterWithDocs,\r\n `The doc comment for the property \"${astDeclaration.astSymbol.localName}\"` +\r\n ` must appear on the getter, not the setter.`,\r\n astDeclaration\r\n );\r\n }\r\n }\r\n\r\n // We never calculate ApiItemMetadata for an ancillary declaration; instead, it is assigned when\r\n // the main declaration is processed.\r\n return;\r\n }\r\n\r\n const options: IApiItemMetadataOptions = {\r\n declaredReleaseTag: ReleaseTag.None,\r\n effectiveReleaseTag: ReleaseTag.None,\r\n isEventProperty: false,\r\n isOverride: false,\r\n isSealed: false,\r\n isVirtual: false,\r\n isPreapproved: false,\r\n releaseTagSameAsParent: false\r\n };\r\n\r\n const parserContext: tsdoc.ParserContext | undefined = declarationMetadata.tsdocParserContext;\r\n if (parserContext) {\r\n const modifierTagSet: tsdoc.StandardModifierTagSet = parserContext.docComment.modifierTagSet;\r\n\r\n let declaredReleaseTag: ReleaseTag = ReleaseTag.None;\r\n let extraReleaseTags: boolean = false;\r\n\r\n if (modifierTagSet.isPublic()) {\r\n declaredReleaseTag = ReleaseTag.Public;\r\n }\r\n if (modifierTagSet.isBeta()) {\r\n if (declaredReleaseTag !== ReleaseTag.None) {\r\n extraReleaseTags = true;\r\n } else {\r\n declaredReleaseTag = ReleaseTag.Beta;\r\n }\r\n }\r\n if (modifierTagSet.isAlpha()) {\r\n if (declaredReleaseTag !== ReleaseTag.None) {\r\n extraReleaseTags = true;\r\n } else {\r\n declaredReleaseTag = ReleaseTag.Alpha;\r\n }\r\n }\r\n if (modifierTagSet.isInternal()) {\r\n if (declaredReleaseTag !== ReleaseTag.None) {\r\n extraReleaseTags = true;\r\n } else {\r\n declaredReleaseTag = ReleaseTag.Internal;\r\n }\r\n }\r\n\r\n if (extraReleaseTags) {\r\n if (!astDeclaration.astSymbol.isExternal) {\r\n // for now, don't report errors for external code\r\n this.messageRouter.addAnalyzerIssue(\r\n ExtractorMessageId.ExtraReleaseTag,\r\n 'The doc comment should not contain more than one release tag',\r\n astDeclaration\r\n );\r\n }\r\n }\r\n\r\n options.declaredReleaseTag = declaredReleaseTag;\r\n\r\n options.isEventProperty = modifierTagSet.isEventProperty();\r\n options.isOverride = modifierTagSet.isOverride();\r\n options.isSealed = modifierTagSet.isSealed();\r\n options.isVirtual = modifierTagSet.isVirtual();\r\n const preapprovedTag: tsdoc.TSDocTagDefinition | void =\r\n this.extractorConfig.tsdocConfiguration.tryGetTagDefinition('@preapproved');\r\n\r\n if (preapprovedTag && modifierTagSet.hasTag(preapprovedTag)) {\r\n // This feature only makes sense for potentially big declarations.\r\n switch (astDeclaration.declaration.kind) {\r\n case ts.SyntaxKind.ClassDeclaration:\r\n case ts.SyntaxKind.EnumDeclaration:\r\n case ts.SyntaxKind.InterfaceDeclaration:\r\n case ts.SyntaxKind.ModuleDeclaration:\r\n if (declaredReleaseTag === ReleaseTag.Internal) {\r\n options.isPreapproved = true;\r\n } else {\r\n this.messageRouter.addAnalyzerIssue(\r\n ExtractorMessageId.PreapprovedBadReleaseTag,\r\n `The @preapproved tag cannot be applied to \"${astDeclaration.astSymbol.localName}\"` +\r\n ` without an @internal release tag`,\r\n astDeclaration\r\n );\r\n }\r\n break;\r\n default:\r\n this.messageRouter.addAnalyzerIssue(\r\n ExtractorMessageId.PreapprovedUnsupportedType,\r\n `The @preapproved tag cannot be applied to \"${astDeclaration.astSymbol.localName}\"` +\r\n ` because it is not a supported declaration type`,\r\n astDeclaration\r\n );\r\n break;\r\n }\r\n }\r\n }\r\n\r\n // This needs to be set regardless of whether or not a parserContext exists\r\n if (astDeclaration.parent) {\r\n const parentApiItemMetadata: ApiItemMetadata = this.fetchApiItemMetadata(astDeclaration.parent);\r\n options.effectiveReleaseTag =\r\n options.declaredReleaseTag === ReleaseTag.None\r\n ? parentApiItemMetadata.effectiveReleaseTag\r\n : options.declaredReleaseTag;\r\n\r\n options.releaseTagSameAsParent =\r\n parentApiItemMetadata.effectiveReleaseTag === options.effectiveReleaseTag;\r\n } else {\r\n options.effectiveReleaseTag = options.declaredReleaseTag;\r\n }\r\n\r\n if (options.effectiveReleaseTag === ReleaseTag.None) {\r\n if (!astDeclaration.astSymbol.isExternal) {\r\n // for now, don't report errors for external code\r\n // Don't report missing release tags for forgotten exports\r\n const astSymbol: AstSymbol = astDeclaration.astSymbol;\r\n const entity: CollectorEntity | undefined = this._entitiesByAstEntity.get(astSymbol.rootAstSymbol);\r\n if (entity && entity.consumable) {\r\n // We also don't report errors for the default export of an entry point, since its doc comment\r\n // isn't easy to obtain from the .d.ts file\r\n if (astSymbol.rootAstSymbol.localName !== '_default') {\r\n this.messageRouter.addAnalyzerIssue(\r\n ExtractorMessageId.MissingReleaseTag,\r\n `\"${entity.astEntity.localName}\" is exported by the package, but it is missing ` +\r\n `a release tag (@alpha, @beta, @public, or @internal)`,\r\n astSymbol\r\n );\r\n }\r\n }\r\n }\r\n\r\n options.effectiveReleaseTag = ReleaseTag.Public;\r\n }\r\n\r\n const apiItemMetadata: ApiItemMetadata = new ApiItemMetadata(options);\r\n if (parserContext) {\r\n apiItemMetadata.tsdocComment = parserContext.docComment;\r\n }\r\n\r\n astDeclaration.apiItemMetadata = apiItemMetadata;\r\n\r\n // Lastly, share the result with any ancillary declarations\r\n for (const ancillaryDeclaration of declarationMetadata.ancillaryDeclarations) {\r\n ancillaryDeclaration.apiItemMetadata = apiItemMetadata;\r\n }\r\n }\r\n\r\n private _parseTsdocForAstDeclaration(astDeclaration: AstDeclaration): tsdoc.ParserContext | undefined {\r\n const declaration: ts.Declaration = astDeclaration.declaration;\r\n let nodeForComment: ts.Node = declaration;\r\n\r\n if (ts.isVariableDeclaration(declaration)) {\r\n // Variable declarations are special because they can be combined into a list. For example:\r\n //\r\n // /** A */ export /** B */ const /** C */ x = 1, /** D **/ [ /** E */ y, z] = [3, 4];\r\n //\r\n // The compiler will only emit comments A and C in the .d.ts file, so in general there isn't a well-defined\r\n // way to document these parts. API Extractor requires you to break them into separate exports like this:\r\n //\r\n // /** A */ export const x = 1;\r\n //\r\n // But _getReleaseTagForDeclaration() still receives a node corresponding to \"x\", so we need to walk upwards\r\n // and find the containing statement in order for getJSDocCommentRanges() to read the comment that we expect.\r\n const statement: ts.VariableStatement | undefined = TypeScriptHelpers.findFirstParent(\r\n declaration,\r\n ts.SyntaxKind.VariableStatement\r\n ) as ts.VariableStatement | undefined;\r\n if (statement !== undefined) {\r\n // For a compound declaration, fall back to looking for C instead of A\r\n if (statement.declarationList.declarations.length === 1) {\r\n nodeForComment = statement;\r\n }\r\n }\r\n }\r\n\r\n const sourceFileText: string = declaration.getSourceFile().text;\r\n const ranges: ts.CommentRange[] =\r\n TypeScriptInternals.getJSDocCommentRanges(nodeForComment, sourceFileText) || [];\r\n\r\n if (ranges.length === 0) {\r\n return undefined;\r\n }\r\n\r\n // We use the JSDoc comment block that is closest to the definition, i.e.\r\n // the last one preceding it\r\n const range: ts.TextRange = ranges[ranges.length - 1];\r\n\r\n const tsdocTextRange: tsdoc.TextRange = tsdoc.TextRange.fromStringRange(\r\n sourceFileText,\r\n range.pos,\r\n range.end\r\n );\r\n\r\n const parserContext: tsdoc.ParserContext = this._tsdocParser.parseRange(tsdocTextRange);\r\n\r\n this.messageRouter.addTsdocMessages(parserContext, declaration.getSourceFile(), astDeclaration);\r\n\r\n // We delete the @privateRemarks block as early as possible, to ensure that it never leaks through\r\n // into one of the output files.\r\n parserContext.docComment.privateRemarks = undefined;\r\n\r\n return parserContext;\r\n }\r\n\r\n private _collectReferenceDirectives(astEntity: AstEntity): void {\r\n if (astEntity instanceof AstSymbol) {\r\n const sourceFiles: ts.SourceFile[] = astEntity.astDeclarations.map((astDeclaration) =>\r\n astDeclaration.declaration.getSourceFile()\r\n );\r\n return this._collectReferenceDirectivesFromSourceFiles(sourceFiles);\r\n }\r\n\r\n if (astEntity instanceof AstNamespaceImport) {\r\n const sourceFiles: ts.SourceFile[] = [astEntity.astModule.sourceFile];\r\n return this._collectReferenceDirectivesFromSourceFiles(sourceFiles);\r\n }\r\n }\r\n\r\n private _collectReferenceDirectivesFromSourceFiles(sourceFiles: ts.SourceFile[]): void {\r\n const seenFilenames: Set<string> = new Set<string>();\r\n\r\n for (const sourceFile of sourceFiles) {\r\n if (sourceFile && sourceFile.fileName) {\r\n if (!seenFilenames.has(sourceFile.fileName)) {\r\n seenFilenames.add(sourceFile.fileName);\r\n\r\n for (const typeReferenceDirective of sourceFile.typeReferenceDirectives) {\r\n const name: string = sourceFile.text.substring(\r\n typeReferenceDirective.pos,\r\n typeReferenceDirective.end\r\n );\r\n this._dtsTypeReferenceDirectives.add(name);\r\n }\r\n\r\n for (const libReferenceDirective of sourceFile.libReferenceDirectives) {\r\n const name: string = sourceFile.text.substring(\r\n libReferenceDirective.pos,\r\n libReferenceDirective.end\r\n );\r\n this._dtsLibReferenceDirectives.add(name);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"Collector.js","sourceRoot":"","sources":["../../src/collector/Collector.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;;;;;;;;;;;;;;;;;;;;AAE3D,+CAAiC;AACjC,wDAA0C;AAC1C,oEAAsF;AACtF,wEAA4D;AAI5D,uDAAoD;AACpD,+DAA4D;AAG5D,qDAAkD;AAElD,qEAAkE;AAClE,qDAAkD;AAClD,kEAA+D;AAC/D,+DAAyF;AACzF,uDAA6E;AAC7E,qDAAkD;AAClD,yEAA+F;AAE/F,2EAAwE;AAExE,uEAAoE;AACpE,qDAAkD;AAqBlD;;;;;GAKG;AACH,MAAa,SAAS;IAuCpB,YAAmB,OAA0B;QAd5B,cAAS,GAAsB,EAAE,CAAC;QAClC,yBAAoB,GAAoC,IAAI,GAAG,EAG7E,CAAC;QAEa,qCAAgC,GAAa,EAAE,CAAC;QAEhD,gCAA2B,GAAgB,IAAI,GAAG,EAAU,CAAC;QAC7D,+BAA0B,GAAgB,IAAI,GAAG,EAAU,CAAC;QAM3E,IAAI,CAAC,iBAAiB,GAAG,IAAI,qCAAiB,EAAE,CAAC;QAEjD,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC;QAChC,IAAI,CAAC,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC;QAE/C,MAAM,oBAAoB,GAA8B,OAAO,CAAC,OAAO,CAAC,aAAa,CACnF,IAAI,CAAC,eAAe,CAAC,sBAAsB,CAC5C,CAAC;QAEF,IAAI,CAAC,oBAAoB,EAAE;YACzB,MAAM,IAAI,KAAK,CAAC,uBAAuB,GAAG,IAA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,CAAC,GAAG,EACzB,qBAAqB,CAAC,GAAG,CAC1B,CAAC;wBACF,IAAI,CAAC,0BAA0B,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;qBAC3C;iBACF;aACF;SACF;IACH,CAAC;CACF;AAz2BD,8BAy2BC","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 ts from 'typescript';\nimport * as tsdoc from '@microsoft/tsdoc';\nimport { PackageJsonLookup, Sort, InternalError } from '@rushstack/node-core-library';\nimport { ReleaseTag } from '@microsoft/api-extractor-model';\n\nimport { ExtractorMessageId } from '../api/ExtractorMessageId';\n\nimport { CollectorEntity } from './CollectorEntity';\nimport { AstSymbolTable } from '../analyzer/AstSymbolTable';\nimport { AstEntity } from '../analyzer/AstEntity';\nimport { AstModule, AstModuleExportInfo } from '../analyzer/AstModule';\nimport { AstSymbol } from '../analyzer/AstSymbol';\nimport { AstDeclaration } from '../analyzer/AstDeclaration';\nimport { TypeScriptHelpers } from '../analyzer/TypeScriptHelpers';\nimport { WorkingPackage } from './WorkingPackage';\nimport { PackageDocComment } from '../aedoc/PackageDocComment';\nimport { DeclarationMetadata, InternalDeclarationMetadata } from './DeclarationMetadata';\nimport { ApiItemMetadata, IApiItemMetadataOptions } from './ApiItemMetadata';\nimport { SymbolMetadata } from './SymbolMetadata';\nimport { TypeScriptInternals, IGlobalVariableAnalyzer } from '../analyzer/TypeScriptInternals';\nimport { MessageRouter } from './MessageRouter';\nimport { AstReferenceResolver } from '../analyzer/AstReferenceResolver';\nimport { ExtractorConfig } from '../api/ExtractorConfig';\nimport { AstNamespaceImport } from '../analyzer/AstNamespaceImport';\nimport { AstImport } from '../analyzer/AstImport';\n\n/**\n * Options for Collector constructor.\n */\nexport interface ICollectorOptions {\n /**\n * Configuration for the TypeScript compiler. The most important options to set are:\n *\n * - target: ts.ScriptTarget.ES5\n * - module: ts.ModuleKind.CommonJS\n * - moduleResolution: ts.ModuleResolutionKind.NodeJs\n * - rootDir: inputFolder\n */\n program: ts.Program;\n\n messageRouter: MessageRouter;\n\n extractorConfig: ExtractorConfig;\n}\n\n/**\n * The `Collector` manages the overall data set that is used by `ApiModelGenerator`,\n * `DtsRollupGenerator`, and `ApiReportGenerator`. Starting from the working package's entry point,\n * the `Collector` collects all exported symbols, determines how to import any symbols they reference,\n * assigns unique names, and sorts everything into a normalized alphabetical ordering.\n */\nexport class Collector {\n public readonly program: ts.Program;\n public readonly typeChecker: ts.TypeChecker;\n public readonly globalVariableAnalyzer: IGlobalVariableAnalyzer;\n public readonly astSymbolTable: AstSymbolTable;\n public readonly astReferenceResolver: AstReferenceResolver;\n\n public readonly packageJsonLookup: PackageJsonLookup;\n public readonly messageRouter: MessageRouter;\n\n public readonly workingPackage: WorkingPackage;\n\n public readonly extractorConfig: ExtractorConfig;\n\n /**\n * The `ExtractorConfig.bundledPackages` names in a set.\n */\n public readonly bundledPackageNames: ReadonlySet<string>;\n\n private readonly _program: ts.Program;\n\n private readonly _tsdocParser: tsdoc.TSDocParser;\n\n private _astEntryPoint: AstModule | undefined;\n\n private readonly _entities: CollectorEntity[] = [];\n private readonly _entitiesByAstEntity: Map<AstEntity, CollectorEntity> = new Map<\n AstEntity,\n CollectorEntity\n >();\n\n private readonly _starExportedExternalModulePaths: string[] = [];\n\n private readonly _dtsTypeReferenceDirectives: Set<string> = new Set<string>();\n private readonly _dtsLibReferenceDirectives: Set<string> = new Set<string>();\n\n // Used by getOverloadIndex()\n private readonly _cachedOverloadIndexesByDeclaration: Map<AstDeclaration, number>;\n\n public constructor(options: ICollectorOptions) {\n this.packageJsonLookup = new PackageJsonLookup();\n\n this._program = options.program;\n this.extractorConfig = options.extractorConfig;\n\n const entryPointSourceFile: ts.SourceFile | undefined = options.program.getSourceFile(\n this.extractorConfig.mainEntryPointFilePath\n );\n\n if (!entryPointSourceFile) {\n throw new Error('Unable to load file: ' + this.extractorConfig.mainEntryPointFilePath);\n }\n\n if (!this.extractorConfig.packageFolder || !this.extractorConfig.packageJson) {\n // TODO: We should be able to analyze projects that don't have any package.json.\n // The ExtractorConfig class is already designed to allow this.\n throw new Error('Unable to find a package.json file for the project being analyzed');\n }\n\n this.workingPackage = new WorkingPackage({\n packageFolder: this.extractorConfig.packageFolder,\n packageJson: this.extractorConfig.packageJson,\n entryPointSourceFile\n });\n\n this.messageRouter = options.messageRouter;\n\n this.program = options.program;\n this.typeChecker = options.program.getTypeChecker();\n this.globalVariableAnalyzer = TypeScriptInternals.getGlobalVariableAnalyzer(this.program);\n\n this._tsdocParser = new tsdoc.TSDocParser(this.extractorConfig.tsdocConfiguration);\n\n this.bundledPackageNames = new Set<string>(this.extractorConfig.bundledPackages);\n\n this.astSymbolTable = new AstSymbolTable(\n this.program,\n this.typeChecker,\n this.packageJsonLookup,\n this.bundledPackageNames,\n this.messageRouter\n );\n this.astReferenceResolver = new AstReferenceResolver(this);\n\n this._cachedOverloadIndexesByDeclaration = new Map<AstDeclaration, number>();\n }\n\n /**\n * Returns a list of names (e.g. \"example-library\") that should appear in a reference like this:\n *\n * ```\n * /// <reference types=\"example-library\" />\n * ```\n */\n public get dtsTypeReferenceDirectives(): ReadonlySet<string> {\n return this._dtsTypeReferenceDirectives;\n }\n\n /**\n * A list of names (e.g. \"runtime-library\") that should appear in a reference like this:\n *\n * ```\n * /// <reference lib=\"runtime-library\" />\n * ```\n */\n public get dtsLibReferenceDirectives(): ReadonlySet<string> {\n return this._dtsLibReferenceDirectives;\n }\n\n public get entities(): ReadonlyArray<CollectorEntity> {\n return this._entities;\n }\n\n /**\n * A list of module specifiers (e.g. `\"@rushstack/node-core-library/lib/FileSystem\"`) that should be emitted\n * as star exports (e.g. `export * from \"@rushstack/node-core-library/lib/FileSystem\"`).\n */\n public get starExportedExternalModulePaths(): ReadonlyArray<string> {\n return this._starExportedExternalModulePaths;\n }\n\n /**\n * Perform the analysis.\n */\n public analyze(): void {\n if (this._astEntryPoint) {\n throw new Error('DtsRollupGenerator.analyze() was already called');\n }\n\n // This runs a full type analysis, and then augments the Abstract Syntax Tree (i.e. declarations)\n // with semantic information (i.e. symbols). The \"diagnostics\" are a subset of the everyday\n // compile errors that would result from a full compilation.\n for (const diagnostic of this._program.getSemanticDiagnostics()) {\n this.messageRouter.addCompilerDiagnostic(diagnostic);\n }\n\n if (this.messageRouter.showDiagnostics) {\n this.messageRouter.logDiagnosticHeader('Root filenames');\n for (const fileName of this.program.getRootFileNames()) {\n this.messageRouter.logDiagnostic(fileName);\n }\n this.messageRouter.logDiagnosticFooter();\n\n this.messageRouter.logDiagnosticHeader('Files analyzed by compiler');\n for (const sourceFile of this.program.getSourceFiles()) {\n this.messageRouter.logDiagnostic(sourceFile.fileName);\n }\n this.messageRouter.logDiagnosticFooter();\n }\n\n // Build the entry point\n const entryPointSourceFile: ts.SourceFile = this.workingPackage.entryPointSourceFile;\n\n const astEntryPoint: AstModule =\n this.astSymbolTable.fetchAstModuleFromWorkingPackage(entryPointSourceFile);\n this._astEntryPoint = astEntryPoint;\n\n const packageDocCommentTextRange: ts.TextRange | undefined = PackageDocComment.tryFindInSourceFile(\n entryPointSourceFile,\n this\n );\n\n if (packageDocCommentTextRange) {\n const range: tsdoc.TextRange = tsdoc.TextRange.fromStringRange(\n entryPointSourceFile.text,\n packageDocCommentTextRange.pos,\n packageDocCommentTextRange.end\n );\n\n this.workingPackage.tsdocParserContext = this._tsdocParser.parseRange(range);\n\n this.messageRouter.addTsdocMessages(this.workingPackage.tsdocParserContext, entryPointSourceFile);\n\n this.workingPackage.tsdocComment = this.workingPackage.tsdocParserContext!.docComment;\n }\n\n const exportedAstEntities: AstEntity[] = [];\n\n // Create a CollectorEntity for each top-level export\n\n const astModuleExportInfo: AstModuleExportInfo =\n this.astSymbolTable.fetchAstModuleExportInfo(astEntryPoint);\n\n for (const [exportName, astEntity] of astModuleExportInfo.exportedLocalEntities) {\n this._createCollectorEntity(astEntity, exportName);\n\n exportedAstEntities.push(astEntity);\n }\n\n // Create a CollectorEntity for each indirectly referenced export.\n // Note that we do this *after* the above loop, so that references to exported AstSymbols\n // are encountered first as exports.\n const alreadySeenAstSymbols: Set<AstSymbol> = new Set<AstSymbol>();\n for (const exportedAstEntity of exportedAstEntities) {\n this._createEntityForIndirectReferences(exportedAstEntity, alreadySeenAstSymbols);\n\n if (exportedAstEntity instanceof AstSymbol) {\n this.fetchSymbolMetadata(exportedAstEntity);\n }\n }\n\n this._makeUniqueNames();\n\n for (const starExportedExternalModule of astModuleExportInfo.starExportedExternalModules) {\n if (starExportedExternalModule.externalModulePath !== undefined) {\n this._starExportedExternalModulePaths.push(starExportedExternalModule.externalModulePath);\n }\n }\n\n Sort.sortBy(this._entities, (x) => x.getSortKey());\n Sort.sortSet(this._dtsTypeReferenceDirectives);\n Sort.sortSet(this._dtsLibReferenceDirectives);\n this._starExportedExternalModulePaths.sort();\n }\n\n /**\n * For a given ts.Identifier that is part of an AstSymbol that we analyzed, return the CollectorEntity that\n * it refers to. Returns undefined if it doesn't refer to anything interesting.\n * @remarks\n * Throws an Error if the ts.Identifier is not part of node tree that was analyzed.\n */\n public tryGetEntityForNode(identifier: ts.Identifier | ts.ImportTypeNode): CollectorEntity | undefined {\n const astEntity: AstEntity | undefined = this.astSymbolTable.tryGetEntityForNode(identifier);\n if (astEntity) {\n return this._entitiesByAstEntity.get(astEntity);\n }\n return undefined;\n }\n\n /**\n * Returns the associated `CollectorEntity` for the given `astEntity`, if one was created during analysis.\n */\n public tryGetCollectorEntity(astEntity: AstEntity): CollectorEntity | undefined {\n return this._entitiesByAstEntity.get(astEntity);\n }\n\n public fetchSymbolMetadata(astSymbol: AstSymbol): SymbolMetadata {\n if (astSymbol.symbolMetadata === undefined) {\n this._fetchSymbolMetadata(astSymbol);\n }\n return astSymbol.symbolMetadata as SymbolMetadata;\n }\n\n public fetchDeclarationMetadata(astDeclaration: AstDeclaration): DeclarationMetadata {\n if (astDeclaration.declarationMetadata === undefined) {\n // Fetching the SymbolMetadata always constructs the DeclarationMetadata\n this._fetchSymbolMetadata(astDeclaration.astSymbol);\n }\n return astDeclaration.declarationMetadata as DeclarationMetadata;\n }\n\n public fetchApiItemMetadata(astDeclaration: AstDeclaration): ApiItemMetadata {\n if (astDeclaration.apiItemMetadata === undefined) {\n // Fetching the SymbolMetadata always constructs the ApiItemMetadata\n this._fetchSymbolMetadata(astDeclaration.astSymbol);\n }\n return astDeclaration.apiItemMetadata as ApiItemMetadata;\n }\n\n public tryFetchMetadataForAstEntity(astEntity: AstEntity): SymbolMetadata | undefined {\n if (astEntity instanceof AstSymbol) {\n return this.fetchSymbolMetadata(astEntity);\n }\n if (astEntity instanceof AstImport) {\n if (astEntity.astSymbol) {\n return this.fetchSymbolMetadata(astEntity.astSymbol);\n }\n }\n return undefined;\n }\n\n public isAncillaryDeclaration(astDeclaration: AstDeclaration): boolean {\n const declarationMetadata: DeclarationMetadata = this.fetchDeclarationMetadata(astDeclaration);\n return declarationMetadata.isAncillary;\n }\n\n public getNonAncillaryDeclarations(astSymbol: AstSymbol): ReadonlyArray<AstDeclaration> {\n const result: AstDeclaration[] = [];\n for (const astDeclaration of astSymbol.astDeclarations) {\n const declarationMetadata: DeclarationMetadata = this.fetchDeclarationMetadata(astDeclaration);\n if (!declarationMetadata.isAncillary) {\n result.push(astDeclaration);\n }\n }\n return result;\n }\n\n /**\n * Removes the leading underscore, for example: \"_Example\" --> \"example*Example*_\"\n *\n * @remarks\n * This causes internal definitions to sort alphabetically case-insensitive, then case-sensitive, and\n * initially ignoring the underscore prefix, while still deterministically comparing it.\n * The star is used as a delimiter because it is not a legal identifier character.\n */\n public static getSortKeyIgnoringUnderscore(identifier: string | undefined): string {\n if (!identifier) return '';\n\n let parts: string[];\n\n if (identifier[0] === '_') {\n const withoutUnderscore: string = identifier.substr(1);\n parts = [withoutUnderscore.toLowerCase(), '*', withoutUnderscore, '*', '_'];\n } else {\n parts = [identifier.toLowerCase(), '*', identifier];\n }\n\n return parts.join('');\n }\n\n /**\n * For function-like signatures, this returns the TSDoc \"overload index\" which can be used to identify\n * a specific overload.\n */\n public getOverloadIndex(astDeclaration: AstDeclaration): number {\n const allDeclarations: ReadonlyArray<AstDeclaration> = astDeclaration.astSymbol.astDeclarations;\n if (allDeclarations.length === 1) {\n return 1; // trivial case\n }\n\n let overloadIndex: number | undefined = this._cachedOverloadIndexesByDeclaration.get(astDeclaration);\n\n if (overloadIndex === undefined) {\n // TSDoc index selectors are positive integers counting from 1\n let nextIndex: number = 1;\n for (const other of allDeclarations) {\n // Filter out other declarations that are not overloads. For example, an overloaded function can also\n // be a namespace.\n if (other.declaration.kind === astDeclaration.declaration.kind) {\n this._cachedOverloadIndexesByDeclaration.set(other, nextIndex);\n ++nextIndex;\n }\n }\n overloadIndex = this._cachedOverloadIndexesByDeclaration.get(astDeclaration);\n }\n\n if (overloadIndex === undefined) {\n // This should never happen\n throw new InternalError('Error calculating overload index for declaration');\n }\n\n return overloadIndex;\n }\n\n private _createCollectorEntity(astEntity: AstEntity, exportedName: string | undefined): CollectorEntity {\n let entity: CollectorEntity | undefined = this._entitiesByAstEntity.get(astEntity);\n\n if (!entity) {\n entity = new CollectorEntity(astEntity);\n\n this._entitiesByAstEntity.set(astEntity, entity);\n this._entities.push(entity);\n this._collectReferenceDirectives(astEntity);\n }\n\n if (exportedName) {\n entity.addExportName(exportedName);\n }\n\n return entity;\n }\n\n private _createEntityForIndirectReferences(\n astEntity: AstEntity,\n alreadySeenAstEntities: Set<AstEntity>\n ): void {\n if (alreadySeenAstEntities.has(astEntity)) {\n return;\n }\n alreadySeenAstEntities.add(astEntity);\n\n if (astEntity instanceof AstSymbol) {\n astEntity.forEachDeclarationRecursive((astDeclaration: AstDeclaration) => {\n for (const referencedAstEntity of astDeclaration.referencedAstEntities) {\n if (referencedAstEntity instanceof AstSymbol) {\n // We only create collector entities for root-level symbols.\n // For example, if a symbols is nested inside a namespace, only the root-level namespace\n // get a collector entity\n if (referencedAstEntity.parentAstSymbol === undefined) {\n this._createCollectorEntity(referencedAstEntity, undefined);\n }\n } else {\n this._createCollectorEntity(referencedAstEntity, undefined);\n }\n\n this._createEntityForIndirectReferences(referencedAstEntity, alreadySeenAstEntities);\n }\n });\n }\n\n if (astEntity instanceof AstNamespaceImport) {\n const astModuleExportInfo: AstModuleExportInfo = astEntity.fetchAstModuleExportInfo(this);\n\n for (const exportedEntity of astModuleExportInfo.exportedLocalEntities.values()) {\n // Create a CollectorEntity for each top-level export of AstImportInternal entity\n const entity: CollectorEntity = this._createCollectorEntity(exportedEntity, undefined);\n entity.addAstNamespaceImports(astEntity);\n\n this._createEntityForIndirectReferences(exportedEntity, alreadySeenAstEntities);\n }\n }\n }\n\n /**\n * Ensures a unique name for each item in the package typings file.\n */\n private _makeUniqueNames(): void {\n // The following examples illustrate the nameForEmit heuristics:\n //\n // Example 1:\n // class X { } <--- nameForEmit should be \"A\" to simplify things and reduce possibility of conflicts\n // export { X as A };\n //\n // Example 2:\n // class X { } <--- nameForEmit should be \"X\" because choosing A or B would be nondeterministic\n // export { X as A };\n // export { X as B };\n //\n // Example 3:\n // class X { } <--- nameForEmit should be \"X_1\" because Y has a stronger claim to the name\n // export { X as A };\n // export { X as B };\n // class Y { } <--- nameForEmit should be \"X\"\n // export { Y as X };\n\n // Set of names that should NOT be used when generating a unique nameForEmit\n const usedNames: Set<string> = new Set<string>();\n\n // First collect the names of explicit package exports, and perform a sanity check.\n for (const entity of this._entities) {\n for (const exportName of entity.exportNames) {\n if (usedNames.has(exportName)) {\n // This should be impossible\n throw new InternalError(`A package cannot have two exports with the name \"${exportName}\"`);\n }\n usedNames.add(exportName);\n }\n }\n\n // Ensure that each entity has a unique nameForEmit\n for (const entity of this._entities) {\n // What name would we ideally want to emit it as?\n let idealNameForEmit: string;\n\n // If this entity is exported exactly once, then we prefer the exported name\n if (\n entity.singleExportName !== undefined &&\n entity.singleExportName !== ts.InternalSymbolName.Default\n ) {\n idealNameForEmit = entity.singleExportName;\n } else {\n // otherwise use the local name\n idealNameForEmit = entity.astEntity.localName;\n }\n\n if (idealNameForEmit.includes('.')) {\n // For an ImportType with a namespace chain, only the top namespace is imported.\n idealNameForEmit = idealNameForEmit.split('.')[0];\n }\n\n // If the idealNameForEmit happens to be the same as one of the exports, then we're safe to use that...\n if (entity.exportNames.has(idealNameForEmit)) {\n // ...except that if it conflicts with a global name, then the global name wins\n if (!this.globalVariableAnalyzer.hasGlobalName(idealNameForEmit)) {\n // ...also avoid \"default\" which can interfere with \"export { default } from 'some-module;'\"\n if (idealNameForEmit !== 'default') {\n entity.nameForEmit = idealNameForEmit;\n continue;\n }\n }\n }\n\n // Generate a unique name based on idealNameForEmit\n let suffix: number = 1;\n let nameForEmit: string = idealNameForEmit;\n\n // Choose a name that doesn't conflict with usedNames or a global name\n while (\n nameForEmit === 'default' ||\n usedNames.has(nameForEmit) ||\n this.globalVariableAnalyzer.hasGlobalName(nameForEmit)\n ) {\n nameForEmit = `${idealNameForEmit}_${++suffix}`;\n }\n entity.nameForEmit = nameForEmit;\n usedNames.add(nameForEmit);\n }\n }\n\n private _fetchSymbolMetadata(astSymbol: AstSymbol): void {\n if (astSymbol.symbolMetadata) {\n return;\n }\n\n // When we solve an astSymbol, then we always also solve all of its parents and all of its declarations.\n // The parent is solved first.\n if (astSymbol.parentAstSymbol && astSymbol.parentAstSymbol.symbolMetadata === undefined) {\n this._fetchSymbolMetadata(astSymbol.parentAstSymbol);\n }\n\n // Construct the DeclarationMetadata objects, and detect any ancillary declarations\n this._calculateDeclarationMetadataForDeclarations(astSymbol);\n\n // Calculate the ApiItemMetadata objects\n for (const astDeclaration of astSymbol.astDeclarations) {\n this._calculateApiItemMetadata(astDeclaration);\n }\n\n // The most public effectiveReleaseTag for all declarations\n let maxEffectiveReleaseTag: ReleaseTag = ReleaseTag.None;\n\n for (const astDeclaration of astSymbol.astDeclarations) {\n // We know we solved this above\n const apiItemMetadata: ApiItemMetadata = astDeclaration.apiItemMetadata as ApiItemMetadata;\n\n const effectiveReleaseTag: ReleaseTag = apiItemMetadata.effectiveReleaseTag;\n\n if (effectiveReleaseTag > maxEffectiveReleaseTag) {\n maxEffectiveReleaseTag = effectiveReleaseTag;\n }\n }\n\n // Update this last when we're sure no exceptions were thrown\n astSymbol.symbolMetadata = new SymbolMetadata({\n maxEffectiveReleaseTag\n });\n }\n\n private _calculateDeclarationMetadataForDeclarations(astSymbol: AstSymbol): void {\n // Initialize DeclarationMetadata for each declaration\n for (const astDeclaration of astSymbol.astDeclarations) {\n if (astDeclaration.declarationMetadata) {\n throw new InternalError(\n 'AstDeclaration.declarationMetadata is not expected to have been initialized yet'\n );\n }\n\n const metadata: InternalDeclarationMetadata = new InternalDeclarationMetadata();\n metadata.tsdocParserContext = this._parseTsdocForAstDeclaration(astDeclaration);\n\n astDeclaration.declarationMetadata = metadata;\n }\n\n // Detect ancillary declarations\n for (const astDeclaration of astSymbol.astDeclarations) {\n // For a getter/setter pair, make the setter ancillary to the getter\n if (astDeclaration.declaration.kind === ts.SyntaxKind.SetAccessor) {\n let foundGetter: boolean = false;\n for (const getterAstDeclaration of astDeclaration.astSymbol.astDeclarations) {\n if (getterAstDeclaration.declaration.kind === ts.SyntaxKind.GetAccessor) {\n // Associate it with the getter\n this._addAncillaryDeclaration(getterAstDeclaration, astDeclaration);\n\n foundGetter = true;\n }\n }\n\n if (!foundGetter) {\n this.messageRouter.addAnalyzerIssue(\n ExtractorMessageId.MissingGetter,\n `The property \"${astDeclaration.astSymbol.localName}\" has a setter but no getter.`,\n astDeclaration\n );\n }\n }\n }\n }\n\n private _addAncillaryDeclaration(\n mainAstDeclaration: AstDeclaration,\n ancillaryAstDeclaration: AstDeclaration\n ): void {\n const mainMetadata: InternalDeclarationMetadata =\n mainAstDeclaration.declarationMetadata as InternalDeclarationMetadata;\n const ancillaryMetadata: InternalDeclarationMetadata =\n ancillaryAstDeclaration.declarationMetadata as InternalDeclarationMetadata;\n\n if (mainMetadata.ancillaryDeclarations.indexOf(ancillaryAstDeclaration) >= 0) {\n return; // already added\n }\n\n if (mainAstDeclaration.astSymbol !== ancillaryAstDeclaration.astSymbol) {\n throw new InternalError(\n 'Invalid call to _addAncillaryDeclaration() because declarations do not' +\n ' belong to the same symbol'\n );\n }\n\n if (mainMetadata.isAncillary) {\n throw new InternalError(\n 'Invalid call to _addAncillaryDeclaration() because the target is ancillary itself'\n );\n }\n\n if (ancillaryMetadata.isAncillary) {\n throw new InternalError(\n 'Invalid call to _addAncillaryDeclaration() because source is already ancillary' +\n ' to another declaration'\n );\n }\n\n if (mainAstDeclaration.apiItemMetadata || ancillaryAstDeclaration.apiItemMetadata) {\n throw new InternalError(\n 'Invalid call to _addAncillaryDeclaration() because the API item metadata' +\n ' has already been constructed'\n );\n }\n\n ancillaryMetadata.isAncillary = true;\n mainMetadata.ancillaryDeclarations.push(ancillaryAstDeclaration);\n }\n\n private _calculateApiItemMetadata(astDeclaration: AstDeclaration): void {\n const declarationMetadata: InternalDeclarationMetadata =\n astDeclaration.declarationMetadata as InternalDeclarationMetadata;\n if (declarationMetadata.isAncillary) {\n if (astDeclaration.declaration.kind === ts.SyntaxKind.SetAccessor) {\n if (declarationMetadata.tsdocParserContext) {\n this.messageRouter.addAnalyzerIssue(\n ExtractorMessageId.SetterWithDocs,\n `The doc comment for the property \"${astDeclaration.astSymbol.localName}\"` +\n ` must appear on the getter, not the setter.`,\n astDeclaration\n );\n }\n }\n\n // We never calculate ApiItemMetadata for an ancillary declaration; instead, it is assigned when\n // the main declaration is processed.\n return;\n }\n\n const options: IApiItemMetadataOptions = {\n declaredReleaseTag: ReleaseTag.None,\n effectiveReleaseTag: ReleaseTag.None,\n isEventProperty: false,\n isOverride: false,\n isSealed: false,\n isVirtual: false,\n isPreapproved: false,\n releaseTagSameAsParent: false\n };\n\n const parserContext: tsdoc.ParserContext | undefined = declarationMetadata.tsdocParserContext;\n if (parserContext) {\n const modifierTagSet: tsdoc.StandardModifierTagSet = parserContext.docComment.modifierTagSet;\n\n let declaredReleaseTag: ReleaseTag = ReleaseTag.None;\n let extraReleaseTags: boolean = false;\n\n if (modifierTagSet.isPublic()) {\n declaredReleaseTag = ReleaseTag.Public;\n }\n if (modifierTagSet.isBeta()) {\n if (declaredReleaseTag !== ReleaseTag.None) {\n extraReleaseTags = true;\n } else {\n declaredReleaseTag = ReleaseTag.Beta;\n }\n }\n if (modifierTagSet.isAlpha()) {\n if (declaredReleaseTag !== ReleaseTag.None) {\n extraReleaseTags = true;\n } else {\n declaredReleaseTag = ReleaseTag.Alpha;\n }\n }\n if (modifierTagSet.isInternal()) {\n if (declaredReleaseTag !== ReleaseTag.None) {\n extraReleaseTags = true;\n } else {\n declaredReleaseTag = ReleaseTag.Internal;\n }\n }\n\n if (extraReleaseTags) {\n if (!astDeclaration.astSymbol.isExternal) {\n // for now, don't report errors for external code\n this.messageRouter.addAnalyzerIssue(\n ExtractorMessageId.ExtraReleaseTag,\n 'The doc comment should not contain more than one release tag',\n astDeclaration\n );\n }\n }\n\n options.declaredReleaseTag = declaredReleaseTag;\n\n options.isEventProperty = modifierTagSet.isEventProperty();\n options.isOverride = modifierTagSet.isOverride();\n options.isSealed = modifierTagSet.isSealed();\n options.isVirtual = modifierTagSet.isVirtual();\n const preapprovedTag: tsdoc.TSDocTagDefinition | void =\n this.extractorConfig.tsdocConfiguration.tryGetTagDefinition('@preapproved');\n\n if (preapprovedTag && modifierTagSet.hasTag(preapprovedTag)) {\n // This feature only makes sense for potentially big declarations.\n switch (astDeclaration.declaration.kind) {\n case ts.SyntaxKind.ClassDeclaration:\n case ts.SyntaxKind.EnumDeclaration:\n case ts.SyntaxKind.InterfaceDeclaration:\n case ts.SyntaxKind.ModuleDeclaration:\n if (declaredReleaseTag === ReleaseTag.Internal) {\n options.isPreapproved = true;\n } else {\n this.messageRouter.addAnalyzerIssue(\n ExtractorMessageId.PreapprovedBadReleaseTag,\n `The @preapproved tag cannot be applied to \"${astDeclaration.astSymbol.localName}\"` +\n ` without an @internal release tag`,\n astDeclaration\n );\n }\n break;\n default:\n this.messageRouter.addAnalyzerIssue(\n ExtractorMessageId.PreapprovedUnsupportedType,\n `The @preapproved tag cannot be applied to \"${astDeclaration.astSymbol.localName}\"` +\n ` because it is not a supported declaration type`,\n astDeclaration\n );\n break;\n }\n }\n }\n\n // This needs to be set regardless of whether or not a parserContext exists\n if (astDeclaration.parent) {\n const parentApiItemMetadata: ApiItemMetadata = this.fetchApiItemMetadata(astDeclaration.parent);\n options.effectiveReleaseTag =\n options.declaredReleaseTag === ReleaseTag.None\n ? parentApiItemMetadata.effectiveReleaseTag\n : options.declaredReleaseTag;\n\n options.releaseTagSameAsParent =\n parentApiItemMetadata.effectiveReleaseTag === options.effectiveReleaseTag;\n } else {\n options.effectiveReleaseTag = options.declaredReleaseTag;\n }\n\n if (options.effectiveReleaseTag === ReleaseTag.None) {\n if (!astDeclaration.astSymbol.isExternal) {\n // for now, don't report errors for external code\n // Don't report missing release tags for forgotten exports\n const astSymbol: AstSymbol = astDeclaration.astSymbol;\n const entity: CollectorEntity | undefined = this._entitiesByAstEntity.get(astSymbol.rootAstSymbol);\n if (entity && entity.consumable) {\n // We also don't report errors for the default export of an entry point, since its doc comment\n // isn't easy to obtain from the .d.ts file\n if (astSymbol.rootAstSymbol.localName !== '_default') {\n this.messageRouter.addAnalyzerIssue(\n ExtractorMessageId.MissingReleaseTag,\n `\"${entity.astEntity.localName}\" is exported by the package, but it is missing ` +\n `a release tag (@alpha, @beta, @public, or @internal)`,\n astSymbol\n );\n }\n }\n }\n\n options.effectiveReleaseTag = ReleaseTag.Public;\n }\n\n const apiItemMetadata: ApiItemMetadata = new ApiItemMetadata(options);\n if (parserContext) {\n apiItemMetadata.tsdocComment = parserContext.docComment;\n }\n\n astDeclaration.apiItemMetadata = apiItemMetadata;\n\n // Lastly, share the result with any ancillary declarations\n for (const ancillaryDeclaration of declarationMetadata.ancillaryDeclarations) {\n ancillaryDeclaration.apiItemMetadata = apiItemMetadata;\n }\n }\n\n private _parseTsdocForAstDeclaration(astDeclaration: AstDeclaration): tsdoc.ParserContext | undefined {\n const declaration: ts.Declaration = astDeclaration.declaration;\n let nodeForComment: ts.Node = declaration;\n\n if (ts.isVariableDeclaration(declaration)) {\n // Variable declarations are special because they can be combined into a list. For example:\n //\n // /** A */ export /** B */ const /** C */ x = 1, /** D **/ [ /** E */ y, z] = [3, 4];\n //\n // The compiler will only emit comments A and C in the .d.ts file, so in general there isn't a well-defined\n // way to document these parts. API Extractor requires you to break them into separate exports like this:\n //\n // /** A */ export const x = 1;\n //\n // But _getReleaseTagForDeclaration() still receives a node corresponding to \"x\", so we need to walk upwards\n // and find the containing statement in order for getJSDocCommentRanges() to read the comment that we expect.\n const statement: ts.VariableStatement | undefined = TypeScriptHelpers.findFirstParent(\n declaration,\n ts.SyntaxKind.VariableStatement\n ) as ts.VariableStatement | undefined;\n if (statement !== undefined) {\n // For a compound declaration, fall back to looking for C instead of A\n if (statement.declarationList.declarations.length === 1) {\n nodeForComment = statement;\n }\n }\n }\n\n const sourceFileText: string = declaration.getSourceFile().text;\n const ranges: ts.CommentRange[] =\n TypeScriptInternals.getJSDocCommentRanges(nodeForComment, sourceFileText) || [];\n\n if (ranges.length === 0) {\n return undefined;\n }\n\n // We use the JSDoc comment block that is closest to the definition, i.e.\n // the last one preceding it\n const range: ts.TextRange = ranges[ranges.length - 1];\n\n const tsdocTextRange: tsdoc.TextRange = tsdoc.TextRange.fromStringRange(\n sourceFileText,\n range.pos,\n range.end\n );\n\n const parserContext: tsdoc.ParserContext = this._tsdocParser.parseRange(tsdocTextRange);\n\n this.messageRouter.addTsdocMessages(parserContext, declaration.getSourceFile(), astDeclaration);\n\n // We delete the @privateRemarks block as early as possible, to ensure that it never leaks through\n // into one of the output files.\n parserContext.docComment.privateRemarks = undefined;\n\n return parserContext;\n }\n\n private _collectReferenceDirectives(astEntity: AstEntity): void {\n if (astEntity instanceof AstSymbol) {\n const sourceFiles: ts.SourceFile[] = astEntity.astDeclarations.map((astDeclaration) =>\n astDeclaration.declaration.getSourceFile()\n );\n return this._collectReferenceDirectivesFromSourceFiles(sourceFiles);\n }\n\n if (astEntity instanceof AstNamespaceImport) {\n const sourceFiles: ts.SourceFile[] = [astEntity.astModule.sourceFile];\n return this._collectReferenceDirectivesFromSourceFiles(sourceFiles);\n }\n }\n\n private _collectReferenceDirectivesFromSourceFiles(sourceFiles: ts.SourceFile[]): void {\n const seenFilenames: Set<string> = new Set<string>();\n\n for (const sourceFile of sourceFiles) {\n if (sourceFile && sourceFile.fileName) {\n if (!seenFilenames.has(sourceFile.fileName)) {\n seenFilenames.add(sourceFile.fileName);\n\n for (const typeReferenceDirective of sourceFile.typeReferenceDirectives) {\n const name: string = sourceFile.text.substring(\n typeReferenceDirective.pos,\n typeReferenceDirective.end\n );\n this._dtsTypeReferenceDirectives.add(name);\n }\n\n for (const libReferenceDirective of sourceFile.libReferenceDirectives) {\n const name: string = sourceFile.text.substring(\n libReferenceDirective.pos,\n libReferenceDirective.end\n );\n this._dtsLibReferenceDirectives.add(name);\n }\n }\n }\n }\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"CollectorEntity.js","sourceRoot":"","sources":["../../src/collector/CollectorEntity.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;;;;;;;;;;;;;;;;;;;;AAE3D,+CAAiC;AAEjC,qDAAkD;AAClD,2CAAwC;AACxC,oEAAoD;AAIpD;;;;;;;;GAQG;AACH,MAAa,eAAe;IAgB1B,YAAmB,SAAoB;QAV/B,iBAAY,GAAgB,IAAI,GAAG,EAAE,CAAC;QACtC,uBAAkB,GAAY,KAAK,CAAC;QACpC,sBAAiB,GAAuB,SAAS,CAAC;QAElD,iBAAY,GAAuB,SAAS,CAAC;QAE7C,aAAQ,GAAuB,SAAS,CAAC;QAEzC,yBAAoB,GAA4B,IAAI,GAAG,EAAE,CAAC;QAGhE,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;IAC7B,CAAC;IAED;;;;OAIG;IACH,IAAW,WAAW;QACpB,OAAO,IAAI,CAAC,YAAY,CAAC;IAC3B,CA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AC,GAAG,CAAC,kBAAkB,CAAC,CAAC;IACpD,CAAC;IAED;;OAEG;IACI,aAAa,CAAC,UAAkB;QACrC,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE;YACtC,IAAI,CAAC,kBAAkB,GAAG,KAAK,CAAC;YAChC,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;YAElC,IAAI,IAAI,CAAC,YAAY,CAAC,IAAI,KAAK,CAAC,EAAE;gBAChC,IAAI,CAAC,iBAAiB,GAAG,UAAU,CAAC;aACrC;iBAAM;gBACL,IAAI,CAAC,iBAAiB,GAAG,SAAS,CAAC;aACpC;SACF;IACH,CAAC;IAED;;OAEG;IACI,UAAU;QACf,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;YAClB,IAAI,CAAC,QAAQ,GAAG,qBAAS,CAAC,4BAA4B,CAAC,IAAI,CAAC,WAAW,IAAI,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;SACtG;QACD,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;CACF;AAzJD,0CAyJC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\r\n// See LICENSE in the project root for license information.\r\n\r\nimport * as ts from 'typescript';\r\n\r\nimport { AstSymbol } from '../analyzer/AstSymbol';\r\nimport { Collector } from './Collector';\r\nimport { Sort } from '@rushstack/node-core-library';\r\nimport { AstEntity } from '../analyzer/AstEntity';\r\nimport { AstNamespaceImport } from '../analyzer/AstNamespaceImport';\r\n\r\n/**\r\n * This is a data structure used by the Collector to track an AstEntity that may be emitted in the *.d.ts file.\r\n *\r\n * @remarks\r\n * The additional contextual state beyond AstSymbol is:\r\n * - Whether it's an export of this entry point or not\r\n * - The nameForEmit, which may get renamed by DtsRollupGenerator._makeUniqueNames()\r\n * - The export name (or names, if the same symbol is exported multiple times)\r\n */\r\nexport class CollectorEntity {\r\n /**\r\n * The AstEntity that this entry represents.\r\n */\r\n public readonly astEntity: AstEntity;\r\n\r\n private _exportNames: Set<string> = new Set();\r\n private _exportNamesSorted: boolean = false;\r\n private _singleExportName: string | undefined = undefined;\r\n\r\n private _nameForEmit: string | undefined = undefined;\r\n\r\n private _sortKey: string | undefined = undefined;\r\n\r\n private _astNamespaceImports: Set<AstNamespaceImport> = new Set();\r\n\r\n public constructor(astEntity: AstEntity) {\r\n this.astEntity = astEntity;\r\n }\r\n\r\n /**\r\n * The declaration name that will be emitted in a .d.ts rollup. For non-exported declarations,\r\n * Collector._makeUniqueNames() may need to rename the declaration to avoid conflicts with other declarations\r\n * in that module.\r\n */\r\n public get nameForEmit(): string | undefined {\r\n return this._nameForEmit;\r\n }\r\n\r\n public set nameForEmit(value: string | undefined) {\r\n this._nameForEmit = value;\r\n this._sortKey = undefined; // invalidate the cached value\r\n }\r\n\r\n /**\r\n * If this symbol is exported from the entry point, the list of export names.\r\n *\r\n * @remarks\r\n * Note that a given symbol may be exported more than once:\r\n * ```\r\n * class X { }\r\n * export { X }\r\n * export { X as Y }\r\n * ```\r\n */\r\n public get exportNames(): ReadonlySet<string> {\r\n if (!this._exportNamesSorted) {\r\n Sort.sortSet(this._exportNames);\r\n this._exportNamesSorted = true;\r\n }\r\n return this._exportNames;\r\n }\r\n\r\n /**\r\n * If exportNames contains only one string, then singleExportName is that string.\r\n * In all other cases, it is undefined.\r\n */\r\n public get singleExportName(): string | undefined {\r\n return this._singleExportName;\r\n }\r\n\r\n /**\r\n * This is true if exportNames contains only one string, and the declaration can be exported using the inline syntax\r\n * such as \"export class X { }\" instead of \"export { X }\".\r\n */\r\n public get shouldInlineExport(): boolean {\r\n // We don't inline an AstImport\r\n if (this.astEntity instanceof AstSymbol) {\r\n // We don't inline a symbol with more than one exported name\r\n if (this._singleExportName !== undefined && this._singleExportName !== ts.InternalSymbolName.Default) {\r\n // We can't inline a symbol whose emitted name is different from the export name\r\n if (this._nameForEmit === undefined || this._nameForEmit === this._singleExportName) {\r\n return true;\r\n }\r\n }\r\n }\r\n return false;\r\n }\r\n\r\n /**\r\n * Returns true if this symbol is an export for the entry point being analyzed.\r\n */\r\n public get exported(): boolean {\r\n return this.exportNames.size > 0;\r\n }\r\n\r\n /**\r\n * Indicates that it is possible for a consumer of the API to access this declaration, either by importing\r\n * it directly, or via some other alias such as a member of a namespace. If a collector entity is not consumable,\r\n * then API Extractor will report a ExtractorMessageId.ForgottenExport warning.\r\n *\r\n * @remarks\r\n * Generally speaking, an API item is consumable if:\r\n *\r\n * - The collector encounters it while crawling the entry point, and it is a root symbol\r\n * (i.e. there is a corresponding a CollectorEntity)\r\n *\r\n * - AND it is exported by the entry point\r\n *\r\n * However a special case occurs with `AstNamespaceImport` which produces a rollup like this:\r\n *\r\n * ```ts\r\n * declare interface IForgottenExport { }\r\n *\r\n * declare function member(): IForgottenExport;\r\n *\r\n * declare namespace ns {\r\n * export {\r\n * member\r\n * }\r\n * }\r\n * export { ns }\r\n * ```\r\n *\r\n * In this example, `IForgottenExport` is not consumable. Whereas `member()` is consumable as `ns.member()`\r\n * even though `member()` itself is not exported.\r\n */\r\n public get consumable(): boolean {\r\n return this.exported || this._astNamespaceImports.size > 0;\r\n }\r\n\r\n /**\r\n * Associates this entity with a `AstNamespaceImport`.\r\n */\r\n public addAstNamespaceImports(astNamespaceImport: AstNamespaceImport): void {\r\n this._astNamespaceImports.add(astNamespaceImport);\r\n }\r\n\r\n /**\r\n * Adds a new exportName to the exportNames set.\r\n */\r\n public addExportName(exportName: string): void {\r\n if (!this._exportNames.has(exportName)) {\r\n this._exportNamesSorted = false;\r\n this._exportNames.add(exportName);\r\n\r\n if (this._exportNames.size === 1) {\r\n this._singleExportName = exportName;\r\n } else {\r\n this._singleExportName = undefined;\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * A sorting key used by DtsRollupGenerator._makeUniqueNames()\r\n */\r\n public getSortKey(): string {\r\n if (!this._sortKey) {\r\n this._sortKey = Collector.getSortKeyIgnoringUnderscore(this.nameForEmit || this.astEntity.localName);\r\n }\r\n return this._sortKey;\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"CollectorEntity.js","sourceRoot":"","sources":["../../src/collector/CollectorEntity.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;;;;;;;;;;;;;;;;;;;;AAE3D,+CAAiC;AAEjC,qDAAkD;AAClD,2CAAwC;AACxC,oEAAoD;AAIpD;;;;;;;;GAQG;AACH,MAAa,eAAe;IAgB1B,YAAmB,SAAoB;QAV/B,iBAAY,GAAgB,IAAI,GAAG,EAAE,CAAC;QACtC,uBAAkB,GAAY,KAAK,CAAC;QACpC,sBAAiB,GAAuB,SAAS,CAAC;QAElD,iBAAY,GAAuB,SAAS,CAAC;QAE7C,aAAQ,GAAuB,SAAS,CAAC;QAEzC,yBAAoB,GAA4B,IAAI,GAAG,EAAE,CAAC;QAGhE,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;IAC7B,CAAC;IAED;;;;OAIG;IACH,IAAW,WAAW;QACpB,OAAO,IAAI,CAAC,YAAY,CAAC;IAC3B,CAAC;IAED,IAAW,WAAW,CAAC,KAAyB;QAC9C,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC;QAC1B,IAAI,CAAC,QAAQ,GAAG,SAAS,CAAC,CAAC,8BAA8B;IAC3D,CAAC;IAED;;;;;;;;;;OAUG;IACH,IAAW,WAAW;QACpB,IAAI,CAAC,IAAI,CAAC,kBAAkB,EAAE;YAC5B,wBAAI,CAAC,OAAO,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;YAChC,IAAI,CAAC,kBAAkB,GAAG,IAAI,CAAC;SAChC;QACD,OAAO,IAAI,CAAC,YAAY,CAAC;IAC3B,CAAC;IAED;;;OAGG;IACH,IAAW,gBAAgB;QACzB,OAAO,IAAI,CAAC,iBAAiB,CAAC;IAChC,CAAC;IAED;;;OAGG;IACH,IAAW,kBAAkB;QAC3B,+BAA+B;QAC/B,IAAI,IAAI,CAAC,SAAS,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4BAA4B,CAAC,IAAI,CAAC,WAAW,IAAI,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;SACtG;QACD,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;CACF;AAzJD,0CAyJC","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 ts from 'typescript';\n\nimport { AstSymbol } from '../analyzer/AstSymbol';\nimport { Collector } from './Collector';\nimport { Sort } from '@rushstack/node-core-library';\nimport { AstEntity } from '../analyzer/AstEntity';\nimport { AstNamespaceImport } from '../analyzer/AstNamespaceImport';\n\n/**\n * This is a data structure used by the Collector to track an AstEntity that may be emitted in the *.d.ts file.\n *\n * @remarks\n * The additional contextual state beyond AstSymbol is:\n * - Whether it's an export of this entry point or not\n * - The nameForEmit, which may get renamed by DtsRollupGenerator._makeUniqueNames()\n * - The export name (or names, if the same symbol is exported multiple times)\n */\nexport class CollectorEntity {\n /**\n * The AstEntity that this entry represents.\n */\n public readonly astEntity: AstEntity;\n\n private _exportNames: Set<string> = new Set();\n private _exportNamesSorted: boolean = false;\n private _singleExportName: string | undefined = undefined;\n\n private _nameForEmit: string | undefined = undefined;\n\n private _sortKey: string | undefined = undefined;\n\n private _astNamespaceImports: Set<AstNamespaceImport> = new Set();\n\n public constructor(astEntity: AstEntity) {\n this.astEntity = astEntity;\n }\n\n /**\n * The declaration name that will be emitted in a .d.ts rollup. For non-exported declarations,\n * Collector._makeUniqueNames() may need to rename the declaration to avoid conflicts with other declarations\n * in that module.\n */\n public get nameForEmit(): string | undefined {\n return this._nameForEmit;\n }\n\n public set nameForEmit(value: string | undefined) {\n this._nameForEmit = value;\n this._sortKey = undefined; // invalidate the cached value\n }\n\n /**\n * If this symbol is exported from the entry point, the list of export names.\n *\n * @remarks\n * Note that a given symbol may be exported more than once:\n * ```\n * class X { }\n * export { X }\n * export { X as Y }\n * ```\n */\n public get exportNames(): ReadonlySet<string> {\n if (!this._exportNamesSorted) {\n Sort.sortSet(this._exportNames);\n this._exportNamesSorted = true;\n }\n return this._exportNames;\n }\n\n /**\n * If exportNames contains only one string, then singleExportName is that string.\n * In all other cases, it is undefined.\n */\n public get singleExportName(): string | undefined {\n return this._singleExportName;\n }\n\n /**\n * This is true if exportNames contains only one string, and the declaration can be exported using the inline syntax\n * such as \"export class X { }\" instead of \"export { X }\".\n */\n public get shouldInlineExport(): boolean {\n // We don't inline an AstImport\n if (this.astEntity instanceof AstSymbol) {\n // We don't inline a symbol with more than one exported name\n if (this._singleExportName !== undefined && this._singleExportName !== ts.InternalSymbolName.Default) {\n // We can't inline a symbol whose emitted name is different from the export name\n if (this._nameForEmit === undefined || this._nameForEmit === this._singleExportName) {\n return true;\n }\n }\n }\n return false;\n }\n\n /**\n * Returns true if this symbol is an export for the entry point being analyzed.\n */\n public get exported(): boolean {\n return this.exportNames.size > 0;\n }\n\n /**\n * Indicates that it is possible for a consumer of the API to access this declaration, either by importing\n * it directly, or via some other alias such as a member of a namespace. If a collector entity is not consumable,\n * then API Extractor will report a ExtractorMessageId.ForgottenExport warning.\n *\n * @remarks\n * Generally speaking, an API item is consumable if:\n *\n * - The collector encounters it while crawling the entry point, and it is a root symbol\n * (i.e. there is a corresponding a CollectorEntity)\n *\n * - AND it is exported by the entry point\n *\n * However a special case occurs with `AstNamespaceImport` which produces a rollup like this:\n *\n * ```ts\n * declare interface IForgottenExport { }\n *\n * declare function member(): IForgottenExport;\n *\n * declare namespace ns {\n * export {\n * member\n * }\n * }\n * export { ns }\n * ```\n *\n * In this example, `IForgottenExport` is not consumable. Whereas `member()` is consumable as `ns.member()`\n * even though `member()` itself is not exported.\n */\n public get consumable(): boolean {\n return this.exported || this._astNamespaceImports.size > 0;\n }\n\n /**\n * Associates this entity with a `AstNamespaceImport`.\n */\n public addAstNamespaceImports(astNamespaceImport: AstNamespaceImport): void {\n this._astNamespaceImports.add(astNamespaceImport);\n }\n\n /**\n * Adds a new exportName to the exportNames set.\n */\n public addExportName(exportName: string): void {\n if (!this._exportNames.has(exportName)) {\n this._exportNamesSorted = false;\n this._exportNames.add(exportName);\n\n if (this._exportNames.size === 1) {\n this._singleExportName = exportName;\n } else {\n this._singleExportName = undefined;\n }\n }\n }\n\n /**\n * A sorting key used by DtsRollupGenerator._makeUniqueNames()\n */\n public getSortKey(): string {\n if (!this._sortKey) {\n this._sortKey = Collector.getSortKeyIgnoringUnderscore(this.nameForEmit || this.astEntity.localName);\n }\n return this._sortKey;\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"DeclarationMetadata.js","sourceRoot":"","sources":["../../src/collector/DeclarationMetadata.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAK3D;;;;;;;GAOG;AACH,MAAsB,mBAAmB;CAuBxC;AAvBD,kDAuBC;AAED;;GAEG;AACH,MAAa,2BAA4B,SAAQ,mBAAmB;IAApE;;QACS,uBAAkB,GAAoC,SAAS,CAAC;QAEhE,gBAAW,GAAY,KAAK,CAAC;QAE7B,0BAAqB,GAAqB,EAAE,CAAC;IACtD,CAAC;CAAA;AAND,kEAMC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\r\n// See LICENSE in the project root for license information.\r\n\r\nimport * as tsdoc from '@microsoft/tsdoc';\r\nimport { AstDeclaration } from '../analyzer/AstDeclaration';\r\n\r\n/**\r\n * Stores the Collector's additional analysis for a specific `AstDeclaration` signature. This object is assigned to\r\n * `AstDeclaration.declarationMetadata` but consumers must always obtain it by calling\r\n * `Collector.fetchDeclarationMetadata()`.\r\n *\r\n * Note that ancillary declarations share their `ApiItemMetadata` with the main declaration,\r\n * whereas a separate `DeclarationMetadata` object is created for each declaration.\r\n */\r\nexport abstract class DeclarationMetadata {\r\n /**\r\n * The ParserContext from when the TSDoc comment was parsed from the source code.\r\n * If the source code did not contain a doc comment, then this will be undefined.\r\n *\r\n * Note that if an ancillary declaration has a doc comment, it is tracked here, whereas\r\n * `ApiItemMetadata.tsdocComment` corresponds to documentation for the main declaration.\r\n */\r\n public abstract readonly tsdocParserContext: tsdoc.ParserContext | undefined;\r\n\r\n /**\r\n * If true, then this declaration is treated as part of another declaration.\r\n */\r\n public abstract readonly isAncillary: boolean;\r\n\r\n /**\r\n * A list of other declarations that are treated as being part of this declaration. For example, a property\r\n * getter/setter pair will be treated as a single API item, with the setter being treated as ancillary to the getter.\r\n *\r\n * If the `ancillaryDeclarations` array is non-empty, then `isAncillary` will be false for this declaration,\r\n * and `isAncillary` will be true for all the array items.\r\n */\r\n public abstract readonly ancillaryDeclarations: ReadonlyArray<AstDeclaration>;\r\n}\r\n\r\n/**\r\n * Used internally by the `Collector` to build up `DeclarationMetadata`.\r\n */\r\nexport class InternalDeclarationMetadata extends DeclarationMetadata {\r\n public tsdocParserContext: tsdoc.ParserContext | undefined = undefined;\r\n\r\n public isAncillary: boolean = false;\r\n\r\n public ancillaryDeclarations: AstDeclaration[] = [];\r\n}\r\n"]}
1
+ {"version":3,"file":"DeclarationMetadata.js","sourceRoot":"","sources":["../../src/collector/DeclarationMetadata.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAK3D;;;;;;;GAOG;AACH,MAAsB,mBAAmB;CAuBxC;AAvBD,kDAuBC;AAED;;GAEG;AACH,MAAa,2BAA4B,SAAQ,mBAAmB;IAApE;;QACS,uBAAkB,GAAoC,SAAS,CAAC;QAEhE,gBAAW,GAAY,KAAK,CAAC;QAE7B,0BAAqB,GAAqB,EAAE,CAAC;IACtD,CAAC;CAAA;AAND,kEAMC","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 tsdoc from '@microsoft/tsdoc';\nimport { AstDeclaration } from '../analyzer/AstDeclaration';\n\n/**\n * Stores the Collector's additional analysis for a specific `AstDeclaration` signature. This object is assigned to\n * `AstDeclaration.declarationMetadata` but consumers must always obtain it by calling\n * `Collector.fetchDeclarationMetadata()`.\n *\n * Note that ancillary declarations share their `ApiItemMetadata` with the main declaration,\n * whereas a separate `DeclarationMetadata` object is created for each declaration.\n */\nexport abstract class DeclarationMetadata {\n /**\n * The ParserContext from when the TSDoc comment was parsed from the source code.\n * If the source code did not contain a doc comment, then this will be undefined.\n *\n * Note that if an ancillary declaration has a doc comment, it is tracked here, whereas\n * `ApiItemMetadata.tsdocComment` corresponds to documentation for the main declaration.\n */\n public abstract readonly tsdocParserContext: tsdoc.ParserContext | undefined;\n\n /**\n * If true, then this declaration is treated as part of another declaration.\n */\n public abstract readonly isAncillary: boolean;\n\n /**\n * A list of other declarations that are treated as being part of this declaration. For example, a property\n * getter/setter pair will be treated as a single API item, with the setter being treated as ancillary to the getter.\n *\n * If the `ancillaryDeclarations` array is non-empty, then `isAncillary` will be false for this declaration,\n * and `isAncillary` will be true for all the array items.\n */\n public abstract readonly ancillaryDeclarations: ReadonlyArray<AstDeclaration>;\n}\n\n/**\n * Used internally by the `Collector` to build up `DeclarationMetadata`.\n */\nexport class InternalDeclarationMetadata extends DeclarationMetadata {\n public tsdocParserContext: tsdoc.ParserContext | undefined = undefined;\n\n public isAncillary: boolean = false;\n\n public ancillaryDeclarations: AstDeclaration[] = [];\n}\n"]}