tsc-ts 0.0.5 → 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 +1 -1
- package/dist/api/compiler/ast.d.ts +10 -9
- package/dist/api/compiler/ast.js +22 -16
- package/dist/api/compiler/binder-utilities.js +2 -1
- package/dist/api/compiler/binder.js +9 -8
- package/dist/api/compiler/checker-calls.js +3 -2
- package/dist/api/compiler/checker-declaration-order.js +2 -1
- package/dist/api/compiler/checker-declarations.js +14 -14
- package/dist/api/compiler/checker-declared-types.d.ts +1 -1
- package/dist/api/compiler/checker-declared-types.js +12 -11
- package/dist/api/compiler/checker-decorators.js +3 -3
- package/dist/api/compiler/checker-deprecation.js +17 -18
- package/dist/api/compiler/checker-destructuring.d.ts +1 -1
- package/dist/api/compiler/checker-destructuring.js +3 -3
- package/dist/api/compiler/checker-elaboration.js +8 -7
- package/dist/api/compiler/checker-emit-resolver.d.ts +1 -1
- package/dist/api/compiler/checker-emit-resolver.js +5 -4
- package/dist/api/compiler/checker-grammar.js +18 -4
- package/dist/api/compiler/checker-heritage.d.ts +1 -1
- package/dist/api/compiler/checker-heritage.js +14 -13
- package/dist/api/compiler/checker-inference.d.ts +1 -1
- package/dist/api/compiler/checker-inference.js +9 -9
- package/dist/api/compiler/checker-javascript.d.ts +1 -1
- package/dist/api/compiler/checker-javascript.js +5 -4
- package/dist/api/compiler/checker-jsx.d.ts +1 -1
- package/dist/api/compiler/checker-jsx.js +4 -4
- package/dist/api/compiler/checker-literals.js +2 -2
- package/dist/api/compiler/checker-members.d.ts +5 -3
- package/dist/api/compiler/checker-members.js +75 -53
- package/dist/api/compiler/checker-modules.d.ts +1 -1
- package/dist/api/compiler/checker-modules.js +13 -13
- package/dist/api/compiler/checker-object-literals.d.ts +1 -1
- package/dist/api/compiler/checker-object-literals.js +11 -7
- package/dist/api/compiler/checker-overloads.d.ts +1 -1
- package/dist/api/compiler/checker-overloads.js +4 -3
- package/dist/api/compiler/checker-property-access.d.ts +1 -1
- package/dist/api/compiler/checker-property-access.js +2 -2
- package/dist/api/compiler/checker-services.js +2 -2
- package/dist/api/compiler/checker-signatures.d.ts +1 -1
- package/dist/api/compiler/checker-signatures.js +9 -8
- package/dist/api/compiler/checker-symbol-types.d.ts +2 -18
- package/dist/api/compiler/checker-symbol-types.js +22 -952
- package/dist/api/compiler/checker-symbols.d.ts +2 -2
- package/dist/api/compiler/checker-symbols.js +29 -27
- package/dist/api/compiler/checker-type-factory.d.ts +2 -2
- package/dist/api/compiler/checker-type-factory.js +57 -16
- package/dist/api/compiler/checker-type-nodes.d.ts +1 -1
- package/dist/api/compiler/checker-type-nodes.js +2 -2
- package/dist/api/compiler/checker-type-operators.d.ts +1 -1
- package/dist/api/compiler/checker-type-operators.js +5 -5
- package/dist/api/compiler/checker-types.d.ts +73 -7
- package/dist/api/compiler/checker-types.js +220 -43
- package/dist/api/compiler/checker-unused.d.ts +1 -1
- package/dist/api/compiler/checker-unused.js +3 -3
- package/dist/api/compiler/checker.d.ts +29 -8
- package/dist/api/compiler/checker.js +29 -9
- package/dist/api/compiler/diagnostics.d.ts +2 -8
- package/dist/api/compiler/diagnostics.js +4 -40
- package/dist/api/compiler/file-include.d.ts +35 -8
- package/dist/api/compiler/file-include.js +81 -18
- package/dist/api/compiler/file-loader.d.ts +33 -4
- package/dist/api/compiler/file-loader.js +90 -24
- package/dist/api/compiler/instantiation.d.ts +1 -1
- package/dist/api/compiler/instantiation.js +86 -50
- package/dist/api/compiler/link-tables.d.ts +69 -0
- package/dist/api/compiler/link-tables.js +236 -0
- package/dist/api/compiler/name-resolver.js +3 -3
- package/dist/api/compiler/node-builder-names.d.ts +1 -1
- package/dist/api/compiler/node-builder-names.js +12 -12
- package/dist/api/compiler/node-builder-pseudo.d.ts +1 -1
- package/dist/api/compiler/node-builder-pseudo.js +2 -1
- package/dist/api/compiler/node-builder.d.ts +1 -1
- package/dist/api/compiler/node-builder.js +16 -16
- package/dist/api/compiler/parallel-parse.d.ts +2 -0
- package/dist/api/compiler/parallel-parse.js +4 -0
- package/dist/api/compiler/parser.d.ts +33 -16
- package/dist/api/compiler/parser.js +95 -76
- package/dist/api/compiler/printer/emit-context.d.ts +5 -2
- package/dist/api/compiler/printer/emit-context.js +19 -13
- package/dist/api/compiler/program-checker.js +3 -0
- package/dist/api/compiler/program.js +9 -1
- package/dist/api/compiler/relations.d.ts +1 -1
- package/dist/api/compiler/relations.js +10 -10
- package/dist/api/compiler/symbol-accessibility.d.ts +1 -1
- package/dist/api/compiler/symbol-accessibility.js +123 -26
- package/dist/api/compiler/symbol.d.ts +45 -3
- package/dist/api/compiler/symbol.js +121 -10
- package/dist/api/compiler/transformers/alias-references.d.ts +1 -1
- package/dist/api/compiler/transformers/alias-references.js +2 -1
- package/dist/api/compiler/transformers/declarations-diagnostics.js +2 -1
- package/dist/api/compiler/transformers/declarations-pseudo.js +4 -2
- package/dist/api/compiler/transformers/declarations-syntactic.d.ts +1 -1
- package/dist/api/compiler/transformers/declarations-syntactic.js +9 -9
- package/dist/api/compiler/transformers/declarations-tracker.d.ts +1 -1
- package/dist/api/compiler/transformers/declarations-tracker.js +3 -2
- package/dist/api/compiler/transformers/declarations.js +6 -5
- package/dist/api/compiler/transformers/reference-resolver.d.ts +2 -1
- package/dist/api/compiler/transformers/reference-resolver.js +26 -24
- package/dist/api/compiler/transformers/subtree-facts.d.ts +1 -0
- package/dist/api/compiler/transformers/subtree-facts.js +7 -5
- package/dist/api/compiler/transformers/syntax-facts.d.ts +1 -0
- package/dist/api/compiler/transformers/syntax-facts.js +9 -5
- package/dist/api/compiler/transformers/type-serialization.js +12 -12
- package/package.json +9 -9
- package/src/compiler/ast.ts +27 -19
- package/src/compiler/binder-utilities.ts +2 -2
- package/src/compiler/binder.ts +15 -11
- package/src/compiler/checker-calls.ts +3 -3
- package/src/compiler/checker-declaration-order.ts +2 -2
- package/src/compiler/checker-declarations.ts +21 -14
- package/src/compiler/checker-declared-types.ts +12 -12
- package/src/compiler/checker-decorators.ts +3 -3
- package/src/compiler/checker-deprecation.ts +17 -21
- package/src/compiler/checker-destructuring.ts +3 -3
- package/src/compiler/checker-elaboration.ts +8 -8
- package/src/compiler/checker-emit-resolver.ts +5 -5
- package/src/compiler/checker-grammar.ts +17 -5
- package/src/compiler/checker-heritage.ts +21 -14
- package/src/compiler/checker-inference.ts +17 -9
- package/src/compiler/checker-javascript.ts +5 -5
- package/src/compiler/checker-jsx.ts +12 -8
- package/src/compiler/checker-literals.ts +2 -2
- package/src/compiler/checker-members.ts +91 -47
- package/src/compiler/checker-modules.ts +23 -13
- package/src/compiler/checker-object-literals.ts +22 -6
- package/src/compiler/checker-overloads.ts +6 -6
- package/src/compiler/checker-property-access.ts +2 -2
- package/src/compiler/checker-services.ts +2 -2
- package/src/compiler/checker-signatures.ts +9 -9
- package/src/compiler/checker-symbol-types.ts +20 -940
- package/src/compiler/checker-symbols.ts +42 -35
- package/src/compiler/checker-type-factory.ts +53 -16
- package/src/compiler/checker-type-nodes.ts +2 -2
- package/src/compiler/checker-type-operators.ts +13 -5
- package/src/compiler/checker-types.ts +223 -43
- package/src/compiler/checker-unused.ts +3 -3
- package/src/compiler/checker.ts +31 -9
- package/src/compiler/diagnostics.ts +5 -44
- package/src/compiler/file-include.ts +85 -17
- package/src/compiler/file-loader.ts +104 -35
- package/src/compiler/incremental.ts +39 -5
- package/src/compiler/instantiation.ts +99 -55
- package/src/compiler/link-tables.ts +245 -0
- package/src/compiler/name-resolver.ts +3 -3
- package/src/compiler/node-builder-names.ts +21 -19
- package/src/compiler/node-builder-pseudo.ts +2 -2
- package/src/compiler/node-builder.ts +24 -16
- package/src/compiler/parallel-check.ts +11 -8
- package/src/compiler/parallel-parse.ts +5 -0
- package/src/compiler/parse-thread.ts +0 -4
- package/src/compiler/parser.ts +120 -70
- package/src/compiler/printer/emit-context.ts +20 -15
- package/src/compiler/program-checker.ts +2 -0
- package/src/compiler/program.ts +8 -1
- package/src/compiler/relations.ts +10 -10
- package/src/compiler/symbol-accessibility.ts +120 -25
- package/src/compiler/symbol.ts +127 -9
- package/src/compiler/transformers/alias-references.ts +2 -2
- package/src/compiler/transformers/declarations-diagnostics.ts +2 -1
- package/src/compiler/transformers/declarations-pseudo.ts +7 -4
- package/src/compiler/transformers/declarations-syntactic.ts +17 -9
- package/src/compiler/transformers/declarations-tracker.ts +3 -3
- package/src/compiler/transformers/declarations.ts +6 -6
- package/src/compiler/transformers/reference-resolver.ts +37 -25
- package/src/compiler/transformers/subtree-facts.ts +13 -5
- package/src/compiler/transformers/syntax-facts.ts +10 -5
- package/src/compiler/transformers/type-serialization.ts +12 -12
- package/src/compiler/tsc-build.ts +17 -13
- package/src/compiler/tsc-cli.ts +9 -6
- package/src/compiler/tsc-compile.ts +16 -7
- package/src/compiler/tsc-watch.ts +94 -26
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { type Node } from './ast.js';
|
|
2
|
-
import { InternalSymbolName, type Symbol } from './symbol.js';
|
|
3
2
|
import type { Checker } from './checker.js';
|
|
4
3
|
import { ElementFlags, IndexInfo, type InterfaceType, Signature, SignatureKind, type Type, type TypeMapper, TypePredicate, type TypeReference } from './checker-types.js';
|
|
5
4
|
import { getSymbolOfDeclaration } from './checker-symbols.js';
|
|
@@ -7,6 +6,7 @@ import { getClassLikeDeclarationOfSymbol, getConstraintOfTypeParameter } from '.
|
|
|
7
6
|
import { instantiateTypes } from './instantiation.js';
|
|
8
7
|
import { getIndexInfosOfType } from './checker-members.js';
|
|
9
8
|
import { type TypeComparer } from './relations.js';
|
|
9
|
+
import { InternalSymbolName, type Symbol } from './symbol.js';
|
|
10
10
|
/** Signatures of a symbol's function-like declarations, skipping overload implementations. */
|
|
11
11
|
export declare function getSignaturesOfSymbol(c: Checker, symbol: Symbol | undefined): Signature[];
|
|
12
12
|
export declare function isFunctionLikeNode(node: Node): boolean;
|
|
@@ -18,13 +18,14 @@ import { isTypeAssignableTo } from './relations.js';
|
|
|
18
18
|
import { getReturnTypeFromBody, getTypePredicateFromBody } from './checker-functions.js';
|
|
19
19
|
import { checkComputedPropertyName } from './checker-expressions.js';
|
|
20
20
|
import { hasLateBindableIndexSignature } from './checker-utilities.js';
|
|
21
|
+
import { declarationCount, getDeclarations } from './symbol.js';
|
|
21
22
|
// ---- From declarations
|
|
22
23
|
/** Signatures of a symbol's function-like declarations, skipping overload implementations. */
|
|
23
24
|
export function getSignaturesOfSymbol(c, symbol) {
|
|
24
25
|
if (symbol === undefined)
|
|
25
26
|
return [];
|
|
26
27
|
const result = [];
|
|
27
|
-
const declarations = symbol
|
|
28
|
+
const declarations = getDeclarations(symbol);
|
|
28
29
|
for (let i = 0; i < declarations.length; i++) {
|
|
29
30
|
const decl = declarations[i];
|
|
30
31
|
if (!isFunctionLikeNode(decl))
|
|
@@ -236,7 +237,7 @@ export function getReturnTypeFromAnnotation(c, declaration) {
|
|
|
236
237
|
if (declaration.kind === 178 /* SyntaxKind.GetAccessor */) {
|
|
237
238
|
const symbol = getSymbolOfDeclaration(c, declaration);
|
|
238
239
|
if (symbol !== undefined) {
|
|
239
|
-
const setter = symbol.
|
|
240
|
+
const setter = getDeclarations(symbol).find((d) => d.kind === 179 /* SyntaxKind.SetAccessor */);
|
|
240
241
|
if (setter !== undefined) {
|
|
241
242
|
const parameters = getParameters(setter);
|
|
242
243
|
if (parameters !== undefined) {
|
|
@@ -655,7 +656,7 @@ export function getIndexInfosOfIndexSymbol(c, indexSymbol, siblingSymbols) {
|
|
|
655
656
|
let readonlyNumber = true;
|
|
656
657
|
let readonlySymbol = true;
|
|
657
658
|
const propertySymbols = [];
|
|
658
|
-
for (const declaration of indexSymbol
|
|
659
|
+
for (const declaration of getDeclarations(indexSymbol)) {
|
|
659
660
|
if (declaration.kind === 182 /* SyntaxKind.IndexSignature */) {
|
|
660
661
|
const parameters = getParameters(declaration)?.nodes ?? [];
|
|
661
662
|
const returnTypeNode = getType(declaration);
|
|
@@ -722,7 +723,7 @@ import { getContextualTypeEx } from './checker-contextual.js';
|
|
|
722
723
|
function isSymbolWithSymbolName(c, symbol) {
|
|
723
724
|
if (symbol.name.startsWith('\ufffe@'))
|
|
724
725
|
return true;
|
|
725
|
-
const name = symbol
|
|
726
|
+
const name = declarationCount(symbol) !== 0 ? getName(symbol.declaration) : undefined;
|
|
726
727
|
return (name !== undefined &&
|
|
727
728
|
name.kind === 168 /* SyntaxKind.ComputedPropertyName */ &&
|
|
728
729
|
isTypeAssignableToKind(c, checkComputedPropertyName(c, name), 512 /* TypeFlags.ESSymbol */));
|
|
@@ -731,7 +732,7 @@ function isSymbolWithSymbolName(c, symbol) {
|
|
|
731
732
|
function isSymbolWithNumericName(c, symbol) {
|
|
732
733
|
if (isNumericLiteralName(symbol.name))
|
|
733
734
|
return true;
|
|
734
|
-
const name = symbol
|
|
735
|
+
const name = declarationCount(symbol) !== 0 ? getName(symbol.declaration) : undefined;
|
|
735
736
|
if (name === undefined)
|
|
736
737
|
return false;
|
|
737
738
|
if (name.kind === 168 /* SyntaxKind.ComputedPropertyName */)
|
|
@@ -750,7 +751,7 @@ function getObjectLiteralIndexInfo(c, isReadonly, properties, keyType) {
|
|
|
750
751
|
(keyType === c.esSymbolType && isSymbolWithSymbolName(c, prop))) {
|
|
751
752
|
propTypes.push(getTypeOfSymbol(c, prop));
|
|
752
753
|
if (isSymbolWithComputedName(prop))
|
|
753
|
-
components.push(prop.
|
|
754
|
+
components.push(prop.declaration);
|
|
754
755
|
}
|
|
755
756
|
}
|
|
756
757
|
const unionType = propTypes.length !== 0
|
|
@@ -759,9 +760,9 @@ function getObjectLiteralIndexInfo(c, isReadonly, properties, keyType) {
|
|
|
759
760
|
return new IndexInfo(keyType, unionType, isReadonly, undefined, components);
|
|
760
761
|
}
|
|
761
762
|
function isSymbolWithComputedName(symbol) {
|
|
762
|
-
if (symbol
|
|
763
|
+
if (declarationCount(symbol) === 0)
|
|
763
764
|
return false;
|
|
764
|
-
const name = getName(symbol.
|
|
765
|
+
const name = getName(symbol.declaration);
|
|
765
766
|
return name !== undefined && name.kind === 168 /* SyntaxKind.ComputedPropertyName */;
|
|
766
767
|
}
|
|
767
768
|
export { getIndexInfosOfType, instantiateTypes, getConstraintOfTypeParameter, getClassLikeDeclarationOfSymbol, getSymbolOfDeclaration, };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { CheckMode } from './checker-types.js';
|
|
2
|
-
import { type Node
|
|
2
|
+
import { type Node } from './ast.js';
|
|
3
3
|
import { hasStaticModifier } from './binder-utilities.js';
|
|
4
|
-
import { type Symbol } from './symbol.js';
|
|
5
4
|
import { type Checker } from './checker.js';
|
|
6
5
|
import { type Type, TypeFlags, type UnionType } from './checker-types.js';
|
|
7
6
|
import { filterType } from './checker-type-factory.js';
|
|
8
7
|
import { getDeclarationOfAliasSymbol } from './checker-symbols.js';
|
|
8
|
+
import { type Symbol } from './symbol.js';
|
|
9
9
|
export declare function getTypeOfSymbol(c: Checker, symbol: Symbol): Type;
|
|
10
10
|
export declare function getTypeOfParameter(c: Checker, symbol: Symbol): Type;
|
|
11
11
|
export declare function getNonMissingTypeOfSymbol(c: Checker, symbol: Symbol): Type;
|
|
@@ -34,22 +34,6 @@ export declare const enum WideningKind {
|
|
|
34
34
|
export declare function reportErrorsFromWidening(c: Checker, declaration: Node, t: Type, wideningKind: WideningKind): void;
|
|
35
35
|
export declare function reportImplicitAny(c: Checker, declaration: Node, t: Type, wideningKind?: WideningKind): void;
|
|
36
36
|
export declare function getWidenedType(c: Checker, t: Type): Type;
|
|
37
|
-
/**
|
|
38
|
-
* By name, the first property of the unions of `file`'s object literals that leave the name missing.
|
|
39
|
-
* Without a checker, as on a parse thread, array literals are taken to have the global Array type, and
|
|
40
|
-
* the result is undefined where an enum the scan can't resolve decides which literals subtype reduction
|
|
41
|
-
* leaves out (`enumKeyOfMemberAccess`); the checker then scans the file itself.
|
|
42
|
-
*/
|
|
43
|
-
export declare function scanSiblingProperties(file: SourceFile, c: Checker | undefined): Map<string, Node> | undefined;
|
|
44
|
-
/** The first property of each name among the files of one of tsgo's checkers, scanned in order. */
|
|
45
|
-
export declare class SlotSiblingProperties {
|
|
46
|
-
readonly members: Map<string, Node>;
|
|
47
|
-
/** The index of the file of each name's property. */
|
|
48
|
-
readonly fileIndexes: Map<string, number>;
|
|
49
|
-
/** The index of the next file of the checker to scan. */
|
|
50
|
-
next: number;
|
|
51
|
-
constructor(first: number);
|
|
52
|
-
}
|
|
53
37
|
export declare function addOptionality(c: Checker, t: Type, isProperty: boolean, isOptional: boolean): Type;
|
|
54
38
|
export declare function getOptionalType(c: Checker, t: Type, isProperty: boolean): Type;
|
|
55
39
|
export declare function addOptionalTypeMarker(c: Checker, t: Type): Type;
|