@topce/native-preview 7.0.0-dev.20260531.1 → 7.0.0-dev.20260711.3
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/NOTICE.txt +436 -0
- package/README.md +3 -1
- package/bin/tsgo +2 -0
- package/dist/api/async/api.d.ts +405 -78
- package/dist/api/async/api.d.ts.map +1 -1
- package/dist/api/async/api.js +992 -169
- package/dist/api/async/api.js.map +1 -1
- package/dist/api/async/client.d.ts +17 -0
- package/dist/api/async/client.d.ts.map +1 -1
- package/dist/api/async/client.js +72 -1
- package/dist/api/async/client.js.map +1 -1
- package/dist/api/async/types.d.ts +148 -17
- package/dist/api/async/types.d.ts.map +1 -1
- package/dist/api/compilerOptions.d.ts +109 -0
- package/dist/api/compilerOptions.d.ts.map +1 -0
- package/dist/api/compilerOptions.js +2 -0
- package/dist/api/compilerOptions.js.map +1 -0
- package/dist/api/node/encoder.d.ts.map +1 -1
- package/dist/api/node/encoder.js +1 -18
- package/dist/api/node/encoder.js.map +1 -1
- package/dist/api/node/msgpack.d.ts.map +1 -1
- package/dist/api/node/msgpack.js +2 -1
- package/dist/api/node/msgpack.js.map +1 -1
- package/dist/api/node/node.d.ts +19 -6
- package/dist/api/node/node.d.ts.map +1 -1
- package/dist/api/node/node.generated.d.ts +11 -0
- package/dist/api/node/node.generated.d.ts.map +1 -1
- package/dist/api/node/node.generated.js +70 -49
- package/dist/api/node/node.generated.js.map +1 -1
- package/dist/api/node/node.infrastructure.d.ts +11 -0
- package/dist/api/node/node.infrastructure.d.ts.map +1 -1
- package/dist/api/node/node.infrastructure.js.map +1 -1
- package/dist/api/node/node.js +117 -20
- package/dist/api/node/node.js.map +1 -1
- package/dist/api/node/wtf8.d.ts +6 -0
- package/dist/api/node/wtf8.d.ts.map +1 -0
- package/dist/api/node/wtf8.js +61 -0
- package/dist/api/node/wtf8.js.map +1 -0
- package/dist/api/options.d.ts +8 -0
- package/dist/api/options.d.ts.map +1 -1
- package/dist/api/options.js.map +1 -1
- package/dist/api/proto.d.ts +111 -24
- package/dist/api/proto.d.ts.map +1 -1
- package/dist/api/proto.js +15 -0
- package/dist/api/proto.js.map +1 -1
- package/dist/api/sourceFileCache.d.ts +4 -4
- package/dist/api/sync/api.d.ts +405 -78
- package/dist/api/sync/api.d.ts.map +1 -1
- package/dist/api/sync/api.js +990 -167
- package/dist/api/sync/api.js.map +1 -1
- package/dist/api/sync/client.d.ts +17 -0
- package/dist/api/sync/client.d.ts.map +1 -1
- package/dist/api/sync/client.js +53 -1
- package/dist/api/sync/client.js.map +1 -1
- package/dist/api/sync/types.d.ts +148 -17
- package/dist/api/sync/types.d.ts.map +1 -1
- package/dist/api/syncChannel.d.ts +4 -1
- package/dist/api/syncChannel.d.ts.map +1 -1
- package/dist/api/syncChannel.js +21 -1
- package/dist/api/syncChannel.js.map +1 -1
- package/dist/api/timing.d.ts +175 -0
- package/dist/api/timing.d.ts.map +1 -0
- package/dist/api/timing.js +149 -0
- package/dist/api/timing.js.map +1 -0
- package/dist/ast/ast.d.ts +36 -2
- package/dist/ast/ast.d.ts.map +1 -1
- package/dist/ast/ast.generated.d.ts +3 -3
- package/dist/ast/ast.generated.d.ts.map +1 -1
- package/dist/ast/ast.js.map +1 -1
- package/dist/ast/factory.generated.d.ts +12 -4
- package/dist/ast/factory.generated.d.ts.map +1 -1
- package/dist/ast/factory.generated.js +36 -2
- package/dist/ast/factory.generated.js.map +1 -1
- package/dist/ast/index.d.ts +2 -0
- package/dist/ast/index.d.ts.map +1 -1
- package/dist/ast/index.js +2 -0
- package/dist/ast/index.js.map +1 -1
- package/dist/ast/is.d.ts +2 -1
- package/dist/ast/is.d.ts.map +1 -1
- package/dist/ast/is.generated.d.ts +2 -2
- package/dist/ast/is.generated.d.ts.map +1 -1
- package/dist/ast/is.generated.js +3 -4
- package/dist/ast/is.generated.js.map +1 -1
- package/dist/ast/is.js +8 -1
- package/dist/ast/is.js.map +1 -1
- package/dist/ast/jsdoc.d.ts +11 -0
- package/dist/ast/jsdoc.d.ts.map +1 -0
- package/dist/ast/jsdoc.js +202 -0
- package/dist/ast/jsdoc.js.map +1 -0
- package/dist/ast/utils.d.ts +12 -0
- package/dist/ast/utils.d.ts.map +1 -1
- package/dist/ast/utils.js +40 -0
- package/dist/ast/utils.js.map +1 -1
- package/dist/enums/characterCodes.enum.d.ts +1 -1
- package/dist/enums/characterCodes.enum.d.ts.map +1 -1
- package/dist/enums/characterCodes.enum.js.map +1 -1
- package/dist/enums/commentDirectiveType.enum.d.ts +1 -1
- package/dist/enums/commentDirectiveType.enum.d.ts.map +1 -1
- package/dist/enums/commentDirectiveType.enum.js.map +1 -1
- package/dist/enums/completionItemKind.d.ts +2 -0
- package/dist/enums/completionItemKind.d.ts.map +1 -0
- package/dist/enums/completionItemKind.enum.d.ts +28 -0
- package/dist/enums/completionItemKind.enum.d.ts.map +1 -0
- package/dist/enums/completionItemKind.enum.js +30 -0
- package/dist/enums/completionItemKind.enum.js.map +1 -0
- package/dist/enums/completionItemKind.js +30 -0
- package/dist/enums/completionItemKind.js.map +1 -0
- package/dist/enums/internalSymbolName.d.ts +2 -0
- package/dist/enums/internalSymbolName.d.ts.map +1 -0
- package/dist/enums/internalSymbolName.enum.d.ts +23 -0
- package/dist/enums/internalSymbolName.enum.d.ts.map +1 -0
- package/dist/enums/internalSymbolName.enum.js +25 -0
- package/dist/enums/internalSymbolName.enum.js.map +1 -0
- package/dist/enums/internalSymbolName.js +25 -0
- package/dist/enums/internalSymbolName.js.map +1 -0
- package/dist/enums/jsxEmit.d.ts +2 -0
- package/dist/enums/jsxEmit.d.ts.map +1 -0
- package/dist/enums/jsxEmit.enum.d.ts +9 -0
- package/dist/enums/jsxEmit.enum.d.ts.map +1 -0
- package/dist/enums/jsxEmit.enum.js +11 -0
- package/dist/enums/jsxEmit.enum.js.map +1 -0
- package/dist/enums/jsxEmit.js +11 -0
- package/dist/enums/jsxEmit.js.map +1 -0
- package/dist/enums/languageVariant.enum.d.ts +1 -1
- package/dist/enums/languageVariant.enum.d.ts.map +1 -1
- package/dist/enums/languageVariant.enum.js.map +1 -1
- package/dist/enums/moduleDetectionKind.d.ts +2 -0
- package/dist/enums/moduleDetectionKind.d.ts.map +1 -0
- package/dist/enums/moduleDetectionKind.enum.d.ts +7 -0
- package/dist/enums/moduleDetectionKind.enum.d.ts.map +1 -0
- package/dist/enums/moduleDetectionKind.enum.js +9 -0
- package/dist/enums/moduleDetectionKind.enum.js.map +1 -0
- package/dist/enums/moduleDetectionKind.js +9 -0
- package/dist/enums/moduleDetectionKind.js.map +1 -0
- package/dist/enums/moduleKind.d.ts +2 -0
- package/dist/enums/moduleKind.d.ts.map +1 -0
- package/dist/enums/moduleKind.enum.d.ts +17 -0
- package/dist/enums/moduleKind.enum.d.ts.map +1 -0
- package/dist/enums/moduleKind.enum.js +19 -0
- package/dist/enums/moduleKind.enum.js.map +1 -0
- package/dist/enums/moduleKind.js +19 -0
- package/dist/enums/moduleKind.js.map +1 -0
- package/dist/enums/moduleResolutionKind.d.ts +2 -0
- package/dist/enums/moduleResolutionKind.d.ts.map +1 -0
- package/dist/enums/moduleResolutionKind.enum.d.ts +9 -0
- package/dist/enums/moduleResolutionKind.enum.d.ts.map +1 -0
- package/dist/enums/moduleResolutionKind.enum.js +11 -0
- package/dist/enums/moduleResolutionKind.enum.js.map +1 -0
- package/dist/enums/moduleResolutionKind.js +11 -0
- package/dist/enums/moduleResolutionKind.js.map +1 -0
- package/dist/enums/newLineKind.d.ts +2 -0
- package/dist/enums/newLineKind.d.ts.map +1 -0
- package/dist/enums/newLineKind.enum.d.ts +6 -0
- package/dist/enums/newLineKind.enum.d.ts.map +1 -0
- package/dist/enums/newLineKind.enum.js +8 -0
- package/dist/enums/newLineKind.enum.js.map +1 -0
- package/dist/enums/newLineKind.js +8 -0
- package/dist/enums/newLineKind.js.map +1 -0
- package/dist/enums/nodeFlags.enum.d.ts +1 -0
- package/dist/enums/nodeFlags.enum.d.ts.map +1 -1
- package/dist/enums/nodeFlags.enum.js +1 -0
- package/dist/enums/nodeFlags.enum.js.map +1 -1
- package/dist/enums/nodeFlags.js +1 -0
- package/dist/enums/nodeFlags.js.map +1 -1
- package/dist/enums/outerExpressionKinds.enum.d.ts +5 -1
- package/dist/enums/outerExpressionKinds.enum.d.ts.map +1 -1
- package/dist/enums/outerExpressionKinds.enum.js +4 -0
- package/dist/enums/outerExpressionKinds.enum.js.map +1 -1
- package/dist/enums/outerExpressionKinds.js +4 -0
- package/dist/enums/outerExpressionKinds.js.map +1 -1
- package/dist/enums/regularExpressionFlags.enum.d.ts +1 -1
- package/dist/enums/regularExpressionFlags.enum.d.ts.map +1 -1
- package/dist/enums/regularExpressionFlags.enum.js.map +1 -1
- package/dist/enums/scriptKind.enum.d.ts +1 -1
- package/dist/enums/scriptKind.enum.d.ts.map +1 -1
- package/dist/enums/scriptKind.enum.js.map +1 -1
- package/dist/enums/scriptTarget.enum.d.ts +1 -1
- package/dist/enums/scriptTarget.enum.d.ts.map +1 -1
- package/dist/enums/scriptTarget.enum.js.map +1 -1
- package/dist/enums/tokenFlags.enum.d.ts +1 -1
- package/dist/enums/tokenFlags.enum.d.ts.map +1 -1
- package/dist/enums/tokenFlags.enum.js.map +1 -1
- package/dist/internal/utils.d.ts +23 -0
- package/dist/internal/utils.d.ts.map +1 -0
- package/dist/internal/utils.js +25 -0
- package/dist/internal/utils.js.map +1 -0
- package/lib/getExePath.js +17 -4
- package/{bin → lib}/tsgo.js +28 -28
- package/lib/version.cjs +3 -0
- package/lib/version.d.cts +2 -0
- package/package.json +20 -17
- package/vendor/vscode-jsonrpc/License.txt +11 -0
- package/vendor/vscode-jsonrpc/README.md +1 -16
- package/vendor/vscode-jsonrpc/lib/browser/ril.js +8 -1
- package/vendor/vscode-jsonrpc/lib/common/connection.js +0 -1
- package/vendor/vscode-jsonrpc/lib/common/events.js +0 -1
- package/vendor/vscode-jsonrpc/lib/node/main.js +1 -1
- package/vendor/vscode-jsonrpc/package.json +3 -3
package/dist/api/async/api.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
/// <reference path="../node/node.d.ts" preserve="true" />
|
|
2
|
+
import { CompletionItemKind } from "#enums/completionItemKind";
|
|
2
3
|
import { DiagnosticCategory } from "#enums/diagnosticCategory";
|
|
3
4
|
import { ElementFlags } from "#enums/elementFlags";
|
|
5
|
+
import { ModuleKind } from "#enums/moduleKind";
|
|
4
6
|
import { NodeBuilderFlags } from "#enums/nodeBuilderFlags";
|
|
5
7
|
import { ObjectFlags } from "#enums/objectFlags";
|
|
6
8
|
import { SignatureFlags } from "#enums/signatureFlags";
|
|
@@ -8,19 +10,16 @@ import { SignatureKind } from "#enums/signatureKind";
|
|
|
8
10
|
import { SymbolFlags } from "#enums/symbolFlags";
|
|
9
11
|
import { TypeFlags } from "#enums/typeFlags";
|
|
10
12
|
import { TypePredicateKind } from "#enums/typePredicateKind";
|
|
11
|
-
import { type Expression, type Identifier, ModifierFlags, type Node, type Path, type SourceFile, type SyntaxKind, type TypeNode } from "../../ast/index.ts";
|
|
12
|
-
import { ObjectRegistry } from "../objectRegistry.ts";
|
|
13
|
+
import { type __String, type Expression, type Identifier, ModifierFlags, type Node, type Path, type SourceFile, type SyntaxKind, type TypeNode } from "../../ast/index.ts";
|
|
13
14
|
import type { APIOptions, LSPConnectionOptions } from "../options.ts";
|
|
14
|
-
import type { ConfigResponse, DocumentIdentifier, DocumentPosition, LSPUpdateSnapshotParams, ProjectResponse, SignatureResponse, SymbolResponse, TypeResponse, UpdateSnapshotParams, UpdateSnapshotResponse } from "../proto.ts";
|
|
15
|
+
import type { CompilerOptions, ConfigResponse, DocumentIdentifier, DocumentPosition, LSPUpdateSnapshotParams, ProjectResponse, SignatureResponse, SourceFileMetadata, SymbolResponse, TypeResponse, UpdateSnapshotParams, UpdateSnapshotResponse } from "../proto.ts";
|
|
15
16
|
import { SourceFileCache } from "../sourceFileCache.ts";
|
|
17
|
+
import type { RequestTiming, TimingAccumulators, TimingInfo } from "../timing.ts";
|
|
16
18
|
import { Client, type ClientSocketOptions, type ClientSpawnOptions } from "./client.ts";
|
|
17
|
-
import type { AssertsIdentifierTypePredicate, AssertsThisTypePredicate, ConditionalType, Diagnostic, IdentifierTypePredicate, IndexedAccessType, IndexInfo, IndexType, InterfaceType, IntersectionType, LiteralType, ObjectType, StringMappingType, SubstitutionType, TemplateLiteralType, ThisTypePredicate, TupleType, Type, TypeParameter, TypePredicate, TypePredicateBase, TypeReference, UnionOrIntersectionType, UnionType } from "./types.ts";
|
|
18
|
-
export { DiagnosticCategory, ElementFlags, ModifierFlags, NodeBuilderFlags, ObjectFlags, SignatureFlags, SignatureKind, SymbolFlags, TypeFlags, TypePredicateKind };
|
|
19
|
-
export type { APIOptions, ClientSocketOptions, ClientSpawnOptions, DocumentIdentifier, DocumentPosition, LSPConnectionOptions };
|
|
20
|
-
export type { AssertsIdentifierTypePredicate, AssertsThisTypePredicate, ConditionalType, Diagnostic, IdentifierTypePredicate, IndexedAccessType, IndexInfo, IndexType, InterfaceType, IntersectionType, LiteralType, ObjectType, StringMappingType, SubstitutionType, TemplateLiteralType, ThisTypePredicate, TupleType, Type, TypeParameter, TypePredicate, TypePredicateBase, TypeReference, UnionOrIntersectionType, UnionType };
|
|
19
|
+
import type { AssertsIdentifierTypePredicate, AssertsThisTypePredicate, BigIntLiteralType, BooleanLiteralType, CompletionEntry, CompletionInfo, CompletionOptions, ConditionalType, Diagnostic, FreshableType, IdentifierTypePredicate, IndexedAccessType, IndexInfo, IndexType, InterfaceType, IntersectionType, IntrinsicType, JSDocTagInfo, LiteralType, NumberLiteralType, ObjectType, StringLiteralType, StringMappingType, SubstitutionType, TemplateLiteralType, ThisTypePredicate, TupleType, Type, TypeParameter, TypePredicate, TypePredicateBase, TypeReference, UnionOrIntersectionType, UnionType } from "./types.ts";
|
|
21
20
|
export { documentURIToFileName, fileNameToDocumentURI } from "../path.ts";
|
|
22
|
-
|
|
23
|
-
type
|
|
21
|
+
export { CompletionItemKind, DiagnosticCategory, ElementFlags, ModifierFlags, ModuleKind, NodeBuilderFlags, ObjectFlags, SignatureFlags, SignatureKind, SymbolFlags, TypeFlags, TypePredicateKind };
|
|
22
|
+
export type { APIOptions, AssertsIdentifierTypePredicate, AssertsThisTypePredicate, BigIntLiteralType, BooleanLiteralType, ClientSocketOptions, ClientSpawnOptions, CompilerOptions, CompletionEntry, CompletionInfo, CompletionOptions, ConditionalType, Diagnostic, DocumentIdentifier, DocumentPosition, FreshableType, IdentifierTypePredicate, IndexedAccessType, IndexInfo, IndexType, InterfaceType, IntersectionType, IntrinsicType, JSDocTagInfo, LiteralType, LSPConnectionOptions, NumberLiteralType, ObjectType, RequestTiming, SourceFileMetadata, StringLiteralType, StringMappingType, SubstitutionType, TemplateLiteralType, ThisTypePredicate, TimingAccumulators, TimingInfo, TupleType, Type, TypeParameter, TypePredicate, TypePredicateBase, TypeReference, UnionOrIntersectionType, UnionType };
|
|
24
23
|
export declare class API<FromLSP extends boolean = false> {
|
|
25
24
|
private client;
|
|
26
25
|
private sourceFileCache;
|
|
@@ -28,7 +27,8 @@ export declare class API<FromLSP extends boolean = false> {
|
|
|
28
27
|
private initialized;
|
|
29
28
|
private activeSnapshots;
|
|
30
29
|
private latestSnapshot;
|
|
31
|
-
|
|
30
|
+
readonly internal: InternalAPI;
|
|
31
|
+
constructor(options?: APIOptions | LSPConnectionOptions);
|
|
32
32
|
/**
|
|
33
33
|
* Create an API instance from an existing LSP connection's API session.
|
|
34
34
|
* Use this when connecting to an API pipe provided by an LSP server via custom/initializeAPISession.
|
|
@@ -39,15 +39,38 @@ export declare class API<FromLSP extends boolean = false> {
|
|
|
39
39
|
updateSnapshot(params?: FromLSP extends true ? LSPUpdateSnapshotParams : UpdateSnapshotParams): Promise<Snapshot>;
|
|
40
40
|
close(): Promise<void>;
|
|
41
41
|
clearSourceFileCache(): void;
|
|
42
|
+
/**
|
|
43
|
+
* Returns a snapshot of collected timing information for requests made
|
|
44
|
+
* through this API instance: client-measured round-trip latency and bytes
|
|
45
|
+
* transferred, folded together with the server's own per-request processing
|
|
46
|
+
* time and an estimated transport overhead (round-trip minus server time).
|
|
47
|
+
*
|
|
48
|
+
* Fetching the snapshot issues a lightweight request to the server to
|
|
49
|
+
* retrieve its timing collection. Collection must be enabled via the
|
|
50
|
+
* `collectTiming` option; when it is not, the returned snapshot has
|
|
51
|
+
* `enabled: false` and zeroed totals.
|
|
52
|
+
*/
|
|
53
|
+
getTimingInfo(): Promise<TimingInfo>;
|
|
54
|
+
/** Clears all accumulated timing totals and recent-request history, on both the client and the server. */
|
|
55
|
+
resetTimingInfo(): Promise<void>;
|
|
56
|
+
}
|
|
57
|
+
export declare class InternalAPI {
|
|
58
|
+
private client;
|
|
59
|
+
private ensureInitialized;
|
|
60
|
+
/** @internal */
|
|
61
|
+
constructor(client: Client, ensureInitialized: () => Promise<void>);
|
|
62
|
+
startCPUProfile(dir: string): Promise<void>;
|
|
63
|
+
stopCPUProfile(): Promise<string>;
|
|
64
|
+
saveHeapProfile(dir: string): Promise<string>;
|
|
42
65
|
}
|
|
43
66
|
export declare class Snapshot {
|
|
44
|
-
readonly id:
|
|
67
|
+
readonly id: number;
|
|
45
68
|
private projectMap;
|
|
46
69
|
private toPath;
|
|
47
70
|
private client;
|
|
48
|
-
private objectRegistry;
|
|
49
71
|
private disposed;
|
|
50
72
|
private onDispose;
|
|
73
|
+
private snapshotRegistry;
|
|
51
74
|
constructor(data: UpdateSnapshotResponse, client: Client, sourceFileCache: SourceFileCache, toPath: (fileName: string) => Path, onDispose: () => void);
|
|
52
75
|
getProjects(): readonly Project[];
|
|
53
76
|
getProject(configFileName: string): Project | undefined;
|
|
@@ -57,31 +80,102 @@ export declare class Snapshot {
|
|
|
57
80
|
isDisposed(): boolean;
|
|
58
81
|
private ensureNotDisposed;
|
|
59
82
|
}
|
|
83
|
+
declare class SnapshotObjectRegistry {
|
|
84
|
+
private readonly symbols;
|
|
85
|
+
private readonly client;
|
|
86
|
+
private readonly snapshotId;
|
|
87
|
+
private readonly resolveProject;
|
|
88
|
+
constructor(client: Client, snapshotId: number, resolveProject: (projectId: Path) => Project | undefined);
|
|
89
|
+
/** Resolve a project id (a config file path) to its Project within this snapshot. */
|
|
90
|
+
getProject(projectId: Path): Project | undefined;
|
|
91
|
+
getOrCreateSymbol(data: SymbolResponse): Symbol;
|
|
92
|
+
getSymbol(id: number): Symbol | undefined;
|
|
93
|
+
clear(): void;
|
|
94
|
+
fetchSymbol(source: Symbol | Signature | Type, method: string, handle: number | undefined, projectId?: Path): Promise<Symbol>;
|
|
95
|
+
fetchSymbols(source: Symbol | Signature | Type, method: string, handles?: readonly number[], projectId?: Path): Promise<readonly Symbol[]>;
|
|
96
|
+
}
|
|
97
|
+
declare class ProjectObjectRegistry {
|
|
98
|
+
private client;
|
|
99
|
+
private snapshotId;
|
|
100
|
+
private project;
|
|
101
|
+
private snapshotRegistry;
|
|
102
|
+
private types;
|
|
103
|
+
private signatures;
|
|
104
|
+
constructor(client: Client, snapshotId: number, project: Project, snapshotRegistry: SnapshotObjectRegistry);
|
|
105
|
+
getOrCreateSymbol(data: SymbolResponse): Symbol;
|
|
106
|
+
getSymbol(id: number): Symbol | undefined;
|
|
107
|
+
getOrCreateType(data: TypeResponse): TypeObject;
|
|
108
|
+
getType(id: number): TypeObject | undefined;
|
|
109
|
+
getOrCreateSignature(data: SignatureResponse): Signature;
|
|
110
|
+
getSignature(id: number): Signature | undefined;
|
|
111
|
+
clear(): void;
|
|
112
|
+
fetchType<T extends Type>(source: Symbol | Signature | Type, method: string, handle: number | false | undefined): Promise<T>;
|
|
113
|
+
fetchSymbol(source: Symbol | Signature | Type, method: string, handle: number | undefined): Promise<Symbol>;
|
|
114
|
+
fetchSignature(source: Symbol | Signature | Type, method: string, handle: number | undefined): Promise<Signature>;
|
|
115
|
+
fetchTypes(source: Symbol | Signature | Type, method: string, handles?: readonly number[]): Promise<readonly Type[]>;
|
|
116
|
+
fetchSymbols(source: Symbol | Signature | Type, method: string, handles?: readonly number[]): Promise<readonly Symbol[]>;
|
|
117
|
+
fetchBaseTypes(source: Type): Promise<readonly Type[]>;
|
|
118
|
+
}
|
|
60
119
|
export declare class Project {
|
|
61
|
-
readonly id:
|
|
120
|
+
readonly id: Path;
|
|
62
121
|
readonly configFileName: string;
|
|
63
|
-
readonly compilerOptions:
|
|
122
|
+
readonly compilerOptions: CompilerOptions;
|
|
64
123
|
readonly rootFiles: readonly string[];
|
|
65
124
|
readonly program: Program;
|
|
66
125
|
readonly checker: Checker;
|
|
67
126
|
readonly emitter: Emitter;
|
|
68
127
|
private client;
|
|
69
|
-
constructor(data: ProjectResponse, snapshotId:
|
|
128
|
+
constructor(data: ProjectResponse, snapshotId: number, client: Client, sourceFileCache: SourceFileCache, toPath: (fileName: string) => Path, snapshotRegistry: SnapshotObjectRegistry);
|
|
129
|
+
dispose(): void;
|
|
70
130
|
}
|
|
71
131
|
export declare class Program {
|
|
72
132
|
private snapshotId;
|
|
73
|
-
private
|
|
133
|
+
private project;
|
|
74
134
|
private client;
|
|
75
135
|
private sourceFileCache;
|
|
76
136
|
private toPath;
|
|
77
137
|
private decoder;
|
|
78
|
-
|
|
138
|
+
private sourceFileMetadataCache;
|
|
139
|
+
constructor(snapshotId: number, project: Project, client: Client, sourceFileCache: SourceFileCache, toPath: (fileName: string) => Path);
|
|
140
|
+
getCompilerOptions(): CompilerOptions;
|
|
79
141
|
getSourceFile(file: DocumentIdentifier): Promise<SourceFile | undefined>;
|
|
142
|
+
getSourceFileNames(): Promise<readonly string[]>;
|
|
143
|
+
/**
|
|
144
|
+
* Returns program-stored metadata for the given source file, or `undefined` if the file
|
|
145
|
+
* is not part of the program. Metadata is fetched lazily per file and cached on this
|
|
146
|
+
* `Program` instance.
|
|
147
|
+
*/
|
|
148
|
+
getSourceFileMetadata(fileName: string): Promise<SourceFileMetadata | undefined>;
|
|
149
|
+
/**
|
|
150
|
+
* Returns program-stored metadata for the source file at the given path, or `undefined`
|
|
151
|
+
* if the file is not part of the program. Like {@link getSourceFileMetadata}, but skips
|
|
152
|
+
* the file name to path conversion. Metadata is fetched lazily per file and cached on
|
|
153
|
+
* this `Program` instance.
|
|
154
|
+
*/
|
|
155
|
+
getSourceFileMetadataByPath(path: Path): Promise<SourceFileMetadata | undefined>;
|
|
156
|
+
private fetchSourceFileMetadata;
|
|
157
|
+
/**
|
|
158
|
+
* Returns whether the given source file was loaded as part of an external library
|
|
159
|
+
* (e.g. a dependency resolved from `node_modules`). The underlying program metadata is
|
|
160
|
+
* fetched lazily per file and cached on this `Program` instance.
|
|
161
|
+
*/
|
|
162
|
+
isSourceFileFromExternalLibrary(file: SourceFile): Promise<boolean>;
|
|
163
|
+
/**
|
|
164
|
+
* Returns whether the given source file is a default library file (e.g. `lib.d.ts`).
|
|
165
|
+
* The underlying program metadata is fetched lazily per file and cached on this
|
|
166
|
+
* `Program` instance.
|
|
167
|
+
*/
|
|
168
|
+
isSourceFileDefaultLibrary(file: SourceFile): Promise<boolean>;
|
|
80
169
|
/**
|
|
81
170
|
* Get syntactic (parse) diagnostics for a specific file or all files.
|
|
82
171
|
* @param file - Optional file to get diagnostics for. If omitted, returns diagnostics for all files.
|
|
83
172
|
*/
|
|
84
173
|
getSyntacticDiagnostics(file?: DocumentIdentifier): Promise<readonly Diagnostic[]>;
|
|
174
|
+
/**
|
|
175
|
+
* Get binder diagnostics for a specific file or all files.
|
|
176
|
+
* @param file - Optional file to get diagnostics for. If omitted, returns diagnostics for all files.
|
|
177
|
+
*/
|
|
178
|
+
getBindDiagnostics(file?: DocumentIdentifier): Promise<readonly Diagnostic[]>;
|
|
85
179
|
/**
|
|
86
180
|
* Get semantic (type-check) diagnostics for a specific file or all files.
|
|
87
181
|
* @param file - Optional file to get diagnostics for. If omitted, returns diagnostics for all files.
|
|
@@ -97,6 +191,14 @@ export declare class Program {
|
|
|
97
191
|
* @param file - Optional file to get diagnostics for. If omitted, returns diagnostics for all files.
|
|
98
192
|
*/
|
|
99
193
|
getDeclarationDiagnostics(file?: DocumentIdentifier): Promise<readonly Diagnostic[]>;
|
|
194
|
+
/**
|
|
195
|
+
* Get program-wide diagnostics for the project, including compiler options diagnostics.
|
|
196
|
+
*/
|
|
197
|
+
getProgramDiagnostics(): Promise<readonly Diagnostic[]>;
|
|
198
|
+
/**
|
|
199
|
+
* Get global (non-file-specific) semantic diagnostics for the project.
|
|
200
|
+
*/
|
|
201
|
+
getGlobalDiagnostics(): Promise<readonly Diagnostic[]>;
|
|
100
202
|
/**
|
|
101
203
|
* Get config file parsing diagnostics for the project.
|
|
102
204
|
*/
|
|
@@ -104,34 +206,79 @@ export declare class Program {
|
|
|
104
206
|
}
|
|
105
207
|
export declare class Checker {
|
|
106
208
|
private snapshotId;
|
|
107
|
-
private
|
|
209
|
+
private project;
|
|
108
210
|
private client;
|
|
109
211
|
private objectRegistry;
|
|
110
|
-
|
|
212
|
+
private wellKnownSymbols;
|
|
213
|
+
private wellKnownSignatures;
|
|
214
|
+
constructor(snapshotId: number, project: Project, client: Client, objectRegistry: ProjectObjectRegistry);
|
|
215
|
+
dispose(): void;
|
|
111
216
|
getSymbolAtLocation(node: Node): Promise<Symbol | undefined>;
|
|
112
217
|
getSymbolAtLocation(nodes: readonly Node[]): Promise<(Symbol | undefined)[]>;
|
|
113
218
|
getSymbolAtPosition(file: DocumentIdentifier, position: number): Promise<Symbol | undefined>;
|
|
114
219
|
getSymbolAtPosition(file: DocumentIdentifier, positions: readonly number[]): Promise<(Symbol | undefined)[]>;
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
220
|
+
/**
|
|
221
|
+
* Get the type of a symbol. Always returns a type; for symbols whose type
|
|
222
|
+
* cannot be determined the checker yields the error type (use
|
|
223
|
+
* {@link Type.isErrorType} to detect it).
|
|
224
|
+
*/
|
|
225
|
+
getTypeOfSymbol(symbol: Symbol): Promise<Type>;
|
|
226
|
+
getTypeOfSymbol(symbols: readonly Symbol[]): Promise<Type[]>;
|
|
227
|
+
/**
|
|
228
|
+
* Get the declared type of a symbol. Always returns a type; for symbols whose
|
|
229
|
+
* declared type cannot be determined the checker yields the error type (use
|
|
230
|
+
* {@link Type.isErrorType} to detect it).
|
|
231
|
+
*/
|
|
232
|
+
getDeclaredTypeOfSymbol(symbol: Symbol): Promise<Type>;
|
|
233
|
+
getReferencesToSymbolInFile(file: DocumentIdentifier, symbol: Symbol): Promise<NodeHandle[]>;
|
|
234
|
+
getReferencedSymbolsForNode(node: Node, position: number): Promise<ReferencedSymbolEntry[]>;
|
|
235
|
+
getSignatureUsage(signatureDecl: Node): Promise<SignatureUsage[]>;
|
|
236
|
+
getCompletionsAtPosition(document: string, position: number, options?: CompletionOptions): Promise<CompletionInfo | undefined>;
|
|
237
|
+
/**
|
|
238
|
+
* Get the type at a node location. Always returns a type; for nodes whose
|
|
239
|
+
* type cannot be determined the checker yields the error type (use
|
|
240
|
+
* {@link Type.isErrorType} to detect it).
|
|
241
|
+
*/
|
|
242
|
+
getTypeAtLocation(node: Node): Promise<Type>;
|
|
243
|
+
getTypeAtLocation(nodes: readonly Node[]): Promise<Type[]>;
|
|
120
244
|
getSignaturesOfType(type: Type, kind: SignatureKind): Promise<readonly Signature[]>;
|
|
121
|
-
|
|
245
|
+
/**
|
|
246
|
+
* Get the resolved signature of a call-like expression. Always returns a
|
|
247
|
+
* signature; when a call cannot be resolved the checker yields the unknown
|
|
248
|
+
* signature (use {@link Checker.isUnknownSignature} to detect it).
|
|
249
|
+
*/
|
|
250
|
+
getResolvedSignature(node: Node): Promise<Signature>;
|
|
122
251
|
getTypeAtPosition(file: DocumentIdentifier, position: number): Promise<Type | undefined>;
|
|
123
252
|
getTypeAtPosition(file: DocumentIdentifier, positions: readonly number[]): Promise<(Type | undefined)[]>;
|
|
124
253
|
resolveName(name: string, meaning: SymbolFlags, location?: Node | DocumentPosition, excludeGlobals?: boolean): Promise<Symbol | undefined>;
|
|
125
254
|
getResolvedSymbol(node: Identifier): Promise<Symbol | undefined>;
|
|
126
255
|
getContextualType(node: Expression): Promise<Type | undefined>;
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
256
|
+
/** Get the base type of a literal type (e.g. `number` for `42`). Always returns a type. */
|
|
257
|
+
getBaseTypeOfLiteralType(type: Type): Promise<Type>;
|
|
258
|
+
/** Get the type with `null` and `undefined` removed. Always returns a type. */
|
|
259
|
+
getNonNullableType(type: Type): Promise<Type>;
|
|
260
|
+
/**
|
|
261
|
+
* Get the type for a type node. Always returns a type; for type nodes whose
|
|
262
|
+
* type cannot be determined the checker yields the error type (use
|
|
263
|
+
* {@link Type.isErrorType} to detect it).
|
|
264
|
+
*/
|
|
265
|
+
getTypeFromTypeNode(node: TypeNode): Promise<Type>;
|
|
266
|
+
/** Get the widened type. Always returns a type. */
|
|
267
|
+
getWidenedType(type: Type): Promise<Type>;
|
|
268
|
+
/**
|
|
269
|
+
* Get the type of the parameter at the given index in a signature. Always
|
|
270
|
+
* returns a type; an out-of-range index yields the `any` type.
|
|
271
|
+
*/
|
|
272
|
+
getParameterType(signature: Signature, index: number): Promise<Type>;
|
|
132
273
|
isArrayLikeType(type: Type): Promise<boolean>;
|
|
274
|
+
isTypeAssignableTo(source: Type, target: Type): Promise<boolean>;
|
|
133
275
|
getShorthandAssignmentValueSymbol(node: Node): Promise<Symbol | undefined>;
|
|
134
|
-
|
|
276
|
+
/**
|
|
277
|
+
* Get the type of a symbol as narrowed at a specific location. Always returns
|
|
278
|
+
* a type; for symbols whose type cannot be determined the checker yields the
|
|
279
|
+
* error type (use {@link Type.isErrorType} to detect it).
|
|
280
|
+
*/
|
|
281
|
+
getTypeOfSymbolAtLocation(symbol: Symbol, location: Node): Promise<Type>;
|
|
135
282
|
private getIntrinsicType;
|
|
136
283
|
getAnyType(): Promise<Type>;
|
|
137
284
|
getStringType(): Promise<Type>;
|
|
@@ -148,19 +295,88 @@ export declare class Checker {
|
|
|
148
295
|
signatureToSignatureDeclaration(signature: Signature, kind: SyntaxKind, enclosingDeclaration?: Node, flags?: NodeBuilderFlags): Promise<Node | undefined>;
|
|
149
296
|
typeToString(type: Type, enclosingDeclaration?: Node, flags?: number): Promise<string>;
|
|
150
297
|
isContextSensitive(node: Node): Promise<boolean>;
|
|
151
|
-
|
|
152
|
-
|
|
298
|
+
isArrayType(type: Type): Promise<boolean>;
|
|
299
|
+
isTupleType(type: Type): Promise<boolean>;
|
|
300
|
+
/** Get the return type of a signature. Always returns a type. */
|
|
301
|
+
getReturnTypeOfSignature(signature: Signature): Promise<Type>;
|
|
302
|
+
/**
|
|
303
|
+
* Get the rest type of a signature. Always returns a type; a signature with
|
|
304
|
+
* no rest parameter yields the `any` type.
|
|
305
|
+
*/
|
|
306
|
+
getRestTypeOfSignature(signature: Signature): Promise<Type>;
|
|
153
307
|
getTypePredicateOfSignature(signature: Signature): Promise<TypePredicate | undefined>;
|
|
154
|
-
|
|
308
|
+
/**
|
|
309
|
+
* Get the base types of a class or interface type. A type with no base types
|
|
310
|
+
* yields an empty array.
|
|
311
|
+
*/
|
|
312
|
+
getBaseTypes(type: InterfaceType): Promise<readonly Type[]>;
|
|
313
|
+
/** Get the apparent type of a type. Always returns a type. */
|
|
314
|
+
getApparentType(type: Type): Promise<Type>;
|
|
155
315
|
getPropertiesOfType(type: Type): Promise<readonly Symbol[]>;
|
|
156
316
|
getIndexInfosOfType(type: Type): Promise<readonly IndexInfo[]>;
|
|
157
|
-
|
|
158
|
-
|
|
317
|
+
/**
|
|
318
|
+
* Get the constraint of a type parameter (the `T` in `<U extends T>`), or
|
|
319
|
+
* undefined if it has none.
|
|
320
|
+
*/
|
|
321
|
+
getConstraintOfTypeParameter(type: TypeParameter): Promise<Type | undefined>;
|
|
322
|
+
getBaseConstraintOfType(type: Type): Promise<Type | undefined>;
|
|
323
|
+
getPropertyOfType(type: Type, name: string): Promise<Symbol | undefined>;
|
|
324
|
+
getConstantValue(node: Node): Promise<string | number | undefined>;
|
|
325
|
+
/** Get the signature of a function-like declaration. Always returns a signature. */
|
|
326
|
+
getSignatureFromDeclaration(node: Node): Promise<Signature>;
|
|
327
|
+
getExportSpecifierLocalTargetSymbol(node: Node): Promise<Symbol | undefined>;
|
|
328
|
+
/**
|
|
329
|
+
* Follow all aliases to get the original symbol. Always returns a symbol; for
|
|
330
|
+
* an unresolved alias the checker yields the unknown symbol (use
|
|
331
|
+
* {@link Checker.isUnknownSymbol} to detect it).
|
|
332
|
+
*/
|
|
333
|
+
getAliasedSymbol(symbol: Symbol): Promise<Symbol>;
|
|
334
|
+
getImmediateAliasedSymbol(symbol: Symbol): Promise<Symbol | undefined>;
|
|
335
|
+
/**
|
|
336
|
+
* Fetch (once, then cache) the handle ids of the per-checker singleton
|
|
337
|
+
* symbols (unknown, undefined, arguments). These ids are stable for the life
|
|
338
|
+
* of the project's checker, so identity checks against them are local after
|
|
339
|
+
* the first call.
|
|
340
|
+
*/
|
|
341
|
+
private getWellKnownSymbols;
|
|
342
|
+
/**
|
|
343
|
+
* Returns `true` if the symbol is the checker's "unknown" symbol (e.g. the
|
|
344
|
+
* result of {@link Checker.getAliasedSymbol} on an unresolved alias).
|
|
345
|
+
*/
|
|
346
|
+
isUnknownSymbol(symbol: Symbol): Promise<boolean>;
|
|
347
|
+
/**
|
|
348
|
+
* Returns `true` if the symbol is the checker's "undefined" symbol.
|
|
349
|
+
*/
|
|
350
|
+
isUndefinedSymbol(symbol: Symbol): Promise<boolean>;
|
|
351
|
+
/**
|
|
352
|
+
* Returns `true` if the symbol is the checker's "arguments" symbol.
|
|
353
|
+
*/
|
|
354
|
+
isArgumentsSymbol(symbol: Symbol): Promise<boolean>;
|
|
355
|
+
/**
|
|
356
|
+
* Fetch (once, then cache) the handle id of the per-checker unknown
|
|
357
|
+
* signature. This id is stable for the life of the project's checker, so
|
|
358
|
+
* identity checks against it are local after the first call.
|
|
359
|
+
*/
|
|
360
|
+
private getWellKnownSignatures;
|
|
361
|
+
/**
|
|
362
|
+
* Returns `true` if the signature is the checker's "unknown" signature (e.g.
|
|
363
|
+
* the result of {@link Checker.getResolvedSignature} on a call that cannot be
|
|
364
|
+
* resolved).
|
|
365
|
+
*/
|
|
366
|
+
isUnknownSignature(signature: Signature): Promise<boolean>;
|
|
367
|
+
getExportsOfModule(symbol: Symbol): Promise<readonly Symbol[]>;
|
|
368
|
+
getMemberInModuleExports(symbol: Symbol, name: string): Promise<Symbol | undefined>;
|
|
369
|
+
getJsDocTagsOfSymbol(symbol: Symbol): Promise<readonly JSDocTagInfo[]>;
|
|
370
|
+
getDocumentationCommentOfSymbol(symbol: Symbol): Promise<string>;
|
|
371
|
+
/**
|
|
372
|
+
* Get the type arguments of a type reference (e.g. the `string` in `Array<string>`).
|
|
373
|
+
*/
|
|
374
|
+
getTypeArguments(type: TypeReference): Promise<readonly Type[]>;
|
|
159
375
|
}
|
|
160
376
|
export interface PrintNodeOptions {
|
|
161
|
-
preserveSourceNewlines?: boolean;
|
|
162
|
-
neverAsciiEscape?: boolean;
|
|
163
|
-
terminateUnterminatedLiterals?: boolean;
|
|
377
|
+
preserveSourceNewlines?: boolean | undefined;
|
|
378
|
+
neverAsciiEscape?: boolean | undefined;
|
|
379
|
+
terminateUnterminatedLiterals?: boolean | undefined;
|
|
164
380
|
}
|
|
165
381
|
export declare class Emitter {
|
|
166
382
|
private client;
|
|
@@ -168,80 +384,191 @@ export declare class Emitter {
|
|
|
168
384
|
printNode(node: Node, options?: PrintNodeOptions): Promise<string>;
|
|
169
385
|
}
|
|
170
386
|
export declare class NodeHandle {
|
|
387
|
+
/**
|
|
388
|
+
* The project this handle was produced in, used as the default for {@link resolve}.
|
|
389
|
+
* Node handles are only meaningful within a project's program, so the producing project
|
|
390
|
+
* is remembered so callers don't have to pass it explicitly.
|
|
391
|
+
*/
|
|
392
|
+
private readonly canonicalProject;
|
|
393
|
+
readonly index: number;
|
|
171
394
|
readonly kind: SyntaxKind;
|
|
172
|
-
readonly pos: number;
|
|
173
|
-
readonly end: number;
|
|
174
395
|
readonly path: Path;
|
|
175
|
-
constructor(handle: string);
|
|
396
|
+
constructor(handle: string, canonicalProject: Project);
|
|
176
397
|
/**
|
|
177
|
-
* Resolve this handle to the actual AST node by fetching the source file
|
|
178
|
-
*
|
|
398
|
+
* Resolve this handle to the actual AST node by fetching the source file from a project
|
|
399
|
+
* and looking up the node by index. If no project is passed, the project that produced
|
|
400
|
+
* the handle is used.
|
|
179
401
|
*/
|
|
180
|
-
resolve(project
|
|
402
|
+
resolve(project?: Project): Promise<Node | undefined>;
|
|
403
|
+
}
|
|
404
|
+
/** A symbol definition paired with all of its reference nodes. */
|
|
405
|
+
export interface ReferencedSymbolEntry {
|
|
406
|
+
/** The node handle for the symbol's definition. */
|
|
407
|
+
definition: NodeHandle;
|
|
408
|
+
/** The resolved symbol for the definition, if available. */
|
|
409
|
+
symbol?: Symbol | undefined;
|
|
410
|
+
/** The node handles for each reference to the symbol. */
|
|
411
|
+
references: NodeHandle[];
|
|
412
|
+
}
|
|
413
|
+
/** A single usage of a signature, pairing the reference name with its call expression (if any). */
|
|
414
|
+
export interface SignatureUsage {
|
|
415
|
+
/** The node handle for the name reference. */
|
|
416
|
+
name: NodeHandle;
|
|
417
|
+
/** The node handle for the call expression, if the reference is invoked. */
|
|
418
|
+
call?: NodeHandle | undefined;
|
|
181
419
|
}
|
|
182
420
|
export declare class Symbol {
|
|
183
|
-
private client;
|
|
184
|
-
private snapshotId;
|
|
185
421
|
private objectRegistry;
|
|
186
|
-
|
|
422
|
+
/**
|
|
423
|
+
* The project this symbol was first observed in, used as the default project for
|
|
424
|
+
* lookups that need a project context (members/exports/parent). Symbols are shared
|
|
425
|
+
* snapshot-wide, so these lookups can otherwise be ambiguous about which project to use.
|
|
426
|
+
*/
|
|
427
|
+
private readonly canonicalProject;
|
|
428
|
+
readonly id: number;
|
|
429
|
+
/** The escaped (`__String`) name, used as the key in member/export tables. */
|
|
430
|
+
readonly escapedName: __String;
|
|
431
|
+
/** The display name (escaped underscores removed). */
|
|
187
432
|
readonly name: string;
|
|
188
433
|
readonly flags: SymbolFlags;
|
|
189
434
|
readonly checkFlags: number;
|
|
190
435
|
readonly declarations: readonly NodeHandle[];
|
|
191
436
|
readonly valueDeclaration: NodeHandle | undefined;
|
|
192
|
-
|
|
437
|
+
private readonly parent;
|
|
438
|
+
private readonly exportSymbol;
|
|
439
|
+
private membersCache;
|
|
440
|
+
private exportsCache;
|
|
441
|
+
constructor(data: SymbolResponse, objectRegistry: SnapshotObjectRegistry);
|
|
193
442
|
getParent(): Promise<Symbol | undefined>;
|
|
194
|
-
|
|
195
|
-
|
|
443
|
+
/**
|
|
444
|
+
* Get this symbol's members keyed by escaped name. The result is cached on
|
|
445
|
+
* the symbol, so repeated calls do not round-trip to the server.
|
|
446
|
+
*/
|
|
447
|
+
getMembers(): Promise<ReadonlyMap<__String, Symbol>>;
|
|
448
|
+
/**
|
|
449
|
+
* Get this symbol's exports keyed by escaped name. The result is cached on
|
|
450
|
+
* the symbol, so repeated calls do not round-trip to the server.
|
|
451
|
+
*/
|
|
452
|
+
getExports(): Promise<ReadonlyMap<__String, Symbol>>;
|
|
453
|
+
private fetchSymbolTable;
|
|
196
454
|
getExportSymbol(): Promise<Symbol>;
|
|
455
|
+
getJsDocTags(checker: Checker): Promise<readonly JSDocTagInfo[]>;
|
|
456
|
+
getDocumentationComment(checker: Checker): Promise<string>;
|
|
197
457
|
}
|
|
198
458
|
declare class TypeObject implements Type {
|
|
199
|
-
private client;
|
|
200
|
-
private snapshotId;
|
|
201
459
|
private objectRegistry;
|
|
202
|
-
readonly id:
|
|
460
|
+
readonly id: number;
|
|
203
461
|
readonly flags: TypeFlags;
|
|
204
462
|
readonly objectFlags: ObjectFlags;
|
|
205
|
-
readonly
|
|
206
|
-
readonly
|
|
207
|
-
readonly
|
|
208
|
-
readonly
|
|
209
|
-
readonly
|
|
463
|
+
readonly symbol: number;
|
|
464
|
+
readonly value: string | number | boolean | bigint;
|
|
465
|
+
readonly intrinsicName: string;
|
|
466
|
+
readonly isThisType: boolean;
|
|
467
|
+
readonly freshType: number;
|
|
468
|
+
readonly regularType: number;
|
|
469
|
+
readonly target: number;
|
|
470
|
+
readonly typeParameters: readonly number[];
|
|
471
|
+
readonly outerTypeParameters: readonly number[];
|
|
472
|
+
readonly localTypeParameters: readonly number[];
|
|
473
|
+
readonly aliasTypeArguments: readonly number[];
|
|
474
|
+
readonly aliasSymbol: number;
|
|
210
475
|
readonly elementFlags: readonly ElementFlags[];
|
|
211
476
|
readonly fixedLength: number;
|
|
212
477
|
readonly readonly: boolean;
|
|
213
478
|
readonly texts: readonly string[];
|
|
214
|
-
readonly objectType:
|
|
215
|
-
readonly indexType:
|
|
216
|
-
readonly checkType:
|
|
217
|
-
readonly extendsType:
|
|
218
|
-
readonly baseType:
|
|
219
|
-
readonly substConstraint:
|
|
220
|
-
|
|
479
|
+
readonly objectType: number;
|
|
480
|
+
readonly indexType: number;
|
|
481
|
+
readonly checkType: number;
|
|
482
|
+
readonly extendsType: number;
|
|
483
|
+
readonly baseType: number;
|
|
484
|
+
readonly substConstraint: number;
|
|
485
|
+
private trueType;
|
|
486
|
+
private falseType;
|
|
487
|
+
constructor(data: TypeResponse, objectRegistry: ProjectObjectRegistry);
|
|
221
488
|
getSymbol(): Promise<Symbol | undefined>;
|
|
222
|
-
|
|
223
|
-
private fetchTypes;
|
|
489
|
+
getAliasSymbol(): Promise<Symbol | undefined>;
|
|
224
490
|
getTarget(): Promise<Type>;
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
491
|
+
getFreshType(): Promise<FreshableType | undefined>;
|
|
492
|
+
getRegularType(): Promise<FreshableType | undefined>;
|
|
493
|
+
getTypes(): Promise<readonly Type[] | undefined>;
|
|
494
|
+
getTypeParameters(): Promise<readonly TypeParameter[]>;
|
|
495
|
+
getOuterTypeParameters(): Promise<readonly TypeParameter[]>;
|
|
496
|
+
getLocalTypeParameters(): Promise<readonly TypeParameter[]>;
|
|
497
|
+
getAliasTypeArguments(): Promise<readonly Type[]>;
|
|
229
498
|
getObjectType(): Promise<Type>;
|
|
230
499
|
getIndexType(): Promise<Type>;
|
|
231
500
|
getCheckType(): Promise<Type>;
|
|
232
501
|
getExtendsType(): Promise<Type>;
|
|
233
502
|
getBaseType(): Promise<Type>;
|
|
234
503
|
getConstraint(): Promise<Type>;
|
|
504
|
+
getTrueType(): Promise<Type>;
|
|
505
|
+
getFalseType(): Promise<Type>;
|
|
506
|
+
/**
|
|
507
|
+
* Get the base types of this type. Returns `undefined` for any type that is
|
|
508
|
+
* not a class or interface.
|
|
509
|
+
*/
|
|
510
|
+
getBaseTypes(): Promise<readonly Type[] | undefined>;
|
|
511
|
+
isClassOrInterface(): this is InterfaceType;
|
|
512
|
+
isUnionType(): this is UnionType;
|
|
513
|
+
isIntersectionType(): this is IntersectionType;
|
|
514
|
+
isObjectType(): this is ObjectType;
|
|
515
|
+
isIntrinsicType(): this is IntrinsicType;
|
|
516
|
+
isErrorType(): boolean;
|
|
517
|
+
isLiteralType(): this is LiteralType;
|
|
518
|
+
isStringLiteralType(): this is StringLiteralType;
|
|
519
|
+
isNumberLiteralType(): this is NumberLiteralType;
|
|
520
|
+
isBigIntLiteralType(): this is BigIntLiteralType;
|
|
521
|
+
isBooleanLiteralType(): this is BooleanLiteralType;
|
|
522
|
+
isTypeReference(): this is TypeReference;
|
|
523
|
+
isTupleType(): this is TupleType;
|
|
524
|
+
isIndexType(): this is IndexType;
|
|
525
|
+
isIndexedAccessType(): this is IndexedAccessType;
|
|
526
|
+
isConditionalType(): this is ConditionalType;
|
|
527
|
+
isSubstitutionType(): this is SubstitutionType;
|
|
528
|
+
isTemplateLiteralType(): this is TemplateLiteralType;
|
|
529
|
+
isStringMappingType(): this is StringMappingType;
|
|
530
|
+
isTypeParameter(): this is TypeParameter;
|
|
235
531
|
}
|
|
532
|
+
export declare function isUnionType(type: Type): type is UnionType;
|
|
533
|
+
export declare function isIntersectionType(type: Type): type is IntersectionType;
|
|
534
|
+
export declare function isObjectType(type: Type): type is ObjectType;
|
|
535
|
+
export declare function isClassOrInterfaceType(type: Type): type is InterfaceType;
|
|
536
|
+
export declare function isIntrinsicType(type: Type): type is IntrinsicType;
|
|
537
|
+
/**
|
|
538
|
+
* Whether this is the error type — the placeholder the checker produces when a
|
|
539
|
+
* type cannot be determined (e.g. an unresolved reference). It is an intrinsic
|
|
540
|
+
* type named `"error"` (this covers both the singleton error type and the
|
|
541
|
+
* per-alias error types manufactured for unresolved type alias references).
|
|
542
|
+
*/
|
|
543
|
+
export declare function isErrorType(type: Type): boolean;
|
|
544
|
+
export declare function isLiteralType(type: Type): type is LiteralType;
|
|
545
|
+
export declare function isStringLiteralType(type: Type): type is StringLiteralType;
|
|
546
|
+
export declare function isNumberLiteralType(type: Type): type is NumberLiteralType;
|
|
547
|
+
export declare function isBigIntLiteralType(type: Type): type is BigIntLiteralType;
|
|
548
|
+
export declare function isBooleanLiteralType(type: Type): type is BooleanLiteralType;
|
|
549
|
+
export declare function isTypeReference(type: Type): type is TypeReference;
|
|
550
|
+
export declare function isTupleType(type: Type): type is TupleType;
|
|
551
|
+
export declare function isIndexType(type: Type): type is IndexType;
|
|
552
|
+
export declare function isIndexedAccessType(type: Type): type is IndexedAccessType;
|
|
553
|
+
export declare function isConditionalType(type: Type): type is ConditionalType;
|
|
554
|
+
export declare function isSubstitutionType(type: Type): type is SubstitutionType;
|
|
555
|
+
export declare function isTemplateLiteralType(type: Type): type is TemplateLiteralType;
|
|
556
|
+
export declare function isStringMappingType(type: Type): type is StringMappingType;
|
|
557
|
+
export declare function isTypeParameter(type: Type): type is TypeParameter;
|
|
236
558
|
export declare class Signature {
|
|
237
559
|
private flags;
|
|
238
|
-
|
|
560
|
+
private objectRegistry;
|
|
561
|
+
readonly id: number;
|
|
239
562
|
readonly declaration?: NodeHandle | undefined;
|
|
240
|
-
readonly typeParameters?: readonly
|
|
241
|
-
readonly parameters: readonly
|
|
242
|
-
readonly thisParameter?:
|
|
243
|
-
readonly target?:
|
|
244
|
-
constructor(data: SignatureResponse, objectRegistry:
|
|
563
|
+
readonly typeParameters?: readonly number[] | undefined;
|
|
564
|
+
readonly parameters: readonly number[];
|
|
565
|
+
readonly thisParameter?: number | undefined;
|
|
566
|
+
readonly target?: number | undefined;
|
|
567
|
+
constructor(data: SignatureResponse, project: Project, objectRegistry: ProjectObjectRegistry);
|
|
568
|
+
getTypeParameters(): Promise<readonly TypeParameter[]>;
|
|
569
|
+
getParameters(): Promise<readonly Symbol[]>;
|
|
570
|
+
getThisParameter(): Promise<Symbol | undefined>;
|
|
571
|
+
getTarget(): Promise<Signature | undefined>;
|
|
245
572
|
get hasRestParameter(): boolean;
|
|
246
573
|
get isConstruct(): boolean;
|
|
247
574
|
get isAbstract(): boolean;
|