tsc-ts 0.0.3 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +46 -0
- package/dist/api/compiler/ast-utilities.d.ts +82 -0
- package/dist/api/compiler/ast-utilities.js +462 -0
- package/dist/api/compiler/ast.d.ts +2350 -0
- package/dist/api/compiler/ast.js +11206 -0
- package/dist/api/compiler/astnav.d.ts +37 -0
- package/dist/api/compiler/astnav.js +767 -0
- package/dist/api/compiler/binder-utilities.d.ts +182 -0
- package/dist/api/compiler/binder-utilities.js +1240 -0
- package/dist/api/compiler/binder.d.ts +33 -0
- package/dist/api/compiler/binder.js +2358 -0
- package/dist/api/compiler/character-codes.d.ts +161 -0
- package/dist/api/compiler/character-codes.js +160 -0
- package/dist/api/compiler/checker-calls.d.ts +46 -0
- package/dist/api/compiler/checker-calls.js +1640 -0
- package/dist/api/compiler/checker-classes.d.ts +30 -0
- package/dist/api/compiler/checker-classes.js +582 -0
- package/dist/api/compiler/checker-contextual.d.ts +77 -0
- package/dist/api/compiler/checker-contextual.js +1136 -0
- package/dist/api/compiler/checker-declaration-order.d.ts +12 -0
- package/dist/api/compiler/checker-declaration-order.js +356 -0
- package/dist/api/compiler/checker-declarations.d.ts +33 -0
- package/dist/api/compiler/checker-declarations.js +888 -0
- package/dist/api/compiler/checker-declared-types.d.ts +48 -0
- package/dist/api/compiler/checker-declared-types.js +787 -0
- package/dist/api/compiler/checker-decorators.d.ts +26 -0
- package/dist/api/compiler/checker-decorators.js +562 -0
- package/dist/api/compiler/checker-deprecation.d.ts +33 -0
- package/dist/api/compiler/checker-deprecation.js +315 -0
- package/dist/api/compiler/checker-destructuring.d.ts +34 -0
- package/dist/api/compiler/checker-destructuring.js +584 -0
- package/dist/api/compiler/checker-elaboration.d.ts +15 -0
- package/dist/api/compiler/checker-elaboration.js +290 -0
- package/dist/api/compiler/checker-emit-helpers.d.ts +58 -0
- package/dist/api/compiler/checker-emit-helpers.js +154 -0
- package/dist/api/compiler/checker-emit-resolver.d.ts +75 -0
- package/dist/api/compiler/checker-emit-resolver.js +579 -0
- package/dist/api/compiler/checker-evaluator.d.ts +27 -0
- package/dist/api/compiler/checker-evaluator.js +188 -0
- package/dist/api/compiler/checker-expressions.d.ts +67 -0
- package/dist/api/compiler/checker-expressions.js +1351 -0
- package/dist/api/compiler/checker-features.d.ts +6 -0
- package/dist/api/compiler/checker-features.js +354 -0
- package/dist/api/compiler/checker-flow.d.ts +86 -0
- package/dist/api/compiler/checker-flow.js +169 -0
- package/dist/api/compiler/checker-functions.d.ts +43 -0
- package/dist/api/compiler/checker-functions.js +1002 -0
- package/dist/api/compiler/checker-generated-code.d.ts +25 -0
- package/dist/api/compiler/checker-generated-code.js +168 -0
- package/dist/api/compiler/checker-globals.d.ts +14 -0
- package/dist/api/compiler/checker-globals.js +37 -0
- package/dist/api/compiler/checker-grammar.d.ts +35 -0
- package/dist/api/compiler/checker-grammar.js +2573 -0
- package/dist/api/compiler/checker-heritage.d.ts +28 -0
- package/dist/api/compiler/checker-heritage.js +900 -0
- package/dist/api/compiler/checker-inference.d.ts +179 -0
- package/dist/api/compiler/checker-inference.js +2105 -0
- package/dist/api/compiler/checker-iteration.d.ts +115 -0
- package/dist/api/compiler/checker-iteration.js +857 -0
- package/dist/api/compiler/checker-javascript.d.ts +42 -0
- package/dist/api/compiler/checker-javascript.js +441 -0
- package/dist/api/compiler/checker-jsdoc.d.ts +30 -0
- package/dist/api/compiler/checker-jsdoc.js +320 -0
- package/dist/api/compiler/checker-jsx.d.ts +94 -0
- package/dist/api/compiler/checker-jsx.js +1433 -0
- package/dist/api/compiler/checker-literals.d.ts +6 -0
- package/dist/api/compiler/checker-literals.js +43 -0
- package/dist/api/compiler/checker-members.d.ts +198 -0
- package/dist/api/compiler/checker-members.js +2126 -0
- package/dist/api/compiler/checker-modules.d.ts +85 -0
- package/dist/api/compiler/checker-modules.js +2141 -0
- package/dist/api/compiler/checker-narrowing.d.ts +120 -0
- package/dist/api/compiler/checker-narrowing.js +2797 -0
- package/dist/api/compiler/checker-object-literals.d.ts +14 -0
- package/dist/api/compiler/checker-object-literals.js +479 -0
- package/dist/api/compiler/checker-operators.d.ts +33 -0
- package/dist/api/compiler/checker-operators.js +1040 -0
- package/dist/api/compiler/checker-overloads.d.ts +7 -0
- package/dist/api/compiler/checker-overloads.js +270 -0
- package/dist/api/compiler/checker-property-access.d.ts +34 -0
- package/dist/api/compiler/checker-property-access.js +672 -0
- package/dist/api/compiler/checker-services.d.ts +49 -0
- package/dist/api/compiler/checker-services.js +995 -0
- package/dist/api/compiler/checker-signatures.d.ts +55 -0
- package/dist/api/compiler/checker-signatures.js +788 -0
- package/dist/api/compiler/checker-source-file.d.ts +27 -0
- package/dist/api/compiler/checker-source-file.js +619 -0
- package/dist/api/compiler/checker-statements.d.ts +18 -0
- package/dist/api/compiler/checker-statements.js +226 -0
- package/dist/api/compiler/checker-super.d.ts +13 -0
- package/dist/api/compiler/checker-super.js +241 -0
- package/dist/api/compiler/checker-symbol-types.d.ts +67 -0
- package/dist/api/compiler/checker-symbol-types.js +1885 -0
- package/dist/api/compiler/checker-symbols.d.ts +181 -0
- package/dist/api/compiler/checker-symbols.js +1782 -0
- package/dist/api/compiler/checker-type-factory.d.ts +142 -0
- package/dist/api/compiler/checker-type-factory.js +2501 -0
- package/dist/api/compiler/checker-type-nodes.d.ts +26 -0
- package/dist/api/compiler/checker-type-nodes.js +828 -0
- package/dist/api/compiler/checker-type-operators.d.ts +109 -0
- package/dist/api/compiler/checker-type-operators.js +1842 -0
- package/dist/api/compiler/checker-types.d.ts +1027 -0
- package/dist/api/compiler/checker-types.js +1697 -0
- package/dist/api/compiler/checker-unused.d.ts +19 -0
- package/dist/api/compiler/checker-unused.js +524 -0
- package/dist/api/compiler/checker-utilities.d.ts +33 -0
- package/dist/api/compiler/checker-utilities.js +141 -0
- package/dist/api/compiler/checker.d.ts +491 -0
- package/dist/api/compiler/checker.js +912 -0
- package/dist/api/compiler/command-line.d.ts +32 -0
- package/dist/api/compiler/command-line.js +383 -0
- package/dist/api/compiler/compile-program.d.ts +118 -0
- package/dist/api/compiler/compile-program.js +384 -0
- package/dist/api/compiler/diagnostic-locales.d.ts +22 -0
- package/dist/api/compiler/diagnostic-locales.js +64 -0
- package/dist/api/compiler/diagnostic-messages.d.ts +2166 -0
- package/dist/api/compiler/diagnostic-messages.js +184 -0
- package/dist/api/compiler/diagnostics.d.ts +167 -0
- package/dist/api/compiler/diagnostics.js +820 -0
- package/dist/api/compiler/emitter.d.ts +71 -0
- package/dist/api/compiler/emitter.js +327 -0
- package/dist/api/compiler/file-include.d.ts +117 -0
- package/dist/api/compiler/file-include.js +536 -0
- package/dist/api/compiler/file-loader.d.ts +261 -0
- package/dist/api/compiler/file-loader.js +1257 -0
- package/dist/api/compiler/file-system.d.ts +51 -0
- package/dist/api/compiler/file-system.js +132 -0
- package/dist/api/compiler/flow.d.ts +60 -0
- package/dist/api/compiler/flow.js +45 -0
- package/dist/api/compiler/instantiation.d.ts +74 -0
- package/dist/api/compiler/instantiation.js +799 -0
- package/dist/api/compiler/jsdoc.d.ts +75 -0
- package/dist/api/compiler/jsdoc.js +1229 -0
- package/dist/api/compiler/link-tables.d.ts +36 -0
- package/dist/api/compiler/link-tables.js +83 -0
- package/dist/api/compiler/locale-data.d.ts +24 -0
- package/dist/api/compiler/locale-data.js +183 -0
- package/dist/api/compiler/locale.d.ts +4 -0
- package/dist/api/compiler/locale.js +317 -0
- package/dist/api/compiler/locales/cs-CZ.d.ts +2 -0
- package/dist/api/compiler/locales/cs-CZ.js +3 -0
- package/dist/api/compiler/locales/de-DE.d.ts +2 -0
- package/dist/api/compiler/locales/de-DE.js +3 -0
- package/dist/api/compiler/locales/es-ES.d.ts +2 -0
- package/dist/api/compiler/locales/es-ES.js +3 -0
- package/dist/api/compiler/locales/fr-FR.d.ts +2 -0
- package/dist/api/compiler/locales/fr-FR.js +3 -0
- package/dist/api/compiler/locales/it-IT.d.ts +2 -0
- package/dist/api/compiler/locales/it-IT.js +3 -0
- package/dist/api/compiler/locales/ja-JP.d.ts +2 -0
- package/dist/api/compiler/locales/ja-JP.js +3 -0
- package/dist/api/compiler/locales/ko-KR.d.ts +2 -0
- package/dist/api/compiler/locales/ko-KR.js +3 -0
- package/dist/api/compiler/locales/pl-PL.d.ts +2 -0
- package/dist/api/compiler/locales/pl-PL.js +3 -0
- package/dist/api/compiler/locales/pt-BR.d.ts +2 -0
- package/dist/api/compiler/locales/pt-BR.js +3 -0
- package/dist/api/compiler/locales/ru-RU.d.ts +2 -0
- package/dist/api/compiler/locales/ru-RU.js +3 -0
- package/dist/api/compiler/locales/tr-TR.d.ts +2 -0
- package/dist/api/compiler/locales/tr-TR.js +3 -0
- package/dist/api/compiler/locales/zh-CN.d.ts +2 -0
- package/dist/api/compiler/locales/zh-CN.js +3 -0
- package/dist/api/compiler/locales/zh-TW.d.ts +2 -0
- package/dist/api/compiler/locales/zh-TW.js +3 -0
- package/dist/api/compiler/module-resolution-types.d.ts +83 -0
- package/dist/api/compiler/module-resolution-types.js +176 -0
- package/dist/api/compiler/module-resolution.d.ts +71 -0
- package/dist/api/compiler/module-resolution.js +1598 -0
- package/dist/api/compiler/module-specifiers.d.ts +64 -0
- package/dist/api/compiler/module-specifiers.js +1101 -0
- package/dist/api/compiler/name-resolver.d.ts +43 -0
- package/dist/api/compiler/name-resolver.js +509 -0
- package/dist/api/compiler/node-builder-names.d.ts +32 -0
- package/dist/api/compiler/node-builder-names.js +854 -0
- package/dist/api/compiler/node-builder-pseudo.d.ts +36 -0
- package/dist/api/compiler/node-builder-pseudo.js +744 -0
- package/dist/api/compiler/node-builder-reuse.d.ts +4 -0
- package/dist/api/compiler/node-builder-reuse.js +647 -0
- package/dist/api/compiler/node-builder.d.ts +270 -0
- package/dist/api/compiler/node-builder.js +2645 -0
- package/dist/api/compiler/option-declarations.d.ts +90 -0
- package/dist/api/compiler/option-declarations.js +1460 -0
- package/dist/api/compiler/options.d.ts +289 -0
- package/dist/api/compiler/options.js +1197 -0
- package/dist/api/compiler/output-paths.d.ts +42 -0
- package/dist/api/compiler/output-paths.js +195 -0
- package/dist/api/compiler/package-json.d.ts +175 -0
- package/dist/api/compiler/package-json.js +1015 -0
- package/dist/api/compiler/parallel-parse.d.ts +219 -0
- package/dist/api/compiler/parallel-parse.js +537 -0
- package/dist/api/compiler/parser.d.ts +587 -0
- package/dist/api/compiler/parser.js +6407 -0
- package/dist/api/compiler/path.d.ts +91 -0
- package/dist/api/compiler/path.js +705 -0
- package/dist/api/compiler/printer/async-helpers.d.ts +22 -0
- package/dist/api/compiler/printer/async-helpers.js +91 -0
- package/dist/api/compiler/printer/auto-generate.d.ts +13 -0
- package/dist/api/compiler/printer/auto-generate.js +20 -0
- package/dist/api/compiler/printer/decorator-helpers.d.ts +24 -0
- package/dist/api/compiler/printer/decorator-helpers.js +118 -0
- package/dist/api/compiler/printer/emit-context.d.ts +154 -0
- package/dist/api/compiler/printer/emit-context.js +576 -0
- package/dist/api/compiler/printer/emit-flags.d.ts +60 -0
- package/dist/api/compiler/printer/emit-flags.js +2 -0
- package/dist/api/compiler/printer/factory-base.d.ts +171 -0
- package/dist/api/compiler/printer/factory-base.js +1505 -0
- package/dist/api/compiler/printer/factory.d.ts +147 -0
- package/dist/api/compiler/printer/factory.js +542 -0
- package/dist/api/compiler/printer/helpers.d.ts +27 -0
- package/dist/api/compiler/printer/helpers.js +164 -0
- package/dist/api/compiler/printer/name-generator.d.ts +41 -0
- package/dist/api/compiler/printer/name-generator.js +283 -0
- package/dist/api/compiler/printer/printer.d.ts +411 -0
- package/dist/api/compiler/printer/printer.js +4517 -0
- package/dist/api/compiler/printer/text-writer.d.ts +46 -0
- package/dist/api/compiler/printer/text-writer.js +172 -0
- package/dist/api/compiler/printer/utilities.d.ts +82 -0
- package/dist/api/compiler/printer/utilities.js +817 -0
- package/dist/api/compiler/program-checker.d.ts +156 -0
- package/dist/api/compiler/program-checker.js +526 -0
- package/dist/api/compiler/program-utilities.d.ts +52 -0
- package/dist/api/compiler/program-utilities.js +365 -0
- package/dist/api/compiler/program.d.ts +180 -0
- package/dist/api/compiler/program.js +1011 -0
- package/dist/api/compiler/pseudo-bigint.d.ts +5 -0
- package/dist/api/compiler/pseudo-bigint.js +61 -0
- package/dist/api/compiler/regexp-checker.d.ts +38 -0
- package/dist/api/compiler/regexp-checker.js +942 -0
- package/dist/api/compiler/relations.d.ts +263 -0
- package/dist/api/compiler/relations.js +4002 -0
- package/dist/api/compiler/reparser.d.ts +48 -0
- package/dist/api/compiler/reparser.js +1323 -0
- package/dist/api/compiler/scanner.d.ts +256 -0
- package/dist/api/compiler/scanner.js +2853 -0
- package/dist/api/compiler/side-state.d.ts +16 -0
- package/dist/api/compiler/side-state.js +89 -0
- package/dist/api/compiler/sourcemap.d.ts +55 -0
- package/dist/api/compiler/sourcemap.js +340 -0
- package/dist/api/compiler/spelling.d.ts +14 -0
- package/dist/api/compiler/spelling.js +128 -0
- package/dist/api/compiler/symbol-accessibility.d.ts +57 -0
- package/dist/api/compiler/symbol-accessibility.js +894 -0
- package/dist/api/compiler/symbol.d.ts +240 -0
- package/dist/api/compiler/symbol.js +228 -0
- package/dist/api/compiler/symlinks.d.ts +32 -0
- package/dist/api/compiler/symlinks.js +114 -0
- package/dist/api/compiler/syntax-kind.d.ts +389 -0
- package/dist/api/compiler/syntax-kind.js +2 -0
- package/dist/api/compiler/timeline.d.ts +9 -0
- package/dist/api/compiler/timeline.js +54 -0
- package/dist/api/compiler/transformers/alias-references.d.ts +39 -0
- package/dist/api/compiler/transformers/alias-references.js +676 -0
- package/dist/api/compiler/transformers/async-utilities.d.ts +51 -0
- package/dist/api/compiler/transformers/async-utilities.js +260 -0
- package/dist/api/compiler/transformers/async.d.ts +53 -0
- package/dist/api/compiler/transformers/async.js +645 -0
- package/dist/api/compiler/transformers/class-fields.d.ts +206 -0
- package/dist/api/compiler/transformers/class-fields.js +2418 -0
- package/dist/api/compiler/transformers/class-utilities.d.ts +46 -0
- package/dist/api/compiler/transformers/class-utilities.js +261 -0
- package/dist/api/compiler/transformers/commonjs-module.d.ts +103 -0
- package/dist/api/compiler/transformers/commonjs-module.js +1180 -0
- package/dist/api/compiler/transformers/const-enum-inliner.d.ts +11 -0
- package/dist/api/compiler/transformers/const-enum-inliner.js +36 -0
- package/dist/api/compiler/transformers/declarations-diagnostics.d.ts +52 -0
- package/dist/api/compiler/transformers/declarations-diagnostics.js +538 -0
- package/dist/api/compiler/transformers/declarations-pseudo.d.ts +160 -0
- package/dist/api/compiler/transformers/declarations-pseudo.js +797 -0
- package/dist/api/compiler/transformers/declarations-resolver.d.ts +152 -0
- package/dist/api/compiler/transformers/declarations-resolver.js +35 -0
- package/dist/api/compiler/transformers/declarations-syntactic.d.ts +119 -0
- package/dist/api/compiler/transformers/declarations-syntactic.js +1582 -0
- package/dist/api/compiler/transformers/declarations-tracker.d.ts +46 -0
- package/dist/api/compiler/transformers/declarations-tracker.js +197 -0
- package/dist/api/compiler/transformers/declarations.d.ts +175 -0
- package/dist/api/compiler/transformers/declarations.js +2380 -0
- package/dist/api/compiler/transformers/decorator-metadata.d.ts +54 -0
- package/dist/api/compiler/transformers/decorator-metadata.js +554 -0
- package/dist/api/compiler/transformers/decorator-utilities.d.ts +38 -0
- package/dist/api/compiler/transformers/decorator-utilities.js +238 -0
- package/dist/api/compiler/transformers/destructuring.d.ts +25 -0
- package/dist/api/compiler/transformers/destructuring.js +626 -0
- package/dist/api/compiler/transformers/downlevel.d.ts +6 -0
- package/dist/api/compiler/transformers/downlevel.js +45 -0
- package/dist/api/compiler/transformers/emit-resolver.d.ts +61 -0
- package/dist/api/compiler/transformers/emit-resolver.js +197 -0
- package/dist/api/compiler/transformers/es-decorators.d.ts +118 -0
- package/dist/api/compiler/transformers/es-decorators.js +1901 -0
- package/dist/api/compiler/transformers/exponentiation.d.ts +11 -0
- package/dist/api/compiler/transformers/exponentiation.js +76 -0
- package/dist/api/compiler/transformers/external-module-info.d.ts +35 -0
- package/dist/api/compiler/transformers/external-module-info.js +351 -0
- package/dist/api/compiler/transformers/for-await.d.ts +43 -0
- package/dist/api/compiler/transformers/for-await.js +469 -0
- package/dist/api/compiler/transformers/import-elision.d.ts +16 -0
- package/dist/api/compiler/transformers/import-elision.js +124 -0
- package/dist/api/compiler/transformers/jsx-entities.d.ts +1 -0
- package/dist/api/compiler/transformers/jsx-entities.js +256 -0
- package/dist/api/compiler/transformers/jsx.d.ts +71 -0
- package/dist/api/compiler/transformers/jsx.js +700 -0
- package/dist/api/compiler/transformers/legacy-decorators.d.ts +56 -0
- package/dist/api/compiler/transformers/legacy-decorators.js +564 -0
- package/dist/api/compiler/transformers/logical-assignment.d.ts +14 -0
- package/dist/api/compiler/transformers/logical-assignment.js +62 -0
- package/dist/api/compiler/transformers/module-utilities.d.ts +9 -0
- package/dist/api/compiler/transformers/module-utilities.js +36 -0
- package/dist/api/compiler/transformers/module.d.ts +49 -0
- package/dist/api/compiler/transformers/module.js +296 -0
- package/dist/api/compiler/transformers/named-evaluation.d.ts +26 -0
- package/dist/api/compiler/transformers/named-evaluation.js +266 -0
- package/dist/api/compiler/transformers/nullish-coalescing.d.ts +9 -0
- package/dist/api/compiler/transformers/nullish-coalescing.js +26 -0
- package/dist/api/compiler/transformers/object-rest-spread.d.ts +34 -0
- package/dist/api/compiler/transformers/object-rest-spread.js +411 -0
- package/dist/api/compiler/transformers/optional-catch.d.ts +9 -0
- package/dist/api/compiler/transformers/optional-catch.js +20 -0
- package/dist/api/compiler/transformers/optional-chain.d.ts +14 -0
- package/dist/api/compiler/transformers/optional-chain.js +188 -0
- package/dist/api/compiler/transformers/reference-resolver.d.ts +128 -0
- package/dist/api/compiler/transformers/reference-resolver.js +1155 -0
- package/dist/api/compiler/transformers/runtime-syntax.d.ts +71 -0
- package/dist/api/compiler/transformers/runtime-syntax.js +753 -0
- package/dist/api/compiler/transformers/subtree-facts.d.ts +9 -0
- package/dist/api/compiler/transformers/subtree-facts.js +203 -0
- package/dist/api/compiler/transformers/syntax-facts.d.ts +51 -0
- package/dist/api/compiler/transformers/syntax-facts.js +254 -0
- package/dist/api/compiler/transformers/tagged-template.d.ts +17 -0
- package/dist/api/compiler/transformers/tagged-template.js +148 -0
- package/dist/api/compiler/transformers/transformer.d.ts +17 -0
- package/dist/api/compiler/transformers/transformer.js +54 -0
- package/dist/api/compiler/transformers/type-eraser.d.ts +21 -0
- package/dist/api/compiler/transformers/type-eraser.js +346 -0
- package/dist/api/compiler/transformers/type-serialization.d.ts +20 -0
- package/dist/api/compiler/transformers/type-serialization.js +347 -0
- package/dist/api/compiler/transformers/using.d.ts +56 -0
- package/dist/api/compiler/transformers/using.js +453 -0
- package/dist/api/compiler/transformers/utilities.d.ts +50 -0
- package/dist/api/compiler/transformers/utilities.js +347 -0
- package/dist/api/compiler/transformers/visitor-base.d.ts +6 -0
- package/dist/api/compiler/transformers/visitor-base.js +817 -0
- package/dist/api/compiler/transformers/visitor-hooks.d.ts +29 -0
- package/dist/api/compiler/transformers/visitor-hooks.js +189 -0
- package/dist/api/compiler/tsconfig.d.ts +177 -0
- package/dist/api/compiler/tsconfig.js +1311 -0
- package/dist/api/compiler/type-printer.d.ts +15 -0
- package/dist/api/compiler/type-printer.js +74 -0
- package/dist/api/compiler/types.d.ts +87 -0
- package/dist/api/compiler/types.js +23 -0
- package/dist/api/compiler/unicode-identifiers.d.ts +2 -0
- package/dist/api/compiler/unicode-identifiers.js +209 -0
- package/dist/api/compiler/unicode-properties.d.ts +8 -0
- package/dist/api/compiler/unicode-properties.js +531 -0
- package/dist/api/compiler/vfs-match.d.ts +24 -0
- package/dist/api/compiler/vfs-match.js +587 -0
- package/dist/api/library/ast.d.ts +74 -0
- package/dist/api/library/ast.generated.d.ts +1145 -0
- package/dist/api/library/ast.generated.js +3 -0
- package/dist/api/library/ast.js +5 -0
- package/dist/api/library/checker.d.ts +51 -0
- package/dist/api/library/checker.js +318 -0
- package/dist/api/library/compiler-options.generated.d.ts +108 -0
- package/dist/api/library/compiler-options.generated.js +3 -0
- package/dist/api/library/diagnostics.d.ts +13 -0
- package/dist/api/library/diagnostics.js +50 -0
- package/dist/api/library/disk.d.ts +13 -0
- package/dist/api/library/disk.js +66 -0
- package/dist/api/library/enums.generated.d.ts +891 -0
- package/dist/api/library/enums.generated.js +916 -0
- package/dist/api/library/errors.d.ts +13 -0
- package/dist/api/library/errors.js +24 -0
- package/dist/api/library/host.d.ts +24 -0
- package/dist/api/library/host.js +52 -0
- package/dist/api/library/index.d.ts +14 -0
- package/dist/api/library/index.js +15 -0
- package/dist/api/library/nodes.d.ts +51 -0
- package/dist/api/library/nodes.js +196 -0
- package/dist/api/library/options.d.ts +144 -0
- package/dist/api/library/options.js +308 -0
- package/dist/api/library/parse.d.ts +19 -0
- package/dist/api/library/parse.js +41 -0
- package/dist/api/library/program.d.ts +21 -0
- package/dist/api/library/program.js +234 -0
- package/dist/api/library/symbols.d.ts +8 -0
- package/dist/api/library/symbols.js +11 -0
- package/dist/api/library/types.d.ts +313 -0
- package/dist/api/library/types.js +6 -0
- package/package.json +22 -8
- package/src/compiler/ast-utilities.ts +548 -0
- package/src/compiler/ast.ts +12862 -0
- package/src/compiler/astnav.ts +799 -0
- package/src/compiler/binder-utilities.ts +1392 -0
- package/src/compiler/binder.ts +2703 -0
- package/src/compiler/build-info.ts +1197 -0
- package/src/compiler/character-codes.ts +323 -0
- package/src/compiler/checker-calls.ts +2155 -0
- package/src/compiler/checker-classes.ts +706 -0
- package/src/compiler/checker-contextual.ts +1457 -0
- package/src/compiler/checker-declaration-order.ts +438 -0
- package/src/compiler/checker-declarations.ts +1194 -0
- package/src/compiler/checker-declared-types.ts +919 -0
- package/src/compiler/checker-decorators.ts +694 -0
- package/src/compiler/checker-deprecation.ts +359 -0
- package/src/compiler/checker-destructuring.ts +805 -0
- package/src/compiler/checker-elaboration.ts +477 -0
- package/src/compiler/checker-emit-helpers.ts +224 -0
- package/src/compiler/checker-emit-resolver.ts +769 -0
- package/src/compiler/checker-evaluator.ts +243 -0
- package/src/compiler/checker-expressions.ts +1831 -0
- package/src/compiler/checker-features.ts +361 -0
- package/src/compiler/checker-flow.ts +394 -0
- package/src/compiler/checker-functions.ts +1296 -0
- package/src/compiler/checker-generated-code.ts +227 -0
- package/src/compiler/checker-globals.ts +52 -0
- package/src/compiler/checker-grammar.ts +3584 -0
- package/src/compiler/checker-heritage.ts +1233 -0
- package/src/compiler/checker-inference.ts +2576 -0
- package/src/compiler/checker-iteration.ts +1206 -0
- package/src/compiler/checker-javascript.ts +502 -0
- package/src/compiler/checker-jsdoc.ts +360 -0
- package/src/compiler/checker-jsx.ts +1924 -0
- package/src/compiler/checker-literals.ts +61 -0
- package/src/compiler/checker-members.ts +2436 -0
- package/src/compiler/checker-modules.ts +2886 -0
- package/src/compiler/checker-narrowing.ts +3230 -0
- package/src/compiler/checker-object-literals.ts +575 -0
- package/src/compiler/checker-operators.ts +1422 -0
- package/src/compiler/checker-overloads.ts +328 -0
- package/src/compiler/checker-property-access.ts +906 -0
- package/src/compiler/checker-services.ts +1149 -0
- package/src/compiler/checker-signatures.ts +1032 -0
- package/src/compiler/checker-source-file.ts +732 -0
- package/src/compiler/checker-statements.ts +292 -0
- package/src/compiler/checker-super.ts +261 -0
- package/src/compiler/checker-symbol-types.ts +2107 -0
- package/src/compiler/checker-symbols.ts +2150 -0
- package/src/compiler/checker-type-factory.ts +2579 -0
- package/src/compiler/checker-type-nodes.ts +1033 -0
- package/src/compiler/checker-type-operators.ts +2502 -0
- package/src/compiler/checker-types.ts +2340 -0
- package/src/compiler/checker-unused.ts +642 -0
- package/src/compiler/checker-utilities.ts +161 -0
- package/src/compiler/checker.ts +1116 -0
- package/src/compiler/command-line.ts +436 -0
- package/src/compiler/compile-program.ts +439 -0
- package/src/compiler/decoder.ts +1209 -0
- package/src/compiler/diagnostic-locales.ts +86 -0
- package/src/compiler/diagnostic-messages.ts +2349 -0
- package/src/compiler/diagnostics.ts +897 -0
- package/src/compiler/emitter.ts +434 -0
- package/src/compiler/encoder.ts +1945 -0
- package/src/compiler/file-include.ts +673 -0
- package/src/compiler/file-loader.ts +1528 -0
- package/src/compiler/file-system.ts +143 -0
- package/src/compiler/flow.ts +89 -0
- package/src/compiler/help.ts +473 -0
- package/src/compiler/incremental.ts +2784 -0
- package/src/compiler/init.ts +141 -0
- package/src/compiler/instantiation.ts +894 -0
- package/src/compiler/jsdoc.ts +1386 -0
- package/src/compiler/link-tables.ts +98 -0
- package/src/compiler/locale-data.ts +203 -0
- package/src/compiler/locale.ts +307 -0
- package/src/compiler/locales/cs-CZ.ts +5 -0
- package/src/compiler/locales/de-DE.ts +5 -0
- package/src/compiler/locales/es-ES.ts +5 -0
- package/src/compiler/locales/fr-FR.ts +5 -0
- package/src/compiler/locales/it-IT.ts +5 -0
- package/src/compiler/locales/ja-JP.ts +5 -0
- package/src/compiler/locales/ko-KR.ts +5 -0
- package/src/compiler/locales/pl-PL.ts +5 -0
- package/src/compiler/locales/pt-BR.ts +5 -0
- package/src/compiler/locales/ru-RU.ts +5 -0
- package/src/compiler/locales/tr-TR.ts +5 -0
- package/src/compiler/locales/zh-CN.ts +5 -0
- package/src/compiler/locales/zh-TW.ts +5 -0
- package/src/compiler/module-resolution-types.ts +243 -0
- package/src/compiler/module-resolution.ts +2072 -0
- package/src/compiler/module-specifiers.ts +1491 -0
- package/src/compiler/name-resolver.ts +646 -0
- package/src/compiler/node-builder-names.ts +1069 -0
- package/src/compiler/node-builder-pseudo.ts +892 -0
- package/src/compiler/node-builder-reuse.ts +764 -0
- package/src/compiler/node-builder.ts +3425 -0
- package/src/compiler/option-declarations.ts +1560 -0
- package/src/compiler/options.ts +1576 -0
- package/src/compiler/output-paths.ts +334 -0
- package/src/compiler/package-json.ts +1083 -0
- package/src/compiler/parallel-check.ts +1951 -0
- package/src/compiler/parallel-parse.ts +590 -0
- package/src/compiler/parse-thread.ts +140 -0
- package/src/compiler/parser.ts +7716 -0
- package/src/compiler/path.ts +717 -0
- package/src/compiler/printer/async-helpers.ts +183 -0
- package/src/compiler/printer/auto-generate.ts +27 -0
- package/src/compiler/printer/decorator-helpers.ts +218 -0
- package/src/compiler/printer/emit-context.ts +679 -0
- package/src/compiler/printer/emit-flags.ts +64 -0
- package/src/compiler/printer/factory-base.ts +2577 -0
- package/src/compiler/printer/factory.ts +764 -0
- package/src/compiler/printer/helpers.ts +291 -0
- package/src/compiler/printer/name-generator.ts +372 -0
- package/src/compiler/printer/printer.ts +5072 -0
- package/src/compiler/printer/text-writer.ts +183 -0
- package/src/compiler/printer/utilities.ts +884 -0
- package/src/compiler/program-checker.ts +592 -0
- package/src/compiler/program-utilities.ts +435 -0
- package/src/compiler/program.ts +1419 -0
- package/src/compiler/pseudo-bigint.ts +62 -0
- package/src/compiler/regexp-checker.ts +1142 -0
- package/src/compiler/relations.ts +5149 -0
- package/src/compiler/reparser.ts +1566 -0
- package/src/compiler/scanner.ts +2951 -0
- package/src/compiler/show-config.ts +239 -0
- package/src/compiler/side-state.ts +125 -0
- package/src/compiler/sourcemap.ts +366 -0
- package/src/compiler/spelling.ts +122 -0
- package/src/compiler/symbol-accessibility.ts +1071 -0
- package/src/compiler/symbol.ts +439 -0
- package/src/compiler/symlinks.ts +137 -0
- package/src/compiler/syntax-kind.ts +391 -0
- package/src/compiler/thread-entry.ts +191 -0
- package/src/compiler/timeline.ts +53 -0
- package/src/compiler/transformers/alias-references.ts +757 -0
- package/src/compiler/transformers/async-utilities.ts +335 -0
- package/src/compiler/transformers/async.ts +838 -0
- package/src/compiler/transformers/class-fields.ts +2967 -0
- package/src/compiler/transformers/class-utilities.ts +324 -0
- package/src/compiler/transformers/commonjs-module.ts +1621 -0
- package/src/compiler/transformers/const-enum-inliner.ts +50 -0
- package/src/compiler/transformers/declarations-diagnostics.ts +832 -0
- package/src/compiler/transformers/declarations-pseudo.ts +966 -0
- package/src/compiler/transformers/declarations-resolver.ts +249 -0
- package/src/compiler/transformers/declarations-syntactic.ts +1859 -0
- package/src/compiler/transformers/declarations-tracker.ts +269 -0
- package/src/compiler/transformers/declarations.ts +3120 -0
- package/src/compiler/transformers/decorator-metadata.ts +697 -0
- package/src/compiler/transformers/decorator-utilities.ts +283 -0
- package/src/compiler/transformers/destructuring.ts +708 -0
- package/src/compiler/transformers/downlevel.ts +50 -0
- package/src/compiler/transformers/emit-resolver.ts +258 -0
- package/src/compiler/transformers/es-decorators.ts +2682 -0
- package/src/compiler/transformers/exponentiation.ts +80 -0
- package/src/compiler/transformers/external-module-info.ts +412 -0
- package/src/compiler/transformers/for-await.ts +687 -0
- package/src/compiler/transformers/import-elision.ts +152 -0
- package/src/compiler/transformers/jsx-entities.ts +256 -0
- package/src/compiler/transformers/jsx.ts +824 -0
- package/src/compiler/transformers/legacy-decorators.ts +726 -0
- package/src/compiler/transformers/logical-assignment.ts +75 -0
- package/src/compiler/transformers/module-utilities.ts +42 -0
- package/src/compiler/transformers/module.ts +474 -0
- package/src/compiler/transformers/named-evaluation.ts +389 -0
- package/src/compiler/transformers/nullish-coalescing.ts +35 -0
- package/src/compiler/transformers/object-rest-spread.ts +577 -0
- package/src/compiler/transformers/optional-catch.ts +29 -0
- package/src/compiler/transformers/optional-chain.ts +246 -0
- package/src/compiler/transformers/reference-resolver.ts +1201 -0
- package/src/compiler/transformers/runtime-syntax.ts +942 -0
- package/src/compiler/transformers/subtree-facts.ts +245 -0
- package/src/compiler/transformers/syntax-facts.ts +353 -0
- package/src/compiler/transformers/tagged-template.ts +167 -0
- package/src/compiler/transformers/transformer.ts +56 -0
- package/src/compiler/transformers/type-eraser.ts +520 -0
- package/src/compiler/transformers/type-serialization.ts +374 -0
- package/src/compiler/transformers/using.ts +613 -0
- package/src/compiler/transformers/utilities.ts +419 -0
- package/src/compiler/transformers/visitor-base.ts +1601 -0
- package/src/compiler/transformers/visitor-hooks.ts +252 -0
- package/src/compiler/tsc-build.ts +1418 -0
- package/src/compiler/tsc-cli.ts +666 -0
- package/src/compiler/tsc-compile.ts +437 -0
- package/src/compiler/tsc-watch.ts +854 -0
- package/src/compiler/tsconfig.ts +1574 -0
- package/src/compiler/type-printer.ts +110 -0
- package/src/compiler/types.ts +115 -0
- package/src/compiler/unicode-identifiers.ts +212 -0
- package/src/compiler/unicode-properties.ts +537 -0
- package/src/compiler/vfs-match.ts +597 -0
- package/src/compiler/xxh3.ts +650 -0
- package/src/library/ast.generated.ts +1685 -0
- package/src/library/ast.ts +104 -0
- package/src/library/checker.ts +384 -0
- package/src/library/compiler-options.generated.ts +114 -0
- package/src/library/diagnostics.ts +72 -0
- package/src/library/disk.ts +73 -0
- package/src/library/enums.generated.ts +1024 -0
- package/src/library/errors.ts +26 -0
- package/src/library/host.ts +63 -0
- package/src/library/index.ts +71 -0
- package/src/library/nodes.ts +232 -0
- package/src/library/options.ts +449 -0
- package/src/library/parse.ts +63 -0
- package/src/library/program.ts +293 -0
- package/src/library/symbols.ts +15 -0
- package/src/library/types.ts +359 -0
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { BinaryExpression, type Node } from './ast.js';
|
|
2
|
+
import { type Symbol } from './symbol.js';
|
|
3
|
+
import type { Checker } from './checker.js';
|
|
4
|
+
import { type Type } from './checker-types.js';
|
|
5
|
+
/** The type of the CommonJS `module` symbol or its `exports` property. */
|
|
6
|
+
export declare function getTypeOfModuleExportsSymbol(c: Checker, symbol: Symbol): Type;
|
|
7
|
+
/** The type of a symbol declared by JavaScript assignments or `Object.defineProperty` calls. */
|
|
8
|
+
export declare function getWidenedTypeForAssignmentDeclaration(c: Checker, symbol: Symbol): Type;
|
|
9
|
+
export declare function getRightMostAssignedExpression(node: Node): Node;
|
|
10
|
+
/** Whether a symbol is a property declared by `this.x` assignments in a constructor. */
|
|
11
|
+
export declare function isConstructorDeclaredThisProperty(c: Checker, symbol: Symbol): boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Whether `node` is `this.x` in the constructor whose assignments type x: x is declared by `this.x`
|
|
14
|
+
* assignments there, or is an auto-typed property declaration.
|
|
15
|
+
*/
|
|
16
|
+
export declare function isThisPropertyAccessInConstructor(c: Checker, node: Node, prop: Symbol): boolean;
|
|
17
|
+
/** The type of `this.x` in a constructor, or of an auto-typed property: the control flow type of its assignments. */
|
|
18
|
+
export declare function getFlowTypeOfAutoTypedProperty(c: Checker, reference: Node, prop: Symbol | undefined): Type;
|
|
19
|
+
/**
|
|
20
|
+
* The contextual type of the right operand of `left = right`: the type of `left`, except for
|
|
21
|
+
* `module.exports = …` and assignment declarations, which would be circular.
|
|
22
|
+
*/
|
|
23
|
+
export declare function getContextualTypeForAssignmentExpression(c: Checker, binary: BinaryExpression): Type | undefined;
|
|
24
|
+
/** Whether `node` is `require("m")` with the CommonJS `require`, not a local function of that name. */
|
|
25
|
+
export declare function isCommonJSRequire(c: Checker, node: Node): boolean;
|
|
26
|
+
/** The type of the module a `require("m")` call names. */
|
|
27
|
+
export declare function resolveExternalModuleTypeByLiteral(c: Checker, name: Node): Type;
|
|
28
|
+
/** Whether a JavaScript declaration declares an alias: a `require` or an exported entity name. */
|
|
29
|
+
export declare function isJSAliasDeclaration(node: Node): boolean;
|
|
30
|
+
/** `this` in `obj.x = function () {}` is `obj`, except for CommonJS `exports.x = function () {}`. */
|
|
31
|
+
export declare function getThisTypeOfAssignedFunction(c: Checker, func: Node): Type | undefined;
|
|
32
|
+
/** The type of an empty object literal with expando members, `const o = {}; o.x = 1`. */
|
|
33
|
+
export declare function getTypeOfExpandoObjectLiteral(c: Checker, node: Node): Type | undefined;
|
|
34
|
+
/** Whether an object literal is in a JavaScript file and has no contextual type. */
|
|
35
|
+
export declare function isJSObjectLiteral(c: Checker, node: Node): boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Whether reading or writing unknown members of `t` is allowed: a JavaScript object literal, a union of
|
|
38
|
+
* them, an intersection with one, or a type variable constrained to one. Not under noImplicitAny.
|
|
39
|
+
*/
|
|
40
|
+
export declare function isJSLiteralType(c: Checker, t: Type): boolean;
|
|
41
|
+
/** `exports.x = undefined` is ignored when x has other assignment declarations. */
|
|
42
|
+
export declare function isUndefinedAssignmentToCommonJSExport(c: Checker, left: Node, rightType: Type): boolean;
|
|
@@ -0,0 +1,441 @@
|
|
|
1
|
+
// JavaScript semantics: CommonJS `module.exports`, `exports.x` and `require`, expando assignments
|
|
2
|
+
// (`f.x = …`, `o = {}; o.x = …`), `this.x` assignment declarations and auto-typed properties,
|
|
3
|
+
// `Object.defineProperty` declarations, and object literals that allow unknown members.
|
|
4
|
+
import { BinaryExpression, NodeVisitor, PropertyAccessExpression, getArguments, getExpression, getInitializer, getProperties, getSymbol, getText, getType, } from './ast.js';
|
|
5
|
+
import { isFunctionLike, isInJSFile, isRequireCall } from './ast-utilities.js';
|
|
6
|
+
import { getSymbolNameForPrivateIdentifier } from './binder.js';
|
|
7
|
+
import { getAssignmentDeclarationKind, expressionIsAlias, getDeclarationOfKind, getSourceFileOfNode, getThisContainer, isAccessExpression, isJsonSourceFile, isStringOrNumericLiteralLike, isVariableDeclarationInitializedToRequire, } from './binder-utilities.js';
|
|
8
|
+
import { createAnonymousType, filterType, getRegularTypeOfLiteralType, getUnionType, typesOf, } from './checker-type-factory.js';
|
|
9
|
+
import { getExportSymbolOfValueSymbolIfExported, getSymbolOfDeclaration, resolveName } from './checker-symbols.js';
|
|
10
|
+
import { resolveExternalModuleName, resolveExternalModuleSymbol } from './checker-modules.js';
|
|
11
|
+
import { getTypeFromTypeNode } from './checker-type-nodes.js';
|
|
12
|
+
import { getPropertyOfType, getResolvedBaseConstraint, getTypeOfPropertyOfType } from './checker-members.js';
|
|
13
|
+
import { getApparentTypeOfContextualTypeEx, getTypeOfPropertyOfContextualType, } from './checker-contextual.js';
|
|
14
|
+
import { getPropertyNameFromType, isTypeUsableAsPropertyName } from './checker-utilities.js';
|
|
15
|
+
import { getReturnTypeOfSignature, getSingleCallSignature, getTypeAtPosition } from './checker-signatures.js';
|
|
16
|
+
import { checkExpressionCached, checkExpressionForMutableLocation, getResolvedSymbol, getTypeOfExpression, } from './checker-expressions.js';
|
|
17
|
+
import { getFlowTypeOfReference, isMatchingReference } from './checker-narrowing.js';
|
|
18
|
+
import { isEmptyArrayLiteralType } from './relations.js';
|
|
19
|
+
import { getTypeOfSymbol, getWidenedType, reportImplicitAny } from './checker-symbol-types.js';
|
|
20
|
+
import { getFlowTypeInConstructor, getFlowTypeOfProperty, getTypeOfPropertyInBaseClass, isAutoTypedProperty, } from './checker-classes.js';
|
|
21
|
+
/** The type of the CommonJS `module` symbol or its `exports` property. */
|
|
22
|
+
export function getTypeOfModuleExportsSymbol(c, symbol) {
|
|
23
|
+
if (symbol.name === 'exports') {
|
|
24
|
+
const target = resolveExternalModuleSymbol(c, getSymbolOfDeclaration(c, symbol.valueDeclaration), false);
|
|
25
|
+
return target !== undefined ? getTypeOfSymbol(c, target) : c.errorType;
|
|
26
|
+
}
|
|
27
|
+
return createAnonymousType(c, symbol, symbol.members, [], [], []);
|
|
28
|
+
}
|
|
29
|
+
/** The type of a symbol declared by JavaScript assignments or `Object.defineProperty` calls. */
|
|
30
|
+
export function getWidenedTypeForAssignmentDeclaration(c, symbol) {
|
|
31
|
+
let t;
|
|
32
|
+
const kind = getThisAssignmentKind(c, symbol);
|
|
33
|
+
const location = c.symbolLinks(symbol).thisAssignmentLocation;
|
|
34
|
+
if (kind === 1 /* ThisAssignmentKind.Typed */)
|
|
35
|
+
t = getTypeFromTypeNode(c, location);
|
|
36
|
+
else if (kind === 2 /* ThisAssignmentKind.Constructor */)
|
|
37
|
+
t = getFlowTypeInConstructor(c, symbol, location);
|
|
38
|
+
else if (kind === 3 /* ThisAssignmentKind.Method */)
|
|
39
|
+
t = getTypeOfPropertyInBaseClass(c, symbol);
|
|
40
|
+
if (t === undefined) {
|
|
41
|
+
const types = [];
|
|
42
|
+
const declarations = symbol.declarations;
|
|
43
|
+
for (let i = 0; i < declarations.length; i++) {
|
|
44
|
+
const declaration = declarations[i];
|
|
45
|
+
const declaredType = declaration instanceof BinaryExpression ? declaration.type : undefined;
|
|
46
|
+
if (declaredType !== undefined) {
|
|
47
|
+
t = getTypeFromTypeNode(c, declaredType);
|
|
48
|
+
break;
|
|
49
|
+
}
|
|
50
|
+
const assignedType = getAssignmentDeclarationInitializerType(c, declaration);
|
|
51
|
+
// An initial `exports.x = undefined` is ignored when there are other declarations.
|
|
52
|
+
if (assignedType !== undefined &&
|
|
53
|
+
(getAssignmentDeclarationKind(declaration) !== 2 /* JSDeclarationKind.ExportsProperty */ ||
|
|
54
|
+
i !== 0 ||
|
|
55
|
+
declarations.length === 1 ||
|
|
56
|
+
(assignedType.flags & 4 /* TypeFlags.Undefined */) === 0) &&
|
|
57
|
+
!types.includes(assignedType))
|
|
58
|
+
types.push(assignedType);
|
|
59
|
+
}
|
|
60
|
+
if (kind === 3 /* ThisAssignmentKind.Method */ && types.length > 0 && c.strictNullChecks) {
|
|
61
|
+
if (!types.includes(c.undefinedOrMissingType))
|
|
62
|
+
types.push(c.undefinedOrMissingType);
|
|
63
|
+
}
|
|
64
|
+
if (t === undefined)
|
|
65
|
+
t = types.length !== 0 ? getUnionType(c, types) : c.anyType;
|
|
66
|
+
}
|
|
67
|
+
t = getWidenedType(c, t);
|
|
68
|
+
// An all-nullable or empty union is an implicit any in JS files.
|
|
69
|
+
if (symbol.valueDeclaration !== undefined &&
|
|
70
|
+
isInJSFile(symbol.valueDeclaration) &&
|
|
71
|
+
filterType(c, t, isNonNullableType) === c.neverType) {
|
|
72
|
+
reportImplicitAny(c, symbol.valueDeclaration, c.anyType);
|
|
73
|
+
return c.anyType;
|
|
74
|
+
}
|
|
75
|
+
return t;
|
|
76
|
+
}
|
|
77
|
+
function isNonNullableType(t) {
|
|
78
|
+
return (t.flags & ~12 /* TypeFlags.Nullable */) !== 0;
|
|
79
|
+
}
|
|
80
|
+
function getAssignmentDeclarationInitializerType(c, node) {
|
|
81
|
+
if (node instanceof BinaryExpression) {
|
|
82
|
+
let t;
|
|
83
|
+
switch (getAssignmentDeclarationKind(node)) {
|
|
84
|
+
case 1 /* JSDeclarationKind.ModuleExports */:
|
|
85
|
+
case 2 /* JSDeclarationKind.ExportsProperty */:
|
|
86
|
+
t = getRegularTypeOfLiteralType(c, checkExpressionCached(c, getRightMostAssignedExpression(node)));
|
|
87
|
+
break;
|
|
88
|
+
case 3 /* JSDeclarationKind.ThisProperty */:
|
|
89
|
+
if (containsSameNamedThisProperty(c, node.left, node.right))
|
|
90
|
+
return undefined;
|
|
91
|
+
t = checkExpressionForMutableLocation(c, node.right);
|
|
92
|
+
break;
|
|
93
|
+
default:
|
|
94
|
+
t = checkExpressionForMutableLocation(c, node.right);
|
|
95
|
+
}
|
|
96
|
+
if (isEmptyArrayLiteralType(c, t) && !hasParentWithTypeAnnotation(c, node.symbol)) {
|
|
97
|
+
reportImplicitAny(c, node, c.anyArrayType);
|
|
98
|
+
return c.anyArrayType;
|
|
99
|
+
}
|
|
100
|
+
return t;
|
|
101
|
+
}
|
|
102
|
+
if (node.kind === 214 /* SyntaxKind.CallExpression */)
|
|
103
|
+
return getTypeFromPropertyDescriptor(c, getArguments(node).nodes[2]);
|
|
104
|
+
return undefined;
|
|
105
|
+
}
|
|
106
|
+
export function getRightMostAssignedExpression(node) {
|
|
107
|
+
let current = node;
|
|
108
|
+
while (current instanceof BinaryExpression && current.operatorToken.kind === 63 /* SyntaxKind.EqualsToken */)
|
|
109
|
+
current = current.right;
|
|
110
|
+
return current;
|
|
111
|
+
}
|
|
112
|
+
/** Whether the parent of an expando symbol is a function expression whose variable is annotated. */
|
|
113
|
+
function hasParentWithTypeAnnotation(c, symbol) {
|
|
114
|
+
const parent = symbol.parent;
|
|
115
|
+
if (parent === undefined || parent.valueDeclaration === undefined)
|
|
116
|
+
return false;
|
|
117
|
+
const kind = parent.valueDeclaration.kind;
|
|
118
|
+
if (kind !== 219 /* SyntaxKind.FunctionExpression */ && kind !== 220 /* SyntaxKind.ArrowFunction */)
|
|
119
|
+
return false;
|
|
120
|
+
const annotated = getSymbolOfDeclaration(c, parent.valueDeclaration.parent);
|
|
121
|
+
return (annotated !== undefined &&
|
|
122
|
+
annotated.valueDeclaration !== undefined &&
|
|
123
|
+
getType(annotated.valueDeclaration) !== undefined);
|
|
124
|
+
}
|
|
125
|
+
/** Finds a reference to a `this.x` property outside nested functions. */
|
|
126
|
+
class SameNamedThisPropertyFinder extends NodeVisitor {
|
|
127
|
+
c;
|
|
128
|
+
thisProperty;
|
|
129
|
+
constructor(c, thisProperty) {
|
|
130
|
+
super();
|
|
131
|
+
this.c = c;
|
|
132
|
+
this.thisProperty = thisProperty;
|
|
133
|
+
}
|
|
134
|
+
visitNode(node) {
|
|
135
|
+
if (isMatchingReference(this.c, this.thisProperty, node))
|
|
136
|
+
return true;
|
|
137
|
+
if (isFunctionLike(node))
|
|
138
|
+
return false;
|
|
139
|
+
return node.forEachChild(this);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
function containsSameNamedThisProperty(c, thisProperty, expression) {
|
|
143
|
+
return new SameNamedThisPropertyFinder(c, thisProperty).visitNode(expression);
|
|
144
|
+
}
|
|
145
|
+
function getTypeFromPropertyDescriptor(c, node) {
|
|
146
|
+
const objectLiteralType = checkExpressionCached(c, node);
|
|
147
|
+
const valueType = getTypeOfPropertyOfType(c, objectLiteralType, 'value');
|
|
148
|
+
if (valueType !== undefined)
|
|
149
|
+
return valueType;
|
|
150
|
+
const getFunc = getTypeOfPropertyOfType(c, objectLiteralType, 'get');
|
|
151
|
+
if (getFunc !== undefined) {
|
|
152
|
+
const getSig = getSingleCallSignature(c, getFunc);
|
|
153
|
+
if (getSig !== undefined)
|
|
154
|
+
return getReturnTypeOfSignature(c, getSig);
|
|
155
|
+
}
|
|
156
|
+
const setFunc = getTypeOfPropertyOfType(c, objectLiteralType, 'set');
|
|
157
|
+
if (setFunc !== undefined) {
|
|
158
|
+
const setSig = getSingleCallSignature(c, setFunc);
|
|
159
|
+
if (setSig !== undefined)
|
|
160
|
+
return getTypeAtPosition(c, setSig, 0);
|
|
161
|
+
}
|
|
162
|
+
return c.anyType;
|
|
163
|
+
}
|
|
164
|
+
// ---- `this.x` assignment declarations
|
|
165
|
+
function getThisAssignmentKind(c, symbol) {
|
|
166
|
+
if (!(symbol.valueDeclaration instanceof BinaryExpression))
|
|
167
|
+
return 0 /* ThisAssignmentKind.None */;
|
|
168
|
+
const links = c.symbolLinks(symbol);
|
|
169
|
+
if (links.thisAssignmentKind !== 0)
|
|
170
|
+
return (links.thisAssignmentKind - 1);
|
|
171
|
+
let allThis = true;
|
|
172
|
+
let typeAnnotation;
|
|
173
|
+
for (const declaration of symbol.declarations) {
|
|
174
|
+
if (!(declaration instanceof BinaryExpression)) {
|
|
175
|
+
allThis = false;
|
|
176
|
+
break;
|
|
177
|
+
}
|
|
178
|
+
const left = declaration.left;
|
|
179
|
+
if (getAssignmentDeclarationKind(declaration) === 3 /* JSDeclarationKind.ThisProperty */ &&
|
|
180
|
+
(left.kind !== 213 /* SyntaxKind.ElementAccessExpression */ || isStringOrNumericLiteralLike(getArgumentExpression(left)))) {
|
|
181
|
+
if (declaration.type !== undefined)
|
|
182
|
+
typeAnnotation = declaration.type;
|
|
183
|
+
}
|
|
184
|
+
else {
|
|
185
|
+
allThis = false;
|
|
186
|
+
break;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
let kind = 0 /* ThisAssignmentKind.None */;
|
|
190
|
+
let location;
|
|
191
|
+
if (allThis) {
|
|
192
|
+
if (typeAnnotation !== undefined) {
|
|
193
|
+
location = typeAnnotation;
|
|
194
|
+
kind = 1 /* ThisAssignmentKind.Typed */;
|
|
195
|
+
}
|
|
196
|
+
else {
|
|
197
|
+
location = getDeclaringConstructor(symbol);
|
|
198
|
+
kind = location === undefined ? 3 /* ThisAssignmentKind.Method */ : 2 /* ThisAssignmentKind.Constructor */;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
links.thisAssignmentKind = kind + 1;
|
|
202
|
+
links.thisAssignmentLocation = location;
|
|
203
|
+
return kind;
|
|
204
|
+
}
|
|
205
|
+
function getArgumentExpression(node) {
|
|
206
|
+
return node.argumentExpression;
|
|
207
|
+
}
|
|
208
|
+
/** Whether a symbol is a property declared by `this.x` assignments in a constructor. */
|
|
209
|
+
export function isConstructorDeclaredThisProperty(c, symbol) {
|
|
210
|
+
return getThisAssignmentKind(c, symbol) === 2 /* ThisAssignmentKind.Constructor */;
|
|
211
|
+
}
|
|
212
|
+
function getDeclaringConstructor(symbol) {
|
|
213
|
+
for (const declaration of symbol.declarations) {
|
|
214
|
+
const container = getThisContainer(declaration, false, false);
|
|
215
|
+
if (container.kind === 177 /* SyntaxKind.Constructor */)
|
|
216
|
+
return container;
|
|
217
|
+
}
|
|
218
|
+
return undefined;
|
|
219
|
+
}
|
|
220
|
+
/**
|
|
221
|
+
* Whether `node` is `this.x` in the constructor whose assignments type x: x is declared by `this.x`
|
|
222
|
+
* assignments there, or is an auto-typed property declaration.
|
|
223
|
+
*/
|
|
224
|
+
export function isThisPropertyAccessInConstructor(c, node, prop) {
|
|
225
|
+
let constructor;
|
|
226
|
+
if (isConstructorDeclaredThisProperty(c, prop))
|
|
227
|
+
constructor = c.symbolLinks(prop).thisAssignmentLocation;
|
|
228
|
+
else if (isThisProperty(node) && isAutoTypedProperty(c, prop))
|
|
229
|
+
constructor = getDeclaringConstructor(prop);
|
|
230
|
+
return getThisContainer(node, true, false) === constructor;
|
|
231
|
+
}
|
|
232
|
+
function isThisProperty(node) {
|
|
233
|
+
return isAccessExpression(node) && getExpression(node).kind === 109 /* SyntaxKind.ThisKeyword */;
|
|
234
|
+
}
|
|
235
|
+
/** The type of `this.x` in a constructor, or of an auto-typed property: the control flow type of its assignments. */
|
|
236
|
+
export function getFlowTypeOfAutoTypedProperty(c, reference, prop) {
|
|
237
|
+
if (prop === undefined)
|
|
238
|
+
return getFlowTypeOfReference(c, reference, c.autoType, c.undefinedType, undefined);
|
|
239
|
+
return getFlowTypeOfProperty(c, reference, prop);
|
|
240
|
+
}
|
|
241
|
+
// ---- Contextual types
|
|
242
|
+
/** The leftmost expression of a property access, element access or call chain. */
|
|
243
|
+
function getLeftmostAccessExpression(node) {
|
|
244
|
+
let current = node;
|
|
245
|
+
while (isAccessExpression(current) || current.kind === 214 /* SyntaxKind.CallExpression */)
|
|
246
|
+
current = getExpression(current);
|
|
247
|
+
return current;
|
|
248
|
+
}
|
|
249
|
+
/**
|
|
250
|
+
* The contextual type of the right operand of `left = right`: the type of `left`, except for
|
|
251
|
+
* `module.exports = …` and assignment declarations, which would be circular.
|
|
252
|
+
*/
|
|
253
|
+
export function getContextualTypeForAssignmentExpression(c, binary) {
|
|
254
|
+
const left = binary.left;
|
|
255
|
+
const target = getLeftmostAccessExpression(left);
|
|
256
|
+
if (target.kind === 79 /* SyntaxKind.Identifier */ && (getResolvedSymbol(c, target).flags & 134217728 /* SymbolFlags.ModuleExports */) !== 0)
|
|
257
|
+
return undefined;
|
|
258
|
+
if (isAccessExpression(left)) {
|
|
259
|
+
const expr = getExpression(left);
|
|
260
|
+
switch (expr.kind) {
|
|
261
|
+
case 79 /* SyntaxKind.Identifier */: {
|
|
262
|
+
const symbol = getExportSymbolOfValueSymbolIfExported(c, getResolvedSymbol(c, expr));
|
|
263
|
+
if ((symbol.flags & 134217728 /* SymbolFlags.ModuleExports */) !== 0)
|
|
264
|
+
return undefined;
|
|
265
|
+
if (binary.symbol === undefined)
|
|
266
|
+
break;
|
|
267
|
+
// `F.id = expr` takes a contextual type only from an annotated variable F.
|
|
268
|
+
const declaration = symbol.valueDeclaration;
|
|
269
|
+
if (declaration === undefined || declaration.kind !== 261 /* SyntaxKind.VariableDeclaration */)
|
|
270
|
+
return undefined;
|
|
271
|
+
const typeNode = getType(declaration);
|
|
272
|
+
if (typeNode === undefined)
|
|
273
|
+
return undefined;
|
|
274
|
+
if (left instanceof PropertyAccessExpression)
|
|
275
|
+
return getTypeOfPropertyOfContextualType(c, getTypeFromTypeNode(c, typeNode), getText(left.name));
|
|
276
|
+
const nameType = checkExpressionCached(c, getArgumentExpression(left));
|
|
277
|
+
if (isTypeUsableAsPropertyName(nameType))
|
|
278
|
+
return getTypeOfPropertyOfContextualType(c, getTypeFromTypeNode(c, typeNode), getPropertyNameFromType(nameType));
|
|
279
|
+
return getTypeOfExpression(c, left);
|
|
280
|
+
}
|
|
281
|
+
case 212 /* SyntaxKind.PropertyAccessExpression */:
|
|
282
|
+
case 213 /* SyntaxKind.ElementAccessExpression */:
|
|
283
|
+
if (binary.symbol !== undefined)
|
|
284
|
+
return undefined;
|
|
285
|
+
break;
|
|
286
|
+
case 109 /* SyntaxKind.ThisKeyword */: {
|
|
287
|
+
const thisType = getTypeOfExpression(c, expr);
|
|
288
|
+
let symbol;
|
|
289
|
+
if (left instanceof PropertyAccessExpression) {
|
|
290
|
+
const name = left.name;
|
|
291
|
+
if (name.kind === 80 /* SyntaxKind.PrivateIdentifier */) {
|
|
292
|
+
if (thisType.symbol !== undefined)
|
|
293
|
+
symbol = getPropertyOfType(c, thisType, getSymbolNameForPrivateIdentifier(thisType.symbol, getText(name)));
|
|
294
|
+
}
|
|
295
|
+
else
|
|
296
|
+
symbol = getPropertyOfType(c, thisType, getText(name));
|
|
297
|
+
}
|
|
298
|
+
else {
|
|
299
|
+
const propType = checkExpressionCached(c, getArgumentExpression(left));
|
|
300
|
+
if (isTypeUsableAsPropertyName(propType))
|
|
301
|
+
symbol = getPropertyOfType(c, thisType, getPropertyNameFromType(propType));
|
|
302
|
+
}
|
|
303
|
+
const d = symbol?.valueDeclaration;
|
|
304
|
+
// `this.x = expr` where x is a property with no type annotation or initializer.
|
|
305
|
+
if (d !== undefined &&
|
|
306
|
+
(d.kind === 173 /* SyntaxKind.PropertyDeclaration */ || d.kind === 172 /* SyntaxKind.PropertySignature */) &&
|
|
307
|
+
getType(d) === undefined &&
|
|
308
|
+
getInitializer(d) === undefined)
|
|
309
|
+
return undefined;
|
|
310
|
+
// An assignment declaration `this.x = expr` without a JSDoc type.
|
|
311
|
+
const declaration = binary.symbol?.valueDeclaration;
|
|
312
|
+
if (declaration !== undefined && getType(declaration) === undefined)
|
|
313
|
+
return undefined;
|
|
314
|
+
break;
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
return getTypeOfExpression(c, left);
|
|
319
|
+
}
|
|
320
|
+
// ---- CommonJS `require`
|
|
321
|
+
/** Whether `node` is `require("m")` with the CommonJS `require`, not a local function of that name. */
|
|
322
|
+
export function isCommonJSRequire(c, node) {
|
|
323
|
+
if (!isRequireCall(node, true))
|
|
324
|
+
return false;
|
|
325
|
+
const callee = getExpression(node);
|
|
326
|
+
const resolved = resolveName(c, callee, getText(callee), 111551 /* SymbolFlags.Value */, undefined, true, false);
|
|
327
|
+
if (resolved === c.requireSymbol)
|
|
328
|
+
return true;
|
|
329
|
+
// A declared `require` must be an ambient function or variable.
|
|
330
|
+
if (resolved === undefined || (resolved.flags & 2097152 /* SymbolFlags.Alias */) !== 0)
|
|
331
|
+
return false;
|
|
332
|
+
let kind = 0 /* SyntaxKind.Unknown */;
|
|
333
|
+
if ((resolved.flags & 16 /* SymbolFlags.Function */) !== 0)
|
|
334
|
+
kind = 263 /* SyntaxKind.FunctionDeclaration */;
|
|
335
|
+
else if ((resolved.flags & 3 /* SymbolFlags.Variable */) !== 0)
|
|
336
|
+
kind = 261 /* SyntaxKind.VariableDeclaration */;
|
|
337
|
+
if (kind === 0 /* SyntaxKind.Unknown */)
|
|
338
|
+
return false;
|
|
339
|
+
const declaration = getDeclarationOfKind(resolved, kind);
|
|
340
|
+
return declaration !== undefined && (declaration.flags & 8388608 /* NodeFlags.Ambient */) !== 0;
|
|
341
|
+
}
|
|
342
|
+
/** The type of the module a `require("m")` call names. */
|
|
343
|
+
export function resolveExternalModuleTypeByLiteral(c, name) {
|
|
344
|
+
const moduleSymbol = resolveExternalModuleName(c, name, name, false);
|
|
345
|
+
if (moduleSymbol !== undefined) {
|
|
346
|
+
const resolved = resolveExternalModuleSymbol(c, moduleSymbol, false);
|
|
347
|
+
if (resolved !== undefined)
|
|
348
|
+
return getTypeOfSymbol(c, resolved);
|
|
349
|
+
}
|
|
350
|
+
return c.anyType;
|
|
351
|
+
}
|
|
352
|
+
/** Whether a JavaScript declaration declares an alias: a `require` or an exported entity name. */
|
|
353
|
+
export function isJSAliasDeclaration(node) {
|
|
354
|
+
if (node.kind !== 227 /* SyntaxKind.BinaryExpression */)
|
|
355
|
+
return isVariableDeclarationInitializedToRequire(node);
|
|
356
|
+
const kind = getAssignmentDeclarationKind(node);
|
|
357
|
+
return ((kind === 1 /* JSDeclarationKind.ModuleExports */ || kind === 2 /* JSDeclarationKind.ExportsProperty */) &&
|
|
358
|
+
expressionIsAlias(node.right));
|
|
359
|
+
}
|
|
360
|
+
/** `this` in `obj.x = function () {}` is `obj`, except for CommonJS `exports.x = function () {}`. */
|
|
361
|
+
export function getThisTypeOfAssignedFunction(c, func) {
|
|
362
|
+
let parent = func.parent;
|
|
363
|
+
while (parent.kind === 218 /* SyntaxKind.ParenthesizedExpression */)
|
|
364
|
+
parent = parent.parent;
|
|
365
|
+
// Compound assignments like `??=` count too.
|
|
366
|
+
if (!(parent instanceof BinaryExpression) ||
|
|
367
|
+
parent.operatorToken.kind < 63 /* SyntaxKind.FirstAssignment */ ||
|
|
368
|
+
parent.operatorToken.kind > 78 /* SyntaxKind.LastAssignment */)
|
|
369
|
+
return undefined;
|
|
370
|
+
const target = parent.left;
|
|
371
|
+
if (!isAccessExpression(target))
|
|
372
|
+
return undefined;
|
|
373
|
+
const expression = getExpression(target);
|
|
374
|
+
if (isInJSFile(func) &&
|
|
375
|
+
expression.kind === 79 /* SyntaxKind.Identifier */ &&
|
|
376
|
+
getSourceFileOfNode(parent).commonJSModuleIndicator !== undefined &&
|
|
377
|
+
(getResolvedSymbol(c, expression).flags & 134217728 /* SymbolFlags.ModuleExports */) !== 0)
|
|
378
|
+
return undefined;
|
|
379
|
+
return getWidenedType(c, checkExpressionCached(c, expression));
|
|
380
|
+
}
|
|
381
|
+
// ---- Object literals
|
|
382
|
+
/** The type of an empty object literal with expando members, `const o = {}; o.x = 1`. */
|
|
383
|
+
export function getTypeOfExpandoObjectLiteral(c, node) {
|
|
384
|
+
const symbol = getSymbol(node);
|
|
385
|
+
if (getProperties(node).nodes.length !== 0 || symbol === undefined)
|
|
386
|
+
return undefined;
|
|
387
|
+
const exports = symbol.exports;
|
|
388
|
+
if (exports === undefined || exports.size === 0)
|
|
389
|
+
return undefined;
|
|
390
|
+
const result = createAnonymousType(c, symbol, exports, [], [], []);
|
|
391
|
+
if (isInJSFile(node) && !isJsonSourceFile(getSourceFileOfNode(node)))
|
|
392
|
+
result.objectFlags |= 4096 /* ObjectFlags.JSLiteral */;
|
|
393
|
+
return result;
|
|
394
|
+
}
|
|
395
|
+
/** Whether an object literal is in a JavaScript file and has no contextual type. */
|
|
396
|
+
export function isJSObjectLiteral(c, node) {
|
|
397
|
+
if (!isInJSFile(node) || isJsonSourceFile(getSourceFileOfNode(node)))
|
|
398
|
+
return false;
|
|
399
|
+
return getApparentTypeOfContextualTypeEx(c, node, 0 /* ContextFlags.None */) === undefined;
|
|
400
|
+
}
|
|
401
|
+
/**
|
|
402
|
+
* Whether reading or writing unknown members of `t` is allowed: a JavaScript object literal, a union of
|
|
403
|
+
* them, an intersection with one, or a type variable constrained to one. Not under noImplicitAny.
|
|
404
|
+
*/
|
|
405
|
+
export function isJSLiteralType(c, t) {
|
|
406
|
+
if (c.noImplicitAny)
|
|
407
|
+
return false;
|
|
408
|
+
if ((t.objectFlags & 4096 /* ObjectFlags.JSLiteral */) !== 0)
|
|
409
|
+
return true;
|
|
410
|
+
if ((t.flags & 134217728 /* TypeFlags.Union */) !== 0) {
|
|
411
|
+
for (const u of typesOf(t))
|
|
412
|
+
if (!isJSLiteralType(c, u))
|
|
413
|
+
return false;
|
|
414
|
+
return true;
|
|
415
|
+
}
|
|
416
|
+
if ((t.flags & 268435456 /* TypeFlags.Intersection */) !== 0) {
|
|
417
|
+
for (const u of typesOf(t))
|
|
418
|
+
if (isJSLiteralType(c, u))
|
|
419
|
+
return true;
|
|
420
|
+
return false;
|
|
421
|
+
}
|
|
422
|
+
if ((t.flags & 132644864 /* TypeFlags.Instantiable */) !== 0) {
|
|
423
|
+
const constraint = getResolvedBaseConstraint(c, t);
|
|
424
|
+
return constraint !== t && isJSLiteralType(c, constraint);
|
|
425
|
+
}
|
|
426
|
+
return false;
|
|
427
|
+
}
|
|
428
|
+
/** `exports.x = undefined` is ignored when x has other assignment declarations. */
|
|
429
|
+
export function isUndefinedAssignmentToCommonJSExport(c, left, rightType) {
|
|
430
|
+
const parent = left.parent;
|
|
431
|
+
if (!(parent instanceof BinaryExpression))
|
|
432
|
+
return false;
|
|
433
|
+
// Typed locals keep scriptc's field reads static after `instanceof`.
|
|
434
|
+
const assignment = parent;
|
|
435
|
+
if (assignment.symbol === undefined)
|
|
436
|
+
return false;
|
|
437
|
+
if (getAssignmentDeclarationKind(assignment) !== 2 /* JSDeclarationKind.ExportsProperty */)
|
|
438
|
+
return false;
|
|
439
|
+
const symbol = c.resolvedSymbols.get(left.id);
|
|
440
|
+
return symbol !== undefined && symbol.declarations.length > 1 && (rightType.flags & 4 /* TypeFlags.Undefined */) !== 0;
|
|
441
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { type ExpressionWithTypeArguments, type Node } from './ast.js';
|
|
2
|
+
import type { Checker } from './checker.js';
|
|
3
|
+
import type { Signature, Type } from './checker-types.js';
|
|
4
|
+
/** The type a JSDoc type reference to a JavaScript-style name means, if it is one. */
|
|
5
|
+
export declare function getIntendedTypeFromJSDocTypeReference(c: Checker, node: Node): Type | undefined;
|
|
6
|
+
/** The JSDoc `@type` of a function, method or arrow function in a JavaScript file. */
|
|
7
|
+
export declare function getFullSignatureTypeNode(node: Node): Node | undefined;
|
|
8
|
+
/** The signature a JSDoc `@type` tag gives a function. */
|
|
9
|
+
export declare function getSignatureOfFullSignatureType(c: Checker, node: Node): Signature | undefined;
|
|
10
|
+
/** The type of a parameter of a function typed by a JSDoc `@type` tag. */
|
|
11
|
+
export declare function getParameterTypeOfFullSignature(c: Checker, fn: Node, parameter: Node): Type | undefined;
|
|
12
|
+
/** The return type of a function typed by a JSDoc `@type` tag. */
|
|
13
|
+
export declare function getReturnTypeOfFullSignature(c: Checker, fn: Node): Type | undefined;
|
|
14
|
+
/** A JSDoc `@type` on a function needs a call signature taking at least its parameters. */
|
|
15
|
+
export declare function checkJSDocFullSignature(c: Checker, fn: Node): void;
|
|
16
|
+
/**
|
|
17
|
+
* Reports `@param` tags of a JavaScript function naming no parameter, and qualified `@param` names
|
|
18
|
+
* without a parent `@param {object}`.
|
|
19
|
+
*/
|
|
20
|
+
export declare function checkUnmatchedJSDocParameters(c: Checker, node: Node): void;
|
|
21
|
+
/** An `@augments` or `@extends` tag naming another class than the `extends` clause. */
|
|
22
|
+
export declare class AugmentsMismatch {
|
|
23
|
+
readonly name: Node;
|
|
24
|
+
readonly tagName: string;
|
|
25
|
+
readonly className: string;
|
|
26
|
+
readonly extendsName: string;
|
|
27
|
+
constructor(name: Node, tagName: string, className: string, extendsName: string);
|
|
28
|
+
}
|
|
29
|
+
/** The `@augments` or `@extends` tag of a class whose class name differs from its `extends` clause. */
|
|
30
|
+
export declare function findMismatchedAugmentsTag(classLike: Node, extendsType: ExpressionWithTypeArguments): AugmentsMismatch | undefined;
|