tsc-ts 0.0.4 → 0.0.6
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 +34 -2
- 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 +2351 -0
- package/dist/api/compiler/ast.js +11212 -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 +1241 -0
- package/dist/api/compiler/binder.d.ts +33 -0
- package/dist/api/compiler/binder.js +2359 -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 +1641 -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 +357 -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 +788 -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 +314 -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 +291 -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 +580 -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 +2587 -0
- package/dist/api/compiler/checker-heritage.d.ts +28 -0
- package/dist/api/compiler/checker-heritage.js +901 -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 +442 -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 +200 -0
- package/dist/api/compiler/checker-members.js +2148 -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 +483 -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 +271 -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 +789 -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 +51 -0
- package/dist/api/compiler/checker-symbol-types.js +955 -0
- package/dist/api/compiler/checker-symbols.d.ts +181 -0
- package/dist/api/compiler/checker-symbols.js +1784 -0
- package/dist/api/compiler/checker-type-factory.d.ts +142 -0
- package/dist/api/compiler/checker-type-factory.js +2542 -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 +1093 -0
- package/dist/api/compiler/checker-types.js +1874 -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 +512 -0
- package/dist/api/compiler/checker.js +932 -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 +161 -0
- package/dist/api/compiler/diagnostics.js +784 -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 +144 -0
- package/dist/api/compiler/file-include.js +599 -0
- package/dist/api/compiler/file-loader.d.ts +290 -0
- package/dist/api/compiler/file-loader.js +1323 -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 +835 -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 +105 -0
- package/dist/api/compiler/link-tables.js +319 -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 +745 -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 +221 -0
- package/dist/api/compiler/parallel-parse.js +541 -0
- package/dist/api/compiler/parser.d.ts +604 -0
- package/dist/api/compiler/parser.js +6426 -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 +157 -0
- package/dist/api/compiler/printer/emit-context.js +582 -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 +529 -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 +1019 -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 +991 -0
- package/dist/api/compiler/symbol.d.ts +282 -0
- package/dist/api/compiler/symbol.js +339 -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 +677 -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 +539 -0
- package/dist/api/compiler/transformers/declarations-pseudo.d.ts +160 -0
- package/dist/api/compiler/transformers/declarations-pseudo.js +799 -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 +198 -0
- package/dist/api/compiler/transformers/declarations.d.ts +175 -0
- package/dist/api/compiler/transformers/declarations.js +2381 -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 +129 -0
- package/dist/api/compiler/transformers/reference-resolver.js +1157 -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 +10 -0
- package/dist/api/compiler/transformers/subtree-facts.js +205 -0
- package/dist/api/compiler/transformers/syntax-facts.d.ts +52 -0
- package/dist/api/compiler/transformers/syntax-facts.js +258 -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 +3 -2
- package/dist/api/library/ast.generated.d.ts +127 -139
- package/dist/api/library/checker.d.ts +51 -0
- package/dist/api/library/checker.js +318 -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/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 +5 -1
- package/dist/api/library/index.js +4 -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/types.d.ts +14 -1
- package/package.json +12 -8
- package/src/compiler/ast-utilities.ts +548 -0
- package/src/compiler/ast.ts +12870 -0
- package/src/compiler/astnav.ts +799 -0
- package/src/compiler/binder-utilities.ts +1392 -0
- package/src/compiler/binder.ts +2707 -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 +1201 -0
- package/src/compiler/checker-declared-types.ts +919 -0
- package/src/compiler/checker-decorators.ts +694 -0
- package/src/compiler/checker-deprecation.ts +355 -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 +3596 -0
- package/src/compiler/checker-heritage.ts +1240 -0
- package/src/compiler/checker-inference.ts +2584 -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 +1928 -0
- package/src/compiler/checker-literals.ts +61 -0
- package/src/compiler/checker-members.ts +2480 -0
- package/src/compiler/checker-modules.ts +2896 -0
- package/src/compiler/checker-narrowing.ts +3230 -0
- package/src/compiler/checker-object-literals.ts +591 -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 +1187 -0
- package/src/compiler/checker-symbols.ts +2157 -0
- package/src/compiler/checker-type-factory.ts +2616 -0
- package/src/compiler/checker-type-nodes.ts +1033 -0
- package/src/compiler/checker-type-operators.ts +2510 -0
- package/src/compiler/checker-types.ts +2520 -0
- package/src/compiler/checker-unused.ts +642 -0
- package/src/compiler/checker-utilities.ts +161 -0
- package/src/compiler/checker.ts +1138 -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 +858 -0
- package/src/compiler/emitter.ts +434 -0
- package/src/compiler/encoder.ts +1945 -0
- package/src/compiler/file-include.ts +741 -0
- package/src/compiler/file-loader.ts +1597 -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 +2818 -0
- package/src/compiler/init.ts +141 -0
- package/src/compiler/instantiation.ts +938 -0
- package/src/compiler/jsdoc.ts +1386 -0
- package/src/compiler/link-tables.ts +343 -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 +1071 -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 +3433 -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 +1954 -0
- package/src/compiler/parallel-parse.ts +595 -0
- package/src/compiler/parse-thread.ts +136 -0
- package/src/compiler/parser.ts +7766 -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 +684 -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 +594 -0
- package/src/compiler/program-utilities.ts +435 -0
- package/src/compiler/program.ts +1426 -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 +1166 -0
- package/src/compiler/symbol.ts +557 -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 +833 -0
- package/src/compiler/transformers/declarations-pseudo.ts +969 -0
- package/src/compiler/transformers/declarations-resolver.ts +249 -0
- package/src/compiler/transformers/declarations-syntactic.ts +1867 -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 +1213 -0
- package/src/compiler/transformers/runtime-syntax.ts +942 -0
- package/src/compiler/transformers/subtree-facts.ts +253 -0
- package/src/compiler/transformers/syntax-facts.ts +358 -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 +1422 -0
- package/src/compiler/tsc-cli.ts +669 -0
- package/src/compiler/tsc-compile.ts +446 -0
- package/src/compiler/tsc-watch.ts +922 -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 +141 -167
- package/src/library/ast.ts +4 -1
- package/src/library/checker.ts +384 -0
- package/src/library/diagnostics.ts +72 -0
- package/src/library/disk.ts +73 -0
- package/src/library/errors.ts +26 -0
- package/src/library/host.ts +63 -0
- package/src/library/index.ts +21 -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/types.ts +14 -1
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
import type { ProgramLifetime } from '@scriptc/types';
|
|
2
|
+
import type { Node } from './ast.js';
|
|
3
|
+
import type { __String, Symbol as PublicSymbol } from '../library/types.js';
|
|
4
|
+
export declare const enum SymbolFlags {
|
|
5
|
+
None = 0,
|
|
6
|
+
/** A `var` or parameter. */
|
|
7
|
+
FunctionScopedVariable = 1,
|
|
8
|
+
/** A `let` or `const`. */
|
|
9
|
+
BlockScopedVariable = 2,
|
|
10
|
+
/** A property or enum member. */
|
|
11
|
+
Property = 4,
|
|
12
|
+
EnumMember = 8,
|
|
13
|
+
Function = 16,
|
|
14
|
+
Class = 32,
|
|
15
|
+
Interface = 64,
|
|
16
|
+
ConstEnum = 128,
|
|
17
|
+
RegularEnum = 256,
|
|
18
|
+
/** An instantiated namespace. */
|
|
19
|
+
ValueModule = 512,
|
|
20
|
+
/** A namespace with only types. */
|
|
21
|
+
NamespaceModule = 1024,
|
|
22
|
+
/** A type literal or mapped type. */
|
|
23
|
+
TypeLiteral = 2048,
|
|
24
|
+
ObjectLiteral = 4096,
|
|
25
|
+
Method = 8192,
|
|
26
|
+
Constructor = 16384,
|
|
27
|
+
GetAccessor = 32768,
|
|
28
|
+
SetAccessor = 65536,
|
|
29
|
+
/** A call, construct or index signature. */
|
|
30
|
+
Signature = 131072,
|
|
31
|
+
TypeParameter = 262144,
|
|
32
|
+
TypeAlias = 524288,
|
|
33
|
+
/** The local half of an exported value; see `Binder.declareModuleMember`. */
|
|
34
|
+
ExportValue = 1048576,
|
|
35
|
+
/** An alias for another symbol, e.g. an import. */
|
|
36
|
+
Alias = 2097152,
|
|
37
|
+
/** A class's `prototype` property. */
|
|
38
|
+
Prototype = 4194304,
|
|
39
|
+
/** `export *` declarations. */
|
|
40
|
+
ExportStar = 8388608,
|
|
41
|
+
Optional = 16777216,
|
|
42
|
+
/** Created by the checker. */
|
|
43
|
+
Transient = 33554432,
|
|
44
|
+
/** A JavaScript assignment that declares a property, e.g. `fn.prop = 1`. */
|
|
45
|
+
Assignment = 67108864,
|
|
46
|
+
/** CommonJS `module` or `module.exports`. */
|
|
47
|
+
ModuleExports = 134217728,
|
|
48
|
+
/** A namespace whose only values are const enums. */
|
|
49
|
+
ConstEnumOnlyModule = 268435456,
|
|
50
|
+
/** A JavaScript `this.x` property that a method of the same name replaces. */
|
|
51
|
+
ReplaceableByMethod = 536870912,
|
|
52
|
+
/** Marks a lookup in the global scope. */
|
|
53
|
+
GlobalLookup = 1073741824,
|
|
54
|
+
All = 1073741823,
|
|
55
|
+
Enum = 384,
|
|
56
|
+
Variable = 3,
|
|
57
|
+
Value = 111551,
|
|
58
|
+
Type = 788968,
|
|
59
|
+
Namespace = 1920,
|
|
60
|
+
Module = 1536,
|
|
61
|
+
Accessor = 98304,
|
|
62
|
+
FunctionScopedVariableExcludes = 111550,
|
|
63
|
+
BlockScopedVariableExcludes = 111551,
|
|
64
|
+
ParameterExcludes = 111551,
|
|
65
|
+
PropertyExcludes = 13243,
|
|
66
|
+
EnumMemberExcludes = 900095,
|
|
67
|
+
FunctionExcludes = 110991,
|
|
68
|
+
/** Class-interface merging is checked by the checker. */
|
|
69
|
+
ClassExcludes = 899503,
|
|
70
|
+
InterfaceExcludes = 788872,
|
|
71
|
+
RegularEnumExcludes = 899327,
|
|
72
|
+
ConstEnumExcludes = 899967,
|
|
73
|
+
ValueModuleExcludes = 110735,
|
|
74
|
+
NamespaceModuleExcludes = 0,
|
|
75
|
+
MethodExcludes = 103359,
|
|
76
|
+
GetAccessorExcludes = 46011,
|
|
77
|
+
SetAccessorExcludes = 78779,
|
|
78
|
+
AccessorExcludes = 111547,
|
|
79
|
+
TypeParameterExcludes = 526824,
|
|
80
|
+
TypeAliasExcludes = 788968,
|
|
81
|
+
AliasExcludes = 2097152,
|
|
82
|
+
ModuleMember = 2623475,
|
|
83
|
+
ExportHasLocal = 944,
|
|
84
|
+
BlockScoped = 418,
|
|
85
|
+
PropertyOrAccessor = 98308,
|
|
86
|
+
ClassMember = 106500,
|
|
87
|
+
ExportSupportsDefaultModifier = 112,
|
|
88
|
+
ExportDoesNotSupportDefaultModifier = -113,
|
|
89
|
+
/** What the language service classifies semantically. */
|
|
90
|
+
Classifiable = 2885600,
|
|
91
|
+
LateBindingContainer = 6256
|
|
92
|
+
}
|
|
93
|
+
/** Flags of transient symbols created by the checker. */
|
|
94
|
+
export declare const enum CheckFlags {
|
|
95
|
+
None = 0,
|
|
96
|
+
Instantiated = 1,
|
|
97
|
+
/** A property of a union or intersection type. */
|
|
98
|
+
SyntheticProperty = 2,
|
|
99
|
+
SyntheticMethod = 4,
|
|
100
|
+
Readonly = 8,
|
|
101
|
+
/** In some but not all constituents. */
|
|
102
|
+
ReadPartial = 16,
|
|
103
|
+
/** In some constituents, and only an index signature in others. */
|
|
104
|
+
WritePartial = 32,
|
|
105
|
+
HasNonUniformType = 64,
|
|
106
|
+
HasLiteralType = 128,
|
|
107
|
+
ContainsPublic = 256,
|
|
108
|
+
ContainsProtected = 512,
|
|
109
|
+
ContainsPrivate = 1024,
|
|
110
|
+
ContainsStatic = 2048,
|
|
111
|
+
/** Late-bound from a computed property name. */
|
|
112
|
+
Late = 4096,
|
|
113
|
+
ReverseMapped = 8192,
|
|
114
|
+
OptionalParameter = 16384,
|
|
115
|
+
RestParameter = 32768,
|
|
116
|
+
/** The type is computed on demand. */
|
|
117
|
+
DeferredType = 65536,
|
|
118
|
+
HasNeverType = 131072,
|
|
119
|
+
Mapped = 262144,
|
|
120
|
+
StripOptional = 524288,
|
|
121
|
+
Unresolved = 1048576,
|
|
122
|
+
IsDiscriminantComputed = 2097152,
|
|
123
|
+
IsDiscriminant = 4194304,
|
|
124
|
+
/** Created from an index signature. */
|
|
125
|
+
IndexSymbol = 8388608,
|
|
126
|
+
Synthetic = 6,
|
|
127
|
+
NonUniformAndLiteral = 192,
|
|
128
|
+
Partial = 48
|
|
129
|
+
}
|
|
130
|
+
/** Fields of Symbol that few symbols set (about one in twenty), allocated on first write. */
|
|
131
|
+
export declare class SymbolRareFields implements ProgramLifetime {
|
|
132
|
+
members: SymbolTable | undefined;
|
|
133
|
+
exports: SymbolTable | undefined;
|
|
134
|
+
exportSymbol: Symbol | undefined;
|
|
135
|
+
/** All declarations of a symbol that has more than one (`getDeclarations`). */
|
|
136
|
+
declarations: Node[] | undefined;
|
|
137
|
+
/** The value declaration where it is not the first declaration (`Symbol.valueDeclaration`). */
|
|
138
|
+
valueDeclaration: Node | undefined;
|
|
139
|
+
}
|
|
140
|
+
export declare class Symbol implements ProgramLifetime {
|
|
141
|
+
flags: SymbolFlags;
|
|
142
|
+
/** The check flags, and `valueDeclarationIsFirst`. */
|
|
143
|
+
private bits;
|
|
144
|
+
readonly name: string;
|
|
145
|
+
/**
|
|
146
|
+
* The first declaration. A symbol with more keeps all of them in its rare fields; read them with
|
|
147
|
+
* `declarationCount`, `declarationAt` and `getDeclarations`. Written only through `setFirst`,
|
|
148
|
+
* which keeps the value declaration.
|
|
149
|
+
*/
|
|
150
|
+
declaration: Node | undefined;
|
|
151
|
+
parent: Symbol | undefined;
|
|
152
|
+
private rareFields;
|
|
153
|
+
/** Assigned on first use by `getSymbolId`, or at creation while threads share the program; 0 until then. */
|
|
154
|
+
id: number;
|
|
155
|
+
constructor(flags: SymbolFlags, name: string);
|
|
156
|
+
get checkFlags(): CheckFlags;
|
|
157
|
+
set checkFlags(flags: CheckFlags);
|
|
158
|
+
/** Makes `node` the first declaration, keeping the value declaration. */
|
|
159
|
+
setFirst(node: Node | undefined): void;
|
|
160
|
+
/**
|
|
161
|
+
* The declaration of the symbol's value. Almost always the first declaration, which a bit of `bits`
|
|
162
|
+
* says; any other is kept in the rare fields.
|
|
163
|
+
*/
|
|
164
|
+
get valueDeclaration(): Node | undefined;
|
|
165
|
+
set valueDeclaration(node: Node | undefined);
|
|
166
|
+
private rareFieldsOrNew;
|
|
167
|
+
/**
|
|
168
|
+
* The declarations, for tsc-ts/api's `Symbol.declarations`. The compiler reads `declaration`,
|
|
169
|
+
* `declarationCount` and `declarationAt`: for a single declaration this builds a list on each read.
|
|
170
|
+
*/
|
|
171
|
+
get declarations(): readonly Node[];
|
|
172
|
+
/** All declarations where there are more than one, else undefined. */
|
|
173
|
+
get moreDeclarations(): Node[] | undefined;
|
|
174
|
+
set moreDeclarations(value: Node[] | undefined);
|
|
175
|
+
get members(): SymbolTable | undefined;
|
|
176
|
+
set members(value: SymbolTable | undefined);
|
|
177
|
+
get exports(): SymbolTable | undefined;
|
|
178
|
+
set exports(value: SymbolTable | undefined);
|
|
179
|
+
/** For the local symbol of an exported declaration, the exported symbol. */
|
|
180
|
+
get exportSymbol(): Symbol | undefined;
|
|
181
|
+
set exportSymbol(value: Symbol | undefined);
|
|
182
|
+
/** The name in its escaped form, the key of member and export tables (`escapeSymbolName`). */
|
|
183
|
+
get escapedName(): string;
|
|
184
|
+
getParent(): Symbol | undefined;
|
|
185
|
+
/** The export symbol, or the symbol itself if it has none. */
|
|
186
|
+
getExportSymbol(): Symbol;
|
|
187
|
+
/** The members, by escaped name. */
|
|
188
|
+
getMembers(): Map<__String, PublicSymbol>;
|
|
189
|
+
/** The exports, by escaped name. */
|
|
190
|
+
getExports(): Map<__String, PublicSymbol>;
|
|
191
|
+
/** Whether this is the symbol of an external module, named by its quoted path. */
|
|
192
|
+
isExternalModule(): boolean;
|
|
193
|
+
/** The flags of this symbol and its export symbol. */
|
|
194
|
+
combinedLocalAndExportSymbolFlags(): SymbolFlags;
|
|
195
|
+
}
|
|
196
|
+
export type SymbolTable = Map<string, Symbol>;
|
|
197
|
+
/** Symbols get their ids when they are created from now on (see `idsAtCreation`). */
|
|
198
|
+
export declare function assignSymbolIdsAtCreation(): void;
|
|
199
|
+
/** Whether symbols get their ids when they are created (`assignSymbolIdsAtCreation`). */
|
|
200
|
+
export declare function symbolIdsAtCreation(): boolean;
|
|
201
|
+
/**
|
|
202
|
+
* Takes symbol ids in chunks from `counter[0]`, shared by the threads that bind together; with
|
|
203
|
+
* `undefined`, goes back to a plain counter above every id handed out.
|
|
204
|
+
*/
|
|
205
|
+
export declare function shareSymbolIds(counter: Int32Array | undefined): void;
|
|
206
|
+
/** The last symbol id handed out on this thread. */
|
|
207
|
+
export declare function lastSymbolIdValue(): number;
|
|
208
|
+
/** Continues symbol ids above `last` (a checker thread starts above the program it checks). */
|
|
209
|
+
export declare function reserveSymbolIds(last: number): void;
|
|
210
|
+
/** Appends `node` to the declarations of `symbol`. */
|
|
211
|
+
export declare function addDeclaration(symbol: Symbol, node: Node): void;
|
|
212
|
+
/** The number of declarations of `symbol`. */
|
|
213
|
+
export declare function declarationCount(symbol: Symbol): number;
|
|
214
|
+
/** The declaration of `symbol` at `index`, which is below `declarationCount(symbol)`. */
|
|
215
|
+
export declare function declarationAt(symbol: Symbol, index: number): Node;
|
|
216
|
+
/**
|
|
217
|
+
* The declarations of `symbol`, in order. A symbol with one declaration gets a new list each call;
|
|
218
|
+
* hot paths read `declaration`, `declarationCount` and `declarationAt` instead.
|
|
219
|
+
*/
|
|
220
|
+
export declare function getDeclarations(symbol: Symbol): readonly Node[];
|
|
221
|
+
/** Whether `node` is a declaration of `symbol`. */
|
|
222
|
+
export declare function hasDeclaration(symbol: Symbol, node: Node): boolean;
|
|
223
|
+
/** Gives `target` the declarations of `source`; a list of several is shared, as the list was before. */
|
|
224
|
+
export declare function copyDeclarations(target: Symbol, source: Symbol): void;
|
|
225
|
+
/** Replaces the declarations of `symbol` with `declarations`, which it keeps when they are more than one. */
|
|
226
|
+
export declare function setDeclarations(symbol: Symbol, declarations: readonly Node[]): void;
|
|
227
|
+
/** A program-wide id, assigned to each symbol when first requested. */
|
|
228
|
+
export declare function getSymbolId(symbol: Symbol): number;
|
|
229
|
+
/** The exports table of `symbol`, created if missing. */
|
|
230
|
+
export declare function getExports(symbol: Symbol): SymbolTable;
|
|
231
|
+
/** The members table of `symbol`, created if missing. */
|
|
232
|
+
export declare function getMembers(symbol: Symbol): SymbolTable;
|
|
233
|
+
/**
|
|
234
|
+
* Starts internal symbol names. A noncharacter, so it never starts an identifier and is
|
|
235
|
+
* vanishingly unlikely in a string-literal property name.
|
|
236
|
+
*/
|
|
237
|
+
export declare const internalSymbolNamePrefix = "\uFFFE";
|
|
238
|
+
export declare const enum InternalSymbolName {
|
|
239
|
+
/** Call signatures. */
|
|
240
|
+
Call = "\uFFFEcall",
|
|
241
|
+
/** Constructor implementations. */
|
|
242
|
+
Constructor = "\uFFFEconstructor",
|
|
243
|
+
/** Construct signatures. */
|
|
244
|
+
New = "\uFFFEnew",
|
|
245
|
+
/** Index signatures. */
|
|
246
|
+
Index = "\uFFFEindex",
|
|
247
|
+
/** `export *` declarations. */
|
|
248
|
+
ExportStar = "\uFFFEexport",
|
|
249
|
+
/** The global scope's self-reference. */
|
|
250
|
+
Global = "\uFFFEglobal",
|
|
251
|
+
/** A missing name. */
|
|
252
|
+
Missing = "\uFFFEmissing",
|
|
253
|
+
/** An anonymous type literal. */
|
|
254
|
+
Type = "\uFFFEtype",
|
|
255
|
+
/** An anonymous object literal. */
|
|
256
|
+
Object = "\uFFFEobject",
|
|
257
|
+
/** An anonymous JSX attributes object literal. */
|
|
258
|
+
JSXAttributes = "\uFFFEjsxAttributes",
|
|
259
|
+
/** An unnamed class expression. */
|
|
260
|
+
Class = "\uFFFEclass",
|
|
261
|
+
/** An unnamed function expression. */
|
|
262
|
+
Function = "\uFFFEfunction",
|
|
263
|
+
/** A computed property name that isn't a literal. */
|
|
264
|
+
Computed = "\uFFFEcomputed",
|
|
265
|
+
/** Late-bound JavaScript assignment declarations. */
|
|
266
|
+
AssignmentDeclaration = "\uFFFEassignment",
|
|
267
|
+
InstantiationExpression = "\uFFFEinstantiationExpression",
|
|
268
|
+
ImportAttributes = "\uFFFEimportAttributes",
|
|
269
|
+
ExportEquals = "export=",
|
|
270
|
+
Default = "default",
|
|
271
|
+
This = "this",
|
|
272
|
+
ModuleExports = "module.exports"
|
|
273
|
+
}
|
|
274
|
+
/** `name` with a leading internal prefix replaced by `__`. */
|
|
275
|
+
export declare function escapeInternalSymbolName(name: string): string;
|
|
276
|
+
/** `name` with every internal prefix replaced by `__`. */
|
|
277
|
+
export declare function escapeAllInternalSymbolNames(name: string): string;
|
|
278
|
+
/**
|
|
279
|
+
* The escaped `__String` form of a symbol name: internal names get `__`, and names that
|
|
280
|
+
* already start with `__` get one more `_`.
|
|
281
|
+
*/
|
|
282
|
+
export declare function escapeSymbolName(name: string): string;
|
|
@@ -0,0 +1,339 @@
|
|
|
1
|
+
/** Fields of Symbol that few symbols set (about one in twenty), allocated on first write. */
|
|
2
|
+
export class SymbolRareFields {
|
|
3
|
+
members = undefined;
|
|
4
|
+
exports = undefined;
|
|
5
|
+
exportSymbol = undefined;
|
|
6
|
+
/** All declarations of a symbol that has more than one (`getDeclarations`). */
|
|
7
|
+
declarations = undefined;
|
|
8
|
+
/** The value declaration where it is not the first declaration (`Symbol.valueDeclaration`). */
|
|
9
|
+
valueDeclaration = undefined;
|
|
10
|
+
}
|
|
11
|
+
/** In `Symbol.bits`, above the check flags: the value declaration is the first declaration. */
|
|
12
|
+
const valueDeclarationIsFirst = 1 << 30;
|
|
13
|
+
export class Symbol {
|
|
14
|
+
flags;
|
|
15
|
+
/** The check flags, and `valueDeclarationIsFirst`. */
|
|
16
|
+
bits;
|
|
17
|
+
name;
|
|
18
|
+
/**
|
|
19
|
+
* The first declaration. A symbol with more keeps all of them in its rare fields; read them with
|
|
20
|
+
* `declarationCount`, `declarationAt` and `getDeclarations`. Written only through `setFirst`,
|
|
21
|
+
* which keeps the value declaration.
|
|
22
|
+
*/
|
|
23
|
+
declaration;
|
|
24
|
+
parent;
|
|
25
|
+
rareFields;
|
|
26
|
+
/** Assigned on first use by `getSymbolId`, or at creation while threads share the program; 0 until then. */
|
|
27
|
+
id;
|
|
28
|
+
constructor(flags, name) {
|
|
29
|
+
this.flags = flags;
|
|
30
|
+
this.bits = 0;
|
|
31
|
+
this.name = name;
|
|
32
|
+
this.declaration = undefined;
|
|
33
|
+
this.parent = undefined;
|
|
34
|
+
this.rareFields = undefined;
|
|
35
|
+
this.id = idsAtCreation ? takeSymbolId() : 0;
|
|
36
|
+
}
|
|
37
|
+
get checkFlags() {
|
|
38
|
+
return (this.bits & ~valueDeclarationIsFirst);
|
|
39
|
+
}
|
|
40
|
+
set checkFlags(flags) {
|
|
41
|
+
this.bits = (this.bits & valueDeclarationIsFirst) | flags;
|
|
42
|
+
}
|
|
43
|
+
/** Makes `node` the first declaration, keeping the value declaration. */
|
|
44
|
+
setFirst(node) {
|
|
45
|
+
if ((this.bits & valueDeclarationIsFirst) !== 0 && node !== this.declaration) {
|
|
46
|
+
// The value declaration stays what it was.
|
|
47
|
+
this.rareFieldsOrNew().valueDeclaration = this.declaration;
|
|
48
|
+
this.bits &= ~valueDeclarationIsFirst;
|
|
49
|
+
}
|
|
50
|
+
this.declaration = node;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* The declaration of the symbol's value. Almost always the first declaration, which a bit of `bits`
|
|
54
|
+
* says; any other is kept in the rare fields.
|
|
55
|
+
*/
|
|
56
|
+
get valueDeclaration() {
|
|
57
|
+
if ((this.bits & valueDeclarationIsFirst) !== 0)
|
|
58
|
+
return this.declaration;
|
|
59
|
+
const group = this.rareFields;
|
|
60
|
+
return group === undefined ? undefined : group.valueDeclaration;
|
|
61
|
+
}
|
|
62
|
+
set valueDeclaration(node) {
|
|
63
|
+
const group = this.rareFields;
|
|
64
|
+
if (node !== undefined && node === this.declaration) {
|
|
65
|
+
this.bits |= valueDeclarationIsFirst;
|
|
66
|
+
if (group !== undefined)
|
|
67
|
+
group.valueDeclaration = undefined;
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
this.bits &= ~valueDeclarationIsFirst;
|
|
71
|
+
if (node !== undefined || group !== undefined)
|
|
72
|
+
this.rareFieldsOrNew().valueDeclaration = node;
|
|
73
|
+
}
|
|
74
|
+
rareFieldsOrNew() {
|
|
75
|
+
let group = this.rareFields;
|
|
76
|
+
if (group === undefined) {
|
|
77
|
+
group = new SymbolRareFields();
|
|
78
|
+
this.rareFields = group;
|
|
79
|
+
}
|
|
80
|
+
return group;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* The declarations, for tsc-ts/api's `Symbol.declarations`. The compiler reads `declaration`,
|
|
84
|
+
* `declarationCount` and `declarationAt`: for a single declaration this builds a list on each read.
|
|
85
|
+
*/
|
|
86
|
+
get declarations() {
|
|
87
|
+
return getDeclarations(this);
|
|
88
|
+
}
|
|
89
|
+
/** All declarations where there are more than one, else undefined. */
|
|
90
|
+
get moreDeclarations() {
|
|
91
|
+
const group = this.rareFields;
|
|
92
|
+
return group === undefined ? undefined : group.declarations;
|
|
93
|
+
}
|
|
94
|
+
set moreDeclarations(value) {
|
|
95
|
+
if (value === undefined && this.rareFields === undefined)
|
|
96
|
+
return;
|
|
97
|
+
this.rareFieldsOrNew().declarations = value;
|
|
98
|
+
}
|
|
99
|
+
get members() {
|
|
100
|
+
const group = this.rareFields;
|
|
101
|
+
return group === undefined ? undefined : group.members;
|
|
102
|
+
}
|
|
103
|
+
set members(value) {
|
|
104
|
+
if (value === undefined && this.rareFields === undefined)
|
|
105
|
+
return;
|
|
106
|
+
this.rareFieldsOrNew().members = value;
|
|
107
|
+
}
|
|
108
|
+
get exports() {
|
|
109
|
+
const group = this.rareFields;
|
|
110
|
+
return group === undefined ? undefined : group.exports;
|
|
111
|
+
}
|
|
112
|
+
set exports(value) {
|
|
113
|
+
if (value === undefined && this.rareFields === undefined)
|
|
114
|
+
return;
|
|
115
|
+
this.rareFieldsOrNew().exports = value;
|
|
116
|
+
}
|
|
117
|
+
/** For the local symbol of an exported declaration, the exported symbol. */
|
|
118
|
+
get exportSymbol() {
|
|
119
|
+
const group = this.rareFields;
|
|
120
|
+
return group === undefined ? undefined : group.exportSymbol;
|
|
121
|
+
}
|
|
122
|
+
set exportSymbol(value) {
|
|
123
|
+
if (value === undefined && this.rareFields === undefined)
|
|
124
|
+
return;
|
|
125
|
+
this.rareFieldsOrNew().exportSymbol = value;
|
|
126
|
+
}
|
|
127
|
+
// TypeScript 7's API (tsc-ts/api). The symbols it hands out have their ids assigned.
|
|
128
|
+
/** The name in its escaped form, the key of member and export tables (`escapeSymbolName`). */
|
|
129
|
+
get escapedName() {
|
|
130
|
+
return escapeSymbolName(this.name);
|
|
131
|
+
}
|
|
132
|
+
getParent() {
|
|
133
|
+
const parent = this.parent;
|
|
134
|
+
if (parent !== undefined)
|
|
135
|
+
getSymbolId(parent);
|
|
136
|
+
return parent;
|
|
137
|
+
}
|
|
138
|
+
/** The export symbol, or the symbol itself if it has none. */
|
|
139
|
+
getExportSymbol() {
|
|
140
|
+
const exported = this.exportSymbol ?? this;
|
|
141
|
+
getSymbolId(exported);
|
|
142
|
+
return exported;
|
|
143
|
+
}
|
|
144
|
+
/** The members, by escaped name. */
|
|
145
|
+
getMembers() {
|
|
146
|
+
return byEscapedName(this.members);
|
|
147
|
+
}
|
|
148
|
+
/** The exports, by escaped name. */
|
|
149
|
+
getExports() {
|
|
150
|
+
return byEscapedName(this.exports);
|
|
151
|
+
}
|
|
152
|
+
/** Whether this is the symbol of an external module, named by its quoted path. */
|
|
153
|
+
isExternalModule() {
|
|
154
|
+
return (this.flags & 1536 /* SymbolFlags.Module */) !== 0 && this.name.charCodeAt(0) === 0x22;
|
|
155
|
+
}
|
|
156
|
+
/** The flags of this symbol and its export symbol. */
|
|
157
|
+
combinedLocalAndExportSymbolFlags() {
|
|
158
|
+
const exportSymbol = this.exportSymbol;
|
|
159
|
+
return exportSymbol === undefined ? this.flags : this.flags | exportSymbol.flags;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
let nextSymbolId = 0;
|
|
163
|
+
// A program shared between threads (parallel-check.ts) is never written, so its symbols get their ids
|
|
164
|
+
// when they are created rather than on first use.
|
|
165
|
+
let idsAtCreation = false;
|
|
166
|
+
// While several threads bind one program (parallel-parse.ts), each takes symbol ids in chunks from a
|
|
167
|
+
// shared counter; ids up to `symbolIdLimit` belong to this thread.
|
|
168
|
+
let symbolIdLimit = Number.POSITIVE_INFINITY;
|
|
169
|
+
let symbolIdCounter = undefined;
|
|
170
|
+
const symbolIdChunk = 4096;
|
|
171
|
+
/** Symbols get their ids when they are created from now on (see `idsAtCreation`). */
|
|
172
|
+
export function assignSymbolIdsAtCreation() {
|
|
173
|
+
idsAtCreation = true;
|
|
174
|
+
}
|
|
175
|
+
/** Whether symbols get their ids when they are created (`assignSymbolIdsAtCreation`). */
|
|
176
|
+
export function symbolIdsAtCreation() {
|
|
177
|
+
return idsAtCreation;
|
|
178
|
+
}
|
|
179
|
+
function takeSymbolId() {
|
|
180
|
+
// `| 0`: ids stay far below 2^31, and native builds then store `id` as an int32.
|
|
181
|
+
return (nextSymbolId < symbolIdLimit ? ++nextSymbolId : takeSymbolIdChunk()) | 0;
|
|
182
|
+
}
|
|
183
|
+
function takeSymbolIdChunk() {
|
|
184
|
+
const base = Atomics.add(symbolIdCounter, 0, symbolIdChunk);
|
|
185
|
+
nextSymbolId = base + 1;
|
|
186
|
+
symbolIdLimit = base + symbolIdChunk;
|
|
187
|
+
return nextSymbolId;
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* Takes symbol ids in chunks from `counter[0]`, shared by the threads that bind together; with
|
|
191
|
+
* `undefined`, goes back to a plain counter above every id handed out.
|
|
192
|
+
*/
|
|
193
|
+
export function shareSymbolIds(counter) {
|
|
194
|
+
if (counter !== undefined) {
|
|
195
|
+
symbolIdCounter = counter;
|
|
196
|
+
symbolIdLimit = nextSymbolId;
|
|
197
|
+
return;
|
|
198
|
+
}
|
|
199
|
+
if (symbolIdCounter !== undefined) {
|
|
200
|
+
const top = Atomics.load(symbolIdCounter, 0);
|
|
201
|
+
if (top > nextSymbolId)
|
|
202
|
+
nextSymbolId = top;
|
|
203
|
+
}
|
|
204
|
+
symbolIdCounter = undefined;
|
|
205
|
+
symbolIdLimit = Number.POSITIVE_INFINITY;
|
|
206
|
+
}
|
|
207
|
+
/** The last symbol id handed out on this thread. */
|
|
208
|
+
export function lastSymbolIdValue() {
|
|
209
|
+
return nextSymbolId;
|
|
210
|
+
}
|
|
211
|
+
/** Continues symbol ids above `last` (a checker thread starts above the program it checks). */
|
|
212
|
+
export function reserveSymbolIds(last) {
|
|
213
|
+
if (last > nextSymbolId)
|
|
214
|
+
nextSymbolId = last;
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* The declarations of a symbol without any: shared, so never modified. Add declarations with
|
|
218
|
+
* `addDeclaration`, which gives the symbol its own array on the first one.
|
|
219
|
+
*/
|
|
220
|
+
const noDeclarations = [];
|
|
221
|
+
/** Appends `node` to the declarations of `symbol`. */
|
|
222
|
+
export function addDeclaration(symbol, node) {
|
|
223
|
+
const first = symbol.declaration;
|
|
224
|
+
if (first === undefined) {
|
|
225
|
+
symbol.setFirst(node);
|
|
226
|
+
return;
|
|
227
|
+
}
|
|
228
|
+
const more = symbol.moreDeclarations;
|
|
229
|
+
if (more !== undefined)
|
|
230
|
+
more.push(node);
|
|
231
|
+
else
|
|
232
|
+
symbol.moreDeclarations = [first, node];
|
|
233
|
+
}
|
|
234
|
+
/** The number of declarations of `symbol`. */
|
|
235
|
+
export function declarationCount(symbol) {
|
|
236
|
+
if (symbol.declaration === undefined)
|
|
237
|
+
return 0;
|
|
238
|
+
const more = symbol.moreDeclarations;
|
|
239
|
+
return more !== undefined ? more.length : 1;
|
|
240
|
+
}
|
|
241
|
+
/** The declaration of `symbol` at `index`, which is below `declarationCount(symbol)`. */
|
|
242
|
+
export function declarationAt(symbol, index) {
|
|
243
|
+
return index === 0 ? symbol.declaration : symbol.moreDeclarations[index];
|
|
244
|
+
}
|
|
245
|
+
/**
|
|
246
|
+
* The declarations of `symbol`, in order. A symbol with one declaration gets a new list each call;
|
|
247
|
+
* hot paths read `declaration`, `declarationCount` and `declarationAt` instead.
|
|
248
|
+
*/
|
|
249
|
+
export function getDeclarations(symbol) {
|
|
250
|
+
const first = symbol.declaration;
|
|
251
|
+
if (first === undefined)
|
|
252
|
+
return noDeclarations;
|
|
253
|
+
const more = symbol.moreDeclarations;
|
|
254
|
+
return more !== undefined ? more : [first];
|
|
255
|
+
}
|
|
256
|
+
/** Whether `node` is a declaration of `symbol`. */
|
|
257
|
+
export function hasDeclaration(symbol, node) {
|
|
258
|
+
const first = symbol.declaration;
|
|
259
|
+
if (first === undefined)
|
|
260
|
+
return false;
|
|
261
|
+
if (first === node)
|
|
262
|
+
return true;
|
|
263
|
+
const more = symbol.moreDeclarations;
|
|
264
|
+
return more !== undefined && more.indexOf(node) >= 0;
|
|
265
|
+
}
|
|
266
|
+
/** Gives `target` the declarations of `source`; a list of several is shared, as the list was before. */
|
|
267
|
+
export function copyDeclarations(target, source) {
|
|
268
|
+
target.setFirst(source.declaration);
|
|
269
|
+
target.moreDeclarations = source.moreDeclarations;
|
|
270
|
+
}
|
|
271
|
+
/** Replaces the declarations of `symbol` with `declarations`, which it keeps when they are more than one. */
|
|
272
|
+
export function setDeclarations(symbol, declarations) {
|
|
273
|
+
symbol.setFirst(declarations.length !== 0 ? declarations[0] : undefined);
|
|
274
|
+
symbol.moreDeclarations = declarations.length > 1 ? declarations : undefined;
|
|
275
|
+
}
|
|
276
|
+
/**
|
|
277
|
+
* The symbols of `table` by escaped name, with their ids assigned, as tsc-ts's public API types them: the map's
|
|
278
|
+
* values are typed as the public Symbol, so a native build returns it as the map that interface declares.
|
|
279
|
+
*/
|
|
280
|
+
function byEscapedName(table) {
|
|
281
|
+
const result = new Map();
|
|
282
|
+
if (table !== undefined)
|
|
283
|
+
for (const symbol of table.values()) {
|
|
284
|
+
getSymbolId(symbol);
|
|
285
|
+
result.set(escapeSymbolName(symbol.name), symbol);
|
|
286
|
+
}
|
|
287
|
+
return result;
|
|
288
|
+
}
|
|
289
|
+
/** A program-wide id, assigned to each symbol when first requested. */
|
|
290
|
+
export function getSymbolId(symbol) {
|
|
291
|
+
let id = symbol.id;
|
|
292
|
+
if (id === 0) {
|
|
293
|
+
id = takeSymbolId();
|
|
294
|
+
symbol.id = id;
|
|
295
|
+
}
|
|
296
|
+
return id;
|
|
297
|
+
}
|
|
298
|
+
/** The exports table of `symbol`, created if missing. */
|
|
299
|
+
export function getExports(symbol) {
|
|
300
|
+
let exports = symbol.exports;
|
|
301
|
+
if (exports === undefined) {
|
|
302
|
+
exports = new Map();
|
|
303
|
+
symbol.exports = exports;
|
|
304
|
+
}
|
|
305
|
+
return exports;
|
|
306
|
+
}
|
|
307
|
+
/** The members table of `symbol`, created if missing. */
|
|
308
|
+
export function getMembers(symbol) {
|
|
309
|
+
let members = symbol.members;
|
|
310
|
+
if (members === undefined) {
|
|
311
|
+
members = new Map();
|
|
312
|
+
symbol.members = members;
|
|
313
|
+
}
|
|
314
|
+
return members;
|
|
315
|
+
}
|
|
316
|
+
/**
|
|
317
|
+
* Starts internal symbol names. A noncharacter, so it never starts an identifier and is
|
|
318
|
+
* vanishingly unlikely in a string-literal property name.
|
|
319
|
+
*/
|
|
320
|
+
export const internalSymbolNamePrefix = '';
|
|
321
|
+
/** `name` with a leading internal prefix replaced by `__`. */
|
|
322
|
+
export function escapeInternalSymbolName(name) {
|
|
323
|
+
return name.startsWith(internalSymbolNamePrefix) ? '__' + name.substring(1) : name;
|
|
324
|
+
}
|
|
325
|
+
/** `name` with every internal prefix replaced by `__`. */
|
|
326
|
+
export function escapeAllInternalSymbolNames(name) {
|
|
327
|
+
return name.indexOf(internalSymbolNamePrefix) < 0 ? name : name.replaceAll(internalSymbolNamePrefix, '__');
|
|
328
|
+
}
|
|
329
|
+
/**
|
|
330
|
+
* The escaped `__String` form of a symbol name: internal names get `__`, and names that
|
|
331
|
+
* already start with `__` get one more `_`.
|
|
332
|
+
*/
|
|
333
|
+
export function escapeSymbolName(name) {
|
|
334
|
+
if (name.startsWith(internalSymbolNamePrefix))
|
|
335
|
+
return '__' + name.substring(1);
|
|
336
|
+
if (name.startsWith('__'))
|
|
337
|
+
return '_' + name;
|
|
338
|
+
return name;
|
|
339
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/** The real directory of a symlink, with a trailing `/`: as `realpath` spells it, and as a path. */
|
|
2
|
+
export declare class KnownDirectoryLink {
|
|
3
|
+
readonly real: string;
|
|
4
|
+
readonly realPath: string;
|
|
5
|
+
constructor(real: string, realPath: string);
|
|
6
|
+
}
|
|
7
|
+
export declare class KnownSymlinks {
|
|
8
|
+
readonly currentDirectory: string;
|
|
9
|
+
readonly useCaseSensitiveFileNames: boolean;
|
|
10
|
+
/** Real directories by symlink path; keys have a trailing `/`. */
|
|
11
|
+
private readonly directories;
|
|
12
|
+
/** Symlinks, as spelled, by real directory path; keys have a trailing `/`. */
|
|
13
|
+
private readonly directoriesByRealpath;
|
|
14
|
+
/**
|
|
15
|
+
* The directory symlink each resolution implies (`null` for none), by original path and resolved
|
|
16
|
+
* file name: many files resolve the same module through the same symlink.
|
|
17
|
+
*/
|
|
18
|
+
private readonly implied;
|
|
19
|
+
constructor(currentDirectory: string, useCaseSensitiveFileNames: boolean);
|
|
20
|
+
hasDirectory(symlinkPath: string): boolean;
|
|
21
|
+
/** The symlinks to the real directory `realPath`, which has a trailing `/`. */
|
|
22
|
+
getSymlinksOfDirectory(realPath: string): ReadonlySet<string> | undefined;
|
|
23
|
+
setDirectory(symlink: string, symlinkPath: string, real: KnownDirectoryLink): void;
|
|
24
|
+
/** Records the directory symlink a resolution through `originalPath` to `resolvedFileName` implies. */
|
|
25
|
+
processResolution(originalPath: string, resolvedFileName: string): void;
|
|
26
|
+
private impliedDirectoryLink;
|
|
27
|
+
/** The longest directories of `resolved` and `original` whose remaining paths are equal. */
|
|
28
|
+
private guessDirectorySymlink;
|
|
29
|
+
private isNodeModulesOrScopedPackageDirectory;
|
|
30
|
+
}
|
|
31
|
+
/** Paths inside `node_modules/.*` (such as pnpm's store), `.git` or editor lock files. */
|
|
32
|
+
export declare function containsIgnoredPath(path: string): boolean;
|