Skip to content

Commit af08d8d

Browse files
committed
chore: wip
1 parent e1c7cfc commit af08d8d

File tree

1 file changed

+263
-0
lines changed

1 file changed

+263
-0
lines changed

test/fixtures/output/checker.d.ts

Lines changed: 263 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,263 @@
1+
import { ModuleDeclaration, Node, Signature, Symbol, SymbolId, TypeChecker, TypeCheckerHost, } from './_namespaces/ts.js';
2+
export declare function getNodeId(node: Node): number;
3+
export declare function getSymbolId(symbol: Symbol): SymbolId;
4+
export declare function isInstantiatedModule(node: ModuleDeclaration, preserveConstEnums: boolean): void;
5+
export declare function createTypeChecker(host: TypeCheckerHost): TypeChecker;
6+
export declare function signatureHasRestParameter(s: Signature): void;
7+
export declare function signatureHasLiteralTypes(s: Signature): void;
8+
declare type TypeSystemEntity = Node | Symbol | Type | Signature
9+
declare type AddUnusedDiagnostic = (containingNode: Node, type: UnusedKind, diagnostic: DiagnosticWithLocation) => void
10+
declare class SymbolTrackerImpl implements SymbolTracker {
11+
moduleResolverHost: ModuleSpecifierResolutionHost & { getCommonSourceDirectory(): string; } | undefined;
12+
context: NodeBuilderContext;
13+
readonly inner: SymbolTracker | undefined;
14+
readonly canTrackSymbol: boolean;
15+
disableTrackSymbol: any;
16+
constructor(context: NodeBuilderContext, tracker: SymbolTracker | undefined, moduleResolverHost: ModuleSpecifierResolutionHost & { getCommonSourceDirectory(): string; } | undefined);
17+
trackSymbol(symbol: Symbol, enclosingDeclaration: Node | undefined, meaning: SymbolFlags): boolean;
18+
reportInaccessibleThisError(): void;
19+
reportPrivateInBaseOfClassExpression(propertyName: string): void;
20+
reportInaccessibleUniqueSymbolError(): void;
21+
reportCyclicStructureError(): void;
22+
reportLikelyUnsafeImportRequiredError(specifier: string): void;
23+
reportTruncationError(): void;
24+
reportNonlocalAugmentation(containingFile: SourceFile, parentSymbol: Symbol, augmentingSymbol: Symbol): void;
25+
reportNonSerializableProperty(propertyName: string): void;
26+
private onDiagnosticReported(): void;
27+
reportInferenceFallback(node: Node): void;
28+
}
29+
declare const enum ReferenceHint {
30+
Unspecified,
31+
Identifier,
32+
Property,
33+
ExportAssignment,
34+
Jsx,
35+
AsyncFunction,
36+
ExportImportEquals,
37+
ExportSpecifier,
38+
Decorator,
39+
}
40+
declare const enum IterationUse {
41+
AllowsSyncIterablesFlag = 1 << 0,
42+
AllowsAsyncIterablesFlag = 1 << 1,
43+
AllowsStringInputFlag = 1 << 2,
44+
ForOfFlag = 1 << 3,
45+
YieldStarFlag = 1 << 4,
46+
SpreadFlag = 1 << 5,
47+
DestructuringFlag = 1 << 6,
48+
PossiblyOutOfBounds = 1 << 7,
49+
50+
// Spread, Destructuring, Array element assignment
51+
Element = AllowsSyncIterablesFlag,
52+
Spread = AllowsSyncIterablesFlag | SpreadFlag,
53+
Destructuring = AllowsSyncIterablesFlag | DestructuringFlag,
54+
55+
ForOf = AllowsSyncIterablesFlag | AllowsStringInputFlag | ForOfFlag,
56+
ForAwaitOf = AllowsSyncIterablesFlag | AllowsAsyncIterablesFlag | AllowsStringInputFlag | ForOfFlag,
57+
58+
YieldStar = AllowsSyncIterablesFlag | YieldStarFlag,
59+
AsyncYieldStar = AllowsSyncIterablesFlag | AllowsAsyncIterablesFlag | YieldStarFlag,
60+
61+
GeneratorReturnType = AllowsSyncIterablesFlag,
62+
AsyncGeneratorReturnType = AllowsAsyncIterablesFlag,
63+
}
64+
declare const enum IterationTypeKind {
65+
Yield,
66+
Return,
67+
Next,
68+
}
69+
declare const enum WideningKind {
70+
Normal,
71+
FunctionReturn,
72+
GeneratorNext,
73+
GeneratorYield,
74+
}
75+
export declare const enum TypeFacts {
76+
None = 0,
77+
TypeofEQString = 1 << 0, // typeof x === "string"
78+
TypeofEQNumber = 1 << 1, // typeof x === "number"
79+
TypeofEQBigInt = 1 << 2, // typeof x === "bigint"
80+
TypeofEQBoolean = 1 << 3, // typeof x === "boolean"
81+
TypeofEQSymbol = 1 << 4, // typeof x === "symbol"
82+
TypeofEQObject = 1 << 5, // typeof x === "object"
83+
TypeofEQFunction = 1 << 6, // typeof x === "function"
84+
TypeofEQHostObject = 1 << 7, // typeof x === "xxx"
85+
TypeofNEString = 1 << 8, // typeof x !== "string"
86+
TypeofNENumber = 1 << 9, // typeof x !== "number"
87+
TypeofNEBigInt = 1 << 10, // typeof x !== "bigint"
88+
TypeofNEBoolean = 1 << 11, // typeof x !== "boolean"
89+
TypeofNESymbol = 1 << 12, // typeof x !== "symbol"
90+
TypeofNEObject = 1 << 13, // typeof x !== "object"
91+
TypeofNEFunction = 1 << 14, // typeof x !== "function"
92+
TypeofNEHostObject = 1 << 15, // typeof x !== "xxx"
93+
EQUndefined = 1 << 16, // x === undefined
94+
EQNull = 1 << 17, // x === null
95+
EQUndefinedOrNull = 1 << 18, // x === undefined / x === null
96+
NEUndefined = 1 << 19, // x !== undefined
97+
NENull = 1 << 20, // x !== null
98+
NEUndefinedOrNull = 1 << 21, // x != undefined / x != null
99+
Truthy = 1 << 22, // x
100+
Falsy = 1 << 23, // !x
101+
IsUndefined = 1 << 24, // Contains undefined or intersection with undefined
102+
IsNull = 1 << 25, // Contains null or intersection with null
103+
IsUndefinedOrNull = IsUndefined | IsNull,
104+
All = (1 << 27) - 1,
105+
// The following members encode facts about particular kinds of types for use in the getTypeFacts function.
106+
// The presence of a particular fact means that the given test is true for some (and possibly all) values
107+
// of that kind of type.
108+
BaseStringStrictFacts = TypeofEQString | TypeofNENumber | TypeofNEBigInt | TypeofNEBoolean | TypeofNESymbol | TypeofNEObject | TypeofNEFunction | TypeofNEHostObject | NEUndefined | NENull | NEUndefinedOrNull,
109+
BaseStringFacts = BaseStringStrictFacts | EQUndefined | EQNull | EQUndefinedOrNull | Falsy,
110+
StringStrictFacts = BaseStringStrictFacts | Truthy | Falsy,
111+
StringFacts = BaseStringFacts | Truthy,
112+
EmptyStringStrictFacts = BaseStringStrictFacts | Falsy,
113+
EmptyStringFacts = BaseStringFacts,
114+
NonEmptyStringStrictFacts = BaseStringStrictFacts | Truthy,
115+
NonEmptyStringFacts = BaseStringFacts | Truthy,
116+
BaseNumberStrictFacts = TypeofEQNumber | TypeofNEString | TypeofNEBigInt | TypeofNEBoolean | TypeofNESymbol | TypeofNEObject | TypeofNEFunction | TypeofNEHostObject | NEUndefined | NENull | NEUndefinedOrNull,
117+
BaseNumberFacts = BaseNumberStrictFacts | EQUndefined | EQNull | EQUndefinedOrNull | Falsy,
118+
NumberStrictFacts = BaseNumberStrictFacts | Truthy | Falsy,
119+
NumberFacts = BaseNumberFacts | Truthy,
120+
ZeroNumberStrictFacts = BaseNumberStrictFacts | Falsy,
121+
ZeroNumberFacts = BaseNumberFacts,
122+
NonZeroNumberStrictFacts = BaseNumberStrictFacts | Truthy,
123+
NonZeroNumberFacts = BaseNumberFacts | Truthy,
124+
BaseBigIntStrictFacts = TypeofEQBigInt | TypeofNEString | TypeofNENumber | TypeofNEBoolean | TypeofNESymbol | TypeofNEObject | TypeofNEFunction | TypeofNEHostObject | NEUndefined | NENull | NEUndefinedOrNull,
125+
BaseBigIntFacts = BaseBigIntStrictFacts | EQUndefined | EQNull | EQUndefinedOrNull | Falsy,
126+
BigIntStrictFacts = BaseBigIntStrictFacts | Truthy | Falsy,
127+
BigIntFacts = BaseBigIntFacts | Truthy,
128+
ZeroBigIntStrictFacts = BaseBigIntStrictFacts | Falsy,
129+
ZeroBigIntFacts = BaseBigIntFacts,
130+
NonZeroBigIntStrictFacts = BaseBigIntStrictFacts | Truthy,
131+
NonZeroBigIntFacts = BaseBigIntFacts | Truthy,
132+
BaseBooleanStrictFacts = TypeofEQBoolean | TypeofNEString | TypeofNENumber | TypeofNEBigInt | TypeofNESymbol | TypeofNEObject | TypeofNEFunction | TypeofNEHostObject | NEUndefined | NENull | NEUndefinedOrNull,
133+
BaseBooleanFacts = BaseBooleanStrictFacts | EQUndefined | EQNull | EQUndefinedOrNull | Falsy,
134+
BooleanStrictFacts = BaseBooleanStrictFacts | Truthy | Falsy,
135+
BooleanFacts = BaseBooleanFacts | Truthy,
136+
FalseStrictFacts = BaseBooleanStrictFacts | Falsy,
137+
FalseFacts = BaseBooleanFacts,
138+
TrueStrictFacts = BaseBooleanStrictFacts | Truthy,
139+
TrueFacts = BaseBooleanFacts | Truthy,
140+
SymbolStrictFacts = TypeofEQSymbol | TypeofNEString | TypeofNENumber | TypeofNEBigInt | TypeofNEBoolean | TypeofNEObject | TypeofNEFunction | TypeofNEHostObject | NEUndefined | NENull | NEUndefinedOrNull | Truthy,
141+
SymbolFacts = SymbolStrictFacts | EQUndefined | EQNull | EQUndefinedOrNull | Falsy,
142+
ObjectStrictFacts = TypeofEQObject | TypeofEQHostObject | TypeofNEString | TypeofNENumber | TypeofNEBigInt | TypeofNEBoolean | TypeofNESymbol | TypeofNEFunction | NEUndefined | NENull | NEUndefinedOrNull | Truthy,
143+
ObjectFacts = ObjectStrictFacts | EQUndefined | EQNull | EQUndefinedOrNull | Falsy,
144+
FunctionStrictFacts = TypeofEQFunction | TypeofEQHostObject | TypeofNEString | TypeofNENumber | TypeofNEBigInt | TypeofNEBoolean | TypeofNESymbol | TypeofNEObject | NEUndefined | NENull | NEUndefinedOrNull | Truthy,
145+
FunctionFacts = FunctionStrictFacts | EQUndefined | EQNull | EQUndefinedOrNull | Falsy,
146+
VoidFacts = TypeofNEString | TypeofNENumber | TypeofNEBigInt | TypeofNEBoolean | TypeofNESymbol | TypeofNEObject | TypeofNEFunction | TypeofNEHostObject | EQUndefined | EQUndefinedOrNull | NENull | Falsy,
147+
UndefinedFacts = TypeofNEString | TypeofNENumber | TypeofNEBigInt | TypeofNEBoolean | TypeofNESymbol | TypeofNEObject | TypeofNEFunction | TypeofNEHostObject | EQUndefined | EQUndefinedOrNull | NENull | Falsy | IsUndefined,
148+
NullFacts = TypeofEQObject | TypeofNEString | TypeofNENumber | TypeofNEBigInt | TypeofNEBoolean | TypeofNESymbol | TypeofNEFunction | TypeofNEHostObject | EQNull | EQUndefinedOrNull | NEUndefined | Falsy | IsNull,
149+
EmptyObjectStrictFacts = All & ~(EQUndefined | EQNull | EQUndefinedOrNull | IsUndefinedOrNull),
150+
EmptyObjectFacts = All & ~IsUndefinedOrNull,
151+
UnknownFacts = All & ~IsUndefinedOrNull,
152+
AllTypeofNE = TypeofNEString | TypeofNENumber | TypeofNEBigInt | TypeofNEBoolean | TypeofNESymbol | TypeofNEObject | TypeofNEFunction | NEUndefined,
153+
// Masks
154+
OrFactsMask = TypeofEQFunction | TypeofNEObject,
155+
AndFactsMask = All & ~OrFactsMask,
156+
}
157+
declare const enum TypeSystemPropertyName {
158+
Type,
159+
ResolvedBaseConstructorType,
160+
DeclaredType,
161+
ResolvedReturnType,
162+
ImmediateBaseConstraint,
163+
ResolvedTypeArguments,
164+
ResolvedBaseTypes,
165+
WriteType,
166+
ParameterInitializerContainsUndefined,
167+
}
168+
export declare const enum CheckMode {
169+
Normal = 0, // Normal type checking
170+
Contextual = 1 << 0, // Explicitly assigned contextual type, therefore not cacheable
171+
Inferential = 1 << 1, // Inferential typing
172+
SkipContextSensitive = 1 << 2, // Skip context sensitive function expressions
173+
SkipGenericFunctions = 1 << 3, // Skip single signature generic functions
174+
IsForSignatureHelp = 1 << 4, // Call resolution for purposes of signature help
175+
RestBindingElement = 1 << 5, // Checking a type that is going to be used to determine the type of a rest binding element
176+
// e.g. in `const { a, ...rest } = foo`, when checking the type of `foo` to determine the type of `rest`,
177+
// we need to preserve generic types instead of substituting them for constraints
178+
TypeOnly = 1 << 6, // Called from getTypeOfExpression, diagnostics may be omitted
179+
}
180+
export declare const enum SignatureCheckMode {
181+
None = 0,
182+
BivariantCallback = 1 << 0,
183+
StrictCallback = 1 << 1,
184+
IgnoreReturnTypes = 1 << 2,
185+
StrictArity = 1 << 3,
186+
StrictTopSignature = 1 << 4,
187+
Callback = BivariantCallback | StrictCallback,
188+
}
189+
declare const enum IntersectionState {
190+
None = 0,
191+
Source = 1 << 0, // Source type is a constituent of an outer intersection
192+
Target = 1 << 1, // Target type is a constituent of an outer intersection
193+
}
194+
declare const enum RecursionFlags {
195+
None = 0,
196+
Source = 1 << 0,
197+
Target = 1 << 1,
198+
Both = Source | Target,
199+
}
200+
declare const enum MappedTypeModifiers {
201+
IncludeReadonly = 1 << 0,
202+
ExcludeReadonly = 1 << 1,
203+
IncludeOptional = 1 << 2,
204+
ExcludeOptional = 1 << 3,
205+
}
206+
declare const enum MappedTypeNameTypeKind {
207+
None,
208+
Filtering,
209+
Remapping,
210+
}
211+
declare const enum ExpandingFlags {
212+
None = 0,
213+
Source = 1,
214+
Target = 1 << 1,
215+
Both = Source | Target,
216+
}
217+
declare const enum MembersOrExportsResolutionKind {
218+
resolvedExports = "resolvedExports",
219+
resolvedMembers = "resolvedMembers",
220+
}
221+
declare const enum UnusedKind {
222+
Local,
223+
Parameter,
224+
}
225+
declare const enum DeclarationMeaning {
226+
GetAccessor = 1,
227+
SetAccessor = 2,
228+
PropertyAssignment = 4,
229+
Method = 8,
230+
PrivateStatic = 16,
231+
GetOrSetAccessor = GetAccessor | SetAccessor,
232+
PropertyAssignmentOrMethod = PropertyAssignment | Method,
233+
}
234+
declare const enum DeclarationSpaces {
235+
None = 0,
236+
ExportValue = 1 << 0,
237+
ExportType = 1 << 1,
238+
ExportNamespace = 1 << 2,
239+
}
240+
declare const enum MinArgumentCountFlags {
241+
None = 0,
242+
StrongArityForUntypedJS = 1 << 0,
243+
VoidIsNonOptional = 1 << 1,
244+
}
245+
declare const enum IntrinsicTypeKind {
246+
Uppercase,
247+
Lowercase,
248+
Capitalize,
249+
Uncapitalize,
250+
NoInfer,
251+
}
252+
declare namespace JsxNames {
253+
export const JSX: string;
254+
export const IntrinsicElements: string;
255+
export const ElementClass: string;
256+
export const ElementAttributesPropertyNameContainer: string;
257+
export const ElementChildrenAttributeNameContainer: string;
258+
export const Element: string;
259+
export const ElementType: string;
260+
export const IntrinsicAttributes: string;
261+
export const IntrinsicClassAttributes: string;
262+
export const LibraryManagedAttributes: string;
263+
}

0 commit comments

Comments
 (0)