tsc-ts 0.0.9 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/bin/tsc-ts.js +70 -1
- package/dist/api/compiler/ast-utilities.d.ts +19 -1
- package/dist/api/compiler/ast-utilities.js +180 -95
- package/dist/api/compiler/ast.d.ts +22 -15
- package/dist/api/compiler/ast.js +1026 -995
- package/dist/api/compiler/astnav.js +15 -15
- package/dist/api/compiler/binder-utilities.js +186 -186
- package/dist/api/compiler/binder.js +290 -263
- package/dist/api/compiler/character-codes.js +2 -2
- package/dist/api/compiler/checker-calls.js +178 -124
- package/dist/api/compiler/checker-classes.d.ts +14 -3
- package/dist/api/compiler/checker-classes.js +134 -90
- package/dist/api/compiler/checker-contextual.js +64 -61
- package/dist/api/compiler/checker-declaration-order.js +79 -79
- package/dist/api/compiler/checker-declarations.d.ts +1 -0
- package/dist/api/compiler/checker-declarations.js +160 -136
- package/dist/api/compiler/checker-declared-types.js +67 -65
- package/dist/api/compiler/checker-decorators.js +77 -77
- package/dist/api/compiler/checker-deprecation.d.ts +8 -3
- package/dist/api/compiler/checker-deprecation.js +76 -55
- package/dist/api/compiler/checker-destructuring.js +47 -45
- package/dist/api/compiler/checker-elaboration.js +24 -24
- package/dist/api/compiler/checker-emit-helpers.js +4 -4
- package/dist/api/compiler/checker-emit-resolver.d.ts +4 -2
- package/dist/api/compiler/checker-emit-resolver.js +25 -13
- package/dist/api/compiler/checker-evaluator.js +9 -9
- package/dist/api/compiler/checker-expressions.js +244 -211
- package/dist/api/compiler/checker-functions.js +113 -107
- package/dist/api/compiler/checker-generated-code.d.ts +0 -11
- package/dist/api/compiler/checker-generated-code.js +28 -52
- package/dist/api/compiler/checker-grammar.d.ts +1 -0
- package/dist/api/compiler/checker-grammar.js +472 -440
- package/dist/api/compiler/checker-heritage.js +91 -93
- package/dist/api/compiler/checker-inference.d.ts +77 -5
- package/dist/api/compiler/checker-inference.js +487 -107
- package/dist/api/compiler/checker-iteration.d.ts +0 -10
- package/dist/api/compiler/checker-iteration.js +35 -52
- package/dist/api/compiler/checker-javascript.js +14 -14
- package/dist/api/compiler/checker-jsdoc.d.ts +8 -10
- package/dist/api/compiler/checker-jsdoc.js +67 -58
- package/dist/api/compiler/checker-jsx.js +105 -88
- package/dist/api/compiler/checker-members.d.ts +9 -2
- package/dist/api/compiler/checker-members.js +212 -75
- package/dist/api/compiler/checker-modules.d.ts +15 -6
- package/dist/api/compiler/checker-modules.js +469 -309
- package/dist/api/compiler/checker-narrowing.js +273 -189
- package/dist/api/compiler/checker-object-literals.js +25 -22
- package/dist/api/compiler/checker-operators.js +126 -118
- package/dist/api/compiler/checker-overloads.js +27 -27
- package/dist/api/compiler/checker-property-access.js +59 -55
- package/dist/api/compiler/checker-services.d.ts +1 -0
- package/dist/api/compiler/checker-services.js +222 -210
- package/dist/api/compiler/checker-signatures.js +65 -49
- package/dist/api/compiler/checker-source-file.d.ts +5 -0
- package/dist/api/compiler/checker-source-file.js +154 -130
- package/dist/api/compiler/checker-statements.js +33 -32
- package/dist/api/compiler/checker-super.js +50 -50
- package/dist/api/compiler/checker-symbol-types.js +109 -93
- package/dist/api/compiler/checker-symbols.d.ts +13 -1
- package/dist/api/compiler/checker-symbols.js +264 -149
- package/dist/api/compiler/checker-type-factory.d.ts +5 -0
- package/dist/api/compiler/checker-type-factory.js +145 -36
- package/dist/api/compiler/checker-type-nodes.d.ts +1 -0
- package/dist/api/compiler/checker-type-nodes.js +179 -141
- package/dist/api/compiler/checker-type-operators.d.ts +2 -0
- package/dist/api/compiler/checker-type-operators.js +110 -63
- package/dist/api/compiler/checker-types.d.ts +80 -3
- package/dist/api/compiler/checker-types.js +121 -2
- package/dist/api/compiler/checker-unused.js +114 -118
- package/dist/api/compiler/checker-utilities.js +11 -11
- package/dist/api/compiler/checker.d.ts +104 -31
- package/dist/api/compiler/checker.js +181 -33
- package/dist/api/compiler/command-line.d.ts +1 -3
- package/dist/api/compiler/command-line.js +47 -44
- package/dist/api/compiler/compile-program.d.ts +42 -3
- package/dist/api/compiler/compile-program.js +139 -27
- package/dist/api/compiler/diagnostic-messages.d.ts +1849 -1774
- package/dist/api/compiler/diagnostic-messages.js +128 -122
- package/dist/api/compiler/diagnostics.d.ts +22 -0
- package/dist/api/compiler/diagnostics.js +93 -11
- package/dist/api/compiler/emitter.d.ts +7 -1
- package/dist/api/compiler/emitter.js +53 -11
- package/dist/api/compiler/file-include.d.ts +2 -1
- package/dist/api/compiler/file-include.js +11 -7
- package/dist/api/compiler/file-loader.d.ts +21 -1
- package/dist/api/compiler/file-loader.js +201 -48
- package/dist/api/compiler/instantiation.d.ts +7 -0
- package/dist/api/compiler/instantiation.js +101 -49
- package/dist/api/compiler/jsdoc.js +23 -23
- package/dist/api/compiler/link-tables.d.ts +48 -18
- package/dist/api/compiler/link-tables.js +80 -37
- package/dist/api/compiler/locales/cs-CZ.d.ts +1 -1
- package/dist/api/compiler/locales/cs-CZ.js +1 -1
- package/dist/api/compiler/locales/de-DE.d.ts +1 -1
- package/dist/api/compiler/locales/de-DE.js +1 -1
- package/dist/api/compiler/locales/es-ES.d.ts +1 -1
- package/dist/api/compiler/locales/es-ES.js +1 -1
- package/dist/api/compiler/locales/fr-FR.d.ts +1 -1
- package/dist/api/compiler/locales/fr-FR.js +1 -1
- package/dist/api/compiler/locales/it-IT.d.ts +1 -1
- package/dist/api/compiler/locales/it-IT.js +1 -1
- package/dist/api/compiler/locales/ja-JP.d.ts +1 -1
- package/dist/api/compiler/locales/ja-JP.js +1 -1
- package/dist/api/compiler/locales/ko-KR.d.ts +1 -1
- package/dist/api/compiler/locales/ko-KR.js +1 -1
- package/dist/api/compiler/locales/pl-PL.d.ts +1 -1
- package/dist/api/compiler/locales/pl-PL.js +1 -1
- package/dist/api/compiler/locales/pt-BR.d.ts +1 -1
- package/dist/api/compiler/locales/pt-BR.js +1 -1
- package/dist/api/compiler/locales/ru-RU.d.ts +1 -1
- package/dist/api/compiler/locales/ru-RU.js +1 -1
- package/dist/api/compiler/locales/tr-TR.d.ts +1 -1
- package/dist/api/compiler/locales/tr-TR.js +1 -1
- package/dist/api/compiler/locales/zh-CN.d.ts +1 -1
- package/dist/api/compiler/locales/zh-CN.js +1 -1
- package/dist/api/compiler/locales/zh-TW.d.ts +1 -1
- package/dist/api/compiler/locales/zh-TW.js +1 -1
- package/dist/api/compiler/module-resolution-types.js +6 -6
- package/dist/api/compiler/module-resolution.d.ts +10 -1
- package/dist/api/compiler/module-resolution.js +115 -84
- package/dist/api/compiler/module-specifiers.d.ts +15 -0
- package/dist/api/compiler/module-specifiers.js +24 -18
- package/dist/api/compiler/name-resolver.js +74 -65
- package/dist/api/compiler/node-builder-names.d.ts +11 -3
- package/dist/api/compiler/node-builder-names.js +210 -90
- package/dist/api/compiler/node-builder-pseudo.js +29 -31
- package/dist/api/compiler/node-builder-reuse.js +23 -22
- package/dist/api/compiler/node-builder.d.ts +18 -1
- package/dist/api/compiler/node-builder.js +191 -102
- package/dist/api/compiler/option-declarations.d.ts +2 -6
- package/dist/api/compiler/option-declarations.js +315 -375
- package/dist/api/compiler/options.d.ts +15 -33
- package/dist/api/compiler/options.js +21 -54
- package/dist/api/compiler/output-paths.d.ts +4 -1
- package/dist/api/compiler/output-paths.js +6 -11
- package/dist/api/compiler/package-json.d.ts +3 -3
- package/dist/api/compiler/package-json.js +11 -10
- package/dist/api/compiler/parallel-parse.d.ts +3 -2
- package/dist/api/compiler/parallel-parse.js +17 -5
- package/dist/api/compiler/parser.d.ts +40 -19
- package/dist/api/compiler/parser.js +308 -216
- package/dist/api/compiler/path.d.ts +9 -0
- package/dist/api/compiler/path.js +20 -3
- package/dist/api/compiler/printer/emit-context.d.ts +5 -1
- package/dist/api/compiler/printer/emit-context.js +20 -1
- package/dist/api/compiler/printer/factory-base.d.ts +2 -2
- package/dist/api/compiler/printer/factory-base.js +7 -3
- package/dist/api/compiler/printer/factory.js +3 -1
- package/dist/api/compiler/printer/helpers.js +10 -1
- package/dist/api/compiler/printer/name-generator.d.ts +1 -1
- package/dist/api/compiler/printer/name-generator.js +35 -16
- package/dist/api/compiler/printer/printer.d.ts +49 -2
- package/dist/api/compiler/printer/printer.js +539 -293
- package/dist/api/compiler/printer/utilities.js +149 -147
- package/dist/api/compiler/program-checker.d.ts +12 -2
- package/dist/api/compiler/program-checker.js +88 -34
- package/dist/api/compiler/program-utilities.d.ts +3 -1
- package/dist/api/compiler/program-utilities.js +28 -15
- package/dist/api/compiler/program.d.ts +4 -6
- package/dist/api/compiler/program.js +74 -87
- package/dist/api/compiler/pseudo-bigint.d.ts +2 -0
- package/dist/api/compiler/pseudo-bigint.js +18 -0
- package/dist/api/compiler/regexp-checker.d.ts +1 -1
- package/dist/api/compiler/regexp-checker.js +93 -76
- package/dist/api/compiler/relations.d.ts +27 -4
- package/dist/api/compiler/relations.js +347 -180
- package/dist/api/compiler/reparser.js +60 -56
- package/dist/api/compiler/scanner.d.ts +19 -2
- package/dist/api/compiler/scanner.js +123 -108
- package/dist/api/compiler/shared-results.d.ts +463 -0
- package/dist/api/compiler/shared-results.js +2128 -0
- package/dist/api/compiler/sourcemap.js +2 -2
- package/dist/api/compiler/symbol-accessibility.js +87 -74
- package/dist/api/compiler/symbol.d.ts +23 -14
- package/dist/api/compiler/symbol.js +23 -11
- package/dist/api/compiler/syntax-kind.d.ts +198 -197
- package/dist/api/compiler/transformers/alias-references.js +247 -139
- package/dist/api/compiler/transformers/async-utilities.js +25 -25
- package/dist/api/compiler/transformers/async.d.ts +0 -1
- package/dist/api/compiler/transformers/async.js +64 -77
- package/dist/api/compiler/transformers/class-fields.d.ts +1 -0
- package/dist/api/compiler/transformers/class-fields.js +81 -78
- package/dist/api/compiler/transformers/commonjs-module.js +18 -15
- package/dist/api/compiler/transformers/const-enum-inliner.js +1 -1
- package/dist/api/compiler/transformers/declarations-diagnostics.js +247 -244
- package/dist/api/compiler/transformers/declarations-pseudo.js +100 -100
- package/dist/api/compiler/transformers/declarations-resolver.d.ts +0 -3
- package/dist/api/compiler/transformers/declarations-syntactic.d.ts +1 -2
- package/dist/api/compiler/transformers/declarations-syntactic.js +134 -156
- package/dist/api/compiler/transformers/declarations-tracker.js +18 -18
- package/dist/api/compiler/transformers/declarations.d.ts +4 -1
- package/dist/api/compiler/transformers/declarations.js +305 -238
- package/dist/api/compiler/transformers/decorator-metadata.d.ts +1 -1
- package/dist/api/compiler/transformers/decorator-metadata.js +53 -45
- package/dist/api/compiler/transformers/decorator-utilities.js +24 -24
- package/dist/api/compiler/transformers/destructuring.js +19 -18
- package/dist/api/compiler/transformers/emit-resolver.js +1 -1
- package/dist/api/compiler/transformers/es-decorators.js +55 -55
- package/dist/api/compiler/transformers/external-module-info.js +3 -3
- package/dist/api/compiler/transformers/for-await.js +25 -25
- package/dist/api/compiler/transformers/import-elision.js +14 -14
- package/dist/api/compiler/transformers/jsx.js +12 -12
- package/dist/api/compiler/transformers/legacy-decorators.js +17 -17
- package/dist/api/compiler/transformers/module.js +8 -8
- package/dist/api/compiler/transformers/named-evaluation.js +4 -4
- package/dist/api/compiler/transformers/object-rest-spread.js +20 -20
- package/dist/api/compiler/transformers/optional-chain.js +10 -10
- package/dist/api/compiler/transformers/reference-resolver.d.ts +12 -1
- package/dist/api/compiler/transformers/reference-resolver.js +131 -69
- package/dist/api/compiler/transformers/runtime-syntax.js +35 -31
- package/dist/api/compiler/transformers/subtree-facts.js +47 -47
- package/dist/api/compiler/transformers/syntax-facts.js +56 -58
- package/dist/api/compiler/transformers/type-eraser.js +73 -66
- package/dist/api/compiler/transformers/type-serialization.js +24 -24
- package/dist/api/compiler/transformers/using.js +12 -12
- package/dist/api/compiler/transformers/utilities.js +77 -77
- package/dist/api/compiler/transformers/visitor-base.js +172 -172
- package/dist/api/compiler/transformers/visitor-hooks.js +6 -2
- package/dist/api/compiler/tsconfig.d.ts +10 -2
- package/dist/api/compiler/tsconfig.js +136 -48
- package/dist/api/compiler/type-printer.js +40 -3
- package/dist/api/compiler/types.d.ts +2 -1
- package/dist/api/library/ast.generated.d.ts +42 -39
- package/dist/api/library/ast.generated.js +1 -1
- package/dist/api/library/compiler-options.generated.d.ts +111 -100
- package/dist/api/library/compiler-options.generated.js +1 -1
- package/dist/api/library/disk.js +12 -1
- package/dist/api/library/enums.generated.d.ts +206 -206
- package/dist/api/library/enums.generated.js +206 -206
- package/dist/api/library/nodes.js +26 -26
- package/package.json +9 -9
- package/src/compiler/ast-utilities.ts +99 -7
- package/src/compiler/ast.ts +58 -26
- package/src/compiler/binder.ts +39 -4
- package/src/compiler/character-codes.ts +2 -2
- package/src/compiler/checker-calls.ts +79 -9
- package/src/compiler/checker-classes.ts +78 -24
- package/src/compiler/checker-contextual.ts +6 -1
- package/src/compiler/checker-declarations.ts +31 -4
- package/src/compiler/checker-declared-types.ts +8 -5
- package/src/compiler/checker-decorators.ts +1 -1
- package/src/compiler/checker-deprecation.ts +29 -8
- package/src/compiler/checker-destructuring.ts +10 -3
- package/src/compiler/checker-emit-helpers.ts +1 -0
- package/src/compiler/checker-emit-resolver.ts +16 -6
- package/src/compiler/checker-expressions.ts +79 -46
- package/src/compiler/checker-functions.ts +21 -6
- package/src/compiler/checker-generated-code.ts +2 -22
- package/src/compiler/checker-grammar.ts +136 -62
- package/src/compiler/checker-heritage.ts +22 -21
- package/src/compiler/checker-inference.ts +514 -82
- package/src/compiler/checker-iteration.ts +18 -31
- package/src/compiler/checker-javascript.ts +1 -1
- package/src/compiler/checker-jsdoc.ts +50 -27
- package/src/compiler/checker-jsx.ts +26 -4
- package/src/compiler/checker-members.ts +200 -56
- package/src/compiler/checker-modules.ts +332 -65
- package/src/compiler/checker-narrowing.ts +98 -19
- package/src/compiler/checker-object-literals.ts +3 -0
- package/src/compiler/checker-operators.ts +11 -4
- package/src/compiler/checker-property-access.ts +7 -2
- package/src/compiler/checker-services.ts +39 -12
- package/src/compiler/checker-signatures.ts +15 -1
- package/src/compiler/checker-source-file.ts +39 -13
- package/src/compiler/checker-statements.ts +3 -2
- package/src/compiler/checker-symbol-types.ts +29 -6
- package/src/compiler/checker-symbols.ts +158 -15
- package/src/compiler/checker-type-factory.ts +124 -23
- package/src/compiler/checker-type-nodes.ts +46 -3
- package/src/compiler/checker-type-operators.ts +83 -26
- package/src/compiler/checker-types.ts +147 -4
- package/src/compiler/checker-unused.ts +9 -14
- package/src/compiler/checker.ts +203 -39
- package/src/compiler/command-line.ts +28 -28
- package/src/compiler/compile-program.ts +167 -27
- package/src/compiler/decoder.ts +13 -4
- package/src/compiler/diagnostic-messages.ts +1973 -1892
- package/src/compiler/diagnostics.ts +84 -3
- package/src/compiler/emitter.ts +57 -8
- package/src/compiler/encoder.ts +23 -8
- package/src/compiler/file-include.ts +9 -3
- package/src/compiler/file-loader.ts +197 -38
- package/src/compiler/help.ts +10 -14
- package/src/compiler/incremental.ts +165 -30
- package/src/compiler/init.ts +2 -7
- package/src/compiler/instantiation.ts +77 -22
- package/src/compiler/jsdoc.ts +3 -1
- package/src/compiler/link-tables.ts +82 -37
- package/src/compiler/locales/cs-CZ.ts +1 -1
- package/src/compiler/locales/de-DE.ts +1 -1
- package/src/compiler/locales/es-ES.ts +1 -1
- package/src/compiler/locales/fr-FR.ts +1 -1
- package/src/compiler/locales/it-IT.ts +1 -1
- package/src/compiler/locales/ja-JP.ts +1 -1
- package/src/compiler/locales/ko-KR.ts +1 -1
- package/src/compiler/locales/pl-PL.ts +1 -1
- package/src/compiler/locales/pt-BR.ts +1 -1
- package/src/compiler/locales/ru-RU.ts +1 -1
- package/src/compiler/locales/tr-TR.ts +1 -1
- package/src/compiler/locales/zh-CN.ts +1 -1
- package/src/compiler/locales/zh-TW.ts +1 -1
- package/src/compiler/module-resolution.ts +44 -8
- package/src/compiler/module-specifiers.ts +62 -20
- package/src/compiler/name-resolver.ts +9 -1
- package/src/compiler/node-builder-names.ts +236 -54
- package/src/compiler/node-builder-pseudo.ts +4 -7
- package/src/compiler/node-builder-reuse.ts +5 -4
- package/src/compiler/node-builder.ts +130 -31
- package/src/compiler/option-declarations.ts +33 -103
- package/src/compiler/options.ts +23 -62
- package/src/compiler/output-paths.ts +5 -18
- package/src/compiler/package-entrypoints.ts +345 -0
- package/src/compiler/package-json.ts +4 -4
- package/src/compiler/parallel-check.ts +326 -52
- package/src/compiler/parallel-emit.ts +320 -0
- package/src/compiler/parallel-parse.ts +16 -5
- package/src/compiler/parse-thread.ts +3 -0
- package/src/compiler/parser.ts +156 -39
- package/src/compiler/path.ts +22 -2
- package/src/compiler/printer/emit-context.ts +21 -0
- package/src/compiler/printer/factory-base.ts +10 -3
- package/src/compiler/printer/factory.ts +4 -1
- package/src/compiler/printer/helpers.ts +10 -1
- package/src/compiler/printer/name-generator.ts +24 -2
- package/src/compiler/printer/printer.ts +266 -30
- package/src/compiler/printer/utilities.ts +8 -2
- package/src/compiler/program-checker.ts +57 -5
- package/src/compiler/program-utilities.ts +23 -10
- package/src/compiler/program.ts +18 -26
- package/src/compiler/pseudo-bigint.ts +17 -0
- package/src/compiler/regexp-checker.ts +63 -30
- package/src/compiler/relations.ts +240 -77
- package/src/compiler/reparser.ts +7 -2
- package/src/compiler/scanner.ts +109 -79
- package/src/compiler/shared-results.ts +2414 -0
- package/src/compiler/show-config.ts +18 -1
- package/src/compiler/sourcemap.ts +2 -2
- package/src/compiler/symbol-accessibility.ts +26 -3
- package/src/compiler/symbol.ts +46 -24
- package/src/compiler/syntax-kind.ts +188 -187
- package/src/compiler/thread-entry.ts +64 -4
- package/src/compiler/transformers/alias-references.ts +123 -4
- package/src/compiler/transformers/async.ts +2 -17
- package/src/compiler/transformers/class-fields.ts +13 -12
- package/src/compiler/transformers/commonjs-module.ts +11 -7
- package/src/compiler/transformers/declarations-diagnostics.ts +5 -3
- package/src/compiler/transformers/declarations-pseudo.ts +2 -4
- package/src/compiler/transformers/declarations-resolver.ts +0 -3
- package/src/compiler/transformers/declarations-syntactic.ts +1 -21
- package/src/compiler/transformers/declarations.ts +134 -48
- package/src/compiler/transformers/decorator-metadata.ts +9 -1
- package/src/compiler/transformers/destructuring.ts +4 -3
- package/src/compiler/transformers/external-module-info.ts +1 -1
- package/src/compiler/transformers/jsx.ts +2 -1
- package/src/compiler/transformers/reference-resolver.ts +83 -19
- package/src/compiler/transformers/runtime-syntax.ts +6 -1
- package/src/compiler/transformers/syntax-facts.ts +2 -7
- package/src/compiler/transformers/type-eraser.ts +10 -1
- package/src/compiler/transformers/type-serialization.ts +3 -2
- package/src/compiler/transformers/visitor-base.ts +2 -1
- package/src/compiler/transformers/visitor-hooks.ts +9 -4
- package/src/compiler/tsc-build.ts +66 -9
- package/src/compiler/tsc-cli.ts +7 -0
- package/src/compiler/tsc-compile.ts +284 -4
- package/src/compiler/tsc-watch.ts +74 -45
- package/src/compiler/tsconfig.ts +176 -19
- package/src/compiler/type-printer.ts +36 -2
- package/src/compiler/types.ts +2 -1
- package/src/library/ast.generated.ts +57 -41
- package/src/library/compiler-options.generated.ts +117 -103
- package/src/library/disk.ts +10 -1
- package/src/library/enums.generated.ts +196 -196
|
@@ -19,7 +19,7 @@ export declare function resolveStructuredTypeMembers(c: Checker, t: Type): Struc
|
|
|
19
19
|
* `t` writes them there; `t` keeps its identity and is never written.
|
|
20
20
|
*/
|
|
21
21
|
export declare function membersHolder(c: Checker, t: Type): StructuredType;
|
|
22
|
-
/** The `objectFlags` of `t` that resolving its members sets (MembersResolved
|
|
22
|
+
/** The `objectFlags` of `t` that resolving its members sets (MembersResolved). */
|
|
23
23
|
export declare function memberResolutionFlags(c: Checker, t: Type): ObjectFlags;
|
|
24
24
|
declare const enum MemberState {
|
|
25
25
|
Skipped = 0,
|
|
@@ -32,6 +32,8 @@ export declare class PendingInstantiatedMembers extends PendingMembers {
|
|
|
32
32
|
readonly sourceTable: SymbolTable | undefined;
|
|
33
33
|
/** Anonymous type instantiations: the properties of the target, in order. */
|
|
34
34
|
readonly sourceList: Symbol[] | undefined;
|
|
35
|
+
/** The source's members at their positions: `sourceList`, or the declared members in table order. */
|
|
36
|
+
readonly sourceMembers: Symbol[];
|
|
35
37
|
readonly mapper: TypeMapper;
|
|
36
38
|
/** MemberState of each member of the source, in order, 16 to a word. */
|
|
37
39
|
readonly states: number[];
|
|
@@ -59,7 +61,7 @@ export declare class PendingInstantiatedMembers extends PendingMembers {
|
|
|
59
61
|
/** Whether the instantiated table has an own member, and one that isn't optional. */
|
|
60
62
|
readonly hasOwnMembers: boolean;
|
|
61
63
|
readonly hasRequiredOwnMembers: boolean;
|
|
62
|
-
constructor(c: Checker, sourceTable: SymbolTable | undefined, sourceList: Symbol[] | undefined, mapper: TypeMapper, states: number[], positions: Map<string, number>, hasOwnMembers: boolean, hasRequiredOwnMembers: boolean);
|
|
64
|
+
constructor(c: Checker, sourceTable: SymbolTable | undefined, sourceList: Symbol[] | undefined, sourceMembers: Symbol[], mapper: TypeMapper, states: number[], positions: Map<string, number>, hasOwnMembers: boolean, hasRequiredOwnMembers: boolean);
|
|
63
65
|
/** Records the next base: `base` where its pending table is complete, else its `properties`. */
|
|
64
66
|
addBase(base: StructuredType | undefined, properties: Symbol[] | undefined): void;
|
|
65
67
|
/** The base at `index` where its pending table is complete (`addBase`), else undefined. */
|
|
@@ -83,6 +85,11 @@ export declare class PendingInstantiatedMembers extends PendingMembers {
|
|
|
83
85
|
*/
|
|
84
86
|
private keepTableOnDemand;
|
|
85
87
|
materializeTable(t: StructuredType): void;
|
|
88
|
+
/**
|
|
89
|
+
* The property order of the source's instantiations for `container` (computed for the first container
|
|
90
|
+
* asked for), or undefined.
|
|
91
|
+
*/
|
|
92
|
+
private namedMemberOrder;
|
|
86
93
|
}
|
|
87
94
|
/**
|
|
88
95
|
* The members of a type whose members table holds only its properties, in the order of the
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { getCombinedModifierFlags, getDeclarationOfKind } from './binder-utilities.js';
|
|
2
2
|
import { getSymbol, getName } from './ast.js';
|
|
3
|
-
import { cachedTypeKey, CompositeSignature, IndexInfo, MemberNames, unionOrIntersectionMembers, emptyIndexInfos, emptySignatures, emptySymbols, emptyTypes, newThisArgumentTypeMapper, newTypeMapper, prependTypeMapping, PendingMembers, } from './checker-types.js';
|
|
3
|
+
import { cachedTypeKey, CompositeSignature, IndexInfo, DeclaredMemberPlan, MemberNames, NamedMemberOrder, unionOrIntersectionMembers, emptyIndexInfos, emptySignatures, emptySymbols, emptyTypes, newThisArgumentTypeMapper, newTypeMapper, prependTypeMapping, PendingMembers, getMappedType, } from './checker-types.js';
|
|
4
4
|
import { createArrayTypeEx, createTupleTypeEx, createTypeReference, everyType, getElementTypes, getIntersectionType, getStringLiteralType, getTemplateLiteralType, getTypeArguments, getUnionOrIntersectionType, getUnionType, getUnionTypeEx, isArrayOrTupleType, isErrorType, isGenericTupleType, isLiteralType, isPatternLiteralType, isReadonlyArrayType, isTupleType, mapType, setStructuredTypeMembers, someType, tupleTargetOf, typesOf, } from './checker-type-factory.js';
|
|
5
5
|
import { getRestTypeOfTupleType, mappedTypeTarget } from './checker-type-operators.js';
|
|
6
6
|
import { isAmbientModule } from './ast-utilities.js';
|
|
7
|
-
import { getExportsOfSymbol, getLateBoundSymbol, getMembersOfSymbol, getMergedSymbol, getNamedMembers, getSymbolOfDeclaration, isReservedMemberName, popTypeResolution, pushTypeResolution, symbolIsValue, } from './checker-symbols.js';
|
|
7
|
+
import { getExportsOfSymbol, getLateBoundSymbol, getMembersOfSymbol, getMergedSymbol, getNamedMemberPositions, getNamedMembers, getSymbolOfDeclaration, isReservedMemberName, popTypeResolution, pushTypeResolution, symbolIsValue, } from './checker-symbols.js';
|
|
8
8
|
import { getBaseConstructorTypeOfClass, getBaseTypes, getConstraintDeclaration, getConstraintFromTypeParameter, getDeclaredTypeOfClassOrInterface, getDeclaredTypeOfSymbol, getLocalTypeParametersOfClassOrInterfaceOrTypeAlias, isMixinConstructorType, } from './checker-declared-types.js';
|
|
9
9
|
import { getTypeOfSymbol, getWriteTypeOfSymbol, isReadonlySymbol } from './checker-symbol-types.js';
|
|
10
10
|
import { getTypeFromTypeNode } from './checker-type-nodes.js';
|
|
11
|
-
import { instantiateIndexInfos, instantiateSignatures, instantiateSymbol, instantiateType, keepsSymbolUnderInstantiation, newInstantiatedSymbol, instantiateTypes, } from './instantiation.js';
|
|
11
|
+
import { instantiateIndexInfos, instantiateSignatures, instantiateSymbol, instantiateType, isThisless, keepsSymbolTypeUnderInstantiation, keepsSymbolUnderInstantiation, newInstantiatedSymbol, instantiateTypes, } from './instantiation.js';
|
|
12
12
|
import { compareProperties, compareSignaturesIdentical, compareTypesIdentical, getRecursionIdentity, isTypeAssignableTo, } from './relations.js';
|
|
13
13
|
import { isUnmatchedTemplateLiteralKey } from './checker-inference.js';
|
|
14
14
|
import { typeToString } from './type-printer.js';
|
|
@@ -42,7 +42,7 @@ export function membersHolder(c, t) {
|
|
|
42
42
|
return unionOrIntersectionMembers(side);
|
|
43
43
|
return side;
|
|
44
44
|
}
|
|
45
|
-
/** The `objectFlags` of `t` that resolving its members sets (MembersResolved
|
|
45
|
+
/** The `objectFlags` of `t` that resolving its members sets (MembersResolved). */
|
|
46
46
|
export function memberResolutionFlags(c, t) {
|
|
47
47
|
if ((t.flags & 402653184 /* TypeFlags.UnionOrIntersection */) === 0)
|
|
48
48
|
return lazyObjectFlags(c, t);
|
|
@@ -128,8 +128,7 @@ function resolveObjectTypeMembers(c, t, source, typeParameters, typeArguments, t
|
|
|
128
128
|
}
|
|
129
129
|
if (baseTypes.length !== 0) {
|
|
130
130
|
members = !instantiated || members === undefined ? new Map(members ?? []) : members;
|
|
131
|
-
|
|
132
|
-
t.objectFlags |= 536870912 /* ObjectFlags.UnresolvedMembers */;
|
|
131
|
+
// The members are set once the bases are added: a recursive request for them resolves them again.
|
|
133
132
|
for (const baseType of baseTypes) {
|
|
134
133
|
const instantiatedBaseType = lastArgument !== undefined
|
|
135
134
|
? getTypeWithThisArgument(c, instantiateType(c, baseType, mapper), lastArgument, false)
|
|
@@ -150,7 +149,6 @@ function resolveObjectTypeMembers(c, t, source, typeParameters, typeArguments, t
|
|
|
150
149
|
if (added.length !== 0)
|
|
151
150
|
indexInfos = indexInfos.concat(added);
|
|
152
151
|
}
|
|
153
|
-
t.objectFlags &= ~536870912 /* ObjectFlags.UnresolvedMembers */;
|
|
154
152
|
}
|
|
155
153
|
setStructuredTypeMembers(c, t, members, callSignatures, constructSignatures, indexInfos);
|
|
156
154
|
}
|
|
@@ -162,6 +160,8 @@ export class PendingInstantiatedMembers extends PendingMembers {
|
|
|
162
160
|
sourceTable;
|
|
163
161
|
/** Anonymous type instantiations: the properties of the target, in order. */
|
|
164
162
|
sourceList;
|
|
163
|
+
/** The source's members at their positions: `sourceList`, or the declared members in table order. */
|
|
164
|
+
sourceMembers;
|
|
165
165
|
mapper;
|
|
166
166
|
/** MemberState of each member of the source, in order, 16 to a word. */
|
|
167
167
|
states;
|
|
@@ -189,8 +189,9 @@ export class PendingInstantiatedMembers extends PendingMembers {
|
|
|
189
189
|
/** Whether the instantiated table has an own member, and one that isn't optional. */
|
|
190
190
|
hasOwnMembers;
|
|
191
191
|
hasRequiredOwnMembers;
|
|
192
|
-
constructor(c, sourceTable, sourceList, mapper, states, positions, hasOwnMembers, hasRequiredOwnMembers) {
|
|
192
|
+
constructor(c, sourceTable, sourceList, sourceMembers, mapper, states, positions, hasOwnMembers, hasRequiredOwnMembers) {
|
|
193
193
|
super();
|
|
194
|
+
this.sourceMembers = sourceMembers;
|
|
194
195
|
this.hasOwnMembers = hasOwnMembers;
|
|
195
196
|
this.hasRequiredOwnMembers = hasRequiredOwnMembers;
|
|
196
197
|
this.c = c;
|
|
@@ -315,6 +316,22 @@ export class PendingInstantiatedMembers extends PendingMembers {
|
|
|
315
316
|
materialize(t) {
|
|
316
317
|
const c = this.c;
|
|
317
318
|
t.pendingMembers = undefined;
|
|
319
|
+
if (!this.hasBases) {
|
|
320
|
+
// The properties are the source's named members, in the order cached for the source
|
|
321
|
+
// (`NamedMemberOrder`), and they are all of the table, which is built only when asked for.
|
|
322
|
+
const order = this.namedMemberOrder(t.symbol);
|
|
323
|
+
if (order !== undefined) {
|
|
324
|
+
const sourceMembers = this.sourceMembers;
|
|
325
|
+
const properties = [];
|
|
326
|
+
for (const position of order.positions)
|
|
327
|
+
properties.push(this.memberAt(position, sourceMembers[position]));
|
|
328
|
+
this.instantiated = undefined;
|
|
329
|
+
t.membersValue = undefined;
|
|
330
|
+
t.propertiesValue = properties;
|
|
331
|
+
t.pendingMembers = new PropertyMembers(properties, order.names);
|
|
332
|
+
return;
|
|
333
|
+
}
|
|
334
|
+
}
|
|
318
335
|
const members = this.ownTable();
|
|
319
336
|
this.instantiated = undefined;
|
|
320
337
|
if (!this.hasBases) {
|
|
@@ -364,6 +381,51 @@ export class PendingInstantiatedMembers extends PendingMembers {
|
|
|
364
381
|
if (pending !== undefined)
|
|
365
382
|
pending.materializeTable(t);
|
|
366
383
|
}
|
|
384
|
+
/**
|
|
385
|
+
* The property order of the source's instantiations for `container` (computed for the first container
|
|
386
|
+
* asked for), or undefined.
|
|
387
|
+
*/
|
|
388
|
+
namedMemberOrder(container) {
|
|
389
|
+
const c = this.c;
|
|
390
|
+
const owner = this.owner;
|
|
391
|
+
let order = owner !== undefined ? owner.namedMemberOrder : c.namedMemberOrdersOfLists.get(this.sourceList);
|
|
392
|
+
if (order === undefined) {
|
|
393
|
+
order = namedMemberOrderOf(c, this.sourceMembers, container, owner !== undefined);
|
|
394
|
+
if (owner !== undefined)
|
|
395
|
+
owner.namedMemberOrder = order;
|
|
396
|
+
else
|
|
397
|
+
c.namedMemberOrdersOfLists.set(this.sourceList, order);
|
|
398
|
+
}
|
|
399
|
+
return order !== null && order.container === container ? order : undefined;
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
/**
|
|
403
|
+
* The `NamedMemberOrder` of instantiations of `members` for `container`; null where `getNamedMemberPositions`
|
|
404
|
+
* has none. With `skipsUnnamed` (declared members), an instantiation's table holds the named members, the
|
|
405
|
+
* others being skipped, in the order of `members`; without it, every member must be named.
|
|
406
|
+
*/
|
|
407
|
+
function namedMemberOrderOf(c, members, container, skipsUnnamed) {
|
|
408
|
+
const positions = getNamedMemberPositions(c, members, container);
|
|
409
|
+
// Members of a list are never skipped (`pendingInstantiatedList`): its table holds them all.
|
|
410
|
+
if (positions === undefined || (!skipsUnnamed && positions.length !== members.length))
|
|
411
|
+
return null;
|
|
412
|
+
const names = [];
|
|
413
|
+
const byName = new Map();
|
|
414
|
+
// The index in `positions` of each member's position, or -1 for a member that isn't a property.
|
|
415
|
+
const indexes = [];
|
|
416
|
+
for (let i = 0; i < members.length; i++)
|
|
417
|
+
indexes.push(-1);
|
|
418
|
+
for (let i = 0; i < positions.length; i++) {
|
|
419
|
+
const name = members[positions[i]].name;
|
|
420
|
+
names.push(name);
|
|
421
|
+
byName.set(name, i);
|
|
422
|
+
indexes[positions[i]] = i;
|
|
423
|
+
}
|
|
424
|
+
const tableOrder = [];
|
|
425
|
+
for (const index of indexes)
|
|
426
|
+
if (index >= 0)
|
|
427
|
+
tableOrder.push(index);
|
|
428
|
+
return new NamedMemberOrder(container, positions, new MemberNames(names, byName, tableOrder));
|
|
367
429
|
}
|
|
368
430
|
/**
|
|
369
431
|
* The members of a type whose members table holds only its properties, in the order of the
|
|
@@ -459,39 +521,80 @@ function pendingInstantiatedTable(c, source, mapper) {
|
|
|
459
521
|
const table = declared.declaredMembers;
|
|
460
522
|
if (table === undefined || table.size === 0)
|
|
461
523
|
return undefined;
|
|
524
|
+
const plan = declaredMemberPlan(c, declared, table);
|
|
525
|
+
if (plan.eager)
|
|
526
|
+
return undefined;
|
|
527
|
+
const members = plan.members;
|
|
528
|
+
const named = plan.named;
|
|
529
|
+
const keptByType = plan.keptByType;
|
|
462
530
|
const states = [];
|
|
463
531
|
let word = 0;
|
|
464
|
-
|
|
465
|
-
let
|
|
466
|
-
let hasRequiredOwnMembers = false;
|
|
467
|
-
for (const [id, symbol] of table) {
|
|
468
|
-
if (id !== symbol.name)
|
|
469
|
-
return undefined;
|
|
532
|
+
const count = members.length;
|
|
533
|
+
for (let i = 0; i < count; i++) {
|
|
470
534
|
let state = 0 /* MemberState.Skipped */;
|
|
471
|
-
if (
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
if ((
|
|
480
|
-
|
|
535
|
+
if (named[i] !== 0) {
|
|
536
|
+
const bit = 1 << (i & 31);
|
|
537
|
+
if ((keptByType[i >> 5] & bit) !== 0)
|
|
538
|
+
state = 3 /* MemberState.Kept */;
|
|
539
|
+
else if (mapper.mapsThisOnly() && isThisless(members[i])) {
|
|
540
|
+
getSymbolId(members[i]);
|
|
541
|
+
state = 3 /* MemberState.Kept */;
|
|
542
|
+
}
|
|
543
|
+
else if (keepsSymbolTypeUnderInstantiation(c, members[i])) {
|
|
544
|
+
keptByType[i >> 5] = keptByType[i >> 5] | bit;
|
|
545
|
+
state = 3 /* MemberState.Kept */;
|
|
546
|
+
}
|
|
547
|
+
else
|
|
548
|
+
state = 1 /* MemberState.Instantiated */;
|
|
481
549
|
}
|
|
482
550
|
word |= state << ((i & 15) * 2);
|
|
483
551
|
if ((i & 15) === 15) {
|
|
484
552
|
states.push(word);
|
|
485
553
|
word = 0;
|
|
486
554
|
}
|
|
487
|
-
i++;
|
|
488
555
|
}
|
|
489
|
-
if ((
|
|
556
|
+
if ((count & 15) !== 0)
|
|
490
557
|
states.push(word);
|
|
491
|
-
const pending = new PendingInstantiatedMembers(c, table, undefined, mapper, sharedStates(declared, states), declaredMemberPositions(declared, table), hasOwnMembers, hasRequiredOwnMembers);
|
|
558
|
+
const pending = new PendingInstantiatedMembers(c, table, undefined, members, mapper, sharedStates(declared, states), declaredMemberPositions(declared, table), plan.hasOwnMembers, plan.hasRequiredOwnMembers);
|
|
492
559
|
pending.owner = declared;
|
|
493
560
|
return pending;
|
|
494
561
|
}
|
|
562
|
+
/** What the pending instantiations of `table`, the declared members of `declared`, share. */
|
|
563
|
+
function declaredMemberPlan(c, declared, table) {
|
|
564
|
+
const known = declared.declaredMemberPlan;
|
|
565
|
+
if (known !== undefined && known.table === table)
|
|
566
|
+
return known;
|
|
567
|
+
const members = [];
|
|
568
|
+
const named = [];
|
|
569
|
+
let hasOwnMembers = false;
|
|
570
|
+
let hasRequiredOwnMembers = false;
|
|
571
|
+
let eager = false;
|
|
572
|
+
for (const [id, symbol] of table) {
|
|
573
|
+
if (id !== symbol.name) {
|
|
574
|
+
eager = true;
|
|
575
|
+
break;
|
|
576
|
+
}
|
|
577
|
+
members.push(symbol);
|
|
578
|
+
if (!isNamedMember(c, symbol, id)) {
|
|
579
|
+
named.push(0);
|
|
580
|
+
continue;
|
|
581
|
+
}
|
|
582
|
+
// A named member without a value flag (an alias) could be replaced by an inherited one; keep
|
|
583
|
+
// such tables eager, so that an own member always stands.
|
|
584
|
+
if ((symbol.flags & 111551 /* SymbolFlags.Value */) === 0) {
|
|
585
|
+
eager = true;
|
|
586
|
+
break;
|
|
587
|
+
}
|
|
588
|
+
named.push(1);
|
|
589
|
+
// Instantiated symbols have the flags of their source.
|
|
590
|
+
hasOwnMembers = true;
|
|
591
|
+
if ((symbol.flags & 16777216 /* SymbolFlags.Optional */) === 0)
|
|
592
|
+
hasRequiredOwnMembers = true;
|
|
593
|
+
}
|
|
594
|
+
const plan = new DeclaredMemberPlan(table, eager, members, named, hasOwnMembers, hasRequiredOwnMembers);
|
|
595
|
+
declared.declaredMemberPlan = plan;
|
|
596
|
+
return plan;
|
|
597
|
+
}
|
|
495
598
|
/**
|
|
496
599
|
* `states`, or the equal list the last instantiation of `source` used: most instantiations of a
|
|
497
600
|
* source keep and instantiate the same members, and the lists are never changed.
|
|
@@ -525,7 +628,7 @@ function pendingInstantiatedList(c, list, mapper) {
|
|
|
525
628
|
}
|
|
526
629
|
if ((list.length & 15) !== 0)
|
|
527
630
|
states.push(word);
|
|
528
|
-
return new PendingInstantiatedMembers(c, undefined, list, mapper, states, listPositions(c, list), true, hasRequiredOwnMembers);
|
|
631
|
+
return new PendingInstantiatedMembers(c, undefined, list, list, mapper, states, listPositions(c, list), true, hasRequiredOwnMembers);
|
|
529
632
|
}
|
|
530
633
|
/**
|
|
531
634
|
* Positions of the declared members of a class or interface by name, shared by all its
|
|
@@ -629,12 +732,13 @@ export function resolvedPropertiesAreOptional(t) {
|
|
|
629
732
|
}
|
|
630
733
|
/** resolveObjectTypeMembers for an instantiation whose member symbols are instantiated on demand. */
|
|
631
734
|
function resolvePendingObjectTypeMembers(c, t, pending, baseTypes, mapper, thisArgument, callSignatures, constructSignatures, indexInfos) {
|
|
632
|
-
|
|
633
|
-
|
|
735
|
+
if (baseTypes.length === 0) {
|
|
736
|
+
setPendingStructuredTypeMembers(c, t, pending, callSignatures, constructSignatures, indexInfos);
|
|
634
737
|
return;
|
|
738
|
+
}
|
|
739
|
+
// The members are set once the bases are added: a recursive request for them resolves them again.
|
|
635
740
|
pending.hasBases = true;
|
|
636
741
|
pending.resolving = true;
|
|
637
|
-
t.objectFlags |= 536870912 /* ObjectFlags.UnresolvedMembers */;
|
|
638
742
|
for (const baseType of baseTypes) {
|
|
639
743
|
const instantiatedBaseType = thisArgument !== undefined
|
|
640
744
|
? getTypeWithThisArgument(c, instantiateType(c, baseType, mapper), thisArgument, false)
|
|
@@ -654,10 +758,7 @@ function resolvePendingObjectTypeMembers(c, t, pending, baseTypes, mapper, thisA
|
|
|
654
758
|
lazyBase = resolved;
|
|
655
759
|
}
|
|
656
760
|
const baseProperties = lazyBase === undefined ? getPropertiesOfType(c, instantiatedBaseType) : undefined;
|
|
657
|
-
|
|
658
|
-
pending.addBase(lazyBase, baseProperties);
|
|
659
|
-
else
|
|
660
|
-
addInheritedMembers(t.membersValue, baseProperties ?? lazyBase.properties);
|
|
761
|
+
pending.addBase(lazyBase, baseProperties);
|
|
661
762
|
const baseCallSignatures = getSignaturesOfType(c, instantiatedBaseType, 0 /* SignatureKind.Call */);
|
|
662
763
|
if (baseCallSignatures.length !== 0)
|
|
663
764
|
callSignatures = callSignatures.concat(baseCallSignatures);
|
|
@@ -672,12 +773,8 @@ function resolvePendingObjectTypeMembers(c, t, pending, baseTypes, mapper, thisA
|
|
|
672
773
|
if (added.length !== 0)
|
|
673
774
|
indexInfos = indexInfos.concat(added);
|
|
674
775
|
}
|
|
675
|
-
t.objectFlags &= ~536870912 /* ObjectFlags.UnresolvedMembers */;
|
|
676
776
|
pending.resolving = false;
|
|
677
|
-
|
|
678
|
-
setPendingStructuredTypeMembers(c, t, pending, callSignatures, constructSignatures, indexInfos);
|
|
679
|
-
else
|
|
680
|
-
setStructuredTypeMembers(c, t, t.membersValue, callSignatures, constructSignatures, indexInfos);
|
|
777
|
+
setPendingStructuredTypeMembers(c, t, pending, callSignatures, constructSignatures, indexInfos);
|
|
681
778
|
}
|
|
682
779
|
function setPendingStructuredTypeMembers(c, type, pending, callSignatures, constructSignatures, indexInfos) {
|
|
683
780
|
const t = membersHolder(c, type);
|
|
@@ -855,7 +952,7 @@ function isOnlyAmbientModuleDeclarations(declarations) {
|
|
|
855
952
|
if (declarations.length === 0)
|
|
856
953
|
return false;
|
|
857
954
|
for (const d of declarations)
|
|
858
|
-
if (d.kind !==
|
|
955
|
+
if (d.kind !== 269 /* SyntaxKind.ModuleDeclaration */ || !isAmbientModule(d))
|
|
859
956
|
return false;
|
|
860
957
|
return true;
|
|
861
958
|
}
|
|
@@ -891,7 +988,7 @@ function getArrayMemberCallSignatures(c, t) {
|
|
|
891
988
|
}
|
|
892
989
|
const arrayArg = mapType(c, t, (u) => {
|
|
893
990
|
const generic = isReadonlyArraySymbol(c, u.symbol.parent) ? c.globalReadonlyArrayType : c.globalArrayType;
|
|
894
|
-
return
|
|
991
|
+
return getMappedType(generic.typeParameters()[0], u.mapper);
|
|
895
992
|
});
|
|
896
993
|
const arrayType = createArrayTypeEx(c, arrayArg, someType(t, (u) => isReadonlyArraySymbol(c, u.symbol.parent)));
|
|
897
994
|
const memberType = getTypeOfPropertyOfType(c, arrayType, memberName);
|
|
@@ -1046,7 +1143,7 @@ export function combineUnionOrIntersectionMemberSignatures(c, left, right, isUni
|
|
|
1046
1143
|
let flags = (left.flags | right.flags) & (335 /* SignatureFlags.PropagatingFlags */ & ~1 /* SignatureFlags.HasRestParameter */);
|
|
1047
1144
|
const params = combineUnionOrIntersectionParameters(c, left, right, paramMapper, isUnion);
|
|
1048
1145
|
const lastParam = params.length !== 0 ? params[params.length - 1] : undefined;
|
|
1049
|
-
if (lastParam !== undefined && (lastParam.checkFlags &
|
|
1146
|
+
if (lastParam !== undefined && (lastParam.checkFlags & 262144 /* CheckFlags.RestParameter */) !== 0)
|
|
1050
1147
|
flags |= 1 /* SignatureFlags.HasRestParameter */;
|
|
1051
1148
|
const thisParam = combineUnionOrIntersectionThisParam(c, left.thisParameter, right.thisParameter, paramMapper, isUnion);
|
|
1052
1149
|
const minArgCount = Math.max(left.minArgumentCount, right.minArgumentCount);
|
|
@@ -1088,12 +1185,12 @@ function combineUnionOrIntersectionParameters(c, left, right, mapper, isUnion) {
|
|
|
1088
1185
|
let paramName = leftName === rightName ? leftName : leftName === '' ? rightName : rightName === '' ? leftName : '';
|
|
1089
1186
|
if (paramName === '')
|
|
1090
1187
|
paramName = 'arg' + i;
|
|
1091
|
-
const paramSymbol = c.newSymbolWithCheckFlags(1 /* SymbolFlags.FunctionScopedVariable */ | (isOptional && !isRestParam ? 16777216 /* SymbolFlags.Optional */ : 0), paramName, isRestParam ?
|
|
1188
|
+
const paramSymbol = c.newSymbolWithCheckFlags(1 /* SymbolFlags.FunctionScopedVariable */ | (isOptional && !isRestParam ? 16777216 /* SymbolFlags.Optional */ : 0), paramName, isRestParam ? 262144 /* CheckFlags.RestParameter */ : isOptional ? 131072 /* CheckFlags.OptionalParameter */ : 0 /* CheckFlags.None */);
|
|
1092
1189
|
c.symbolTypes.set(getSymbolId(paramSymbol), isRestParam ? createArrayTypeEx(c, combinedParamType, false) : combinedParamType);
|
|
1093
1190
|
params.push(paramSymbol);
|
|
1094
1191
|
}
|
|
1095
1192
|
if (needsExtraRestElement) {
|
|
1096
|
-
const restParamSymbol = c.newSymbolWithCheckFlags(1 /* SymbolFlags.FunctionScopedVariable */, 'args',
|
|
1193
|
+
const restParamSymbol = c.newSymbolWithCheckFlags(1 /* SymbolFlags.FunctionScopedVariable */, 'args', 262144 /* CheckFlags.RestParameter */);
|
|
1097
1194
|
let restType = createArrayTypeEx(c, getTypeAtPosition(c, shorter, longestCount), false);
|
|
1098
1195
|
if (shorter === right)
|
|
1099
1196
|
restType = instantiateType(c, restType, mapper);
|
|
@@ -1268,7 +1365,8 @@ export function getPropertyOfTypeEx(c, t, name, skipObjectFunctionPropertyAugmen
|
|
|
1268
1365
|
if (!isOwnReducedApparentType(t))
|
|
1269
1366
|
t = getReducedApparentTypeWorker(c, t);
|
|
1270
1367
|
if ((t.flags & 1048576 /* TypeFlags.Object */) !== 0) {
|
|
1271
|
-
|
|
1368
|
+
// The first test of resolveStructuredTypeMembers, here where most lookups find the members resolved.
|
|
1369
|
+
const resolved = (t.objectFlags & 2097152 /* ObjectFlags.MembersResolved */) !== 0 ? t : resolveStructuredTypeMembers(c, t);
|
|
1272
1370
|
const symbol = getResolvedMember(resolved, name);
|
|
1273
1371
|
if (symbol !== undefined && includeTypeOnlyMembers)
|
|
1274
1372
|
return symbol;
|
|
@@ -1530,12 +1628,24 @@ export function getUnionOrIntersectionProperty(c, t, name, skipObjectFunctionPro
|
|
|
1530
1628
|
return prop;
|
|
1531
1629
|
}
|
|
1532
1630
|
export function getDeclarationModifierFlagsFromSymbol(c, s, isWrite) {
|
|
1631
|
+
const checkFlags = s.checkFlags;
|
|
1632
|
+
if ((checkFlags & 6 /* CheckFlags.Synthetic */) !== 0) {
|
|
1633
|
+
// The least restricted access of the constituents, for reading or for writing.
|
|
1634
|
+
let access = 0 /* ModifierFlags.None */;
|
|
1635
|
+
if ((checkFlags & (isWrite ? 2048 /* CheckFlags.ContainsWritePublic */ : 256 /* CheckFlags.ContainsPublic */)) !== 0)
|
|
1636
|
+
access = 1 /* ModifierFlags.Public */;
|
|
1637
|
+
else if ((checkFlags & (isWrite ? 4096 /* CheckFlags.ContainsWriteProtected */ : 512 /* CheckFlags.ContainsProtected */)) !== 0)
|
|
1638
|
+
access = 4 /* ModifierFlags.Protected */;
|
|
1639
|
+
else if ((checkFlags & (isWrite ? 8192 /* CheckFlags.ContainsWritePrivate */ : 1024 /* CheckFlags.ContainsPrivate */)) !== 0)
|
|
1640
|
+
access = 2 /* ModifierFlags.Private */;
|
|
1641
|
+
return (checkFlags & 16384 /* CheckFlags.ContainsStatic */) !== 0 ? access | 256 /* ModifierFlags.Static */ : access;
|
|
1642
|
+
}
|
|
1533
1643
|
if (s.valueDeclaration !== undefined) {
|
|
1534
1644
|
let declaration;
|
|
1535
1645
|
if (isWrite)
|
|
1536
|
-
declaration = getDeclarationOfKind(s,
|
|
1646
|
+
declaration = getDeclarationOfKind(s, 180 /* SyntaxKind.SetAccessor */);
|
|
1537
1647
|
if (declaration === undefined && (s.flags & 32768 /* SymbolFlags.GetAccessor */) !== 0)
|
|
1538
|
-
declaration = getDeclarationOfKind(s,
|
|
1648
|
+
declaration = getDeclarationOfKind(s, 179 /* SyntaxKind.GetAccessor */);
|
|
1539
1649
|
if (declaration === undefined)
|
|
1540
1650
|
declaration = s.valueDeclaration;
|
|
1541
1651
|
const flags = getCombinedModifierFlags(declaration);
|
|
@@ -1543,15 +1653,6 @@ export function getDeclarationModifierFlagsFromSymbol(c, s, isWrite) {
|
|
|
1543
1653
|
? flags
|
|
1544
1654
|
: flags & ~7 /* ModifierFlags.AccessibilityModifier */;
|
|
1545
1655
|
}
|
|
1546
|
-
if ((s.checkFlags & 6 /* CheckFlags.Synthetic */) !== 0) {
|
|
1547
|
-
const access = (s.checkFlags & 1024 /* CheckFlags.ContainsPrivate */) !== 0
|
|
1548
|
-
? 2 /* ModifierFlags.Private */
|
|
1549
|
-
: (s.checkFlags & 256 /* CheckFlags.ContainsPublic */) !== 0
|
|
1550
|
-
? 1 /* ModifierFlags.Public */
|
|
1551
|
-
: 4 /* ModifierFlags.Protected */;
|
|
1552
|
-
const staticModifier = (s.checkFlags & 2048 /* CheckFlags.ContainsStatic */) !== 0 ? 256 /* ModifierFlags.Static */ : 0;
|
|
1553
|
-
return access | staticModifier;
|
|
1554
|
-
}
|
|
1555
1656
|
if ((s.flags & 4194304 /* SymbolFlags.Prototype */) !== 0)
|
|
1556
1657
|
return 1 /* ModifierFlags.Public */ | 256 /* ModifierFlags.Static */;
|
|
1557
1658
|
return 0;
|
|
@@ -1574,6 +1675,7 @@ export function createUnionOrIntersectionProperty(c, containingType, name, skipO
|
|
|
1574
1675
|
const prop = getPropertyOfTypeEx(c, t, name, skipObjectFunctionPropertyAugment, false);
|
|
1575
1676
|
if (prop !== undefined) {
|
|
1576
1677
|
const modifiers = getDeclarationModifierFlagsFromSymbol(c, prop, false);
|
|
1678
|
+
const writeModifiers = getDeclarationModifierFlagsFromSymbol(c, prop, true);
|
|
1577
1679
|
if ((prop.flags & 106500 /* SymbolFlags.ClassMember */) !== 0) {
|
|
1578
1680
|
if (isUnion)
|
|
1579
1681
|
optionalFlag |= prop.flags & 16777216 /* SymbolFlags.Optional */;
|
|
@@ -1607,14 +1709,20 @@ export function createUnionOrIntersectionProperty(c, containingType, name, skipO
|
|
|
1607
1709
|
checkFlags |= 8 /* CheckFlags.Readonly */;
|
|
1608
1710
|
else if (!isUnion && !isReadonlySymbol(c, prop))
|
|
1609
1711
|
checkFlags &= ~8 /* CheckFlags.Readonly */;
|
|
1610
|
-
if ((modifiers &
|
|
1611
|
-
checkFlags |= 256 /* CheckFlags.ContainsPublic */;
|
|
1612
|
-
if ((modifiers & 4 /* ModifierFlags.Protected */) !== 0)
|
|
1712
|
+
if ((modifiers & (4 /* ModifierFlags.Protected */ | 1 /* ModifierFlags.Public */)) === 4 /* ModifierFlags.Protected */)
|
|
1613
1713
|
checkFlags |= 512 /* CheckFlags.ContainsProtected */;
|
|
1614
|
-
if ((modifiers & 2 /* ModifierFlags.Private */)
|
|
1714
|
+
else if ((modifiers & (2 /* ModifierFlags.Private */ | 1 /* ModifierFlags.Public */)) === 2 /* ModifierFlags.Private */)
|
|
1615
1715
|
checkFlags |= 1024 /* CheckFlags.ContainsPrivate */;
|
|
1716
|
+
else
|
|
1717
|
+
checkFlags |= 256 /* CheckFlags.ContainsPublic */;
|
|
1718
|
+
if ((writeModifiers & (4 /* ModifierFlags.Protected */ | 1 /* ModifierFlags.Public */)) === 4 /* ModifierFlags.Protected */)
|
|
1719
|
+
checkFlags |= 4096 /* CheckFlags.ContainsWriteProtected */;
|
|
1720
|
+
else if ((writeModifiers & (2 /* ModifierFlags.Private */ | 1 /* ModifierFlags.Public */)) === 2 /* ModifierFlags.Private */)
|
|
1721
|
+
checkFlags |= 8192 /* CheckFlags.ContainsWritePrivate */;
|
|
1722
|
+
else
|
|
1723
|
+
checkFlags |= 2048 /* CheckFlags.ContainsWritePublic */;
|
|
1616
1724
|
if ((modifiers & 256 /* ModifierFlags.Static */) !== 0)
|
|
1617
|
-
checkFlags |=
|
|
1725
|
+
checkFlags |= 16384 /* CheckFlags.ContainsStatic */;
|
|
1618
1726
|
if (!isPrototypeProperty(prop))
|
|
1619
1727
|
syntheticFlag = 2 /* CheckFlags.SyntheticProperty */;
|
|
1620
1728
|
}
|
|
@@ -1633,13 +1741,27 @@ export function createUnionOrIntersectionProperty(c, containingType, name, skipO
|
|
|
1633
1741
|
checkFlags |= 16 /* CheckFlags.ReadPartial */;
|
|
1634
1742
|
}
|
|
1635
1743
|
}
|
|
1636
|
-
if (singleProp === undefined
|
|
1637
|
-
(isUnion &&
|
|
1638
|
-
(propSet !== undefined || (checkFlags & 48 /* CheckFlags.Partial */) !== 0) &&
|
|
1639
|
-
(checkFlags & (1024 /* CheckFlags.ContainsPrivate */ | 512 /* CheckFlags.ContainsProtected */)) !== 0 &&
|
|
1640
|
-
!(propSet !== undefined && hasCommonDeclaration(propSet))))
|
|
1641
|
-
// Missing, or private/protected in one constituent but missing or different in another.
|
|
1744
|
+
if (singleProp === undefined)
|
|
1642
1745
|
return undefined;
|
|
1746
|
+
if (isUnion &&
|
|
1747
|
+
(propSet !== undefined || (checkFlags & 48 /* CheckFlags.Partial */) !== 0) &&
|
|
1748
|
+
(checkFlags &
|
|
1749
|
+
(1024 /* CheckFlags.ContainsPrivate */ |
|
|
1750
|
+
512 /* CheckFlags.ContainsProtected */ |
|
|
1751
|
+
8192 /* CheckFlags.ContainsWritePrivate */ |
|
|
1752
|
+
4096 /* CheckFlags.ContainsWriteProtected */)) !==
|
|
1753
|
+
0 &&
|
|
1754
|
+
!(propSet !== undefined && hasCommonDeclaration(propSet))) {
|
|
1755
|
+
// The property is private or protected in one constituent but missing or different in another.
|
|
1756
|
+
// Private or protected reading leaves no property; private or protected writing restricts write
|
|
1757
|
+
// access to that of the most restricted constituent.
|
|
1758
|
+
if ((checkFlags & (1024 /* CheckFlags.ContainsPrivate */ | 512 /* CheckFlags.ContainsProtected */)) !== 0)
|
|
1759
|
+
return undefined;
|
|
1760
|
+
if ((checkFlags & 8192 /* CheckFlags.ContainsWritePrivate */) !== 0)
|
|
1761
|
+
checkFlags &= ~(2048 /* CheckFlags.ContainsWritePublic */ | 4096 /* CheckFlags.ContainsWriteProtected */);
|
|
1762
|
+
else if ((checkFlags & 4096 /* CheckFlags.ContainsWriteProtected */) !== 0)
|
|
1763
|
+
checkFlags &= ~2048 /* CheckFlags.ContainsWritePublic */;
|
|
1764
|
+
}
|
|
1643
1765
|
if (propSet === undefined && (checkFlags & 16 /* CheckFlags.ReadPartial */) === 0 && indexTypes.length === 0) {
|
|
1644
1766
|
if (!mergedInstantiations)
|
|
1645
1767
|
return singleProp;
|
|
@@ -1674,7 +1796,8 @@ export function createUnionOrIntersectionProperty(c, containingType, name, skipO
|
|
|
1674
1796
|
else if (prop.valueDeclaration !== undefined && prop.valueDeclaration !== firstValueDeclaration)
|
|
1675
1797
|
hasNonUniformValueDeclaration = true;
|
|
1676
1798
|
for (const d of getDeclarations(prop))
|
|
1677
|
-
declarations.
|
|
1799
|
+
if (!declarations.includes(d))
|
|
1800
|
+
declarations.push(d);
|
|
1678
1801
|
const t = getTypeOfSymbol(c, prop);
|
|
1679
1802
|
if (firstType === undefined) {
|
|
1680
1803
|
firstType = t;
|
|
@@ -1691,7 +1814,7 @@ export function createUnionOrIntersectionProperty(c, containingType, name, skipO
|
|
|
1691
1814
|
if (isLiteralType(t) || isPatternLiteralType(c, t))
|
|
1692
1815
|
checkFlags |= 128 /* CheckFlags.HasLiteralType */;
|
|
1693
1816
|
if ((t.flags & 262144 /* TypeFlags.Never */) !== 0 && t !== c.uniqueLiteralType)
|
|
1694
|
-
checkFlags |=
|
|
1817
|
+
checkFlags |= 1048576 /* CheckFlags.HasNeverType */;
|
|
1695
1818
|
propTypes.push(t);
|
|
1696
1819
|
}
|
|
1697
1820
|
for (const t of indexTypes)
|
|
@@ -1707,7 +1830,7 @@ export function createUnionOrIntersectionProperty(c, containingType, name, skipO
|
|
|
1707
1830
|
c.symbolNameTypes.set(id, nameType);
|
|
1708
1831
|
if (propTypes.length > 2) {
|
|
1709
1832
|
// Defer normalization of possibly large constituent lists.
|
|
1710
|
-
result.checkFlags |=
|
|
1833
|
+
result.checkFlags |= 524288 /* CheckFlags.DeferredType */;
|
|
1711
1834
|
const links = c.symbolLinks(result);
|
|
1712
1835
|
links.deferralParent = containingType;
|
|
1713
1836
|
links.deferralConstituents = propTypes;
|
|
@@ -1991,7 +2114,7 @@ export function getReducedType(c, t) {
|
|
|
1991
2114
|
const side = sideOf(c, t);
|
|
1992
2115
|
if ((side.objectFlags & 33554432 /* ObjectFlags.IsNeverIntersectionComputed */) === 0) {
|
|
1993
2116
|
side.objectFlags |= 33554432 /* ObjectFlags.IsNeverIntersectionComputed */;
|
|
1994
|
-
if (hasNeverReducedProperty(c, t))
|
|
2117
|
+
if (!isMappingOfSameObjectType(c, typesOf(t)) && hasNeverReducedProperty(c, t))
|
|
1995
2118
|
side.objectFlags |= 67108864 /* ObjectFlags.IsNeverIntersection */;
|
|
1996
2119
|
}
|
|
1997
2120
|
if ((side.objectFlags & 67108864 /* ObjectFlags.IsNeverIntersection */) !== 0)
|
|
@@ -1999,6 +2122,20 @@ export function getReducedType(c, t) {
|
|
|
1999
2122
|
}
|
|
2000
2123
|
return t;
|
|
2001
2124
|
}
|
|
2125
|
+
/** Whether `types` are mapped types that all map the same object type. */
|
|
2126
|
+
function isMappingOfSameObjectType(c, types) {
|
|
2127
|
+
if (types.length === 0 || (types[0].objectFlags & 32 /* ObjectFlags.Mapped */) === 0)
|
|
2128
|
+
return false;
|
|
2129
|
+
const first = getModifiersTypeFromMappedType(c, types[0]);
|
|
2130
|
+
if ((first.flags & 1048576 /* TypeFlags.Object */) === 0)
|
|
2131
|
+
return false;
|
|
2132
|
+
for (let i = 1; i < types.length; i++) {
|
|
2133
|
+
const t = types[i];
|
|
2134
|
+
if ((t.objectFlags & 32 /* ObjectFlags.Mapped */) === 0 || getModifiersTypeFromMappedType(c, t) !== first)
|
|
2135
|
+
return false;
|
|
2136
|
+
}
|
|
2137
|
+
return true;
|
|
2138
|
+
}
|
|
2002
2139
|
/**
|
|
2003
2140
|
* Whether a property of the intersection `t` reduces it to never, without resolving all of its
|
|
2004
2141
|
* properties. Such a property is one that createUnionOrIntersectionProperty combines from different
|
|
@@ -2112,7 +2249,7 @@ function isNeverReducedProperty(c, prop) {
|
|
|
2112
2249
|
export function isDiscriminantWithNeverType(c, prop) {
|
|
2113
2250
|
// A synthetic required property with non-uniform literal types, none never, reducing to never.
|
|
2114
2251
|
return ((prop.flags & 16777216 /* SymbolFlags.Optional */) === 0 &&
|
|
2115
|
-
(prop.checkFlags & (192 /* CheckFlags.NonUniformAndLiteral */ |
|
|
2252
|
+
(prop.checkFlags & (192 /* CheckFlags.NonUniformAndLiteral */ | 1048576 /* CheckFlags.HasNeverType */)) ===
|
|
2116
2253
|
192 /* CheckFlags.NonUniformAndLiteral */ &&
|
|
2117
2254
|
(getTypeOfSymbol(c, prop).flags & 262144 /* TypeFlags.Never */) !== 0);
|
|
2118
2255
|
}
|
|
@@ -2176,7 +2313,7 @@ export function getResolvedBaseConstraint(c, t, stack) {
|
|
|
2176
2313
|
return c.circularConstraintType;
|
|
2177
2314
|
let constraint;
|
|
2178
2315
|
// At least 10 levels; up to 50 without deeply nested types on the stack.
|
|
2179
|
-
const identity = getRecursionIdentity(t);
|
|
2316
|
+
const identity = getRecursionIdentity(c, t);
|
|
2180
2317
|
const current = stack ?? [];
|
|
2181
2318
|
if (current.length < 10 || (current.length < 50 && !current.includes(identity)))
|
|
2182
2319
|
constraint = computeBaseConstraint(c, getSimplifiedType(c, t, false), current.concat([identity]));
|
|
@@ -2184,7 +2321,7 @@ export function getResolvedBaseConstraint(c, t, stack) {
|
|
|
2184
2321
|
if ((t.flags & 524288 /* TypeFlags.TypeParameter */) !== 0) {
|
|
2185
2322
|
const errorNode = getConstraintDeclaration(t);
|
|
2186
2323
|
if (errorNode !== undefined)
|
|
2187
|
-
c.error(errorNode,
|
|
2324
|
+
c.error(errorNode, 498 /* Diagnostics.Type_parameter_0_has_a_circular_constraint */, typeToString(c, t));
|
|
2188
2325
|
}
|
|
2189
2326
|
constraint = c.circularConstraintType;
|
|
2190
2327
|
}
|
|
@@ -1,19 +1,20 @@
|
|
|
1
|
-
import { type Node, type SourceFile } from './ast.js';
|
|
1
|
+
import { type ImportAttributes, type Node, type SourceFile } from './ast.js';
|
|
2
2
|
import { type DiagnosticMessage } from './diagnostics.js';
|
|
3
3
|
import { ModuleKind } from './options.js';
|
|
4
4
|
import { type Checker, type CheckerHost } from './checker.js';
|
|
5
5
|
import { type Type } from './checker-types.js';
|
|
6
6
|
import { type Symbol, SymbolFlags, type SymbolTable } from './symbol.js';
|
|
7
7
|
/** The module symbol `moduleReference` names, reporting it when it isn't found unless `ignoreErrors`. */
|
|
8
|
-
export declare function resolveExternalModuleName(c: Checker, location: Node, moduleReference: Node | undefined, ignoreErrors: boolean): Symbol | undefined;
|
|
9
|
-
export declare function resolveExternalModuleNameWorker(c: Checker, location: Node, moduleReference: Node | undefined, moduleNotFoundError: DiagnosticMessage | undefined, ignoreErrors: boolean, isForAugmentation: boolean): Symbol | undefined;
|
|
8
|
+
export declare function resolveExternalModuleName(c: Checker, location: Node, moduleReference: Node | undefined, ignoreErrors: boolean, importAttributesType: Type | undefined): Symbol | undefined;
|
|
9
|
+
export declare function resolveExternalModuleNameWorker(c: Checker, location: Node, moduleReference: Node | undefined, moduleNotFoundError: DiagnosticMessage | undefined, ignoreErrors: boolean, isForAugmentation: boolean, importAttributesType: Type | undefined): Symbol | undefined;
|
|
10
10
|
/** A `resolveExternalModule` result that reported nothing, and the arguments it was computed for. */
|
|
11
11
|
export declare class ModuleResolution {
|
|
12
12
|
readonly moduleReference: string;
|
|
13
13
|
readonly moduleNotFoundError: DiagnosticMessage | undefined;
|
|
14
14
|
readonly isForAugmentation: boolean;
|
|
15
|
+
readonly importAttributesType: Type | undefined;
|
|
15
16
|
readonly symbol: Symbol | undefined;
|
|
16
|
-
constructor(moduleReference: string, moduleNotFoundError: DiagnosticMessage | undefined, isForAugmentation: boolean, symbol: Symbol | undefined);
|
|
17
|
+
constructor(moduleReference: string, moduleNotFoundError: DiagnosticMessage | undefined, isForAugmentation: boolean, importAttributesType: Type | undefined, symbol: Symbol | undefined);
|
|
17
18
|
}
|
|
18
19
|
/**
|
|
19
20
|
* The module symbol `moduleReference` resolves to from `location`, reporting resolution errors at
|
|
@@ -21,7 +22,9 @@ export declare class ModuleResolution {
|
|
|
21
22
|
* with the same result and the same diagnostics: a result that reported nothing is kept for the
|
|
22
23
|
* specifier and returned to later calls from the same declaration (`sharesSpecifierContext`).
|
|
23
24
|
*/
|
|
24
|
-
export declare function resolveExternalModule(c: Checker, location: Node, moduleReference: string, moduleNotFoundError: DiagnosticMessage | undefined, errorNode: Node | undefined, isForAugmentation: boolean): Symbol | undefined;
|
|
25
|
+
export declare function resolveExternalModule(c: Checker, location: Node, moduleReference: string, moduleNotFoundError: DiagnosticMessage | undefined, errorNode: Node | undefined, isForAugmentation: boolean, importAttributesType: Type | undefined): Symbol | undefined;
|
|
26
|
+
/** The import attributes type an ambient module declares, or the empty object type. */
|
|
27
|
+
export declare function getTypeOfModuleImportAttributes(c: Checker, symbol: Symbol): Type;
|
|
25
28
|
/** A message with its arguments, the elaboration of a diagnostic before it has a location. */
|
|
26
29
|
export declare class DiagnosticDetails {
|
|
27
30
|
readonly message: DiagnosticMessage;
|
|
@@ -43,6 +46,8 @@ export declare function tryFindAmbientModule(c: Checker, moduleName: string, wit
|
|
|
43
46
|
export declare function resolveExternalModuleSymbol(c: Checker, moduleSymbol: Symbol | undefined, dontResolveAlias: boolean): Symbol | undefined;
|
|
44
47
|
/** The module as a namespace: removes call and construct signatures, or wraps it with a synthetic default. */
|
|
45
48
|
export declare function resolveESModuleSymbol(c: Checker, moduleSymbol: Symbol | undefined, node: Node, moduleSpecifier: Node): Symbol | undefined;
|
|
49
|
+
/** The module syntax of the import or export containing `usage`, or `None` for non-literals. */
|
|
50
|
+
export declare function getEmitSyntaxForModuleSpecifierExpression(c: Checker, usage: Node): ModuleKind;
|
|
46
51
|
/** The symbol an alias declaration refers to, without resolving further aliases. */
|
|
47
52
|
export declare function getTargetOfAliasDeclaration(c: Checker, node: Node | undefined): Symbol | undefined;
|
|
48
53
|
/**
|
|
@@ -87,10 +92,14 @@ export declare function getHostSignatureFromJSDoc(node: Node): Node | undefined;
|
|
|
87
92
|
export declare function checkMetaProperty(c: Checker, node: Node): Type;
|
|
88
93
|
export declare function checkNewTargetMetaProperty(c: Checker, node: Node): Type;
|
|
89
94
|
export declare function checkImportDeclaration(c: Checker, node: Node): void;
|
|
95
|
+
/** Import attributes must be assignable to the global `ImportAttributes`. */
|
|
96
|
+
export declare function checkImportAttributes(c: Checker, declaration: Node): void;
|
|
97
|
+
/** The import attributes type of the declaration `node` is the module specifier of. */
|
|
98
|
+
export declare function getImportAttributesTypeForModuleSpecifier(c: Checker, moduleSpecifier: Node): Type | undefined;
|
|
99
|
+
export declare function checkImportAttributesExpression(c: Checker, node: ImportAttributes): Type;
|
|
90
100
|
export declare function checkImportEqualsDeclaration(c: Checker, node: Node): void;
|
|
91
101
|
export declare function checkExportDeclaration(c: Checker, node: Node): void;
|
|
92
102
|
export declare function getDeclarationContainer(node: Node): Node;
|
|
93
|
-
/** `export = e` and `export default e`; the grammar checker reports misplaced ones. */
|
|
94
103
|
export declare function checkExportAssignment(c: Checker, node: Node): void;
|
|
95
104
|
/** Reports aliases that conflict with local declarations, and type-only rules of isolated modules. */
|
|
96
105
|
export declare function checkAliasSymbol(c: Checker, node: Node): void;
|