typescript 7.1.0-dev.20260827.1 → 7.1.0-dev.20260829.1

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.
Files changed (37) hide show
  1. package/dist/api/async/api.d.ts +54 -21
  2. package/dist/api/async/api.d.ts.map +1 -1
  3. package/dist/api/async/api.js +124 -21
  4. package/dist/api/async/api.js.map +1 -1
  5. package/dist/api/async/types.d.ts +12 -3
  6. package/dist/api/async/types.d.ts.map +1 -1
  7. package/dist/api/node/node.generated.d.ts.map +1 -1
  8. package/dist/api/node/node.generated.js +2 -0
  9. package/dist/api/node/node.generated.js.map +1 -1
  10. package/dist/api/proto.d.ts.map +1 -1
  11. package/dist/api/proto.generated.d.ts +37 -9
  12. package/dist/api/proto.generated.d.ts.map +1 -1
  13. package/dist/api/proto.generated.js +12 -1
  14. package/dist/api/proto.generated.js.map +1 -1
  15. package/dist/api/proto.js +6 -0
  16. package/dist/api/proto.js.map +1 -1
  17. package/dist/api/sync/api.d.ts +819 -216
  18. package/dist/api/sync/api.d.ts.map +1 -1
  19. package/dist/api/sync/api.js +3069 -1149
  20. package/dist/api/sync/api.js.map +1 -1
  21. package/dist/api/sync/client.d.ts +2 -1
  22. package/dist/api/sync/client.d.ts.map +1 -1
  23. package/dist/api/sync/client.js +3 -0
  24. package/dist/api/sync/client.js.map +1 -1
  25. package/dist/api/sync/generatorSupport.d.ts +17 -0
  26. package/dist/api/sync/generatorSupport.d.ts.map +1 -0
  27. package/dist/api/sync/generatorSupport.js +82 -0
  28. package/dist/api/sync/generatorSupport.js.map +1 -0
  29. package/dist/api/sync/types.d.ts +159 -38
  30. package/dist/api/sync/types.d.ts.map +1 -1
  31. package/dist/enums/symbolFlags.enum.d.ts +1 -1
  32. package/dist/enums/symbolFlags.enum.d.ts.map +1 -1
  33. package/dist/enums/symbolFlags.enum.js +1 -1
  34. package/dist/enums/symbolFlags.enum.js.map +1 -1
  35. package/dist/enums/symbolFlags.js +1 -1
  36. package/dist/enums/symbolFlags.js.map +1 -1
  37. package/package.json +9 -9
@@ -1,9 +1,12 @@
1
+ import type { APIRequest as ProtocolRequest, APIResponse as ProtocolResponse } from "../proto.ts";
1
2
  import { CheckFlags } from "#enums/checkFlags";
2
3
  import { CompletionItemKind } from "#enums/completionItemKind";
3
4
  import { DiagnosticCategory } from "#enums/diagnosticCategory";
4
5
  import { ElementFlags } from "#enums/elementFlags";
5
6
  import { EmitOnly } from "#enums/emitOnly";
7
+ import { JsxEmit } from "#enums/jsxEmit";
6
8
  import { ModuleKind } from "#enums/moduleKind";
9
+ import { ModuleResolutionKind } from "#enums/moduleResolutionKind";
7
10
  import { NodeBuilderFlags } from "#enums/nodeBuilderFlags";
8
11
  import { ObjectFlags } from "#enums/objectFlags";
9
12
  import { SignatureFlags } from "#enums/signatureFlags";
@@ -14,15 +17,15 @@ import { TypeFormatFlags } from "#enums/typeFormatFlags";
14
17
  import { TypePredicateKind } from "#enums/typePredicateKind";
15
18
  import { type __String, type Declaration, type Expression, type Identifier, ModifierFlags, type Node, type Path, type SourceFile, type SyntaxKind, type TypeNode } from "../../ast/index.ts";
16
19
  import type { APIOptions, LSPConnectionOptions } from "../options.ts";
17
- import type { APIRequest, APIResponseTuple, CompilerOptions, Diagnostic, DocumentIdentifier, DocumentPosition, LSPUpdateSnapshotParams, ParsedCommandLine, ProjectReference, ProjectResponse, ReadConfigFileResponse, SignaturePropertyMethod, SignatureResponse, SourceFileMetadata, SymbolPropertyMethod, SymbolResponse, SymbolsPropertyMethod, TextEdit, TypeAcquisition, TypePropertyMethod, TypeResponse, TypesPropertyMethod, UpdateSnapshotParams, UpdateSnapshotResponse } from "../proto.ts";
20
+ import type { APIFileChanges, CompilerOptions, CreateProgramOptions, Diagnostic, DocumentIdentifier, DocumentPosition, LSPUpdateSnapshotParams, ParsedCommandLine, ProjectReference, ProjectResponse, ReadConfigFileResponse, SignaturePropertyMethod, SignatureResponse, SourceFileMetadata, SymbolPropertyMethod, SymbolResponse, SymbolsPropertyMethod, TextEdit, TypeAcquisition, TypePropertyMethod, TypeResponse, TypesPropertyMethod, UpdateSnapshotParams, UpdateSnapshotResponse } from "../proto.ts";
18
21
  import { SourceFileCache } from "../sourceFileCache.ts";
19
22
  import type { RequestTiming, TimingAccumulators, TimingInfo } from "../timing.ts";
20
23
  import { Client, type ClientSocketOptions, type ClientSpawnOptions } from "./client.ts";
21
- import type { AssertsIdentifierTypePredicate, AssertsThisTypePredicate, BigIntLiteralType, BooleanLiteralType, CompletionEntry, CompletionInfo, CompletionOptions, ConditionalType, EmitOutput, EmitOutputFile, EmitResult, FormatDiagnosticsHost, FreshableType, GetImportEditsForSymbolsOptions, IdentifierTypePredicate, ImportAdderAction as APIImportAdderAction, IndexedAccessType, IndexInfo, IndexType, InterfaceType, IntersectionType, IntrinsicType, JSDocTagInfo, LiteralType, NumberLiteralType, ObjectType, StringLiteralType, StringMappingType, StructuredType, SubstitutionType, TemplateLiteralType, ThisTypePredicate, TupleType, Type, TypeParameter, TypePredicate, TypePredicateBase, TypeReference, UnionOrIntersectionType, UnionType } from "./types.ts";
24
+ import type { AssertsIdentifierTypePredicate, AssertsThisTypePredicate, BigIntLiteralType, BooleanLiteralType, CompletionEntry, CompletionInfo, CompletionOptions, ConditionalType, EmitOutput, EmitOutputFile, EmitResult, FormatDiagnosticsHost, FreshableType, GetImportEditsForSymbolsOptions, IdentifierTypePredicate, ImportAdderAction as APIImportAdderAction, IndexedAccessType, IndexInfo, IndexType, InterfaceType, IntersectionType, IntrinsicType, JSDocTagInfo, LiteralType, NumberLiteralType, ObjectType, StringLiteralType, StringMappingType, StructuredType, SubstitutionType, TemplateLiteralType, ThisTypePredicate, TupleType, TupleTypeReference, Type, TypeParameter, TypePredicate, TypePredicateBase, TypeReference, UnionOrIntersectionType, UnionType } from "./types.ts";
22
25
  export { formatDiagnostics, formatDiagnosticsWithColorAndContext } from "../diagnosticFormatter.ts";
23
26
  export { documentURIToFileName, fileNameToDocumentURI } from "../path.ts";
24
- export { CheckFlags, CompletionItemKind, DiagnosticCategory, ElementFlags, EmitOnly, ModifierFlags, ModuleKind, NodeBuilderFlags, ObjectFlags, SignatureFlags, SignatureKind, SymbolFlags, TypeFlags, TypeFormatFlags, TypePredicateKind };
25
- export type { APIImportAdderAction as ImportAdderAction, APIOptions, AssertsIdentifierTypePredicate, AssertsThisTypePredicate, BigIntLiteralType, BooleanLiteralType, ClientSocketOptions, ClientSpawnOptions, CompilerOptions, CompletionEntry, CompletionInfo, CompletionOptions, ConditionalType, Diagnostic, DocumentIdentifier, DocumentPosition, EmitOutput, EmitOutputFile, EmitResult, FormatDiagnosticsHost, FreshableType, GetImportEditsForSymbolsOptions, IdentifierTypePredicate, IndexedAccessType, IndexInfo, IndexType, InterfaceType, IntersectionType, IntrinsicType, JSDocTagInfo, LiteralType, LSPConnectionOptions, NumberLiteralType, ObjectType, ParsedCommandLine, ProjectReference, ReadConfigFileResponse, RequestTiming, SourceFileMetadata, StringLiteralType, StringMappingType, StructuredType, SubstitutionType, TemplateLiteralType, TextEdit, ThisTypePredicate, TimingAccumulators, TimingInfo, TupleType, Type, TypeAcquisition, TypeParameter, TypePredicate, TypePredicateBase, TypeReference, UnionOrIntersectionType, UnionType, };
27
+ export { CheckFlags, CompletionItemKind, DiagnosticCategory, ElementFlags, EmitOnly, JsxEmit, ModifierFlags, ModuleKind, ModuleResolutionKind, NodeBuilderFlags, ObjectFlags, SignatureFlags, SignatureKind, SymbolFlags, TypeFlags, TypeFormatFlags, TypePredicateKind };
28
+ export type { APIFileChanges, APIImportAdderAction as ImportAdderAction, APIOptions, AssertsIdentifierTypePredicate, AssertsThisTypePredicate, BigIntLiteralType, BooleanLiteralType, ClientSocketOptions, ClientSpawnOptions, CompilerOptions, CompletionEntry, CompletionInfo, CompletionOptions, ConditionalType, CreateProgramOptions, Diagnostic, DocumentIdentifier, DocumentPosition, EmitOutput, EmitOutputFile, EmitResult, FormatDiagnosticsHost, FreshableType, GetImportEditsForSymbolsOptions, IdentifierTypePredicate, IndexedAccessType, IndexInfo, IndexType, InterfaceType, IntersectionType, IntrinsicType, JSDocTagInfo, LiteralType, LSPConnectionOptions, NumberLiteralType, ObjectType, ParsedCommandLine, ProjectReference, ReadConfigFileResponse, RequestTiming, SourceFileMetadata, StringLiteralType, StringMappingType, StructuredType, SubstitutionType, TemplateLiteralType, TextEdit, ThisTypePredicate, TimingAccumulators, TimingInfo, TupleType, TupleTypeReference, Type, TypeAcquisition, TypeParameter, TypePredicate, TypePredicateBase, TypeReference, UnionOrIntersectionType, UnionType, };
26
29
  export interface TranspileOptions {
27
30
  compilerOptions?: CompilerOptions;
28
31
  fileName?: string;
@@ -33,6 +36,8 @@ export interface TranspileOutput {
33
36
  diagnostics?: readonly Diagnostic[];
34
37
  sourceMapText?: string;
35
38
  }
39
+ export { all } from "./generatorSupport.ts";
40
+ import { type APIRequestGenerator, type ExecutedGeneratorsResults } from "./generatorSupport.ts";
36
41
  export declare class API<FromLSP extends boolean = false> implements FormatDiagnosticsHost {
37
42
  private client;
38
43
  private sourceFileCache;
@@ -48,32 +53,72 @@ export declare class API<FromLSP extends boolean = false> implements FormatDiagn
48
53
  * Create an API instance from an existing LSP connection's API session.
49
54
  * Use this when connecting to an API pipe provided by an LSP server via custom/initializeAPISession.
50
55
  */
51
- static fromLSPConnection(options: LSPConnectionOptions): API<true>;
52
- batchRequests<const Requests extends readonly APIRequest[]>(requests: Requests): {
53
- responses: APIResponseTuple<Requests>;
56
+ static get fromLSPConnection(): {
57
+ (options: LSPConnectionOptions): API<true>;
58
+ gen(options: LSPConnectionOptions): Generator<ProtocolRequest, API<true>, ProtocolResponse["result"]>;
54
59
  };
55
- private ensureInitialized;
60
+ batch<T extends readonly APIRequestGenerator[]>(...requestGenerators: T): ExecutedGeneratorsResults<T>;
61
+ private get ensureInitialized();
56
62
  getCurrentDirectory(): string;
57
63
  getCanonicalFileName(fileName: string): string;
58
64
  getNewLine(): string;
59
- parseConfigFile(file: DocumentIdentifier): ParsedCommandLine;
60
- parseCommandLine(commandLine: readonly string[]): ParsedCommandLine;
61
- readConfigFile(file: DocumentIdentifier): ReadConfigFileResponse;
62
- parseJsonConfigFileContent(json: any, options: {
63
- configDirectory: string;
64
- configFileName?: never;
65
- } | {
66
- configFileName: DocumentIdentifier;
67
- configDirectory?: never;
68
- }): ParsedCommandLine;
69
- transpileModule(input: string, options?: TranspileOptions): TranspileOutput;
70
- transpileModuleFromFile(fileName: string, options?: TranspileOptions): TranspileOutput;
71
- transpileDeclaration(input: string, options?: TranspileOptions): TranspileOutput;
72
- transpileDeclarationFromFile(fileName: string, options?: TranspileOptions): TranspileOutput;
73
- updateSnapshot(params?: FromLSP extends true ? LSPUpdateSnapshotParams : UpdateSnapshotParams): Snapshot;
74
- close(): void;
65
+ get parseConfigFile(): {
66
+ (file: DocumentIdentifier): ParsedCommandLine;
67
+ gen(file: DocumentIdentifier): Generator<ProtocolRequest, ParsedCommandLine, ProtocolResponse["result"]>;
68
+ };
69
+ get parseCommandLine(): {
70
+ (commandLine: readonly string[]): ParsedCommandLine;
71
+ gen(commandLine: readonly string[]): Generator<ProtocolRequest, ParsedCommandLine, ProtocolResponse["result"]>;
72
+ };
73
+ get readConfigFile(): {
74
+ (file: DocumentIdentifier): ReadConfigFileResponse;
75
+ gen(file: DocumentIdentifier): Generator<ProtocolRequest, ReadConfigFileResponse, ProtocolResponse["result"]>;
76
+ };
77
+ get parseJsonConfigFileContent(): {
78
+ (json: any, options: {
79
+ configDirectory: string;
80
+ configFileName?: never;
81
+ } | {
82
+ configFileName: DocumentIdentifier;
83
+ configDirectory?: never;
84
+ }): ParsedCommandLine;
85
+ gen(json: any, options: {
86
+ configDirectory: string;
87
+ configFileName?: never;
88
+ } | {
89
+ configFileName: DocumentIdentifier;
90
+ configDirectory?: never;
91
+ }): Generator<ProtocolRequest, ParsedCommandLine, ProtocolResponse["result"]>;
92
+ };
93
+ get transpileModule(): {
94
+ (input: string, options?: TranspileOptions): TranspileOutput;
95
+ gen(input: string, options?: TranspileOptions): Generator<ProtocolRequest, TranspileOutput, ProtocolResponse["result"]>;
96
+ };
97
+ get transpileModuleFromFile(): {
98
+ (file: DocumentIdentifier, options?: TranspileOptions): TranspileOutput;
99
+ gen(file: DocumentIdentifier, options?: TranspileOptions): Generator<ProtocolRequest, TranspileOutput, ProtocolResponse["result"]>;
100
+ };
101
+ get transpileDeclaration(): {
102
+ (input: string, options?: TranspileOptions): TranspileOutput;
103
+ gen(input: string, options?: TranspileOptions): Generator<ProtocolRequest, TranspileOutput, ProtocolResponse["result"]>;
104
+ };
105
+ get transpileDeclarationFromFile(): {
106
+ (file: DocumentIdentifier, options?: TranspileOptions): TranspileOutput;
107
+ gen(file: DocumentIdentifier, options?: TranspileOptions): Generator<ProtocolRequest, TranspileOutput, ProtocolResponse["result"]>;
108
+ };
109
+ get updateSnapshot(): {
110
+ (params?: FromLSP extends true ? LSPUpdateSnapshotParams : UpdateSnapshotParams): Snapshot;
111
+ gen(params?: FromLSP extends true ? LSPUpdateSnapshotParams : UpdateSnapshotParams): Generator<ProtocolRequest, Snapshot, ProtocolResponse["result"]>;
112
+ };
113
+ get close(): {
114
+ (): void;
115
+ gen(): Generator<ProtocolRequest, void, ProtocolResponse["result"]>;
116
+ };
75
117
  clearSourceFileCache(): void;
76
- runWithTemporaryFileUpdate(baseSnapshot: Snapshot, file: DocumentIdentifier, newText: string, cb: (newSnapshot: Snapshot) => void): void;
118
+ get runWithTemporaryFileUpdate(): {
119
+ (baseSnapshot: Snapshot, file: DocumentIdentifier, newText: string, cb: (newSnapshot: Snapshot) => void): void;
120
+ gen(baseSnapshot: Snapshot, file: DocumentIdentifier, newText: string, cb: (newSnapshot: Snapshot) => void | Generator<ProtocolRequest, void, ProtocolResponse["result"]>): Generator<ProtocolRequest, void, ProtocolResponse["result"]>;
121
+ };
77
122
  /**
78
123
  * Returns a snapshot of collected timing information for requests made
79
124
  * through this API instance: client-measured round-trip latency and bytes
@@ -85,18 +130,44 @@ export declare class API<FromLSP extends boolean = false> implements FormatDiagn
85
130
  * `collectTiming` option; when it is not, the returned snapshot has
86
131
  * `enabled: false` and zeroed totals.
87
132
  */
88
- getTimingInfo(): TimingInfo;
133
+ get getTimingInfo(): {
134
+ (): TimingInfo;
135
+ gen(): Generator<ProtocolRequest, TimingInfo, ProtocolResponse["result"]>;
136
+ };
89
137
  /** Clears all accumulated timing totals and recent-request history, on both the client and the server. */
90
- resetTimingInfo(): void;
138
+ get resetTimingInfo(): {
139
+ (): void;
140
+ gen(): Generator<ProtocolRequest, void, ProtocolResponse["result"]>;
141
+ };
142
+ private isProgramActive;
143
+ /**
144
+ * Creates a program from current filesystem state, or derives one from oldProgram after applying fileChanges.
145
+ */
146
+ get createProgram(): {
147
+ (rootFiles: readonly DocumentIdentifier[], createProgramOptions: CreateProgramOptions, oldProgram?: Program, fileChanges?: APIFileChanges): Program;
148
+ gen(rootFiles: readonly DocumentIdentifier[], createProgramOptions: CreateProgramOptions, oldProgram?: Program, fileChanges?: APIFileChanges): Generator<ProtocolRequest, Program, ProtocolResponse["result"]>;
149
+ };
91
150
  }
151
+ type EnsureInitialized = (() => void) & {
152
+ gen(): Generator<ProtocolRequest, void, ProtocolResponse["result"]>;
153
+ };
92
154
  export declare class InternalAPI {
93
155
  private client;
94
156
  private ensureInitialized;
95
157
  /** @internal */
96
- constructor(client: Client, ensureInitialized: () => void);
97
- startCPUProfile(dir: string): void;
98
- stopCPUProfile(): string;
99
- saveHeapProfile(dir: string): string;
158
+ constructor(client: Client, ensureInitialized: EnsureInitialized);
159
+ get startCPUProfile(): {
160
+ (dir: string): void;
161
+ gen(dir: string): Generator<ProtocolRequest, void, ProtocolResponse["result"]>;
162
+ };
163
+ get stopCPUProfile(): {
164
+ (): string;
165
+ gen(): Generator<ProtocolRequest, string, ProtocolResponse["result"]>;
166
+ };
167
+ get saveHeapProfile(): {
168
+ (dir: string): string;
169
+ gen(dir: string): Generator<ProtocolRequest, string, ProtocolResponse["result"]>;
170
+ };
100
171
  }
101
172
  export declare class Snapshot {
102
173
  readonly id: number;
@@ -110,9 +181,15 @@ export declare class Snapshot {
110
181
  constructor(data: UpdateSnapshotResponse, client: Client, sourceFileCache: SourceFileCache, toPath: (fileName: string) => Path, formatDiagnosticsHost: FormatDiagnosticsHost, onDispose: () => void);
111
182
  getProjects(): readonly Project[];
112
183
  getProject(configFileName: string): Project | undefined;
113
- getDefaultProjectForFile(file: DocumentIdentifier): Project | undefined;
184
+ get getDefaultProjectForFile(): {
185
+ (file: DocumentIdentifier): Project | undefined;
186
+ gen(file: DocumentIdentifier): Generator<ProtocolRequest, Project | undefined, ProtocolResponse["result"]>;
187
+ };
114
188
  [globalThis.Symbol.dispose](): void;
115
- dispose(): void;
189
+ get dispose(): {
190
+ (): void;
191
+ gen(): Generator<ProtocolRequest, void, ProtocolResponse["result"]>;
192
+ };
116
193
  isDisposed(): boolean;
117
194
  private ensureNotDisposed;
118
195
  }
@@ -127,8 +204,14 @@ declare class SnapshotObjectRegistry {
127
204
  getOrCreateSymbol(data: SymbolResponse): Symbol;
128
205
  getSymbol(id: number): Symbol | undefined;
129
206
  clear(): void;
130
- fetchSymbol(source: Symbol | Signature | Type, method: SymbolPropertyMethod, handle: number | undefined, projectId: Path): Symbol;
131
- fetchSymbols(source: Symbol | Signature | Type, method: SymbolsPropertyMethod, handles: readonly number[] | undefined, projectId: Path): readonly Symbol[];
207
+ get fetchSymbol(): {
208
+ (source: Symbol | Signature | Type, method: SymbolPropertyMethod, handle: number | undefined, projectId: Path): Symbol;
209
+ gen(source: Symbol | Signature | Type, method: SymbolPropertyMethod, handle: number | undefined, projectId: Path): Generator<ProtocolRequest, Symbol, ProtocolResponse["result"]>;
210
+ };
211
+ get fetchSymbols(): {
212
+ (source: Symbol | Signature | Type, method: SymbolsPropertyMethod, handles: readonly number[] | undefined, projectId: Path): readonly Symbol[];
213
+ gen(source: Symbol | Signature | Type, method: SymbolsPropertyMethod, handles: readonly number[] | undefined, projectId: Path): Generator<ProtocolRequest, readonly Symbol[], ProtocolResponse["result"]>;
214
+ };
132
215
  }
133
216
  declare class ProjectObjectRegistry {
134
217
  private client;
@@ -145,19 +228,58 @@ declare class ProjectObjectRegistry {
145
228
  getOrCreateSignature(data: SignatureResponse): Signature;
146
229
  getSignature(id: number): Signature | undefined;
147
230
  clear(): void;
148
- fetchOptionalType<T extends Type>(source: Symbol | Signature | Type, method: TypePropertyMethod, handle: number | false | undefined): T | undefined;
149
- fetchType<T extends Type>(source: Symbol | Signature | Type, method: TypePropertyMethod, handle: number | false | undefined): T;
150
- fetchSymbol(source: Symbol | Signature | Type, method: SymbolPropertyMethod, handle: number | undefined): Symbol;
151
- fetchSignature(source: Symbol | Signature | Type, method: SignaturePropertyMethod, handle: number | undefined): Signature;
152
- fetchTypes(source: Symbol | Signature | Type, method: TypesPropertyMethod, handles?: readonly number[]): readonly Type[];
153
- fetchSymbols(source: Symbol | Signature | Type, method: SymbolsPropertyMethod, handles?: readonly number[]): readonly Symbol[];
154
- fetchBaseTypes(source: Type): readonly Type[];
155
- fetchPropertiesOfType(source: Type): readonly Symbol[];
156
- fetchApparentPropertiesOfType(source: Type): readonly Symbol[];
157
- fetchPropertyOfType(source: Type, name: string): Symbol | undefined;
158
- fetchSignaturesOfType(source: Type, kind: SignatureKind): readonly Signature[];
159
- fetchIndexInfosOfType(source: Type): readonly IndexInfo[];
160
- fetchTypeParameterAtPosition(source: Signature, pos: number): Type;
231
+ get fetchOptionalType(): {
232
+ <T extends Type>(source: Symbol | Signature | Type, method: TypePropertyMethod, handle: number | false | undefined): T | undefined;
233
+ gen<T extends Type>(source: Symbol | Signature | Type, method: TypePropertyMethod, handle: number | false | undefined): Generator<ProtocolRequest, T | undefined, ProtocolResponse["result"]>;
234
+ };
235
+ get fetchType(): {
236
+ <T extends Type>(source: Symbol | Signature | Type, method: TypePropertyMethod, handle: number | false | undefined): T;
237
+ gen<T extends Type>(source: Symbol | Signature | Type, method: TypePropertyMethod, handle: number | false | undefined): Generator<ProtocolRequest, T, ProtocolResponse["result"]>;
238
+ };
239
+ get fetchSymbol(): {
240
+ (source: Symbol | Signature | Type, method: SymbolPropertyMethod, handle: number | undefined): Symbol;
241
+ gen(source: Symbol | Signature | Type, method: SymbolPropertyMethod, handle: number | undefined): Generator<ProtocolRequest, Symbol, ProtocolResponse["result"]>;
242
+ };
243
+ get fetchSignature(): {
244
+ (source: Symbol | Signature | Type, method: SignaturePropertyMethod, handle: number | undefined): Signature;
245
+ gen(source: Symbol | Signature | Type, method: SignaturePropertyMethod, handle: number | undefined): Generator<ProtocolRequest, Signature, ProtocolResponse["result"]>;
246
+ };
247
+ get fetchTypes(): {
248
+ (source: Symbol | Signature | Type, method: TypesPropertyMethod, handles?: readonly number[]): readonly Type[];
249
+ gen(source: Symbol | Signature | Type, method: TypesPropertyMethod, handles?: readonly number[]): Generator<ProtocolRequest, readonly Type[], ProtocolResponse["result"]>;
250
+ };
251
+ get fetchSymbols(): {
252
+ (source: Symbol | Signature | Type, method: SymbolsPropertyMethod, handles?: readonly number[]): readonly Symbol[];
253
+ gen(source: Symbol | Signature | Type, method: SymbolsPropertyMethod, handles?: readonly number[]): Generator<ProtocolRequest, readonly Symbol[], ProtocolResponse["result"]>;
254
+ };
255
+ get fetchBaseTypes(): {
256
+ (source: Type): readonly Type[];
257
+ gen(source: Type): Generator<ProtocolRequest, readonly Type[], ProtocolResponse["result"]>;
258
+ };
259
+ get fetchPropertiesOfType(): {
260
+ (source: Type): readonly Symbol[];
261
+ gen(source: Type): Generator<ProtocolRequest, readonly Symbol[], ProtocolResponse["result"]>;
262
+ };
263
+ get fetchApparentPropertiesOfType(): {
264
+ (source: Type): readonly Symbol[];
265
+ gen(source: Type): Generator<ProtocolRequest, readonly Symbol[], ProtocolResponse["result"]>;
266
+ };
267
+ get fetchPropertyOfType(): {
268
+ (source: Type, name: string): Symbol | undefined;
269
+ gen(source: Type, name: string): Generator<ProtocolRequest, Symbol | undefined, ProtocolResponse["result"]>;
270
+ };
271
+ get fetchSignaturesOfType(): {
272
+ (source: Type, kind: SignatureKind): readonly Signature[];
273
+ gen(source: Type, kind: SignatureKind): Generator<ProtocolRequest, readonly Signature[], ProtocolResponse["result"]>;
274
+ };
275
+ get fetchIndexInfosOfType(): {
276
+ (source: Type): readonly IndexInfo[];
277
+ gen(source: Type): Generator<ProtocolRequest, readonly IndexInfo[], ProtocolResponse["result"]>;
278
+ };
279
+ get fetchTypeParameterAtPosition(): {
280
+ (source: Signature, pos: number): Type;
281
+ gen(source: Signature, pos: number): Generator<ProtocolRequest, Type, ProtocolResponse["result"]>;
282
+ };
161
283
  }
162
284
  export declare class Project {
163
285
  readonly id: Path;
@@ -176,9 +298,15 @@ export declare class Project {
176
298
  private snapshotId;
177
299
  constructor(data: ProjectResponse, snapshotId: number, client: Client, sourceFileCache: SourceFileCache, toPath: (fileName: string) => Path, formatDiagnosticsHost: FormatDiagnosticsHost, snapshotRegistry: SnapshotObjectRegistry);
178
300
  /** @deprecated Use `languageService.getImportAdderEdits`. */
179
- getImportAdderEdits(file: DocumentIdentifier, actions: readonly APIImportAdderAction[]): readonly TextEdit[];
301
+ get getImportAdderEdits(): {
302
+ (file: DocumentIdentifier, actions: readonly APIImportAdderAction[]): readonly TextEdit[];
303
+ gen(file: DocumentIdentifier, actions: readonly APIImportAdderAction[]): Generator<ProtocolRequest, readonly TextEdit[], ProtocolResponse["result"]>;
304
+ };
180
305
  /** @deprecated Use `languageService.getImportEditsForSymbols`. */
181
- getImportEditsForSymbols(file: DocumentIdentifier, symbols: readonly Symbol[], options?: GetImportEditsForSymbolsOptions): readonly TextEdit[];
306
+ get getImportEditsForSymbols(): {
307
+ (file: DocumentIdentifier, symbols: readonly Symbol[], options?: GetImportEditsForSymbolsOptions): readonly TextEdit[];
308
+ gen(file: DocumentIdentifier, symbols: readonly Symbol[], options?: GetImportEditsForSymbolsOptions): Generator<ProtocolRequest, readonly TextEdit[], ProtocolResponse["result"]>;
309
+ };
182
310
  dispose(): void;
183
311
  }
184
312
  export declare class LanguageService {
@@ -187,120 +315,205 @@ export declare class LanguageService {
187
315
  private client;
188
316
  private objectRegistry;
189
317
  constructor(snapshotId: number, project: Project, client: Client, objectRegistry: ProjectObjectRegistry);
190
- getImportAdderEdits(file: DocumentIdentifier, actions: readonly APIImportAdderAction[]): readonly TextEdit[];
191
- getImportEditsForSymbols(file: DocumentIdentifier, symbols: readonly Symbol[], options?: GetImportEditsForSymbolsOptions): readonly TextEdit[];
192
- getReferencedSymbolsForNode(node: Node, position: number): ReferencedSymbolEntry[];
193
- getSignatureUsage(signatureDecl: Node): SignatureUsage[];
194
- getCompletionsAtPosition(document: string, position: number, options?: CompletionOptions): CompletionInfo | undefined;
318
+ get getImportAdderEdits(): {
319
+ (file: DocumentIdentifier, actions: readonly APIImportAdderAction[]): readonly TextEdit[];
320
+ gen(file: DocumentIdentifier, actions: readonly APIImportAdderAction[]): Generator<ProtocolRequest, readonly TextEdit[], ProtocolResponse["result"]>;
321
+ };
322
+ get getImportEditsForSymbols(): {
323
+ (file: DocumentIdentifier, symbols: readonly Symbol[], options?: GetImportEditsForSymbolsOptions): readonly TextEdit[];
324
+ gen(file: DocumentIdentifier, symbols: readonly Symbol[], options?: GetImportEditsForSymbolsOptions): Generator<ProtocolRequest, readonly TextEdit[], ProtocolResponse["result"]>;
325
+ };
326
+ get getReferencedSymbolsForNode(): {
327
+ (node: Node, position: number): ReferencedSymbolEntry[];
328
+ gen(node: Node, position: number): Generator<ProtocolRequest, ReferencedSymbolEntry[], ProtocolResponse["result"]>;
329
+ };
330
+ get getSignatureUsage(): {
331
+ (signatureDecl: Node): SignatureUsage[];
332
+ gen(signatureDecl: Node): Generator<ProtocolRequest, SignatureUsage[], ProtocolResponse["result"]>;
333
+ };
334
+ get getCompletionsAtPosition(): {
335
+ (document: string, position: number, options?: CompletionOptions): CompletionInfo | undefined;
336
+ gen(document: string, position: number, options?: CompletionOptions): Generator<ProtocolRequest, CompletionInfo | undefined, ProtocolResponse["result"]>;
337
+ };
195
338
  }
196
339
  export declare class Program implements FormatDiagnosticsHost {
197
- private snapshotId;
198
- private project;
199
- private client;
200
- private sourceFileCache;
201
- private toPath;
202
- private formatDiagnosticsHost;
203
- private decoder;
204
- private sourceFileMetadataCache;
340
+ /** @internal */
341
+ readonly snapshotId: number;
342
+ private readonly project;
343
+ private readonly client;
344
+ private readonly sourceFileCache;
345
+ private readonly toPath;
346
+ private readonly formatDiagnosticsHost;
347
+ private readonly decoder;
348
+ private readonly sourceFileMetadataCache;
349
+ private ownedSnapshot;
205
350
  constructor(snapshotId: number, project: Project, client: Client, sourceFileCache: SourceFileCache, toPath: (fileName: string) => Path, formatDiagnosticsHost: FormatDiagnosticsHost);
206
351
  getCurrentDirectory(): string;
207
352
  getCanonicalFileName(fileName: string): string;
208
353
  getNewLine(): string;
354
+ /** @internal */
355
+ setOwnedSnapshot(snapshot: Snapshot): void;
356
+ [globalThis.Symbol.dispose](): void;
357
+ get dispose(): {
358
+ (): void;
359
+ gen(): Generator<ProtocolRequest, void, ProtocolResponse["result"]>;
360
+ };
209
361
  getCompilerOptions(): CompilerOptions;
210
- getSourceFile(file: DocumentIdentifier): SourceFile | undefined;
211
- getSourceFileNames(): readonly string[];
362
+ get getSourceFile(): {
363
+ (file: DocumentIdentifier): SourceFile | undefined;
364
+ gen(file: DocumentIdentifier): Generator<ProtocolRequest, SourceFile | undefined, ProtocolResponse["result"]>;
365
+ };
366
+ get getSourceFileNames(): {
367
+ (): readonly string[];
368
+ gen(): Generator<ProtocolRequest, readonly string[], ProtocolResponse["result"]>;
369
+ };
212
370
  /**
213
371
  * Returns program-stored metadata for the given source file, or `undefined` if the file
214
372
  * is not part of the program. Metadata is fetched lazily per file and cached on this
215
373
  * `Program` instance.
216
374
  */
217
- getSourceFileMetadata(fileName: string): SourceFileMetadata | undefined;
375
+ get getSourceFileMetadata(): {
376
+ (file: DocumentIdentifier): SourceFileMetadata | undefined;
377
+ gen(file: DocumentIdentifier): Generator<ProtocolRequest, SourceFileMetadata | undefined, ProtocolResponse["result"]>;
378
+ };
218
379
  /**
219
380
  * Returns program-stored metadata for the source file at the given path, or `undefined`
220
381
  * if the file is not part of the program. Like {@link getSourceFileMetadata}, but skips
221
382
  * the file name to path conversion. Metadata is fetched lazily per file and cached on
222
383
  * this `Program` instance.
223
384
  */
224
- getSourceFileMetadataByPath(path: Path): SourceFileMetadata | undefined;
225
- private fetchSourceFileMetadata;
385
+ get getSourceFileMetadataByPath(): {
386
+ (path: Path): SourceFileMetadata | undefined;
387
+ gen(path: Path): Generator<ProtocolRequest, SourceFileMetadata | undefined, ProtocolResponse["result"]>;
388
+ };
389
+ private get fetchSourceFileMetadata();
226
390
  /**
227
391
  * Returns whether the given source file was loaded as part of an external library
228
392
  * (e.g. a dependency resolved from `node_modules`). The underlying program metadata is
229
393
  * fetched lazily per file and cached on this `Program` instance.
230
394
  */
231
- isSourceFileFromExternalLibrary(file: SourceFile): boolean;
395
+ get isSourceFileFromExternalLibrary(): {
396
+ (file: SourceFile): boolean;
397
+ gen(file: SourceFile): Generator<ProtocolRequest, boolean, ProtocolResponse["result"]>;
398
+ };
232
399
  /**
233
400
  * Returns whether the given source file is a default library file (e.g. `lib.d.ts`).
234
401
  * The underlying program metadata is fetched lazily per file and cached on this
235
402
  * `Program` instance.
236
403
  */
237
- isSourceFileDefaultLibrary(file: SourceFile): boolean;
404
+ get isSourceFileDefaultLibrary(): {
405
+ (file: SourceFile): boolean;
406
+ gen(file: SourceFile): Generator<ProtocolRequest, boolean, ProtocolResponse["result"]>;
407
+ };
238
408
  /**
239
409
  * Get all config source file names associated with this program's project config.
240
410
  * Includes the root config file and any extended config files.
241
411
  */
242
- getConfigFileNames(): readonly string[];
412
+ get getConfigFileNames(): {
413
+ (): readonly string[];
414
+ gen(): Generator<ProtocolRequest, readonly string[], ProtocolResponse["result"]>;
415
+ };
243
416
  /**
244
417
  * Get a config source file by file name/URI.
245
418
  * This can return the project's root tsconfig file or one of its extended config files.
246
419
  */
247
- getConfigSourceFile(file: DocumentIdentifier): SourceFile | undefined;
420
+ get getConfigSourceFile(): {
421
+ (file: DocumentIdentifier): SourceFile | undefined;
422
+ gen(file: DocumentIdentifier): Generator<ProtocolRequest, SourceFile | undefined, ProtocolResponse["result"]>;
423
+ };
248
424
  /**
249
425
  * Get syntactic (parse) diagnostics for specific files or all files.
250
426
  * @param file - Optional file(s) to get diagnostics for. If omitted, returns diagnostics for all files.
251
427
  */
252
- getSyntacticDiagnostics(file?: DocumentIdentifier | readonly DocumentIdentifier[]): readonly Diagnostic[];
428
+ get getSyntacticDiagnostics(): {
429
+ (file?: DocumentIdentifier | readonly DocumentIdentifier[]): readonly Diagnostic[];
430
+ gen(file?: DocumentIdentifier | readonly DocumentIdentifier[]): Generator<ProtocolRequest, readonly Diagnostic[], ProtocolResponse["result"]>;
431
+ };
253
432
  /**
254
433
  * Get binder diagnostics for specific files or all files.
255
434
  * @param file - Optional file(s) to get diagnostics for. If omitted, returns diagnostics for all files.
256
435
  */
257
- getBindDiagnostics(file?: DocumentIdentifier | readonly DocumentIdentifier[]): readonly Diagnostic[];
436
+ get getBindDiagnostics(): {
437
+ (file?: DocumentIdentifier | readonly DocumentIdentifier[]): readonly Diagnostic[];
438
+ gen(file?: DocumentIdentifier | readonly DocumentIdentifier[]): Generator<ProtocolRequest, readonly Diagnostic[], ProtocolResponse["result"]>;
439
+ };
258
440
  /**
259
441
  * Get semantic (type-check) diagnostics for specific files or all files.
260
442
  * @param file - Optional file(s) to get diagnostics for. If omitted, returns diagnostics for all files.
261
443
  */
262
- getSemanticDiagnostics(file?: DocumentIdentifier | readonly DocumentIdentifier[]): readonly Diagnostic[];
444
+ get getSemanticDiagnostics(): {
445
+ (file?: DocumentIdentifier | readonly DocumentIdentifier[]): readonly Diagnostic[];
446
+ gen(file?: DocumentIdentifier | readonly DocumentIdentifier[]): Generator<ProtocolRequest, readonly Diagnostic[], ProtocolResponse["result"]>;
447
+ };
263
448
  /**
264
449
  * Get suggestion diagnostics for specific files or all files.
265
450
  * @param file - Optional file(s) to get diagnostics for. If omitted, returns diagnostics for all files.
266
451
  */
267
- getSuggestionDiagnostics(file?: DocumentIdentifier | readonly DocumentIdentifier[]): readonly Diagnostic[];
452
+ get getSuggestionDiagnostics(): {
453
+ (file?: DocumentIdentifier | readonly DocumentIdentifier[]): readonly Diagnostic[];
454
+ gen(file?: DocumentIdentifier | readonly DocumentIdentifier[]): Generator<ProtocolRequest, readonly Diagnostic[], ProtocolResponse["result"]>;
455
+ };
268
456
  /**
269
457
  * Get declaration emit diagnostics for specific files or all files.
270
458
  * @param file - Optional file(s) to get diagnostics for. If omitted, returns diagnostics for all files.
271
459
  */
272
- getDeclarationDiagnostics(file?: DocumentIdentifier | readonly DocumentIdentifier[]): readonly Diagnostic[];
460
+ get getDeclarationDiagnostics(): {
461
+ (file?: DocumentIdentifier | readonly DocumentIdentifier[]): readonly Diagnostic[];
462
+ gen(file?: DocumentIdentifier | readonly DocumentIdentifier[]): Generator<ProtocolRequest, readonly Diagnostic[], ProtocolResponse["result"]>;
463
+ };
273
464
  /**
274
465
  * Get program-wide diagnostics for the project, including compiler options diagnostics.
275
466
  */
276
- getProgramDiagnostics(): readonly Diagnostic[];
467
+ get getProgramDiagnostics(): {
468
+ (): readonly Diagnostic[];
469
+ gen(): Generator<ProtocolRequest, readonly Diagnostic[], ProtocolResponse["result"]>;
470
+ };
277
471
  /**
278
472
  * Get global (non-file-specific) semantic diagnostics for the project.
279
473
  */
280
- getGlobalDiagnostics(): readonly Diagnostic[];
474
+ get getGlobalDiagnostics(): {
475
+ (): readonly Diagnostic[];
476
+ gen(): Generator<ProtocolRequest, readonly Diagnostic[], ProtocolResponse["result"]>;
477
+ };
281
478
  /**
282
479
  * Get config file parsing diagnostics for the project.
283
480
  */
284
- getConfigFileParsingDiagnostics(): readonly Diagnostic[];
481
+ get getConfigFileParsingDiagnostics(): {
482
+ (): readonly Diagnostic[];
483
+ gen(): Generator<ProtocolRequest, readonly Diagnostic[], ProtocolResponse["result"]>;
484
+ };
285
485
  /**
286
486
  * Emits files to the configured filesystem.
287
487
  *
288
488
  * When the API has a virtual filesystem with a `writeFile` callback, output
289
489
  * is written there. Otherwise, the server writes directly to the host filesystem.
290
490
  */
291
- emit(emitOnly?: EmitOnly): EmitResult;
491
+ get emit(): {
492
+ (emitOnly?: EmitOnly): EmitResult;
493
+ gen(emitOnly?: EmitOnly): Generator<ProtocolRequest, EmitResult, ProtocolResponse["result"]>;
494
+ };
292
495
  /**
293
496
  * Emits files and returns their contents without writing to the filesystem.
294
497
  */
295
- emitToString(emitOnly?: EmitOnly): EmitOutput;
498
+ get emitToString(): {
499
+ (emitOnly?: EmitOnly): EmitOutput;
500
+ gen(emitOnly?: EmitOnly): Generator<ProtocolRequest, EmitOutput, ProtocolResponse["result"]>;
501
+ };
296
502
  /**
297
503
  * Gets JavaScript output for selected files regardless of project `noEmit`, `emitDeclarationOnly`, and `noEmitOnError` settings.
298
504
  */
299
- getJavaScriptEmit(files: readonly DocumentIdentifier[]): EmitOutput;
505
+ get getJavaScriptEmit(): {
506
+ (files: readonly DocumentIdentifier[]): EmitOutput;
507
+ gen(files: readonly DocumentIdentifier[]): Generator<ProtocolRequest, EmitOutput, ProtocolResponse["result"]>;
508
+ };
300
509
  /**
301
510
  * Gets declaration output for selected files regardless of project `noEmit`, `declaration`, `emitDeclarationOnly`, and `noEmitOnError` settings.
302
511
  */
303
- getDeclarationEmit(files: readonly DocumentIdentifier[]): EmitOutput;
512
+ get getDeclarationEmit(): {
513
+ (files: readonly DocumentIdentifier[]): EmitOutput;
514
+ gen(files: readonly DocumentIdentifier[]): Generator<ProtocolRequest, EmitOutput, ProtocolResponse["result"]>;
515
+ };
516
+ getProject(): Project;
304
517
  }
305
518
  export declare class Checker {
306
519
  private snapshotId;
@@ -311,187 +524,436 @@ export declare class Checker {
311
524
  private wellKnownSignatures;
312
525
  constructor(snapshotId: number, project: Project, client: Client, objectRegistry: ProjectObjectRegistry);
313
526
  dispose(): void;
314
- getSymbolAtLocation(node: Node): Symbol | undefined;
315
- getSymbolAtLocation(nodes: readonly Node[]): (Symbol | undefined)[];
316
- getSymbolAtPosition(file: DocumentIdentifier, position: number): Symbol | undefined;
317
- getSymbolAtPosition(file: DocumentIdentifier, positions: readonly number[]): (Symbol | undefined)[];
318
- getSymbolOfSourceFile(file: DocumentIdentifier): Symbol | undefined;
319
- getSymbolOfSourceFile(files: readonly DocumentIdentifier[]): (Symbol | undefined)[];
527
+ get getSymbolAtLocation(): {
528
+ (node: Node): Symbol | undefined;
529
+ (nodes: readonly Node[]): (Symbol | undefined)[];
530
+ gen(node: Node): Generator<ProtocolRequest, Symbol | undefined, ProtocolResponse["result"]>;
531
+ gen(nodes: readonly Node[]): Generator<ProtocolRequest, (Symbol | undefined)[], ProtocolResponse["result"]>;
532
+ };
533
+ get getSymbolAtPosition(): {
534
+ (file: DocumentIdentifier, position: number): Symbol | undefined;
535
+ (file: DocumentIdentifier, positions: readonly number[]): (Symbol | undefined)[];
536
+ gen(file: DocumentIdentifier, position: number): Generator<ProtocolRequest, Symbol | undefined, ProtocolResponse["result"]>;
537
+ gen(file: DocumentIdentifier, positions: readonly number[]): Generator<ProtocolRequest, (Symbol | undefined)[], ProtocolResponse["result"]>;
538
+ };
539
+ get getSymbolOfSourceFile(): {
540
+ (file: DocumentIdentifier): Symbol | undefined;
541
+ (files: readonly DocumentIdentifier[]): (Symbol | undefined)[];
542
+ gen(file: DocumentIdentifier): Generator<ProtocolRequest, Symbol | undefined, ProtocolResponse["result"]>;
543
+ gen(files: readonly DocumentIdentifier[]): Generator<ProtocolRequest, (Symbol | undefined)[], ProtocolResponse["result"]>;
544
+ };
320
545
  /**
321
546
  * Get the type of a symbol. Always returns a type; for symbols whose type
322
547
  * cannot be determined the checker yields the error type (use
323
548
  * {@link Type.isErrorType} to detect it).
324
549
  */
325
- getTypeOfSymbol(symbol: Symbol): Type;
326
- getTypeOfSymbol(symbols: readonly Symbol[]): Type[];
550
+ get getTypeOfSymbol(): {
551
+ (symbol: Symbol): Type;
552
+ (symbols: readonly Symbol[]): Type[];
553
+ gen(symbol: Symbol): Generator<ProtocolRequest, Type, ProtocolResponse["result"]>;
554
+ gen(symbols: readonly Symbol[]): Generator<ProtocolRequest, Type[], ProtocolResponse["result"]>;
555
+ };
327
556
  /**
328
557
  * Get the declared type of a symbol. Always returns a type; for symbols whose
329
558
  * declared type cannot be determined the checker yields the error type (use
330
559
  * {@link Type.isErrorType} to detect it).
331
560
  */
332
- getDeclaredTypeOfSymbol(symbol: Symbol): Type;
333
- getReferencesToSymbolInFile(file: DocumentIdentifier, symbol: Symbol): NodeHandle[];
561
+ get getDeclaredTypeOfSymbol(): {
562
+ (symbol: Symbol): Type;
563
+ gen(symbol: Symbol): Generator<ProtocolRequest, Type, ProtocolResponse["result"]>;
564
+ };
565
+ /**
566
+ * Get the type of a symbol, excluding the missing type when
567
+ * `exactOptionalPropertyTypes: true` is set; for symbols whose
568
+ * type cannot be determined the checker yields the error type
569
+ * (use {@link Type.isErrorType} to detect it).
570
+ */
571
+ get getNonMissingTypeOfSymbol(): {
572
+ (symbol: Symbol): Type;
573
+ gen(symbol: Symbol): Generator<ProtocolRequest, Type, ProtocolResponse["result"]>;
574
+ };
575
+ get getReferencesToSymbolInFile(): {
576
+ (file: DocumentIdentifier, symbol: Symbol): NodeHandle[];
577
+ gen(file: DocumentIdentifier, symbol: Symbol): Generator<ProtocolRequest, NodeHandle[], ProtocolResponse["result"]>;
578
+ };
334
579
  /** @deprecated Use `project.languageService.getReferencedSymbolsForNode`. */
335
- getReferencedSymbolsForNode(node: Node, position: number): ReferencedSymbolEntry[];
580
+ get getReferencedSymbolsForNode(): {
581
+ (node: Node, position: number): ReferencedSymbolEntry[];
582
+ gen(node: Node, position: number): Generator<ProtocolRequest, ReferencedSymbolEntry[], ProtocolResponse["result"]>;
583
+ };
336
584
  /** @deprecated Use `project.languageService.getSignatureUsage`. */
337
- getSignatureUsage(signatureDecl: Node): SignatureUsage[];
585
+ get getSignatureUsage(): {
586
+ (signatureDecl: Node): SignatureUsage[];
587
+ gen(signatureDecl: Node): Generator<ProtocolRequest, SignatureUsage[], ProtocolResponse["result"]>;
588
+ };
338
589
  /** @deprecated Use `project.languageService.getCompletionsAtPosition`. */
339
- getCompletionsAtPosition(document: string, position: number, options?: CompletionOptions): CompletionInfo | undefined;
590
+ get getCompletionsAtPosition(): {
591
+ (document: string, position: number, options?: CompletionOptions): CompletionInfo | undefined;
592
+ gen(document: string, position: number, options?: CompletionOptions): Generator<ProtocolRequest, CompletionInfo | undefined, ProtocolResponse["result"]>;
593
+ };
340
594
  /**
341
595
  * Get the type at a node location. Always returns a type; for nodes whose
342
596
  * type cannot be determined the checker yields the error type (use
343
597
  * {@link Type.isErrorType} to detect it).
344
598
  */
345
- getTypeAtLocation(node: Node): Type;
346
- getTypeAtLocation(nodes: readonly Node[]): Type[];
347
- getSignaturesOfType(type: Type, kind: SignatureKind): readonly Signature[];
599
+ get getTypeAtLocation(): {
600
+ (node: Node): Type;
601
+ (nodes: readonly Node[]): Type[];
602
+ gen(node: Node): Generator<ProtocolRequest, Type, ProtocolResponse["result"]>;
603
+ gen(nodes: readonly Node[]): Generator<ProtocolRequest, Type[], ProtocolResponse["result"]>;
604
+ };
605
+ get getSignaturesOfType(): {
606
+ (type: Type, kind: SignatureKind): readonly Signature[];
607
+ gen(type: Type, kind: SignatureKind): Generator<ProtocolRequest, readonly Signature[], ProtocolResponse["result"]>;
608
+ };
348
609
  /**
349
610
  * Get the resolved signature of a call-like expression. Always returns a
350
611
  * signature; when a call cannot be resolved the checker yields the unknown
351
612
  * signature (use {@link Checker.isUnknownSignature} to detect it).
352
613
  */
353
- getResolvedSignature(node: Node): Signature;
354
- getTypeAtPosition(file: DocumentIdentifier, position: number): Type | undefined;
355
- getTypeAtPosition(file: DocumentIdentifier, positions: readonly number[]): (Type | undefined)[];
356
- resolveName(name: string, meaning: SymbolFlags, location?: Node | DocumentPosition, excludeGlobals?: boolean): Symbol | undefined;
614
+ get getResolvedSignature(): {
615
+ (node: Node): Signature;
616
+ gen(node: Node): Generator<ProtocolRequest, Signature, ProtocolResponse["result"]>;
617
+ };
618
+ get getTypeAtPosition(): {
619
+ (file: DocumentIdentifier, position: number): Type | undefined;
620
+ (file: DocumentIdentifier, positions: readonly number[]): (Type | undefined)[];
621
+ gen(file: DocumentIdentifier, position: number): Generator<ProtocolRequest, Type | undefined, ProtocolResponse["result"]>;
622
+ gen(file: DocumentIdentifier, positions: readonly number[]): Generator<ProtocolRequest, (Type | undefined)[], ProtocolResponse["result"]>;
623
+ };
624
+ get resolveName(): {
625
+ (name: string, meaning: SymbolFlags, location?: Node | DocumentPosition, excludeGlobals?: boolean): Symbol | undefined;
626
+ gen(name: string, meaning: SymbolFlags, location?: Node | DocumentPosition, excludeGlobals?: boolean): Generator<ProtocolRequest, Symbol | undefined, ProtocolResponse["result"]>;
627
+ };
357
628
  /**
358
629
  * Returns all symbols with the given meaning that are visible at `location`.
359
630
  */
360
- getSymbolsInScope(location: Node | DocumentPosition, meaning: SymbolFlags): readonly Symbol[];
361
- getResolvedSymbol(node: Identifier): Symbol | undefined;
362
- getContextualType(node: Expression): Type | undefined;
631
+ get getSymbolsInScope(): {
632
+ (location: Node | DocumentPosition, meaning: SymbolFlags): readonly Symbol[];
633
+ gen(location: Node | DocumentPosition, meaning: SymbolFlags): Generator<ProtocolRequest, readonly Symbol[], ProtocolResponse["result"]>;
634
+ };
635
+ get getResolvedSymbol(): {
636
+ (node: Identifier): Symbol | undefined;
637
+ gen(node: Identifier): Generator<ProtocolRequest, Symbol | undefined, ProtocolResponse["result"]>;
638
+ };
639
+ get getContextualType(): {
640
+ (node: Expression): Type | undefined;
641
+ gen(node: Expression): Generator<ProtocolRequest, Type | undefined, ProtocolResponse["result"]>;
642
+ };
363
643
  /** Get the base type of a literal type (e.g. `number` for `42`). Always returns a type. */
364
- getBaseTypeOfLiteralType(type: Type): Type;
644
+ get getBaseTypeOfLiteralType(): {
645
+ (type: Type): Type;
646
+ gen(type: Type): Generator<ProtocolRequest, Type, ProtocolResponse["result"]>;
647
+ };
365
648
  /** Get the type with `null` and `undefined` removed. Always returns a type. */
366
- getNonNullableType(type: Type): Type;
649
+ get getNonNullableType(): {
650
+ (type: Type): Type;
651
+ gen(type: Type): Generator<ProtocolRequest, Type, ProtocolResponse["result"]>;
652
+ };
367
653
  /**
368
654
  * Get the type for a type node. Always returns a type; for type nodes whose
369
655
  * type cannot be determined the checker yields the error type (use
370
656
  * {@link Type.isErrorType} to detect it).
371
657
  */
372
- getTypeFromTypeNode(node: TypeNode): Type;
658
+ get getTypeFromTypeNode(): {
659
+ (node: TypeNode): Type;
660
+ gen(node: TypeNode): Generator<ProtocolRequest, Type, ProtocolResponse["result"]>;
661
+ };
373
662
  /** Get the widened type. Always returns a type. */
374
- getWidenedType(type: Type): Type;
663
+ get getWidenedType(): {
664
+ (type: Type): Type;
665
+ gen(type: Type): Generator<ProtocolRequest, Type, ProtocolResponse["result"]>;
666
+ };
375
667
  /**
376
668
  * Get the type of the parameter at the given index in a signature. Always
377
669
  * returns a type; an out-of-range index yields the `any` type.
378
670
  */
379
- getParameterType(signature: Signature, index: number): Type;
380
- isArrayLikeType(type: Type): boolean;
381
- isTypeAssignableTo(source: Type, target: Type): boolean;
382
- getShorthandAssignmentValueSymbol(node: Node): Symbol | undefined;
671
+ get getParameterType(): {
672
+ (signature: Signature, index: number): Type;
673
+ gen(signature: Signature, index: number): Generator<ProtocolRequest, Type, ProtocolResponse["result"]>;
674
+ };
675
+ get isArrayLikeType(): {
676
+ (type: Type): boolean;
677
+ gen(type: Type): Generator<ProtocolRequest, boolean, ProtocolResponse["result"]>;
678
+ };
679
+ get isTypeAssignableTo(): {
680
+ (source: Type, target: Type): boolean;
681
+ gen(source: Type, target: Type): Generator<ProtocolRequest, boolean, ProtocolResponse["result"]>;
682
+ };
683
+ get getShorthandAssignmentValueSymbol(): {
684
+ (node: Node): Symbol | undefined;
685
+ gen(node: Node): Generator<ProtocolRequest, Symbol | undefined, ProtocolResponse["result"]>;
686
+ };
383
687
  /**
384
688
  * Get the type of a symbol as narrowed at a specific location. Always returns
385
689
  * a type; for symbols whose type cannot be determined the checker yields the
386
690
  * error type (use {@link Type.isErrorType} to detect it).
387
691
  */
388
- getTypeOfSymbolAtLocation(symbol: Symbol, location: Node): Type;
389
- private getIntrinsicType;
390
- getAnyType(): Type;
391
- getStringType(): Type;
392
- getNumberType(): Type;
393
- getBooleanType(): Type;
394
- getVoidType(): Type;
395
- getUndefinedType(): Type;
396
- getNullType(): Type;
397
- getNeverType(): Type;
398
- getUnknownType(): Type;
399
- getBigIntType(): Type;
400
- getESSymbolType(): Type;
401
- getNonPrimitiveType(): Type;
402
- typeToTypeNode(type: Type, enclosingDeclaration?: Node, flags?: number): TypeNode | undefined;
403
- signatureToSignatureDeclaration(signature: Signature, kind: SyntaxKind, enclosingDeclaration?: Node, flags?: NodeBuilderFlags): Node | undefined;
404
- typeToString(type: Type, enclosingDeclaration?: Node, flags?: TypeFormatFlags): string;
405
- isContextSensitive(node: Node): boolean;
406
- isArrayType(type: Type): boolean;
407
- isTupleType(type: Type): boolean;
692
+ get getTypeOfSymbolAtLocation(): {
693
+ (symbol: Symbol, location: Node): Type;
694
+ gen(symbol: Symbol, location: Node): Generator<ProtocolRequest, Type, ProtocolResponse["result"]>;
695
+ };
696
+ private get getIntrinsicType();
697
+ get getAnyType(): {
698
+ (): Type;
699
+ gen(): Generator<ProtocolRequest, Type, ProtocolResponse["result"]>;
700
+ };
701
+ get getStringType(): {
702
+ (): Type;
703
+ gen(): Generator<ProtocolRequest, Type, ProtocolResponse["result"]>;
704
+ };
705
+ get getNumberType(): {
706
+ (): Type;
707
+ gen(): Generator<ProtocolRequest, Type, ProtocolResponse["result"]>;
708
+ };
709
+ get getBooleanType(): {
710
+ (): Type;
711
+ gen(): Generator<ProtocolRequest, Type, ProtocolResponse["result"]>;
712
+ };
713
+ get getVoidType(): {
714
+ (): Type;
715
+ gen(): Generator<ProtocolRequest, Type, ProtocolResponse["result"]>;
716
+ };
717
+ get getUndefinedType(): {
718
+ (): Type;
719
+ gen(): Generator<ProtocolRequest, Type, ProtocolResponse["result"]>;
720
+ };
721
+ get getNullType(): {
722
+ (): Type;
723
+ gen(): Generator<ProtocolRequest, Type, ProtocolResponse["result"]>;
724
+ };
725
+ get getNeverType(): {
726
+ (): Type;
727
+ gen(): Generator<ProtocolRequest, Type, ProtocolResponse["result"]>;
728
+ };
729
+ get getUnknownType(): {
730
+ (): Type;
731
+ gen(): Generator<ProtocolRequest, Type, ProtocolResponse["result"]>;
732
+ };
733
+ get getBigIntType(): {
734
+ (): Type;
735
+ gen(): Generator<ProtocolRequest, Type, ProtocolResponse["result"]>;
736
+ };
737
+ get getESSymbolType(): {
738
+ (): Type;
739
+ gen(): Generator<ProtocolRequest, Type, ProtocolResponse["result"]>;
740
+ };
741
+ get getNonPrimitiveType(): {
742
+ (): Type;
743
+ gen(): Generator<ProtocolRequest, Type, ProtocolResponse["result"]>;
744
+ };
745
+ get typeToTypeNode(): {
746
+ (type: Type, enclosingDeclaration?: Node, flags?: number): TypeNode | undefined;
747
+ gen(type: Type, enclosingDeclaration?: Node, flags?: number): Generator<ProtocolRequest, TypeNode | undefined, ProtocolResponse["result"]>;
748
+ };
749
+ get signatureToSignatureDeclaration(): {
750
+ (signature: Signature, kind: SyntaxKind, enclosingDeclaration?: Node, flags?: NodeBuilderFlags): Node | undefined;
751
+ gen(signature: Signature, kind: SyntaxKind, enclosingDeclaration?: Node, flags?: NodeBuilderFlags): Generator<ProtocolRequest, Node | undefined, ProtocolResponse["result"]>;
752
+ };
753
+ get typeToString(): {
754
+ (type: Type, enclosingDeclaration?: Node, flags?: TypeFormatFlags): string;
755
+ gen(type: Type, enclosingDeclaration?: Node, flags?: TypeFormatFlags): Generator<ProtocolRequest, string, ProtocolResponse["result"]>;
756
+ };
757
+ get isContextSensitive(): {
758
+ (node: Node): boolean;
759
+ gen(node: Node): Generator<ProtocolRequest, boolean, ProtocolResponse["result"]>;
760
+ };
761
+ get isArrayType(): {
762
+ (type: Type): boolean;
763
+ gen(type: Type): Generator<ProtocolRequest, boolean, ProtocolResponse["result"]>;
764
+ };
765
+ get isTupleType(): {
766
+ (type: Type): boolean;
767
+ gen(type: Type): Generator<ProtocolRequest, boolean, ProtocolResponse["result"]>;
768
+ };
769
+ get isTupleTypeTarget(): {
770
+ (type: Type): boolean;
771
+ gen(type: Type): Generator<ProtocolRequest, boolean, ProtocolResponse["result"]>;
772
+ };
773
+ /**
774
+ * The following symbols are considered read-only:
775
+ * - Properties with a `readonly` modifier
776
+ * - Variables declared with `const`
777
+ * - Get accessors without matching set accessors
778
+ * - Enum members
779
+ * - `Object.defineProperty` assignments with `writable: false` or no setter
780
+ * - Unions and intersections of the above
781
+ */
782
+ get isReadonlySymbol(): {
783
+ (symbol: Symbol): boolean;
784
+ gen(symbol: Symbol): Generator<ProtocolRequest, boolean, ProtocolResponse["result"]>;
785
+ };
408
786
  /** Get the return type of a signature. Always returns a type. */
409
- getReturnTypeOfSignature(signature: Signature): Type;
787
+ get getReturnTypeOfSignature(): {
788
+ (signature: Signature): Type;
789
+ gen(signature: Signature): Generator<ProtocolRequest, Type, ProtocolResponse["result"]>;
790
+ };
410
791
  /**
411
792
  * Get the rest type of a signature. Always returns a type; a signature with
412
793
  * no rest parameter yields the `any` type.
413
794
  */
414
- getRestTypeOfSignature(signature: Signature): Type;
415
- getTypePredicateOfSignature(signature: Signature): TypePredicate | undefined;
795
+ get getRestTypeOfSignature(): {
796
+ (signature: Signature): Type;
797
+ gen(signature: Signature): Generator<ProtocolRequest, Type, ProtocolResponse["result"]>;
798
+ };
799
+ get getTypePredicateOfSignature(): {
800
+ (signature: Signature): TypePredicate | undefined;
801
+ gen(signature: Signature): Generator<ProtocolRequest, TypePredicate | undefined, ProtocolResponse["result"]>;
802
+ };
416
803
  /**
417
804
  * Get the base types of a class or interface type. A type with no base types
418
805
  * yields an empty array.
419
806
  */
420
- getBaseTypes(type: InterfaceType): readonly Type[];
807
+ get getBaseTypes(): {
808
+ (type: InterfaceType): readonly Type[];
809
+ gen(type: InterfaceType): Generator<ProtocolRequest, readonly Type[], ProtocolResponse["result"]>;
810
+ };
421
811
  /** Get the apparent type of a type. Always returns a type. */
422
- getApparentType(type: Type): Type;
812
+ get getApparentType(): {
813
+ (type: Type): Type;
814
+ gen(type: Type): Generator<ProtocolRequest, Type, ProtocolResponse["result"]>;
815
+ };
423
816
  /** Get the reduced type of a type. Always returns a type. */
424
- getReducedType(type: Type): Type;
425
- getPropertiesOfType(type: Type): readonly Symbol[];
426
- getIndexInfosOfType(type: Type): readonly IndexInfo[];
817
+ get getReducedType(): {
818
+ (type: Type): Type;
819
+ gen(type: Type): Generator<ProtocolRequest, Type, ProtocolResponse["result"]>;
820
+ };
821
+ get getPropertiesOfType(): {
822
+ (type: Type): readonly Symbol[];
823
+ gen(type: Type): Generator<ProtocolRequest, readonly Symbol[], ProtocolResponse["result"]>;
824
+ };
825
+ get getIndexInfosOfType(): {
826
+ (type: Type): readonly IndexInfo[];
827
+ gen(type: Type): Generator<ProtocolRequest, readonly IndexInfo[], ProtocolResponse["result"]>;
828
+ };
427
829
  /**
428
830
  * Get the constraint of a type parameter (the `T` in `<U extends T>`), or
429
831
  * undefined if it has none.
430
832
  */
431
- getConstraintOfTypeParameter(type: TypeParameter): Type | undefined;
432
- getDefaultFromTypeParameter(type: TypeParameter): Type | undefined;
433
- getBaseConstraintOfType(type: Type): Type | undefined;
434
- getPropertyOfType(type: Type, name: string): Symbol | undefined;
435
- getConstantValue(node: Node): string | number | undefined;
833
+ get getConstraintOfTypeParameter(): {
834
+ (type: TypeParameter): Type | undefined;
835
+ gen(type: TypeParameter): Generator<ProtocolRequest, Type | undefined, ProtocolResponse["result"]>;
836
+ };
837
+ get getDefaultFromTypeParameter(): {
838
+ (type: TypeParameter): Type | undefined;
839
+ gen(type: TypeParameter): Generator<ProtocolRequest, Type | undefined, ProtocolResponse["result"]>;
840
+ };
841
+ get getBaseConstraintOfType(): {
842
+ (type: Type): Type | undefined;
843
+ gen(type: Type): Generator<ProtocolRequest, Type | undefined, ProtocolResponse["result"]>;
844
+ };
845
+ get getPropertyOfType(): {
846
+ (type: Type, name: string): Symbol | undefined;
847
+ gen(type: Type, name: string): Generator<ProtocolRequest, Symbol | undefined, ProtocolResponse["result"]>;
848
+ };
849
+ get getConstantValue(): {
850
+ (node: Node): string | number | undefined;
851
+ gen(node: Node): Generator<ProtocolRequest, string | number | undefined, ProtocolResponse["result"]>;
852
+ };
436
853
  /** Get the signature of a function-like declaration. Always returns a signature. */
437
- getSignatureFromDeclaration(node: Node): Signature;
438
- getExportSpecifierLocalTargetSymbol(node: Node): Symbol | undefined;
854
+ get getSignatureFromDeclaration(): {
855
+ (node: Node): Signature;
856
+ gen(node: Node): Generator<ProtocolRequest, Signature, ProtocolResponse["result"]>;
857
+ };
858
+ get getExportSpecifierLocalTargetSymbol(): {
859
+ (node: Node): Symbol | undefined;
860
+ gen(node: Node): Generator<ProtocolRequest, Symbol | undefined, ProtocolResponse["result"]>;
861
+ };
439
862
  /**
440
863
  * Follow all aliases to get the original symbol. Always returns a symbol; for
441
864
  * an unresolved alias the checker yields the unknown symbol (use
442
865
  * {@link Checker.isUnknownSymbol} to detect it).
443
866
  */
444
- getAliasedSymbol(symbol: Symbol): Symbol;
867
+ get getAliasedSymbol(): {
868
+ (symbol: Symbol): Symbol;
869
+ gen(symbol: Symbol): Generator<ProtocolRequest, Symbol, ProtocolResponse["result"]>;
870
+ };
445
871
  /**
446
872
  * Get the fully qualified name of a symbol, walking up its parent chain
447
873
  * (e.g. `"/path/to/module".Namespace.Name`).
448
874
  */
449
- getFullyQualifiedName(symbol: Symbol): string;
450
- getImmediateAliasedSymbol(symbol: Symbol): Symbol | undefined;
875
+ get getFullyQualifiedName(): {
876
+ (symbol: Symbol): string;
877
+ gen(symbol: Symbol): Generator<ProtocolRequest, string, ProtocolResponse["result"]>;
878
+ };
879
+ get getImmediateAliasedSymbol(): {
880
+ (symbol: Symbol): Symbol | undefined;
881
+ gen(symbol: Symbol): Generator<ProtocolRequest, Symbol | undefined, ProtocolResponse["result"]>;
882
+ };
451
883
  /**
452
884
  * Get the target symbol if instantiated, or the provided symbol otherwise.
453
885
  */
454
- getTargetSymbol(symbol: Symbol): Symbol;
886
+ get getTargetSymbol(): {
887
+ (symbol: Symbol): Symbol;
888
+ gen(symbol: Symbol): Generator<ProtocolRequest, Symbol, ProtocolResponse["result"]>;
889
+ };
455
890
  /**
456
891
  * Fetch (once, then cache) the handle ids of the per-checker singleton
457
892
  * symbols (unknown, undefined, arguments). These ids are stable for the life
458
893
  * of the project's checker, so identity checks against them are local after
459
894
  * the first call.
460
895
  */
461
- private getWellKnownSymbols;
896
+ private get getWellKnownSymbols();
462
897
  /**
463
898
  * Returns `true` if the symbol is the checker's "unknown" symbol (e.g. the
464
899
  * result of {@link Checker.getAliasedSymbol} on an unresolved alias).
465
900
  */
466
- isUnknownSymbol(symbol: Symbol): boolean;
901
+ get isUnknownSymbol(): {
902
+ (symbol: Symbol): boolean;
903
+ gen(symbol: Symbol): Generator<ProtocolRequest, boolean, ProtocolResponse["result"]>;
904
+ };
467
905
  /**
468
906
  * Returns `true` if the symbol is the checker's "undefined" symbol.
469
907
  */
470
- isUndefinedSymbol(symbol: Symbol): boolean;
908
+ get isUndefinedSymbol(): {
909
+ (symbol: Symbol): boolean;
910
+ gen(symbol: Symbol): Generator<ProtocolRequest, boolean, ProtocolResponse["result"]>;
911
+ };
471
912
  /**
472
913
  * Returns `true` if the symbol is the checker's "arguments" symbol.
473
914
  */
474
- isArgumentsSymbol(symbol: Symbol): boolean;
915
+ get isArgumentsSymbol(): {
916
+ (symbol: Symbol): boolean;
917
+ gen(symbol: Symbol): Generator<ProtocolRequest, boolean, ProtocolResponse["result"]>;
918
+ };
475
919
  /**
476
920
  * Fetch (once, then cache) the handle id of the per-checker unknown
477
921
  * signature. This id is stable for the life of the project's checker, so
478
922
  * identity checks against it are local after the first call.
479
923
  */
480
- private getWellKnownSignatures;
924
+ private get getWellKnownSignatures();
481
925
  /**
482
926
  * Returns `true` if the signature is the checker's "unknown" signature (e.g.
483
927
  * the result of {@link Checker.getResolvedSignature} on a call that cannot be
484
928
  * resolved).
485
929
  */
486
- isUnknownSignature(signature: Signature): boolean;
487
- getExportsOfModule(symbol: Symbol): readonly Symbol[];
488
- getMemberInModuleExports(symbol: Symbol, name: string): Symbol | undefined;
489
- getJsDocTagsOfSymbol(symbol: Symbol): readonly JSDocTagInfo[];
490
- getDocumentationCommentOfSymbol(symbol: Symbol): string;
930
+ get isUnknownSignature(): {
931
+ (signature: Signature): boolean;
932
+ gen(signature: Signature): Generator<ProtocolRequest, boolean, ProtocolResponse["result"]>;
933
+ };
934
+ get getExportsOfModule(): {
935
+ (symbol: Symbol): readonly Symbol[];
936
+ gen(symbol: Symbol): Generator<ProtocolRequest, readonly Symbol[], ProtocolResponse["result"]>;
937
+ };
938
+ get getMemberInModuleExports(): {
939
+ (symbol: Symbol, name: string): Symbol | undefined;
940
+ gen(symbol: Symbol, name: string): Generator<ProtocolRequest, Symbol | undefined, ProtocolResponse["result"]>;
941
+ };
942
+ get getJsDocTagsOfSymbol(): {
943
+ (symbol: Symbol): readonly JSDocTagInfo[];
944
+ gen(symbol: Symbol): Generator<ProtocolRequest, readonly JSDocTagInfo[], ProtocolResponse["result"]>;
945
+ };
946
+ get getDocumentationCommentOfSymbol(): {
947
+ (symbol: Symbol): string;
948
+ gen(symbol: Symbol): Generator<ProtocolRequest, string, ProtocolResponse["result"]>;
949
+ };
491
950
  /**
492
951
  * Get the type arguments of a type reference (e.g. the `string` in `Array<string>`).
493
952
  */
494
- getTypeArguments(type: TypeReference): readonly Type[];
953
+ get getTypeArguments(): {
954
+ (type: TypeReference): readonly Type[];
955
+ gen(type: TypeReference): Generator<ProtocolRequest, readonly Type[], ProtocolResponse["result"]>;
956
+ };
495
957
  }
496
958
  export interface PrintNodeOptions {
497
959
  preserveSourceNewlines?: boolean | undefined;
@@ -501,7 +963,10 @@ export interface PrintNodeOptions {
501
963
  export declare class Emitter {
502
964
  private client;
503
965
  constructor(client: Client);
504
- printNode(node: Node, options?: PrintNodeOptions): string;
966
+ get printNode(): {
967
+ (node: Node, options?: PrintNodeOptions): string;
968
+ gen(node: Node, options?: PrintNodeOptions): Generator<ProtocolRequest, string, ProtocolResponse["result"]>;
969
+ };
505
970
  }
506
971
  export declare class SnapshotInternalAPI {
507
972
  private snapshotId;
@@ -516,7 +981,10 @@ export declare class SnapshotInternalAPI {
516
981
  * @param position The UTF-16 code-unit offset in the target file for insertion.
517
982
  * @returns The formatted text of the node, indented for the insertion position.
518
983
  */
519
- formatNodeForInsertion(node: Node, file: DocumentIdentifier, position: number): string;
984
+ get formatNodeForInsertion(): {
985
+ (node: Node, file: DocumentIdentifier, position: number): string;
986
+ gen(node: Node, file: DocumentIdentifier, position: number): Generator<ProtocolRequest, string, ProtocolResponse["result"]>;
987
+ };
520
988
  }
521
989
  export declare class NodeHandle<out T extends Node = Node> {
522
990
  /**
@@ -534,7 +1002,10 @@ export declare class NodeHandle<out T extends Node = Node> {
534
1002
  * and looking up the node by index. If no project is passed, the project that produced
535
1003
  * the handle is used.
536
1004
  */
537
- resolve(project?: Project): T | undefined;
1005
+ get resolve(): {
1006
+ (project?: Project): T | undefined;
1007
+ gen(project?: Project): Generator<ProtocolRequest, T | undefined, ProtocolResponse["result"]>;
1008
+ };
538
1009
  }
539
1010
  /** A symbol definition paired with all of its reference nodes. */
540
1011
  export interface ReferencedSymbolEntry {
@@ -574,21 +1045,39 @@ export declare class Symbol {
574
1045
  private membersCache;
575
1046
  private exportsCache;
576
1047
  constructor(data: SymbolResponse, objectRegistry: SnapshotObjectRegistry);
577
- getParent(): Symbol | undefined;
1048
+ get getParent(): {
1049
+ (): Symbol | undefined;
1050
+ gen(): Generator<ProtocolRequest, Symbol | undefined, ProtocolResponse["result"]>;
1051
+ };
578
1052
  /**
579
1053
  * Get this symbol's members keyed by escaped name. The result is cached on
580
1054
  * the symbol, so repeated calls do not round-trip to the server.
581
1055
  */
582
- getMembers(): ReadonlyMap<__String, Symbol>;
1056
+ get getMembers(): {
1057
+ (): ReadonlyMap<__String, Symbol>;
1058
+ gen(): Generator<ProtocolRequest, ReadonlyMap<__String, Symbol>, ProtocolResponse["result"]>;
1059
+ };
583
1060
  /**
584
1061
  * Get this symbol's exports keyed by escaped name. The result is cached on
585
1062
  * the symbol, so repeated calls do not round-trip to the server.
586
1063
  */
587
- getExports(): ReadonlyMap<__String, Symbol>;
588
- private fetchSymbolTable;
589
- getExportSymbol(): Symbol;
590
- getJsDocTags(checker: Checker): readonly JSDocTagInfo[];
591
- getDocumentationComment(checker: Checker): string;
1064
+ get getExports(): {
1065
+ (): ReadonlyMap<__String, Symbol>;
1066
+ gen(): Generator<ProtocolRequest, ReadonlyMap<__String, Symbol>, ProtocolResponse["result"]>;
1067
+ };
1068
+ private get fetchSymbolTable();
1069
+ get getExportSymbol(): {
1070
+ (): Symbol;
1071
+ gen(): Generator<ProtocolRequest, Symbol, ProtocolResponse["result"]>;
1072
+ };
1073
+ get getJsDocTags(): {
1074
+ (checker: Checker): readonly JSDocTagInfo[];
1075
+ gen(checker: Checker): Generator<ProtocolRequest, readonly JSDocTagInfo[], ProtocolResponse["result"]>;
1076
+ };
1077
+ get getDocumentationComment(): {
1078
+ (checker: Checker): string;
1079
+ gen(checker: Checker): Generator<ProtocolRequest, string, ProtocolResponse["result"]>;
1080
+ };
592
1081
  }
593
1082
  declare class TypeObject implements Type {
594
1083
  private objectRegistry;
@@ -602,6 +1091,7 @@ declare class TypeObject implements Type {
602
1091
  readonly freshType: number;
603
1092
  readonly regularType: number;
604
1093
  readonly target: number;
1094
+ private readonly tupleType;
605
1095
  readonly typeParameters: readonly number[];
606
1096
  readonly outerTypeParameters: readonly number[];
607
1097
  readonly localTypeParameters: readonly number[];
@@ -633,43 +1123,136 @@ declare class TypeObject implements Type {
633
1123
  private stringIndexType;
634
1124
  private numberIndexType;
635
1125
  constructor(data: TypeResponse, objectRegistry: ProjectObjectRegistry);
636
- getSymbol(): Symbol | undefined;
637
- getProperties(): readonly Symbol[];
638
- getProperty(propertyName: string): Symbol | undefined;
639
- getApparentProperties(): readonly Symbol[];
640
- getCallSignatures(): readonly Signature[];
641
- getConstructSignatures(): readonly Signature[];
642
- getNonNullableType(): Type;
643
- getStringIndexType(): Type | undefined;
644
- private getStringIndexTypeWorker;
645
- getNumberIndexType(): Type | undefined;
646
- private getNumberIndexTypeWorker;
647
- getApparentType(): Type;
648
- getReducedType(): Type;
649
- getIndexInfos(): readonly IndexInfo[];
650
- getAliasSymbol(): Symbol | undefined;
651
- getTarget(): Type;
652
- getFreshType(): FreshableType | undefined;
653
- getRegularType(): FreshableType | undefined;
654
- getTypes(): readonly Type[] | undefined;
655
- getTypeParameters(): readonly TypeParameter[];
656
- getOuterTypeParameters(): readonly TypeParameter[];
657
- getLocalTypeParameters(): readonly TypeParameter[];
658
- getAliasTypeArguments(): readonly Type[];
659
- getObjectType(): Type;
660
- getIndexType(): Type;
661
- getCheckType(): Type;
662
- getExtendsType(): Type;
663
- getBaseType(): Type;
664
- getConstraint(): Type | undefined;
665
- getDefault(): Type | undefined;
666
- getTrueType(): Type;
667
- getFalseType(): Type;
1126
+ get getSymbol(): {
1127
+ (): Symbol | undefined;
1128
+ gen(): Generator<ProtocolRequest, Symbol | undefined, ProtocolResponse["result"]>;
1129
+ };
1130
+ get getProperties(): {
1131
+ (): readonly Symbol[];
1132
+ gen(): Generator<ProtocolRequest, readonly Symbol[], ProtocolResponse["result"]>;
1133
+ };
1134
+ get getProperty(): {
1135
+ (propertyName: string): Symbol | undefined;
1136
+ gen(propertyName: string): Generator<ProtocolRequest, Symbol | undefined, ProtocolResponse["result"]>;
1137
+ };
1138
+ get getApparentProperties(): {
1139
+ (): readonly Symbol[];
1140
+ gen(): Generator<ProtocolRequest, readonly Symbol[], ProtocolResponse["result"]>;
1141
+ };
1142
+ get getCallSignatures(): {
1143
+ (): readonly Signature[];
1144
+ gen(): Generator<ProtocolRequest, readonly Signature[], ProtocolResponse["result"]>;
1145
+ };
1146
+ get getConstructSignatures(): {
1147
+ (): readonly Signature[];
1148
+ gen(): Generator<ProtocolRequest, readonly Signature[], ProtocolResponse["result"]>;
1149
+ };
1150
+ get getNonNullableType(): {
1151
+ (): Type;
1152
+ gen(): Generator<ProtocolRequest, Type, ProtocolResponse["result"]>;
1153
+ };
1154
+ get getStringIndexType(): {
1155
+ (): Type | undefined;
1156
+ gen(): Generator<ProtocolRequest, Type | undefined, ProtocolResponse["result"]>;
1157
+ };
1158
+ private get getStringIndexTypeWorker();
1159
+ get getNumberIndexType(): {
1160
+ (): Type | undefined;
1161
+ gen(): Generator<ProtocolRequest, Type | undefined, ProtocolResponse["result"]>;
1162
+ };
1163
+ private get getNumberIndexTypeWorker();
1164
+ get getApparentType(): {
1165
+ (): Type;
1166
+ gen(): Generator<ProtocolRequest, Type, ProtocolResponse["result"]>;
1167
+ };
1168
+ get getReducedType(): {
1169
+ (): Type;
1170
+ gen(): Generator<ProtocolRequest, Type, ProtocolResponse["result"]>;
1171
+ };
1172
+ get getIndexInfos(): {
1173
+ (): readonly IndexInfo[];
1174
+ gen(): Generator<ProtocolRequest, readonly IndexInfo[], ProtocolResponse["result"]>;
1175
+ };
1176
+ get getAliasSymbol(): {
1177
+ (): Symbol | undefined;
1178
+ gen(): Generator<ProtocolRequest, Symbol | undefined, ProtocolResponse["result"]>;
1179
+ };
1180
+ get getTarget(): {
1181
+ (): Type;
1182
+ gen(): Generator<ProtocolRequest, Type, ProtocolResponse["result"]>;
1183
+ };
1184
+ get getFreshType(): {
1185
+ (): FreshableType | undefined;
1186
+ gen(): Generator<ProtocolRequest, FreshableType | undefined, ProtocolResponse["result"]>;
1187
+ };
1188
+ get getRegularType(): {
1189
+ (): FreshableType | undefined;
1190
+ gen(): Generator<ProtocolRequest, FreshableType | undefined, ProtocolResponse["result"]>;
1191
+ };
1192
+ get getTypes(): {
1193
+ (): readonly Type[] | undefined;
1194
+ gen(): Generator<ProtocolRequest, readonly Type[] | undefined, ProtocolResponse["result"]>;
1195
+ };
1196
+ get getTypeParameters(): {
1197
+ (): readonly TypeParameter[];
1198
+ gen(): Generator<ProtocolRequest, readonly TypeParameter[], ProtocolResponse["result"]>;
1199
+ };
1200
+ get getOuterTypeParameters(): {
1201
+ (): readonly TypeParameter[];
1202
+ gen(): Generator<ProtocolRequest, readonly TypeParameter[], ProtocolResponse["result"]>;
1203
+ };
1204
+ get getLocalTypeParameters(): {
1205
+ (): readonly TypeParameter[];
1206
+ gen(): Generator<ProtocolRequest, readonly TypeParameter[], ProtocolResponse["result"]>;
1207
+ };
1208
+ get getAliasTypeArguments(): {
1209
+ (): readonly Type[];
1210
+ gen(): Generator<ProtocolRequest, readonly Type[], ProtocolResponse["result"]>;
1211
+ };
1212
+ get getObjectType(): {
1213
+ (): Type;
1214
+ gen(): Generator<ProtocolRequest, Type, ProtocolResponse["result"]>;
1215
+ };
1216
+ get getIndexType(): {
1217
+ (): Type;
1218
+ gen(): Generator<ProtocolRequest, Type, ProtocolResponse["result"]>;
1219
+ };
1220
+ get getCheckType(): {
1221
+ (): Type;
1222
+ gen(): Generator<ProtocolRequest, Type, ProtocolResponse["result"]>;
1223
+ };
1224
+ get getExtendsType(): {
1225
+ (): Type;
1226
+ gen(): Generator<ProtocolRequest, Type, ProtocolResponse["result"]>;
1227
+ };
1228
+ get getBaseType(): {
1229
+ (): Type;
1230
+ gen(): Generator<ProtocolRequest, Type, ProtocolResponse["result"]>;
1231
+ };
1232
+ get getConstraint(): {
1233
+ (): Type | undefined;
1234
+ gen(): Generator<ProtocolRequest, Type | undefined, ProtocolResponse["result"]>;
1235
+ };
1236
+ get getDefault(): {
1237
+ (): Type | undefined;
1238
+ gen(): Generator<ProtocolRequest, Type | undefined, ProtocolResponse["result"]>;
1239
+ };
1240
+ get getTrueType(): {
1241
+ (): Type;
1242
+ gen(): Generator<ProtocolRequest, Type, ProtocolResponse["result"]>;
1243
+ };
1244
+ get getFalseType(): {
1245
+ (): Type;
1246
+ gen(): Generator<ProtocolRequest, Type, ProtocolResponse["result"]>;
1247
+ };
668
1248
  /**
669
1249
  * Get the base types of this type. Returns `undefined` for any type that is
670
1250
  * not a class or interface.
671
1251
  */
672
- getBaseTypes(): readonly Type[] | undefined;
1252
+ get getBaseTypes(): {
1253
+ (): readonly Type[] | undefined;
1254
+ gen(): Generator<ProtocolRequest, readonly Type[] | undefined, ProtocolResponse["result"]>;
1255
+ };
673
1256
  isClassOrInterface(): this is InterfaceType;
674
1257
  isUnionType(): this is UnionType;
675
1258
  isIntersectionType(): this is IntersectionType;
@@ -682,7 +1265,8 @@ declare class TypeObject implements Type {
682
1265
  isBigIntLiteralType(): this is BigIntLiteralType;
683
1266
  isBooleanLiteralType(): this is BooleanLiteralType;
684
1267
  isTypeReference(): this is TypeReference;
685
- isTupleType(): this is TupleType;
1268
+ isTupleType(): this is TupleTypeReference;
1269
+ isTupleTypeTarget(): this is TupleType;
686
1270
  isIndexType(): this is IndexType;
687
1271
  isIndexedAccessType(): this is IndexedAccessType;
688
1272
  isConditionalType(): this is ConditionalType;
@@ -709,7 +1293,8 @@ export declare function isNumberLiteralType(type: Type): type is NumberLiteralTy
709
1293
  export declare function isBigIntLiteralType(type: Type): type is BigIntLiteralType;
710
1294
  export declare function isBooleanLiteralType(type: Type): type is BooleanLiteralType;
711
1295
  export declare function isTypeReference(type: Type): type is TypeReference;
712
- export declare function isTupleType(type: Type): type is TupleType;
1296
+ export declare function isTupleType(type: Type): type is TupleTypeReference;
1297
+ export declare function isTupleTypeTarget(type: Type): type is TupleType;
713
1298
  export declare function isIndexType(type: Type): type is IndexType;
714
1299
  export declare function isIndexedAccessType(type: Type): type is IndexedAccessType;
715
1300
  export declare function isConditionalType(type: Type): type is ConditionalType;
@@ -728,12 +1313,30 @@ export declare class Signature {
728
1313
  readonly target?: number | undefined;
729
1314
  private returnType;
730
1315
  constructor(data: SignatureResponse, project: Project, objectRegistry: ProjectObjectRegistry);
731
- getTypeParameters(): readonly TypeParameter[];
732
- getParameters(): readonly Symbol[];
733
- getThisParameter(): Symbol | undefined;
734
- getTarget(): Signature | undefined;
735
- getReturnType(): Type;
736
- getTypeParameterAtPosition(pos: number): Type;
1316
+ get getTypeParameters(): {
1317
+ (): readonly TypeParameter[];
1318
+ gen(): Generator<ProtocolRequest, readonly TypeParameter[], ProtocolResponse["result"]>;
1319
+ };
1320
+ get getParameters(): {
1321
+ (): readonly Symbol[];
1322
+ gen(): Generator<ProtocolRequest, readonly Symbol[], ProtocolResponse["result"]>;
1323
+ };
1324
+ get getThisParameter(): {
1325
+ (): Symbol | undefined;
1326
+ gen(): Generator<ProtocolRequest, Symbol | undefined, ProtocolResponse["result"]>;
1327
+ };
1328
+ get getTarget(): {
1329
+ (): Signature | undefined;
1330
+ gen(): Generator<ProtocolRequest, Signature | undefined, ProtocolResponse["result"]>;
1331
+ };
1332
+ get getReturnType(): {
1333
+ (): Type;
1334
+ gen(): Generator<ProtocolRequest, Type, ProtocolResponse["result"]>;
1335
+ };
1336
+ get getTypeParameterAtPosition(): {
1337
+ (pos: number): Type;
1338
+ gen(pos: number): Generator<ProtocolRequest, Type, ProtocolResponse["result"]>;
1339
+ };
737
1340
  get hasRestParameter(): boolean;
738
1341
  get isConstruct(): boolean;
739
1342
  get isAbstract(): boolean;