typescript 7.0.2 → 7.1.0-beta
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 +5 -36
- package/dist/api/async/api.d.ts +597 -122
- package/dist/api/async/api.d.ts.map +1 -1
- package/dist/api/async/api.js +1775 -333
- package/dist/api/async/api.js.map +1 -1
- package/dist/api/async/client.d.ts +18 -2
- package/dist/api/async/client.d.ts.map +1 -1
- package/dist/api/async/client.js +255 -68
- package/dist/api/async/client.js.map +1 -1
- package/dist/api/async/types.d.ts +99 -34
- package/dist/api/async/types.d.ts.map +1 -1
- package/dist/api/compilerOptions.generated.d.ts +123 -0
- package/dist/api/compilerOptions.generated.d.ts.map +1 -0
- package/dist/api/compilerOptions.generated.js +8 -0
- package/dist/api/compilerOptions.generated.js.map +1 -0
- package/dist/api/diagnosticFormatter.d.ts +9 -0
- package/dist/api/diagnosticFormatter.d.ts.map +1 -0
- package/dist/api/diagnosticFormatter.js +169 -0
- package/dist/api/diagnosticFormatter.js.map +1 -0
- package/dist/api/fs.d.ts +68 -13
- package/dist/api/fs.d.ts.map +1 -1
- package/dist/api/fs.js +62 -101
- package/dist/api/fs.js.map +1 -1
- package/dist/api/fsCallbacks.d.ts +27 -0
- package/dist/api/fsCallbacks.d.ts.map +1 -0
- package/dist/api/fsCallbacks.js +111 -0
- package/dist/api/fsCallbacks.js.map +1 -0
- package/dist/api/node/encoder.d.ts +3 -0
- package/dist/api/node/encoder.d.ts.map +1 -1
- package/dist/api/node/encoder.generated.js +2 -2
- package/dist/api/node/encoder.generated.js.map +1 -1
- package/dist/api/node/encoder.js +20 -15
- 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 -3
- package/dist/api/node/msgpack.js.map +1 -1
- package/dist/api/node/node.d.ts +28 -9
- package/dist/api/node/node.d.ts.map +1 -1
- package/dist/api/node/node.generated.d.ts +9 -2
- package/dist/api/node/node.generated.d.ts.map +1 -1
- package/dist/api/node/node.generated.js +55 -6
- package/dist/api/node/node.generated.js.map +1 -1
- package/dist/api/node/node.infrastructure.d.ts +6 -4
- package/dist/api/node/node.infrastructure.d.ts.map +1 -1
- package/dist/api/node/node.infrastructure.js +20 -40
- package/dist/api/node/node.infrastructure.js.map +1 -1
- package/dist/api/node/node.js +178 -23
- package/dist/api/node/node.js.map +1 -1
- package/dist/api/node/protocol.d.ts +5 -2
- package/dist/api/node/protocol.d.ts.map +1 -1
- package/dist/api/node/protocol.generated.js +2 -2
- package/dist/api/node/protocol.generated.js.map +1 -1
- package/dist/api/node/protocol.js +5 -2
- package/dist/api/node/protocol.js.map +1 -1
- package/dist/api/node/wtf8.d.ts +6 -2
- package/dist/api/node/wtf8.d.ts.map +1 -1
- package/dist/api/node/wtf8.js +71 -2
- package/dist/api/node/wtf8.js.map +1 -1
- package/dist/api/options.d.ts +19 -7
- package/dist/api/options.d.ts.map +1 -1
- package/dist/api/options.js +21 -0
- package/dist/api/options.js.map +1 -1
- package/dist/api/path.d.ts +49 -39
- package/dist/api/path.d.ts.map +1 -1
- package/dist/api/path.js +409 -33
- package/dist/api/path.js.map +1 -1
- package/dist/api/prepareCompilerOptions.generated.d.ts +5 -0
- package/dist/api/prepareCompilerOptions.generated.d.ts.map +1 -0
- package/dist/api/prepareCompilerOptions.generated.js +24 -0
- package/dist/api/prepareCompilerOptions.generated.js.map +1 -0
- package/dist/api/proto.d.ts +58 -217
- package/dist/api/proto.d.ts.map +1 -1
- package/dist/api/proto.generated.d.ts +1419 -0
- package/dist/api/proto.generated.d.ts.map +1 -0
- package/dist/api/proto.generated.js +21 -0
- package/dist/api/proto.generated.js.map +1 -0
- package/dist/api/proto.js +28 -15
- package/dist/api/proto.js.map +1 -1
- package/dist/api/sourceFileCache.d.ts +51 -20
- package/dist/api/sourceFileCache.d.ts.map +1 -1
- package/dist/api/sourceFileCache.js +168 -37
- package/dist/api/sourceFileCache.js.map +1 -1
- package/dist/api/sync/api.d.ts +1365 -220
- package/dist/api/sync/api.d.ts.map +1 -1
- package/dist/api/sync/api.js +4673 -930
- package/dist/api/sync/api.js.map +1 -1
- package/dist/api/sync/client.d.ts +8 -2
- package/dist/api/sync/client.d.ts.map +1 -1
- package/dist/api/sync/client.js +80 -30
- package/dist/api/sync/client.js.map +1 -1
- package/dist/api/sync/generatorSupport.d.ts +32 -0
- package/dist/api/sync/generatorSupport.d.ts.map +1 -0
- package/dist/api/sync/generatorSupport.js +338 -0
- package/dist/api/sync/generatorSupport.js.map +1 -0
- package/dist/api/sync/types.d.ts +248 -56
- package/dist/api/sync/types.d.ts.map +1 -1
- package/dist/api/syncChannel.d.ts +3 -0
- package/dist/api/syncChannel.d.ts.map +1 -1
- package/dist/api/syncChannel.js +20 -2
- package/dist/api/syncChannel.js.map +1 -1
- package/dist/api/timing.d.ts +2 -2
- package/dist/api/timing.d.ts.map +1 -1
- package/dist/api/timing.js +1 -1
- package/dist/api/timing.js.map +1 -1
- package/dist/api/timingDump.d.ts +13 -0
- package/dist/api/timingDump.d.ts.map +1 -0
- package/dist/api/timingDump.js +38 -0
- package/dist/api/timingDump.js.map +1 -0
- package/dist/api/typedPaths.d.ts +3 -0
- package/dist/api/typedPaths.d.ts.map +1 -0
- package/dist/api/typedPaths.js +2 -0
- package/dist/api/typedPaths.js.map +1 -0
- package/dist/api/userPreferences.generated.d.ts +195 -0
- package/dist/api/userPreferences.generated.d.ts.map +1 -0
- package/dist/api/userPreferences.generated.js +3 -0
- package/dist/api/userPreferences.generated.js.map +1 -0
- package/dist/ast/ast.d.ts +90 -7
- package/dist/ast/ast.d.ts.map +1 -1
- package/dist/ast/ast.generated.d.ts +45 -39
- package/dist/ast/ast.generated.d.ts.map +1 -1
- package/dist/ast/ast.generated.js +1 -1
- package/dist/ast/ast.generated.js.map +1 -1
- package/dist/ast/ast.js +1 -0
- package/dist/ast/ast.js.map +1 -1
- package/dist/ast/astnav.d.ts +3 -2
- package/dist/ast/astnav.d.ts.map +1 -1
- package/dist/ast/astnav.js +148 -3
- package/dist/ast/astnav.js.map +1 -1
- package/dist/ast/factory.generated.d.ts +8 -154
- package/dist/ast/factory.generated.d.ts.map +1 -1
- package/dist/ast/factory.generated.js +2701 -7
- package/dist/ast/factory.generated.js.map +1 -1
- package/dist/ast/index.d.ts +5 -0
- package/dist/ast/index.d.ts.map +1 -1
- package/dist/ast/index.js +5 -0
- package/dist/ast/index.js.map +1 -1
- package/dist/ast/is.d.ts +2 -12
- package/dist/ast/is.d.ts.map +1 -1
- package/dist/ast/is.generated.d.ts +889 -1
- package/dist/ast/is.generated.d.ts.map +1 -1
- package/dist/ast/is.generated.js +300 -3
- package/dist/ast/is.generated.js.map +1 -1
- package/dist/ast/is.js +224 -1
- package/dist/ast/is.js.map +1 -1
- package/dist/ast/jsdoc.d.ts +2 -1
- package/dist/ast/jsdoc.d.ts.map +1 -1
- package/dist/ast/jsdoc.js +14 -8
- package/dist/ast/jsdoc.js.map +1 -1
- package/dist/ast/modifiers.d.ts +4 -0
- package/dist/ast/modifiers.d.ts.map +1 -0
- package/dist/ast/modifiers.js +41 -0
- package/dist/ast/modifiers.js.map +1 -0
- package/dist/ast/scanner.d.ts.map +1 -1
- package/dist/ast/scanner.js +2 -1
- package/dist/ast/scanner.js.map +1 -1
- package/dist/ast/spanMap.d.ts +88 -0
- package/dist/ast/spanMap.d.ts.map +1 -0
- package/dist/ast/spanMap.js +417 -0
- package/dist/ast/spanMap.js.map +1 -0
- package/dist/ast/utils.d.ts +14 -1
- package/dist/ast/utils.d.ts.map +1 -1
- package/dist/ast/utils.js +251 -0
- package/dist/ast/utils.js.map +1 -1
- package/dist/ast/visitor.d.ts +2 -0
- package/dist/ast/visitor.d.ts.map +1 -1
- package/dist/ast/visitor.generated.d.ts.map +1 -1
- package/dist/ast/visitor.generated.js +5 -4
- package/dist/ast/visitor.generated.js.map +1 -1
- package/dist/ast/visitor.js +40 -0
- package/dist/ast/visitor.js.map +1 -1
- package/dist/enums/caseSensitivity.d.ts +2 -0
- package/dist/enums/caseSensitivity.d.ts.map +1 -0
- package/dist/enums/caseSensitivity.enum.d.ts +5 -0
- package/dist/enums/caseSensitivity.enum.d.ts.map +1 -0
- package/dist/enums/caseSensitivity.enum.js +7 -0
- package/dist/enums/caseSensitivity.enum.js.map +1 -0
- package/dist/enums/caseSensitivity.js +7 -0
- package/dist/enums/caseSensitivity.js.map +1 -0
- package/dist/enums/checkFlags.d.ts +2 -0
- package/dist/enums/checkFlags.d.ts.map +1 -0
- package/dist/enums/checkFlags.enum.d.ts +34 -0
- package/dist/enums/checkFlags.enum.d.ts.map +1 -0
- package/dist/enums/checkFlags.enum.js +36 -0
- package/dist/enums/checkFlags.enum.js.map +1 -0
- package/dist/enums/checkFlags.js +36 -0
- package/dist/enums/checkFlags.js.map +1 -0
- package/dist/enums/completionItemKind.enum.js +1 -1
- package/dist/enums/completionItemKind.enum.js.map +1 -1
- package/dist/enums/completionItemKind.js +1 -1
- package/dist/enums/completionItemKind.js.map +1 -1
- package/dist/enums/diagnosticCategory.enum.js +1 -1
- package/dist/enums/diagnosticCategory.enum.js.map +1 -1
- package/dist/enums/diagnosticCategory.js +1 -1
- package/dist/enums/diagnosticCategory.js.map +1 -1
- package/dist/enums/diagnosticDirectivePolicy.d.ts +2 -0
- package/dist/enums/diagnosticDirectivePolicy.d.ts.map +1 -0
- package/dist/enums/diagnosticDirectivePolicy.enum.d.ts +5 -0
- package/dist/enums/diagnosticDirectivePolicy.enum.d.ts.map +1 -0
- package/dist/enums/diagnosticDirectivePolicy.enum.js +7 -0
- package/dist/enums/diagnosticDirectivePolicy.enum.js.map +1 -0
- package/dist/enums/diagnosticDirectivePolicy.js +7 -0
- package/dist/enums/diagnosticDirectivePolicy.js.map +1 -0
- package/dist/enums/elementFlags.enum.js +1 -1
- package/dist/enums/elementFlags.enum.js.map +1 -1
- package/dist/enums/elementFlags.js +1 -1
- package/dist/enums/elementFlags.js.map +1 -1
- package/dist/enums/emitOnly.d.ts +2 -0
- package/dist/enums/emitOnly.d.ts.map +1 -0
- package/dist/enums/emitOnly.enum.d.ts +6 -0
- package/dist/enums/emitOnly.enum.d.ts.map +1 -0
- package/dist/enums/emitOnly.enum.js +8 -0
- package/dist/enums/emitOnly.enum.js.map +1 -0
- package/dist/enums/emitOnly.js +8 -0
- package/dist/enums/emitOnly.js.map +1 -0
- package/dist/enums/indexKind.d.ts +2 -0
- package/dist/enums/indexKind.d.ts.map +1 -0
- package/dist/enums/indexKind.enum.d.ts +5 -0
- package/dist/enums/indexKind.enum.d.ts.map +1 -0
- package/dist/enums/indexKind.enum.js +7 -0
- package/dist/enums/indexKind.enum.js.map +1 -0
- package/dist/enums/indexKind.js +7 -0
- package/dist/enums/indexKind.js.map +1 -0
- package/dist/enums/internalSymbolName.enum.js +1 -1
- package/dist/enums/internalSymbolName.enum.js.map +1 -1
- package/dist/enums/internalSymbolName.js +1 -1
- package/dist/enums/internalSymbolName.js.map +1 -1
- package/dist/enums/jsDeclarationKind.d.ts +2 -0
- package/dist/enums/jsDeclarationKind.d.ts.map +1 -0
- package/dist/enums/jsDeclarationKind.enum.d.ts +10 -0
- package/dist/enums/jsDeclarationKind.enum.d.ts.map +1 -0
- package/dist/enums/jsDeclarationKind.enum.js +12 -0
- package/dist/enums/jsDeclarationKind.enum.js.map +1 -0
- package/dist/enums/jsDeclarationKind.js +12 -0
- package/dist/enums/jsDeclarationKind.js.map +1 -0
- package/dist/enums/jsxEmit.enum.d.ts +2 -2
- package/dist/enums/jsxEmit.enum.d.ts.map +1 -1
- package/dist/enums/jsxEmit.enum.js +3 -3
- package/dist/enums/jsxEmit.enum.js.map +1 -1
- package/dist/enums/jsxEmit.js +3 -3
- package/dist/enums/jsxEmit.js.map +1 -1
- package/dist/enums/modifierFlags.enum.js +1 -1
- package/dist/enums/modifierFlags.enum.js.map +1 -1
- package/dist/enums/modifierFlags.js +1 -1
- package/dist/enums/modifierFlags.js.map +1 -1
- package/dist/enums/moduleDetectionKind.enum.js +1 -1
- package/dist/enums/moduleDetectionKind.enum.js.map +1 -1
- package/dist/enums/moduleDetectionKind.js +1 -1
- package/dist/enums/moduleDetectionKind.js.map +1 -1
- package/dist/enums/moduleKind.enum.js +1 -1
- package/dist/enums/moduleKind.enum.js.map +1 -1
- package/dist/enums/moduleKind.js +1 -1
- package/dist/enums/moduleKind.js.map +1 -1
- package/dist/enums/moduleResolutionKind.enum.js +1 -1
- package/dist/enums/moduleResolutionKind.enum.js.map +1 -1
- package/dist/enums/moduleResolutionKind.js +1 -1
- package/dist/enums/moduleResolutionKind.js.map +1 -1
- package/dist/enums/newLineKind.enum.js +1 -1
- package/dist/enums/newLineKind.enum.js.map +1 -1
- package/dist/enums/newLineKind.js +1 -1
- package/dist/enums/newLineKind.js.map +1 -1
- package/dist/enums/nodeBuilderFlags.enum.js +1 -1
- package/dist/enums/nodeBuilderFlags.enum.js.map +1 -1
- package/dist/enums/nodeBuilderFlags.js +1 -1
- package/dist/enums/nodeBuilderFlags.js.map +1 -1
- package/dist/enums/nodeFlags.enum.js +1 -1
- package/dist/enums/nodeFlags.enum.js.map +1 -1
- package/dist/enums/nodeFlags.js +1 -1
- package/dist/enums/nodeFlags.js.map +1 -1
- package/dist/enums/objectFlags.enum.d.ts +3 -2
- package/dist/enums/objectFlags.enum.d.ts.map +1 -1
- package/dist/enums/objectFlags.enum.js +4 -3
- package/dist/enums/objectFlags.enum.js.map +1 -1
- package/dist/enums/objectFlags.js +4 -3
- package/dist/enums/objectFlags.js.map +1 -1
- package/dist/enums/outerExpressionKinds.enum.js +1 -1
- package/dist/enums/outerExpressionKinds.enum.js.map +1 -1
- package/dist/enums/outerExpressionKinds.js +1 -1
- package/dist/enums/outerExpressionKinds.js.map +1 -1
- package/dist/enums/scriptKind.d.ts.map +1 -1
- package/dist/enums/scriptKind.enum.d.ts +1 -3
- package/dist/enums/scriptKind.enum.d.ts.map +1 -1
- package/dist/enums/scriptKind.enum.js +1 -2
- package/dist/enums/scriptKind.enum.js.map +1 -1
- package/dist/enums/scriptKind.js +1 -2
- package/dist/enums/scriptKind.js.map +1 -1
- package/dist/enums/scriptTarget.d.ts.map +1 -1
- package/dist/enums/scriptTarget.enum.d.ts +1 -0
- package/dist/enums/scriptTarget.enum.d.ts.map +1 -1
- package/dist/enums/scriptTarget.enum.js +2 -0
- package/dist/enums/scriptTarget.enum.js.map +1 -1
- package/dist/enums/scriptTarget.js +2 -0
- package/dist/enums/scriptTarget.js.map +1 -1
- package/dist/enums/signatureFlags.enum.js +1 -1
- package/dist/enums/signatureFlags.enum.js.map +1 -1
- package/dist/enums/signatureFlags.js +1 -1
- package/dist/enums/signatureFlags.js.map +1 -1
- package/dist/enums/signatureKind.enum.js +1 -1
- package/dist/enums/signatureKind.enum.js.map +1 -1
- package/dist/enums/signatureKind.js +1 -1
- package/dist/enums/signatureKind.js.map +1 -1
- package/dist/enums/spanMapFeature.d.ts +2 -0
- package/dist/enums/spanMapFeature.d.ts.map +1 -0
- package/dist/enums/spanMapFeature.enum.d.ts +25 -0
- package/dist/enums/spanMapFeature.enum.d.ts.map +1 -0
- package/dist/enums/spanMapFeature.enum.js +27 -0
- package/dist/enums/spanMapFeature.enum.js.map +1 -0
- package/dist/enums/spanMapFeature.js +27 -0
- package/dist/enums/spanMapFeature.js.map +1 -0
- package/dist/enums/spanMapFidelity.d.ts +2 -0
- package/dist/enums/spanMapFidelity.d.ts.map +1 -0
- package/dist/enums/spanMapFidelity.enum.d.ts +7 -0
- package/dist/enums/spanMapFidelity.enum.d.ts.map +1 -0
- package/dist/enums/spanMapFidelity.enum.js +9 -0
- package/dist/enums/spanMapFidelity.enum.js.map +1 -0
- package/dist/enums/spanMapFidelity.js +9 -0
- package/dist/enums/spanMapFidelity.js.map +1 -0
- package/dist/enums/spanMapKind.d.ts +2 -0
- package/dist/enums/spanMapKind.d.ts.map +1 -0
- package/dist/enums/spanMapKind.enum.d.ts +6 -0
- package/dist/enums/spanMapKind.enum.d.ts.map +1 -0
- package/dist/enums/spanMapKind.enum.js +8 -0
- package/dist/enums/spanMapKind.enum.js.map +1 -0
- package/dist/enums/spanMapKind.js +8 -0
- package/dist/enums/spanMapKind.js.map +1 -0
- package/dist/enums/symbolFlags.enum.d.ts +1 -2
- package/dist/enums/symbolFlags.enum.d.ts.map +1 -1
- package/dist/enums/symbolFlags.enum.js +2 -3
- package/dist/enums/symbolFlags.enum.js.map +1 -1
- package/dist/enums/symbolFlags.js +2 -3
- package/dist/enums/symbolFlags.js.map +1 -1
- package/dist/enums/symbolOwnerKind.d.ts +2 -0
- package/dist/enums/symbolOwnerKind.d.ts.map +1 -0
- package/dist/enums/symbolOwnerKind.enum.d.ts +5 -0
- package/dist/enums/symbolOwnerKind.enum.d.ts.map +1 -0
- package/dist/enums/symbolOwnerKind.enum.js +7 -0
- package/dist/enums/symbolOwnerKind.enum.js.map +1 -0
- package/dist/enums/symbolOwnerKind.js +7 -0
- package/dist/enums/symbolOwnerKind.js.map +1 -0
- package/dist/enums/syntaxKind.enum.d.ts +198 -197
- package/dist/enums/syntaxKind.enum.d.ts.map +1 -1
- package/dist/enums/syntaxKind.enum.js +199 -198
- package/dist/enums/syntaxKind.enum.js.map +1 -1
- package/dist/enums/syntaxKind.js +199 -198
- package/dist/enums/syntaxKind.js.map +1 -1
- package/dist/enums/tokenFlags.enum.js +1 -1
- package/dist/enums/tokenFlags.enum.js.map +1 -1
- package/dist/enums/tokenFlags.js +1 -1
- package/dist/enums/tokenFlags.js.map +1 -1
- package/dist/enums/typeFlags.enum.js +1 -1
- package/dist/enums/typeFlags.enum.js.map +1 -1
- package/dist/enums/typeFlags.js +1 -1
- package/dist/enums/typeFlags.js.map +1 -1
- package/dist/enums/typeFormatFlags.d.ts +2 -0
- package/dist/enums/typeFormatFlags.d.ts.map +1 -0
- package/dist/enums/typeFormatFlags.enum.d.ts +29 -0
- package/dist/enums/typeFormatFlags.enum.d.ts.map +1 -0
- package/dist/enums/typeFormatFlags.enum.js +31 -0
- package/dist/enums/typeFormatFlags.enum.js.map +1 -0
- package/dist/enums/typeFormatFlags.js +31 -0
- package/dist/enums/typeFormatFlags.js.map +1 -0
- package/dist/enums/typePredicateKind.enum.js +1 -1
- package/dist/enums/typePredicateKind.enum.js.map +1 -1
- package/dist/enums/typePredicateKind.js +1 -1
- package/dist/enums/typePredicateKind.js.map +1 -1
- package/dist/internal/utils.js.map +1 -1
- package/dist/vscode/extensionApi.d.ts +101 -0
- package/dist/vscode/extensionApi.d.ts.map +1 -0
- package/dist/vscode/extensionApi.js +2 -0
- package/dist/vscode/extensionApi.js.map +1 -0
- package/dist/vscode/moduleLoader.d.ts +14 -0
- package/dist/vscode/moduleLoader.d.ts.map +1 -0
- package/dist/vscode/moduleLoader.js +36 -0
- package/dist/vscode/moduleLoader.js.map +1 -0
- package/dist/vscode/protocol.generated.d.ts +2886 -0
- package/dist/vscode/protocol.generated.d.ts.map +1 -0
- package/dist/vscode/protocol.generated.js +4 -0
- package/dist/vscode/protocol.generated.js.map +1 -0
- package/lib/getExePath.js +2 -2
- package/lib/version.cjs +1 -1
- package/lib/version.d.cts +1 -1
- package/package.json +40 -34
- package/schemas/jsconfig.schema.json +2207 -0
- package/schemas/tsconfig.schema.json +2206 -0
- package/vendor/vscode-jsonrpc/lib/node/main.js +1 -1
- package/vendor/vscode-jsonrpc/package.json +1 -1
- package/dist/api/compilerOptions.d.ts +0 -109
- package/dist/api/compilerOptions.d.ts.map +0 -1
- package/dist/api/compilerOptions.js +0 -2
- package/dist/api/compilerOptions.js.map +0 -1
package/dist/api/sync/api.d.ts
CHANGED
|
@@ -1,44 +1,217 @@
|
|
|
1
|
-
|
|
1
|
+
import type { APIRequest as ProtocolRequest, APIResponse as ProtocolResponse } from "../proto.ts";
|
|
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";
|
|
6
|
+
import { EmitOnly } from "#enums/emitOnly";
|
|
7
|
+
import { IndexKind } from "#enums/indexKind";
|
|
8
|
+
import { JsxEmit } from "#enums/jsxEmit";
|
|
5
9
|
import { ModuleKind } from "#enums/moduleKind";
|
|
10
|
+
import { ModuleResolutionKind } from "#enums/moduleResolutionKind";
|
|
6
11
|
import { NodeBuilderFlags } from "#enums/nodeBuilderFlags";
|
|
7
12
|
import { ObjectFlags } from "#enums/objectFlags";
|
|
13
|
+
import { ScriptKind } from "#enums/scriptKind";
|
|
8
14
|
import { SignatureFlags } from "#enums/signatureFlags";
|
|
9
15
|
import { SignatureKind } from "#enums/signatureKind";
|
|
10
16
|
import { SymbolFlags } from "#enums/symbolFlags";
|
|
17
|
+
import { SymbolOwnerKind } from "#enums/symbolOwnerKind";
|
|
11
18
|
import { TypeFlags } from "#enums/typeFlags";
|
|
19
|
+
import { TypeFormatFlags } from "#enums/typeFormatFlags";
|
|
12
20
|
import { TypePredicateKind } from "#enums/typePredicateKind";
|
|
13
|
-
import { type __String, type Expression, type Identifier, ModifierFlags, type Node, type
|
|
21
|
+
import { type __String, type CallLikeExpression, type Declaration, type Expression, type FileReference, type Identifier, ModifierFlags, type NamedTupleMember, type Node, type ParameterDeclaration, type PathKey, type RootedDirectoryPath, type RootedFilePath, type SourceFile, type StringLiteralLikeNode, type SyntaxKind, type TypeNode } from "../../ast/index.ts";
|
|
14
22
|
import type { APIOptions, LSPConnectionOptions } from "../options.ts";
|
|
15
|
-
import type { CompilerOptions,
|
|
16
|
-
import {
|
|
23
|
+
import type { BuildResponse, CleanBuildResponse, CompactSymbolReference, CompilerOptions, CompletionPreferences, ConfiguredProjectId, CreateBuildOrchestratorResponse, CreateProgramOptions as ProtocolCreateProgramOptions, CreateSnapshotParams as ProtocolCreateSnapshotParams, CreateSnapshotProgramParams as ProtocolCreateSnapshotProgramParams, CreateSnapshotResponse, CreateSourceFileOptions, Diagnostic, DocumentIdentifier, DocumentPosition, FileNotifications, InferredProjectId, LanguageServerSnapshotChanges as ProtocolLanguageServerSnapshotChanges, ModuleResolutionEntry, ModuleResolutionSpec, PackageId, ParsedCommandLine, ProjectId, ProjectReference, ProjectResponse, ProtocolSymbolResponse, RawCompilerOptions, ReadConfigFileResponse, ReconfigureSnapshotProgramParams as ProtocolReconfigureSnapshotProgramParams, ResolutionMode, ResolvedModule, ResolvedTypeReferenceDirective, ResolveModuleNameResult, SignaturePropertyMethod, SignatureResponse, SourceFileMetadata, StaticModuleResolution, SymbolPropertyMethod, SymbolResponse, SymbolsPropertyMethod, SyntheticProjectId, TextEdit, TypeAcquisition, TypePropertyMethod, TypeResponse, TypesPropertyMethod, UserPreferences } from "../proto.ts";
|
|
24
|
+
import { type CachedSourceFile } from "../sourceFileCache.ts";
|
|
17
25
|
import type { RequestTiming, TimingAccumulators, TimingInfo } from "../timing.ts";
|
|
18
26
|
import { Client, type ClientSocketOptions, type ClientSpawnOptions } from "./client.ts";
|
|
19
|
-
import type { AssertsIdentifierTypePredicate, AssertsThisTypePredicate, BigIntLiteralType, BooleanLiteralType, CompletionEntry, CompletionInfo, CompletionOptions, ConditionalType,
|
|
27
|
+
import type { AssertsIdentifierTypePredicate, AssertsThisTypePredicate, BigIntLiteralType, BooleanLiteralType, CompletionEntry, CompletionInfo, CompletionOptions, ConditionalType, EmitOutput, EmitOutputFile, EmitResult, FormatDiagnosticsHost, FreshableType, GenericType, GetImportEditsForSymbolsOptions, IdentifierTypePredicate, ImportAdderAction as APIImportAdderAction, IndexedAccessType, IndexInfo, IndexType, InterfaceType, IntersectionType, IntrinsicType, JSDocTagInfo, LiteralType, MappedType, NumberLiteralType, ObjectType, StringLiteralType, StringMappingType, StructuredType, SubstitutionType, TemplateLiteralType, ThisTypePredicate, TupleType, TupleTypeReference, Type, TypeParameter, TypePredicate, TypePredicateBase, TypeReference, UnionOrIntersectionType, UnionType } from "./types.ts";
|
|
28
|
+
export { formatDiagnostics, formatDiagnosticsWithColorAndContext } from "../diagnosticFormatter.ts";
|
|
20
29
|
export { documentURIToFileName, fileNameToDocumentURI } from "../path.ts";
|
|
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 };
|
|
23
|
-
export
|
|
24
|
-
|
|
25
|
-
|
|
30
|
+
export { CheckFlags, CompletionItemKind, DiagnosticCategory, ElementFlags, EmitOnly, IndexKind, JsxEmit, ModifierFlags, ModuleKind, ModuleResolutionKind, NodeBuilderFlags, ObjectFlags, ScriptKind, SignatureFlags, SignatureKind, SymbolFlags, SymbolOwnerKind, TypeFlags, TypeFormatFlags, TypePredicateKind };
|
|
31
|
+
export type { APIImportAdderAction as ImportAdderAction, APIOptions, AssertsIdentifierTypePredicate, AssertsThisTypePredicate, BigIntLiteralType, BooleanLiteralType, ClientSocketOptions, ClientSpawnOptions, CompilerOptions, CompletionEntry, CompletionInfo, CompletionOptions, CompletionPreferences, ConditionalType, ConfiguredProjectId, CreateSourceFileOptions, Diagnostic, DocumentIdentifier, DocumentPosition, EmitOutput, EmitOutputFile, EmitResult, FileNotifications, FormatDiagnosticsHost, FreshableType, GenericType, GetImportEditsForSymbolsOptions, IdentifierTypePredicate, IndexedAccessType, IndexInfo, IndexType, InferredProjectId, InterfaceType, IntersectionType, IntrinsicType, JSDocTagInfo, LiteralType, LSPConnectionOptions, MappedType, ModuleResolutionEntry, ModuleResolutionSpec, NumberLiteralType, ObjectType, PackageId, ParsedCommandLine, ProjectId, ProjectReference, RawCompilerOptions, ReadConfigFileResponse, RequestTiming, ResolutionMode, ResolvedModule, ResolvedTypeReferenceDirective, ResolveModuleNameResult, SourceFileMetadata, StaticModuleResolution, StringLiteralType, StringMappingType, StructuredType, SubstitutionType, SyntheticProjectId, TemplateLiteralType, TextEdit, ThisTypePredicate, TimingAccumulators, TimingInfo, TupleType, TupleTypeReference, Type, TypeAcquisition, TypeParameter, TypePredicate, TypePredicateBase, TypeReference, UnionOrIntersectionType, UnionType, UserPreferences, };
|
|
32
|
+
export interface ModuleResolverOptions {
|
|
33
|
+
moduleResolutions?: ModuleResolutionSpec | undefined;
|
|
34
|
+
resolveModuleName?: ResolveModuleNameCallback | undefined;
|
|
35
|
+
}
|
|
36
|
+
export interface ResolveModuleNameCallbackOptions {
|
|
37
|
+
snapshot: Snapshot | InProgressSnapshot | undefined;
|
|
38
|
+
}
|
|
39
|
+
declare const inProgressSnapshotBrand: unique symbol;
|
|
40
|
+
export type InProgressSnapshot = number & {
|
|
41
|
+
readonly [inProgressSnapshotBrand]: never;
|
|
42
|
+
};
|
|
43
|
+
export type ResolveModuleNameCallback = (moduleName: string, containingDirectory: string, resolutionMode: ResolutionMode | undefined, options: ResolveModuleNameCallbackOptions) => StaticModuleResolution | undefined;
|
|
44
|
+
export type CreateProgramOptions = Omit<ProtocolCreateProgramOptions, "moduleResolver" | "projectReferences"> & {
|
|
45
|
+
moduleResolver?: ModuleResolver | undefined;
|
|
46
|
+
projectReferences?: readonly (Omit<ProjectReference, "path"> & {
|
|
47
|
+
path: string;
|
|
48
|
+
})[] | undefined;
|
|
49
|
+
};
|
|
50
|
+
export type CreateSnapshotProgramParams = Omit<ProtocolCreateSnapshotProgramParams, "options"> & {
|
|
51
|
+
options?: CreateProgramOptions | undefined;
|
|
52
|
+
};
|
|
53
|
+
export type ReconfigureSnapshotProgramParams = Omit<ProtocolReconfigureSnapshotProgramParams, "options"> & {
|
|
54
|
+
options?: CreateProgramOptions | undefined;
|
|
55
|
+
};
|
|
56
|
+
export type CreateSnapshotParams = Omit<ProtocolCreateSnapshotParams, "createPrograms" | "reconfigurePrograms"> & {
|
|
57
|
+
createPrograms?: readonly CreateSnapshotProgramParams[] | undefined;
|
|
58
|
+
reconfigurePrograms?: readonly ReconfigureSnapshotProgramParams[] | undefined;
|
|
59
|
+
};
|
|
60
|
+
export type LanguageServerSnapshotChanges = Omit<ProtocolLanguageServerSnapshotChanges, "createPrograms" | "reconfigurePrograms"> & {
|
|
61
|
+
createPrograms?: readonly CreateSnapshotProgramParams[] | undefined;
|
|
62
|
+
reconfigurePrograms?: readonly ReconfigureSnapshotProgramParams[] | undefined;
|
|
63
|
+
};
|
|
64
|
+
export interface TranspileOptions {
|
|
65
|
+
compilerOptions?: RawCompilerOptions | undefined;
|
|
66
|
+
fileName?: string | undefined;
|
|
67
|
+
reportDiagnostics?: boolean | undefined;
|
|
68
|
+
}
|
|
69
|
+
export interface TranspileOutput {
|
|
70
|
+
outputText: string;
|
|
71
|
+
diagnostics?: readonly Diagnostic[] | undefined;
|
|
72
|
+
sourceMapText?: string | undefined;
|
|
73
|
+
}
|
|
74
|
+
export { all, type AllAPIRequestGenerator, type AnyAPIRequestGenerator, type APIRequestGenerator, defer, type DeferredAPIRequestGenerator, type ExecutedGeneratorsResults } from "./generatorSupport.ts";
|
|
75
|
+
import { type AnyAPIRequestGenerator, type ExecutedGeneratorsResults } from "./generatorSupport.ts";
|
|
76
|
+
export declare class API<FromLSP extends boolean = false> implements FormatDiagnosticsHost {
|
|
26
77
|
private toPath;
|
|
78
|
+
private readonly decoder;
|
|
79
|
+
private currentDirectory;
|
|
80
|
+
private caseSensitivity;
|
|
27
81
|
private initialized;
|
|
82
|
+
private initializing;
|
|
28
83
|
private activeSnapshots;
|
|
29
|
-
private
|
|
30
|
-
|
|
84
|
+
private activeBuildOrchestrators;
|
|
85
|
+
private activeSourceFileLeases;
|
|
86
|
+
readonly printer: Printer;
|
|
87
|
+
readonly debug: DebugHandlers;
|
|
31
88
|
constructor(options?: APIOptions | LSPConnectionOptions);
|
|
89
|
+
/**
|
|
90
|
+
* Looks up a remote declaration's binder symbol. Throws for synthesized or configuration ASTs.
|
|
91
|
+
*/
|
|
92
|
+
get getSymbol(): {
|
|
93
|
+
(declaration: Declaration): Symbol;
|
|
94
|
+
gen(declaration: Declaration): Generator<ProtocolRequest, Symbol, ProtocolResponse["result"]>;
|
|
95
|
+
};
|
|
96
|
+
private get fetchDeclarationSymbol();
|
|
32
97
|
/**
|
|
33
98
|
* Create an API instance from an existing LSP connection's API session.
|
|
34
99
|
* Use this when connecting to an API pipe provided by an LSP server via custom/initializeAPISession.
|
|
35
100
|
*/
|
|
36
|
-
static fromLSPConnection(
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
101
|
+
static get fromLSPConnection(): {
|
|
102
|
+
(options: LSPConnectionOptions): API<true>;
|
|
103
|
+
gen(options: LSPConnectionOptions): Generator<ProtocolRequest, API<true>, ProtocolResponse["result"]>;
|
|
104
|
+
};
|
|
105
|
+
batch<T extends readonly AnyAPIRequestGenerator[]>(...requestGenerators: T): ExecutedGeneratorsResults<T>;
|
|
106
|
+
private get ensureInitialized();
|
|
107
|
+
private get initializeWorker();
|
|
108
|
+
getCurrentDirectory(): RootedDirectoryPath;
|
|
109
|
+
getCanonicalFileName(fileName: string): string;
|
|
110
|
+
private getCaseSensitivity;
|
|
111
|
+
getNewLine(): string;
|
|
112
|
+
get parseConfigFile(): {
|
|
113
|
+
(file: DocumentIdentifier): ParsedCommandLine;
|
|
114
|
+
gen(file: DocumentIdentifier): Generator<ProtocolRequest, ParsedCommandLine, ProtocolResponse["result"]>;
|
|
115
|
+
};
|
|
116
|
+
get parseCommandLine(): {
|
|
117
|
+
(commandLine: readonly string[]): ParsedCommandLine;
|
|
118
|
+
gen(commandLine: readonly string[]): Generator<ProtocolRequest, ParsedCommandLine, ProtocolResponse["result"]>;
|
|
119
|
+
};
|
|
120
|
+
get readConfigFile(): {
|
|
121
|
+
(file: DocumentIdentifier): ReadConfigFileResponse;
|
|
122
|
+
gen(file: DocumentIdentifier): Generator<ProtocolRequest, ReadConfigFileResponse, ProtocolResponse["result"]>;
|
|
123
|
+
};
|
|
124
|
+
get parseJsonConfigFileContent(): {
|
|
125
|
+
(json: any, options: {
|
|
126
|
+
configDirectory: string;
|
|
127
|
+
configFileName?: never;
|
|
128
|
+
} | {
|
|
129
|
+
configFileName: DocumentIdentifier;
|
|
130
|
+
configDirectory?: never;
|
|
131
|
+
}): ParsedCommandLine;
|
|
132
|
+
gen(json: any, options: {
|
|
133
|
+
configDirectory: string;
|
|
134
|
+
configFileName?: never;
|
|
135
|
+
} | {
|
|
136
|
+
configFileName: DocumentIdentifier;
|
|
137
|
+
configDirectory?: never;
|
|
138
|
+
}): Generator<ProtocolRequest, ParsedCommandLine, ProtocolResponse["result"]>;
|
|
139
|
+
};
|
|
140
|
+
/**
|
|
141
|
+
* Create and retain a source file independently of a program.
|
|
142
|
+
* Dispose the returned lease when the source file no longer needs to remain available remotely.
|
|
143
|
+
*/
|
|
144
|
+
get createSourceFile(): {
|
|
145
|
+
(fileName: string, sourceText: string, options?: CreateSourceFileOptions): RetainedSourceFile;
|
|
146
|
+
gen(fileName: string, sourceText: string, options?: CreateSourceFileOptions): Generator<ProtocolRequest, RetainedSourceFile, ProtocolResponse["result"]>;
|
|
147
|
+
};
|
|
148
|
+
/**
|
|
149
|
+
* Read, create, and retain a source file independently of a program.
|
|
150
|
+
* Dispose the returned lease when the source file no longer needs to remain available remotely.
|
|
151
|
+
*/
|
|
152
|
+
get createSourceFileFromFile(): {
|
|
153
|
+
(file: DocumentIdentifier, options?: CreateSourceFileOptions): RetainedSourceFile;
|
|
154
|
+
gen(file: DocumentIdentifier, options?: CreateSourceFileOptions): Generator<ProtocolRequest, RetainedSourceFile, ProtocolResponse["result"]>;
|
|
155
|
+
};
|
|
156
|
+
/**
|
|
157
|
+
* Retain an ordinary remote source file independently of the snapshot or lease that produced it.
|
|
158
|
+
*/
|
|
159
|
+
get retainSourceFile(): {
|
|
160
|
+
(sourceFile: SourceFile): RetainedSourceFile;
|
|
161
|
+
gen(sourceFile: SourceFile): Generator<ProtocolRequest, RetainedSourceFile, ProtocolResponse["result"]>;
|
|
162
|
+
};
|
|
163
|
+
private retainSourceFileResponse;
|
|
164
|
+
private addSourceFileLease;
|
|
165
|
+
get transpileModule(): {
|
|
166
|
+
(input: string, options?: TranspileOptions): TranspileOutput;
|
|
167
|
+
gen(input: string, options?: TranspileOptions): Generator<ProtocolRequest, TranspileOutput, ProtocolResponse["result"]>;
|
|
168
|
+
};
|
|
169
|
+
get transpileModuleFromFile(): {
|
|
170
|
+
(file: DocumentIdentifier, options?: TranspileOptions): TranspileOutput;
|
|
171
|
+
gen(file: DocumentIdentifier, options?: TranspileOptions): Generator<ProtocolRequest, TranspileOutput, ProtocolResponse["result"]>;
|
|
172
|
+
};
|
|
173
|
+
get transpileDeclaration(): {
|
|
174
|
+
(input: string, options?: TranspileOptions): TranspileOutput;
|
|
175
|
+
gen(input: string, options?: TranspileOptions): Generator<ProtocolRequest, TranspileOutput, ProtocolResponse["result"]>;
|
|
176
|
+
};
|
|
177
|
+
get transpileDeclarationFromFile(): {
|
|
178
|
+
(file: DocumentIdentifier, options?: TranspileOptions): TranspileOutput;
|
|
179
|
+
gen(file: DocumentIdentifier, options?: TranspileOptions): Generator<ProtocolRequest, TranspileOutput, ProtocolResponse["result"]>;
|
|
180
|
+
};
|
|
181
|
+
get createSnapshot(): {
|
|
182
|
+
<const CreatePrograms extends CreateSnapshotParams["createPrograms"] = undefined, const OpenFiles extends CreateSnapshotParams["openFiles"] = undefined>(params: SnapshotOperationParams<CreateSnapshotParams, CreatePrograms, OpenFiles>): SnapshotForOperationResults<CreatePrograms, OpenFiles>;
|
|
183
|
+
(): Snapshot;
|
|
184
|
+
gen<const CreatePrograms extends CreateSnapshotParams["createPrograms"] = undefined, const OpenFiles extends CreateSnapshotParams["openFiles"] = undefined>(params: SnapshotOperationParams<CreateSnapshotParams, CreatePrograms, OpenFiles>): Generator<ProtocolRequest, SnapshotForOperationResults<CreatePrograms, OpenFiles>, ProtocolResponse["result"]>;
|
|
185
|
+
gen(): Generator<ProtocolRequest, Snapshot, ProtocolResponse["result"]>;
|
|
186
|
+
};
|
|
187
|
+
private get updateSnapshot();
|
|
188
|
+
private prepareCreateSnapshotParams;
|
|
189
|
+
private prepareLanguageServerSnapshotChanges;
|
|
190
|
+
private createSnapshotUpdater;
|
|
191
|
+
/**
|
|
192
|
+
* Returns the language server's current canonical snapshot after atomically
|
|
193
|
+
* adopting any supplied API-driven changes. Only available on LSP-connected APIs.
|
|
194
|
+
*/
|
|
195
|
+
get getCurrentLanguageServerSnapshot(): {
|
|
196
|
+
<const CreatePrograms extends LanguageServerSnapshotChanges["createPrograms"] = undefined, const OpenFiles extends LanguageServerSnapshotChanges["openFiles"] = undefined>(...args: FromLSP extends true ? [changes: SnapshotOperationParams<LanguageServerSnapshotChanges, CreatePrograms, OpenFiles>, baseSnapshot?: Snapshot] : [changes: never, baseSnapshot?: never]): SnapshotForOperationResults<CreatePrograms, OpenFiles>;
|
|
197
|
+
(...args: FromLSP extends true ? [changes?: LanguageServerSnapshotChanges, baseSnapshot?: Snapshot] : [changes: never, baseSnapshot?: never]): Snapshot;
|
|
198
|
+
gen<const CreatePrograms extends LanguageServerSnapshotChanges["createPrograms"] = undefined, const OpenFiles extends LanguageServerSnapshotChanges["openFiles"] = undefined>(...args: FromLSP extends true ? [changes: SnapshotOperationParams<LanguageServerSnapshotChanges, CreatePrograms, OpenFiles>, baseSnapshot?: Snapshot] : [changes: never, baseSnapshot?: never]): Generator<ProtocolRequest, SnapshotForOperationResults<CreatePrograms, OpenFiles>, ProtocolResponse["result"]>;
|
|
199
|
+
gen(...args: FromLSP extends true ? [changes?: LanguageServerSnapshotChanges, baseSnapshot?: Snapshot] : [changes: never, baseSnapshot?: never]): Generator<ProtocolRequest, Snapshot, ProtocolResponse["result"]>;
|
|
200
|
+
};
|
|
201
|
+
[globalThis.Symbol.dispose](): void;
|
|
202
|
+
get close(): {
|
|
203
|
+
(): void;
|
|
204
|
+
gen(): Generator<ProtocolRequest, void, ProtocolResponse["result"]>;
|
|
205
|
+
};
|
|
206
|
+
get createModuleResolver(): {
|
|
207
|
+
(compilerOptions: RawCompilerOptions, options?: ModuleResolverOptions): ModuleResolver;
|
|
208
|
+
gen(compilerOptions: RawCompilerOptions, options?: ModuleResolverOptions): Generator<ProtocolRequest, ModuleResolver, ProtocolResponse["result"]>;
|
|
209
|
+
};
|
|
41
210
|
clearSourceFileCache(): void;
|
|
211
|
+
get runWithTemporaryFileUpdate(): {
|
|
212
|
+
(baseSnapshot: Snapshot, file: DocumentIdentifier, newText: string, cb: (newSnapshot: Snapshot) => void): void;
|
|
213
|
+
gen(baseSnapshot: Snapshot, file: DocumentIdentifier, newText: string, cb: (newSnapshot: Snapshot) => void | Generator<ProtocolRequest, void, ProtocolResponse["result"]>): Generator<ProtocolRequest, void, ProtocolResponse["result"]>;
|
|
214
|
+
};
|
|
42
215
|
/**
|
|
43
216
|
* Returns a snapshot of collected timing information for requests made
|
|
44
217
|
* through this API instance: client-measured round-trip latency and bytes
|
|
@@ -47,312 +220,1085 @@ export declare class API<FromLSP extends boolean = false> {
|
|
|
47
220
|
*
|
|
48
221
|
* Fetching the snapshot issues a lightweight request to the server to
|
|
49
222
|
* retrieve its timing collection. Collection must be enabled via the
|
|
50
|
-
* `collectTiming` option
|
|
51
|
-
* `enabled: false` and zeroed totals.
|
|
223
|
+
* `collectTiming` option or `TS_API_TIMING_DIR` environment variable; when
|
|
224
|
+
* it is not, the returned snapshot has `enabled: false` and zeroed totals.
|
|
52
225
|
*/
|
|
53
|
-
getTimingInfo():
|
|
226
|
+
get getTimingInfo(): {
|
|
227
|
+
(): TimingInfo;
|
|
228
|
+
gen(): Generator<ProtocolRequest, TimingInfo, ProtocolResponse["result"]>;
|
|
229
|
+
};
|
|
54
230
|
/** Clears all accumulated timing totals and recent-request history, on both the client and the server. */
|
|
55
|
-
resetTimingInfo():
|
|
231
|
+
get resetTimingInfo(): {
|
|
232
|
+
(): void;
|
|
233
|
+
gen(): Generator<ProtocolRequest, void, ProtocolResponse["result"]>;
|
|
234
|
+
};
|
|
235
|
+
/** Creates a program from current filesystem state. */
|
|
236
|
+
get createProgram(): {
|
|
237
|
+
(rootFiles: readonly DocumentIdentifier[], compilerOptions: RawCompilerOptions, createProgramOptions?: CreateProgramOptions): Program;
|
|
238
|
+
gen(rootFiles: readonly DocumentIdentifier[], compilerOptions: RawCompilerOptions, createProgramOptions?: CreateProgramOptions): Generator<ProtocolRequest, Program, ProtocolResponse["result"]>;
|
|
239
|
+
};
|
|
56
240
|
}
|
|
57
|
-
|
|
241
|
+
type EnsureInitialized = (() => void) & {
|
|
242
|
+
gen(): Generator<ProtocolRequest, void, ProtocolResponse["result"]>;
|
|
243
|
+
};
|
|
244
|
+
/** Returns whether a node is backed by a remote compiler response. */
|
|
245
|
+
export declare function isRemoteNode(node: Node): boolean;
|
|
246
|
+
/** Looks up a remote declaration's binder symbol through its API. Throws for non-remote declarations. */
|
|
247
|
+
export declare function getSymbol(declaration: Declaration): Symbol;
|
|
248
|
+
export declare namespace getSymbol {
|
|
249
|
+
function gen(declaration: Declaration): Generator<ProtocolRequest, Symbol, ProtocolResponse["result"]>;
|
|
250
|
+
}
|
|
251
|
+
/** An independently retained source file and its disposable remote-lifetime lease. */
|
|
252
|
+
export declare class RetainedSourceFile {
|
|
253
|
+
readonly sourceFile: SourceFile;
|
|
254
|
+
private readonly lease;
|
|
255
|
+
private readonly onDispose;
|
|
256
|
+
private disposed;
|
|
257
|
+
private disposePromise;
|
|
258
|
+
constructor(sourceFile: SourceFile, lease: number, onDispose: () => void);
|
|
259
|
+
[globalThis.Symbol.dispose](): void;
|
|
260
|
+
get dispose(): {
|
|
261
|
+
(): void;
|
|
262
|
+
gen(): Generator<ProtocolRequest, void, ProtocolResponse["result"]>;
|
|
263
|
+
};
|
|
264
|
+
private get disposeWorker();
|
|
265
|
+
}
|
|
266
|
+
export declare class DebugHandlers {
|
|
58
267
|
private client;
|
|
59
268
|
private ensureInitialized;
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
269
|
+
constructor(client: Client, ensureInitialized: EnsureInitialized);
|
|
270
|
+
get startCPUProfile(): {
|
|
271
|
+
(dir: string): void;
|
|
272
|
+
gen(dir: string): Generator<ProtocolRequest, void, ProtocolResponse["result"]>;
|
|
273
|
+
};
|
|
274
|
+
get stopCPUProfile(): {
|
|
275
|
+
(): RootedFilePath;
|
|
276
|
+
gen(): Generator<ProtocolRequest, RootedFilePath, ProtocolResponse["result"]>;
|
|
277
|
+
};
|
|
278
|
+
get saveHeapProfile(): {
|
|
279
|
+
(dir: string): RootedFilePath;
|
|
280
|
+
gen(dir: string): Generator<ProtocolRequest, RootedFilePath, ProtocolResponse["result"]>;
|
|
281
|
+
};
|
|
282
|
+
}
|
|
283
|
+
type SnapshotUpdater = ((params: CreateSnapshotParams) => Snapshot) & {
|
|
284
|
+
gen(params: CreateSnapshotParams): Generator<ProtocolRequest, Snapshot, ProtocolResponse["result"]>;
|
|
285
|
+
};
|
|
286
|
+
export interface SnapshotOperation {
|
|
287
|
+
readonly createdPrograms?: readonly Program<SyntheticProjectId>[] | undefined;
|
|
288
|
+
readonly openedFiles?: readonly SnapshotOpenedFileOperation[] | undefined;
|
|
65
289
|
}
|
|
290
|
+
export interface SnapshotOpenedFileOperation {
|
|
291
|
+
readonly project: Project;
|
|
292
|
+
}
|
|
293
|
+
/** Replaces every element of a tuple while preserving its length and index structure. */
|
|
294
|
+
type MapTupleTo<Tuple extends readonly unknown[], Result> = {
|
|
295
|
+
readonly [Index in keyof Tuple]: Result;
|
|
296
|
+
};
|
|
297
|
+
/**
|
|
298
|
+
* Keeps `Tuple` as an inference target while contextually typing each element from
|
|
299
|
+
* `Elements`. The mapped intersection supplies nested completions and excess-property
|
|
300
|
+
* checks without widening an inferred tuple to an array.
|
|
301
|
+
*/
|
|
302
|
+
type ContextualizeTuple<Tuple extends readonly unknown[] | undefined, Elements extends readonly unknown[] | undefined> = Tuple & {
|
|
303
|
+
readonly [Index in keyof Tuple]: NonNullable<Elements>[number];
|
|
304
|
+
};
|
|
305
|
+
/** Substitutes the operation arrays with contextually typed, tuple-preserving versions. */
|
|
306
|
+
type SnapshotOperationParams<Params extends {
|
|
307
|
+
createPrograms?: readonly unknown[] | undefined;
|
|
308
|
+
openFiles?: readonly unknown[] | undefined;
|
|
309
|
+
}, CreatePrograms extends Params["createPrograms"], OpenFiles extends Params["openFiles"]> = Omit<Params, "createPrograms" | "openFiles"> & {
|
|
310
|
+
createPrograms?: ContextualizeTuple<CreatePrograms, Params["createPrograms"]> | undefined;
|
|
311
|
+
openFiles?: ContextualizeTuple<OpenFiles, Params["openFiles"]> | undefined;
|
|
312
|
+
};
|
|
313
|
+
/**
|
|
314
|
+
* Refines a snapshot's operation results to required tuples when the corresponding
|
|
315
|
+
* operation arrays were supplied, preserving their lengths for indexed access.
|
|
316
|
+
*/
|
|
317
|
+
type SnapshotForOperationResults<CreatePrograms extends readonly unknown[] | undefined, OpenFiles extends readonly unknown[] | undefined> = Snapshot & {
|
|
318
|
+
readonly operation: SnapshotOperation & (CreatePrograms extends readonly unknown[] ? {
|
|
319
|
+
readonly createdPrograms: MapTupleTo<CreatePrograms, Program<SyntheticProjectId>>;
|
|
320
|
+
} : unknown) & (OpenFiles extends readonly unknown[] ? {
|
|
321
|
+
readonly openedFiles: MapTupleTo<OpenFiles, SnapshotOpenedFileOperation>;
|
|
322
|
+
} : unknown);
|
|
323
|
+
};
|
|
324
|
+
/** Derives the refined snapshot result type from a complete operation parameter type. */
|
|
325
|
+
export type SnapshotForOperation<Params extends CreateSnapshotParams> = SnapshotForOperationResults<Params extends {
|
|
326
|
+
createPrograms: infer CreatePrograms extends readonly unknown[];
|
|
327
|
+
} ? CreatePrograms : undefined, Params extends {
|
|
328
|
+
openFiles: infer OpenFiles extends readonly unknown[];
|
|
329
|
+
} ? OpenFiles : undefined>;
|
|
66
330
|
export declare class Snapshot {
|
|
67
331
|
readonly id: number;
|
|
332
|
+
readonly operation: SnapshotOperation;
|
|
68
333
|
private projectMap;
|
|
69
334
|
private toPath;
|
|
70
|
-
private
|
|
335
|
+
private readonly api;
|
|
71
336
|
private disposed;
|
|
337
|
+
private disposePromise;
|
|
72
338
|
private onDispose;
|
|
73
339
|
private snapshotRegistry;
|
|
74
|
-
|
|
340
|
+
private projectDataMap;
|
|
341
|
+
private updateSnapshot;
|
|
342
|
+
private get client();
|
|
343
|
+
constructor(data: CreateSnapshotResponse, toPath: (fileName: string, basePath?: string) => PathKey, api: API<boolean>, onDispose: () => void, updateSnapshot: SnapshotUpdater, baseSnapshot?: Snapshot);
|
|
75
344
|
getProjects(): readonly Project[];
|
|
76
|
-
|
|
77
|
-
|
|
345
|
+
getConfiguredProject(configFileName: string): Project<ConfiguredProjectId> | undefined;
|
|
346
|
+
getProject<Id extends ProjectId>(projectId: Id): Project<Id> | undefined;
|
|
347
|
+
getProgram<Id extends ProjectId>(projectId: Id): Program<Id> | undefined;
|
|
348
|
+
get update(): {
|
|
349
|
+
<const CreatePrograms extends CreateSnapshotParams["createPrograms"] = undefined, const OpenFiles extends CreateSnapshotParams["openFiles"] = undefined>(params: SnapshotOperationParams<CreateSnapshotParams, CreatePrograms, OpenFiles>): SnapshotForOperationResults<CreatePrograms, OpenFiles>;
|
|
350
|
+
(params: CreateSnapshotParams): Snapshot;
|
|
351
|
+
gen<const CreatePrograms extends CreateSnapshotParams["createPrograms"] = undefined, const OpenFiles extends CreateSnapshotParams["openFiles"] = undefined>(params: SnapshotOperationParams<CreateSnapshotParams, CreatePrograms, OpenFiles>): Generator<ProtocolRequest, SnapshotForOperationResults<CreatePrograms, OpenFiles>, ProtocolResponse["result"]>;
|
|
352
|
+
gen(params: CreateSnapshotParams): Generator<ProtocolRequest, Snapshot, ProtocolResponse["result"]>;
|
|
353
|
+
};
|
|
354
|
+
/**
|
|
355
|
+
* Gets the default project for a given file from the configured projects and
|
|
356
|
+
* inferred project already loaded in the snapshot. Synthetic projects are not
|
|
357
|
+
* considered. Files that have been opened with `openFiles` are guaranteed to
|
|
358
|
+
* have a result.
|
|
359
|
+
*/
|
|
360
|
+
get getDefaultProjectForFile(): {
|
|
361
|
+
(file: DocumentIdentifier): Project | undefined;
|
|
362
|
+
gen(file: DocumentIdentifier): Generator<ProtocolRequest, Project | undefined, ProtocolResponse["result"]>;
|
|
363
|
+
};
|
|
78
364
|
[globalThis.Symbol.dispose](): void;
|
|
79
|
-
dispose():
|
|
365
|
+
get dispose(): {
|
|
366
|
+
(): void;
|
|
367
|
+
gen(): Generator<ProtocolRequest, void, ProtocolResponse["result"]>;
|
|
368
|
+
};
|
|
369
|
+
private get disposeWorker();
|
|
80
370
|
isDisposed(): boolean;
|
|
81
371
|
private ensureNotDisposed;
|
|
372
|
+
private requireProject;
|
|
373
|
+
}
|
|
374
|
+
export declare class ModuleResolver {
|
|
375
|
+
readonly id: number;
|
|
376
|
+
private readonly client;
|
|
377
|
+
private readonly disposeCallback;
|
|
378
|
+
private disposed;
|
|
379
|
+
constructor(id: number, client: Client, disposeCallback: (() => void) | undefined);
|
|
380
|
+
get resolveModuleName(): {
|
|
381
|
+
(moduleName: string, containingDirectory: DocumentIdentifier, resolutionMode?: ResolutionMode, options?: {
|
|
382
|
+
snapshot?: Snapshot | InProgressSnapshot | undefined;
|
|
383
|
+
}): ResolveModuleNameResult;
|
|
384
|
+
gen(moduleName: string, containingDirectory: DocumentIdentifier, resolutionMode?: ResolutionMode, options?: {
|
|
385
|
+
snapshot?: Snapshot | InProgressSnapshot | undefined;
|
|
386
|
+
}): Generator<ProtocolRequest, ResolveModuleNameResult, ProtocolResponse["result"]>;
|
|
387
|
+
};
|
|
388
|
+
[globalThis.Symbol.dispose](): void;
|
|
389
|
+
get dispose(): {
|
|
390
|
+
(): void;
|
|
391
|
+
gen(): Generator<ProtocolRequest, void, ProtocolResponse["result"]>;
|
|
392
|
+
};
|
|
82
393
|
}
|
|
83
394
|
declare class SnapshotObjectRegistry {
|
|
84
395
|
private readonly symbols;
|
|
85
|
-
private readonly
|
|
396
|
+
private readonly projectRegistries;
|
|
86
397
|
private readonly snapshotId;
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
/** Resolve a project id (a config file path) to its Project within this snapshot. */
|
|
90
|
-
getProject(projectId: Path): Project | undefined;
|
|
398
|
+
constructor(snapshotId: number);
|
|
399
|
+
addProjectRegistry(registry: ProjectObjectRegistry): void;
|
|
91
400
|
getOrCreateSymbol(data: SymbolResponse): Symbol;
|
|
92
401
|
getSymbol(id: number): Symbol | undefined;
|
|
93
402
|
clear(): void;
|
|
94
|
-
fetchSymbol(source: Symbol | Signature | Type, method: string, handle: number | undefined, projectId?: Path): Symbol;
|
|
95
|
-
fetchSymbols(source: Symbol | Signature | Type, method: string, handles?: readonly number[], projectId?: Path): readonly Symbol[];
|
|
96
403
|
}
|
|
97
404
|
declare class ProjectObjectRegistry {
|
|
98
|
-
private client;
|
|
99
405
|
private snapshotId;
|
|
100
|
-
|
|
406
|
+
readonly project: Project;
|
|
101
407
|
private snapshotRegistry;
|
|
102
408
|
private types;
|
|
103
409
|
private signatures;
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
410
|
+
private disposed;
|
|
411
|
+
private get client();
|
|
412
|
+
private get sourceFileCache();
|
|
413
|
+
constructor(snapshotId: number, project: Project, snapshotRegistry: SnapshotObjectRegistry);
|
|
414
|
+
getOrCreateSymbol(data: ProtocolSymbolResponse): Symbol;
|
|
415
|
+
/** Find an already-interned symbol and retain its file record for this registry. */
|
|
416
|
+
getCachedSymbol(reference: CompactSymbolReference): Symbol | undefined;
|
|
107
417
|
getOrCreateType(data: TypeResponse): TypeObject;
|
|
108
418
|
getType(id: number): TypeObject | undefined;
|
|
419
|
+
createNodeHandle<T extends Node>(handle: string): NodeHandle<T>;
|
|
109
420
|
getOrCreateSignature(data: SignatureResponse): Signature;
|
|
110
421
|
getSignature(id: number): Signature | undefined;
|
|
111
422
|
clear(): void;
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
423
|
+
private ensureNotDisposed;
|
|
424
|
+
get fetchOptionalType(): {
|
|
425
|
+
<T extends Type>(source: Symbol | Signature | Type, method: TypePropertyMethod, handle: number | false | undefined): T | undefined;
|
|
426
|
+
gen<T extends Type>(source: Symbol | Signature | Type, method: TypePropertyMethod, handle: number | false | undefined): Generator<ProtocolRequest, T | undefined, ProtocolResponse["result"]>;
|
|
427
|
+
};
|
|
428
|
+
get fetchType(): {
|
|
429
|
+
<T extends Type>(source: Symbol | Signature | Type, method: TypePropertyMethod, handle: number | false | undefined): T;
|
|
430
|
+
gen<T extends Type>(source: Symbol | Signature | Type, method: TypePropertyMethod, handle: number | false | undefined): Generator<ProtocolRequest, T, ProtocolResponse["result"]>;
|
|
431
|
+
};
|
|
432
|
+
get fetchSymbol(): {
|
|
433
|
+
(source: Symbol | Signature | Type, method: SymbolPropertyMethod, reference: CompactSymbolReference | undefined): Symbol;
|
|
434
|
+
gen(source: Symbol | Signature | Type, method: SymbolPropertyMethod, reference: CompactSymbolReference | undefined): Generator<ProtocolRequest, Symbol, ProtocolResponse["result"]>;
|
|
435
|
+
};
|
|
436
|
+
get fetchSignature(): {
|
|
437
|
+
(source: Symbol | Signature | Type, method: SignaturePropertyMethod, handle: number | undefined): Signature;
|
|
438
|
+
gen(source: Symbol | Signature | Type, method: SignaturePropertyMethod, handle: number | undefined): Generator<ProtocolRequest, Signature, ProtocolResponse["result"]>;
|
|
439
|
+
};
|
|
440
|
+
get fetchTypes(): {
|
|
441
|
+
(source: Symbol | Signature | Type, method: TypesPropertyMethod, handles?: readonly number[]): readonly Type[];
|
|
442
|
+
gen(source: Symbol | Signature | Type, method: TypesPropertyMethod, handles?: readonly number[]): Generator<ProtocolRequest, readonly Type[], ProtocolResponse["result"]>;
|
|
443
|
+
};
|
|
444
|
+
get fetchSymbols(): {
|
|
445
|
+
(source: Symbol | Signature | Type, method: SymbolsPropertyMethod, references?: readonly CompactSymbolReference[]): readonly Symbol[];
|
|
446
|
+
gen(source: Symbol | Signature | Type, method: SymbolsPropertyMethod, references?: readonly CompactSymbolReference[]): Generator<ProtocolRequest, readonly Symbol[], ProtocolResponse["result"]>;
|
|
447
|
+
};
|
|
448
|
+
private get fetchSymbolsFromServer();
|
|
449
|
+
get fetchBaseTypes(): {
|
|
450
|
+
(source: Type): readonly Type[];
|
|
451
|
+
gen(source: Type): Generator<ProtocolRequest, readonly Type[], ProtocolResponse["result"]>;
|
|
452
|
+
};
|
|
453
|
+
get fetchPropertiesOfType(): {
|
|
454
|
+
(source: Type): readonly Symbol[];
|
|
455
|
+
gen(source: Type): Generator<ProtocolRequest, readonly Symbol[], ProtocolResponse["result"]>;
|
|
456
|
+
};
|
|
457
|
+
get fetchApparentPropertiesOfType(): {
|
|
458
|
+
(source: Type): readonly Symbol[];
|
|
459
|
+
gen(source: Type): Generator<ProtocolRequest, readonly Symbol[], ProtocolResponse["result"]>;
|
|
460
|
+
};
|
|
461
|
+
get fetchPropertyOfType(): {
|
|
462
|
+
(source: Type, name: string): Symbol | undefined;
|
|
463
|
+
gen(source: Type, name: string): Generator<ProtocolRequest, Symbol | undefined, ProtocolResponse["result"]>;
|
|
464
|
+
};
|
|
465
|
+
get fetchSignaturesOfType(): {
|
|
466
|
+
(source: Type, kind: SignatureKind): readonly Signature[];
|
|
467
|
+
gen(source: Type, kind: SignatureKind): Generator<ProtocolRequest, readonly Signature[], ProtocolResponse["result"]>;
|
|
468
|
+
};
|
|
469
|
+
get fetchIndexInfosOfType(): {
|
|
470
|
+
(source: Type): readonly IndexInfo[];
|
|
471
|
+
gen(source: Type): Generator<ProtocolRequest, readonly IndexInfo[], ProtocolResponse["result"]>;
|
|
472
|
+
};
|
|
473
|
+
get fetchTypeParameterAtPosition(): {
|
|
474
|
+
(source: Signature, pos: number): Type;
|
|
475
|
+
gen(source: Signature, pos: number): Generator<ProtocolRequest, Type, ProtocolResponse["result"]>;
|
|
476
|
+
};
|
|
118
477
|
}
|
|
119
|
-
export declare class Project {
|
|
120
|
-
readonly id:
|
|
121
|
-
readonly configFileName:
|
|
122
|
-
readonly
|
|
123
|
-
readonly
|
|
124
|
-
readonly
|
|
478
|
+
export declare class Project<Id extends ProjectId = ProjectId> {
|
|
479
|
+
readonly id: Id;
|
|
480
|
+
readonly configFileName: RootedFilePath | undefined;
|
|
481
|
+
readonly currentDirectory: RootedDirectoryPath;
|
|
482
|
+
readonly dirty: boolean;
|
|
483
|
+
readonly parsedCommandLine: ParsedCommandLine;
|
|
484
|
+
readonly program: Program<Id>;
|
|
125
485
|
readonly checker: Checker;
|
|
126
|
-
readonly
|
|
127
|
-
|
|
128
|
-
constructor(data: ProjectResponse, snapshotId: number, client: Client, sourceFileCache: SourceFileCache, toPath: (fileName: string) => Path, snapshotRegistry: SnapshotObjectRegistry);
|
|
486
|
+
readonly languageService: LanguageService;
|
|
487
|
+
constructor(data: ProjectResponse, snapshotId: number, toPath: (fileName: string, basePath?: string) => PathKey, api: API<boolean>, snapshotRegistry: SnapshotObjectRegistry);
|
|
129
488
|
dispose(): void;
|
|
130
489
|
}
|
|
131
|
-
export declare class
|
|
490
|
+
export declare class LanguageService {
|
|
132
491
|
private snapshotId;
|
|
133
492
|
private project;
|
|
134
|
-
private
|
|
135
|
-
private
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
493
|
+
private objectRegistry;
|
|
494
|
+
private get client();
|
|
495
|
+
constructor(snapshotId: number, project: Project, objectRegistry: ProjectObjectRegistry);
|
|
496
|
+
get getImportAdderEdits(): {
|
|
497
|
+
(file: DocumentIdentifier, actions: readonly APIImportAdderAction[]): readonly TextEdit[];
|
|
498
|
+
gen(file: DocumentIdentifier, actions: readonly APIImportAdderAction[]): Generator<ProtocolRequest, readonly TextEdit[], ProtocolResponse["result"]>;
|
|
499
|
+
};
|
|
500
|
+
get getImportEditsForSymbols(): {
|
|
501
|
+
(file: DocumentIdentifier, symbols: readonly Symbol[], options?: GetImportEditsForSymbolsOptions): readonly TextEdit[];
|
|
502
|
+
gen(file: DocumentIdentifier, symbols: readonly Symbol[], options?: GetImportEditsForSymbolsOptions): Generator<ProtocolRequest, readonly TextEdit[], ProtocolResponse["result"]>;
|
|
503
|
+
};
|
|
504
|
+
get getReferencedSymbolsForNode(): {
|
|
505
|
+
(node: Node, position: number): ReferencedSymbolEntry[];
|
|
506
|
+
gen(node: Node, position: number): Generator<ProtocolRequest, ReferencedSymbolEntry[], ProtocolResponse["result"]>;
|
|
507
|
+
};
|
|
508
|
+
get getSignatureUsage(): {
|
|
509
|
+
(signatureDecl: Node): SignatureUsage[];
|
|
510
|
+
gen(signatureDecl: Node): Generator<ProtocolRequest, SignatureUsage[], ProtocolResponse["result"]>;
|
|
511
|
+
};
|
|
512
|
+
get getCompletionsAtPosition(): {
|
|
513
|
+
(document: string, position: number, options?: CompletionOptions): CompletionInfo | undefined;
|
|
514
|
+
gen(document: string, position: number, options?: CompletionOptions): Generator<ProtocolRequest, CompletionInfo | undefined, ProtocolResponse["result"]>;
|
|
515
|
+
};
|
|
516
|
+
/**
|
|
517
|
+
* Format a synthesized node with the correct indentation for insertion at a
|
|
518
|
+
* specific position in an existing source file.
|
|
519
|
+
*
|
|
520
|
+
* @param node The synthesized AST node to format.
|
|
521
|
+
* @param file The target file where the node will be inserted.
|
|
522
|
+
* @param position The UTF-16 code-unit offset in the target file for insertion.
|
|
523
|
+
* @returns The formatted text of the node, indented for the insertion position.
|
|
524
|
+
*/
|
|
525
|
+
get formatNodeForInsertion(): {
|
|
526
|
+
(node: Node, file: DocumentIdentifier, position: number): string;
|
|
527
|
+
gen(node: Node, file: DocumentIdentifier, position: number): Generator<ProtocolRequest, string, ProtocolResponse["result"]>;
|
|
528
|
+
};
|
|
529
|
+
}
|
|
530
|
+
export declare class Program<Id extends ProjectId = ProjectId> implements FormatDiagnosticsHost {
|
|
531
|
+
readonly id: Id;
|
|
532
|
+
private readonly project;
|
|
533
|
+
private readonly toPath;
|
|
534
|
+
private readonly decoder;
|
|
535
|
+
private readonly sourceFileMetadataCache;
|
|
536
|
+
private ownedSnapshot;
|
|
537
|
+
private disposePromise;
|
|
538
|
+
private get client();
|
|
539
|
+
private get sourceFileCache();
|
|
540
|
+
constructor(snapshotId: number, project: Project<Id>, toPath: (fileName: string, basePath?: string) => PathKey);
|
|
541
|
+
getCurrentDirectory(): RootedDirectoryPath;
|
|
542
|
+
getCanonicalFileName(fileName: string): string;
|
|
543
|
+
getNewLine(): string;
|
|
544
|
+
[globalThis.Symbol.dispose](): void;
|
|
545
|
+
get dispose(): {
|
|
546
|
+
(): void;
|
|
547
|
+
gen(): Generator<ProtocolRequest, void, ProtocolResponse["result"]>;
|
|
548
|
+
};
|
|
549
|
+
private get disposeWorker();
|
|
140
550
|
getCompilerOptions(): CompilerOptions;
|
|
141
|
-
getSourceFile(
|
|
142
|
-
|
|
551
|
+
get getSourceFile(): {
|
|
552
|
+
(file: DocumentIdentifier): SourceFile | undefined;
|
|
553
|
+
gen(file: DocumentIdentifier): Generator<ProtocolRequest, SourceFile | undefined, ProtocolResponse["result"]>;
|
|
554
|
+
};
|
|
555
|
+
/**
|
|
556
|
+
* Returns the source file for an already-canonical path.
|
|
557
|
+
*/
|
|
558
|
+
get getSourceFileByPath(): {
|
|
559
|
+
(path: PathKey): SourceFile | undefined;
|
|
560
|
+
gen(path: PathKey): Generator<ProtocolRequest, SourceFile | undefined, ProtocolResponse["result"]>;
|
|
561
|
+
};
|
|
562
|
+
private get getSourceFileWorker();
|
|
563
|
+
get getResolvedModule(): {
|
|
564
|
+
(file: DocumentIdentifier, moduleName: string, mode: ModuleKind): ResolvedModule | undefined;
|
|
565
|
+
gen(file: DocumentIdentifier, moduleName: string, mode: ModuleKind): Generator<ProtocolRequest, ResolvedModule | undefined, ProtocolResponse["result"]>;
|
|
566
|
+
};
|
|
567
|
+
get getModeForUsageLocation(): {
|
|
568
|
+
(file: DocumentIdentifier, usage: StringLiteralLikeNode): ModuleKind;
|
|
569
|
+
gen(file: DocumentIdentifier, usage: StringLiteralLikeNode): Generator<ProtocolRequest, ModuleKind, ProtocolResponse["result"]>;
|
|
570
|
+
};
|
|
571
|
+
get getModeForResolutionAtIndex(): {
|
|
572
|
+
(file: DocumentIdentifier, index: number): ModuleKind;
|
|
573
|
+
gen(file: DocumentIdentifier, index: number): Generator<ProtocolRequest, ModuleKind, ProtocolResponse["result"]>;
|
|
574
|
+
};
|
|
575
|
+
get getResolvedModuleFromModuleSpecifier(): {
|
|
576
|
+
(moduleSpecifier: StringLiteralLikeNode, sourceFile?: DocumentIdentifier): ResolvedModule | undefined;
|
|
577
|
+
gen(moduleSpecifier: StringLiteralLikeNode, sourceFile?: DocumentIdentifier): Generator<ProtocolRequest, ResolvedModule | undefined, ProtocolResponse["result"]>;
|
|
578
|
+
};
|
|
579
|
+
get getResolvedTypeReferenceDirective(): {
|
|
580
|
+
(file: DocumentIdentifier, typeDirectiveName: string, mode: ModuleKind): ResolvedTypeReferenceDirective | undefined;
|
|
581
|
+
gen(file: DocumentIdentifier, typeDirectiveName: string, mode: ModuleKind): Generator<ProtocolRequest, ResolvedTypeReferenceDirective | undefined, ProtocolResponse["result"]>;
|
|
582
|
+
};
|
|
583
|
+
get getResolvedTypeReferenceDirectiveFromTypeReferenceDirective(): {
|
|
584
|
+
(typeReferenceDirective: FileReference, sourceFile: DocumentIdentifier): ResolvedTypeReferenceDirective | undefined;
|
|
585
|
+
gen(typeReferenceDirective: FileReference, sourceFile: DocumentIdentifier): Generator<ProtocolRequest, ResolvedTypeReferenceDirective | undefined, ProtocolResponse["result"]>;
|
|
586
|
+
};
|
|
587
|
+
get getSourceFileNames(): {
|
|
588
|
+
(): readonly RootedFilePath[];
|
|
589
|
+
gen(): Generator<ProtocolRequest, readonly RootedFilePath[], ProtocolResponse["result"]>;
|
|
590
|
+
};
|
|
143
591
|
/**
|
|
144
592
|
* Returns program-stored metadata for the given source file, or `undefined` if the file
|
|
145
593
|
* is not part of the program. Metadata is fetched lazily per file and cached on this
|
|
146
594
|
* `Program` instance.
|
|
147
595
|
*/
|
|
148
|
-
getSourceFileMetadata(
|
|
596
|
+
get getSourceFileMetadata(): {
|
|
597
|
+
(file: DocumentIdentifier): SourceFileMetadata | undefined;
|
|
598
|
+
gen(file: DocumentIdentifier): Generator<ProtocolRequest, SourceFileMetadata | undefined, ProtocolResponse["result"]>;
|
|
599
|
+
};
|
|
149
600
|
/**
|
|
150
601
|
* Returns program-stored metadata for the source file at the given path, or `undefined`
|
|
151
602
|
* if the file is not part of the program. Like {@link getSourceFileMetadata}, but skips
|
|
152
603
|
* the file name to path conversion. Metadata is fetched lazily per file and cached on
|
|
153
604
|
* this `Program` instance.
|
|
154
605
|
*/
|
|
155
|
-
getSourceFileMetadataByPath(
|
|
156
|
-
|
|
606
|
+
get getSourceFileMetadataByPath(): {
|
|
607
|
+
(path: PathKey): SourceFileMetadata | undefined;
|
|
608
|
+
gen(path: PathKey): Generator<ProtocolRequest, SourceFileMetadata | undefined, ProtocolResponse["result"]>;
|
|
609
|
+
};
|
|
610
|
+
private get fetchSourceFileMetadata();
|
|
611
|
+
private pathKeyForFileName;
|
|
157
612
|
/**
|
|
158
613
|
* Returns whether the given source file was loaded as part of an external library
|
|
159
614
|
* (e.g. a dependency resolved from `node_modules`). The underlying program metadata is
|
|
160
615
|
* fetched lazily per file and cached on this `Program` instance.
|
|
161
616
|
*/
|
|
162
|
-
isSourceFileFromExternalLibrary(
|
|
617
|
+
get isSourceFileFromExternalLibrary(): {
|
|
618
|
+
(file: SourceFile): boolean;
|
|
619
|
+
gen(file: SourceFile): Generator<ProtocolRequest, boolean, ProtocolResponse["result"]>;
|
|
620
|
+
};
|
|
163
621
|
/**
|
|
164
622
|
* Returns whether the given source file is a default library file (e.g. `lib.d.ts`).
|
|
165
623
|
* The underlying program metadata is fetched lazily per file and cached on this
|
|
166
624
|
* `Program` instance.
|
|
167
625
|
*/
|
|
168
|
-
isSourceFileDefaultLibrary(
|
|
626
|
+
get isSourceFileDefaultLibrary(): {
|
|
627
|
+
(file: SourceFile): boolean;
|
|
628
|
+
gen(file: SourceFile): Generator<ProtocolRequest, boolean, ProtocolResponse["result"]>;
|
|
629
|
+
};
|
|
630
|
+
/**
|
|
631
|
+
* Get all config source file names associated with this program's project config.
|
|
632
|
+
* Includes the root config file and any extended config files.
|
|
633
|
+
*/
|
|
634
|
+
get getConfigFileNames(): {
|
|
635
|
+
(): readonly RootedFilePath[];
|
|
636
|
+
gen(): Generator<ProtocolRequest, readonly RootedFilePath[], ProtocolResponse["result"]>;
|
|
637
|
+
};
|
|
638
|
+
/**
|
|
639
|
+
* Get a config source file by file name/URI.
|
|
640
|
+
* This can return the project's root tsconfig file or one of its extended config files.
|
|
641
|
+
*/
|
|
642
|
+
get getConfigSourceFile(): {
|
|
643
|
+
(file: DocumentIdentifier): SourceFile | undefined;
|
|
644
|
+
gen(file: DocumentIdentifier): Generator<ProtocolRequest, SourceFile | undefined, ProtocolResponse["result"]>;
|
|
645
|
+
};
|
|
169
646
|
/**
|
|
170
|
-
* Get syntactic (parse) diagnostics for
|
|
171
|
-
* @param file - Optional file to get diagnostics for. If omitted, returns diagnostics for all files.
|
|
647
|
+
* Get syntactic (parse) diagnostics for specific files or all files.
|
|
648
|
+
* @param file - Optional file(s) to get diagnostics for. If omitted, returns diagnostics for all files.
|
|
172
649
|
*/
|
|
173
|
-
getSyntacticDiagnostics(
|
|
650
|
+
get getSyntacticDiagnostics(): {
|
|
651
|
+
(file?: DocumentIdentifier | readonly DocumentIdentifier[]): readonly Diagnostic[];
|
|
652
|
+
gen(file?: DocumentIdentifier | readonly DocumentIdentifier[]): Generator<ProtocolRequest, readonly Diagnostic[], ProtocolResponse["result"]>;
|
|
653
|
+
};
|
|
174
654
|
/**
|
|
175
|
-
* Get binder diagnostics for
|
|
176
|
-
* @param file - Optional file to get diagnostics for. If omitted, returns diagnostics for all files.
|
|
655
|
+
* Get binder diagnostics for specific files or all files.
|
|
656
|
+
* @param file - Optional file(s) to get diagnostics for. If omitted, returns diagnostics for all files.
|
|
177
657
|
*/
|
|
178
|
-
getBindDiagnostics(
|
|
658
|
+
get getBindDiagnostics(): {
|
|
659
|
+
(file?: DocumentIdentifier | readonly DocumentIdentifier[]): readonly Diagnostic[];
|
|
660
|
+
gen(file?: DocumentIdentifier | readonly DocumentIdentifier[]): Generator<ProtocolRequest, readonly Diagnostic[], ProtocolResponse["result"]>;
|
|
661
|
+
};
|
|
179
662
|
/**
|
|
180
|
-
* Get semantic (type-check) diagnostics for
|
|
181
|
-
* @param file - Optional file to get diagnostics for. If omitted, returns diagnostics for all files.
|
|
663
|
+
* Get semantic (type-check) diagnostics for specific files or all files.
|
|
664
|
+
* @param file - Optional file(s) to get diagnostics for. If omitted, returns diagnostics for all files.
|
|
182
665
|
*/
|
|
183
|
-
getSemanticDiagnostics(
|
|
666
|
+
get getSemanticDiagnostics(): {
|
|
667
|
+
(file?: DocumentIdentifier | readonly DocumentIdentifier[]): readonly Diagnostic[];
|
|
668
|
+
gen(file?: DocumentIdentifier | readonly DocumentIdentifier[]): Generator<ProtocolRequest, readonly Diagnostic[], ProtocolResponse["result"]>;
|
|
669
|
+
};
|
|
184
670
|
/**
|
|
185
|
-
* Get suggestion diagnostics for
|
|
186
|
-
* @param file - Optional file to get diagnostics for. If omitted, returns diagnostics for all files.
|
|
671
|
+
* Get suggestion diagnostics for specific files or all files.
|
|
672
|
+
* @param file - Optional file(s) to get diagnostics for. If omitted, returns diagnostics for all files.
|
|
187
673
|
*/
|
|
188
|
-
getSuggestionDiagnostics(
|
|
674
|
+
get getSuggestionDiagnostics(): {
|
|
675
|
+
(file?: DocumentIdentifier | readonly DocumentIdentifier[]): readonly Diagnostic[];
|
|
676
|
+
gen(file?: DocumentIdentifier | readonly DocumentIdentifier[]): Generator<ProtocolRequest, readonly Diagnostic[], ProtocolResponse["result"]>;
|
|
677
|
+
};
|
|
189
678
|
/**
|
|
190
|
-
* Get declaration emit diagnostics for
|
|
191
|
-
* @param file - Optional file to get diagnostics for. If omitted, returns diagnostics for all files.
|
|
679
|
+
* Get declaration emit diagnostics for specific files or all files.
|
|
680
|
+
* @param file - Optional file(s) to get diagnostics for. If omitted, returns diagnostics for all files.
|
|
192
681
|
*/
|
|
193
|
-
getDeclarationDiagnostics(
|
|
682
|
+
get getDeclarationDiagnostics(): {
|
|
683
|
+
(file?: DocumentIdentifier | readonly DocumentIdentifier[]): readonly Diagnostic[];
|
|
684
|
+
gen(file?: DocumentIdentifier | readonly DocumentIdentifier[]): Generator<ProtocolRequest, readonly Diagnostic[], ProtocolResponse["result"]>;
|
|
685
|
+
};
|
|
194
686
|
/**
|
|
195
687
|
* Get program-wide diagnostics for the project, including compiler options diagnostics.
|
|
196
688
|
*/
|
|
197
|
-
getProgramDiagnostics():
|
|
689
|
+
get getProgramDiagnostics(): {
|
|
690
|
+
(): readonly Diagnostic[];
|
|
691
|
+
gen(): Generator<ProtocolRequest, readonly Diagnostic[], ProtocolResponse["result"]>;
|
|
692
|
+
};
|
|
198
693
|
/**
|
|
199
694
|
* Get global (non-file-specific) semantic diagnostics for the project.
|
|
200
695
|
*/
|
|
201
|
-
getGlobalDiagnostics():
|
|
696
|
+
get getGlobalDiagnostics(): {
|
|
697
|
+
(): readonly Diagnostic[];
|
|
698
|
+
gen(): Generator<ProtocolRequest, readonly Diagnostic[], ProtocolResponse["result"]>;
|
|
699
|
+
};
|
|
202
700
|
/**
|
|
203
701
|
* Get config file parsing diagnostics for the project.
|
|
204
702
|
*/
|
|
205
|
-
getConfigFileParsingDiagnostics():
|
|
703
|
+
get getConfigFileParsingDiagnostics(): {
|
|
704
|
+
(): readonly Diagnostic[];
|
|
705
|
+
gen(): Generator<ProtocolRequest, readonly Diagnostic[], ProtocolResponse["result"]>;
|
|
706
|
+
};
|
|
707
|
+
/**
|
|
708
|
+
* Emits files to the configured filesystem. Layer and host filesystems are
|
|
709
|
+
* written through; full filesystems remain immutable and return emitted
|
|
710
|
+
* files in {@link EmitResult.fileSystem}.
|
|
711
|
+
*/
|
|
712
|
+
get emit(): {
|
|
713
|
+
(emitOnly?: EmitOnly): EmitResult;
|
|
714
|
+
gen(emitOnly?: EmitOnly): Generator<ProtocolRequest, EmitResult, ProtocolResponse["result"]>;
|
|
715
|
+
};
|
|
716
|
+
/**
|
|
717
|
+
* Emits files and returns their contents without writing to the filesystem.
|
|
718
|
+
*/
|
|
719
|
+
get emitToString(): {
|
|
720
|
+
(emitOnly?: EmitOnly): EmitOutput;
|
|
721
|
+
gen(emitOnly?: EmitOnly): Generator<ProtocolRequest, EmitOutput, ProtocolResponse["result"]>;
|
|
722
|
+
};
|
|
723
|
+
/**
|
|
724
|
+
* Gets JavaScript output for selected files regardless of project `noEmit`, `emitDeclarationOnly`, and `noEmitOnError` settings.
|
|
725
|
+
*/
|
|
726
|
+
get getJavaScriptEmit(): {
|
|
727
|
+
(files: readonly DocumentIdentifier[]): EmitOutput;
|
|
728
|
+
gen(files: readonly DocumentIdentifier[]): Generator<ProtocolRequest, EmitOutput, ProtocolResponse["result"]>;
|
|
729
|
+
};
|
|
730
|
+
/**
|
|
731
|
+
* Gets declaration output for selected files regardless of project `noEmit`, `declaration`, `emitDeclarationOnly`, and `noEmitOnError` settings.
|
|
732
|
+
*/
|
|
733
|
+
get getDeclarationEmit(): {
|
|
734
|
+
(files: readonly DocumentIdentifier[]): EmitOutput;
|
|
735
|
+
gen(files: readonly DocumentIdentifier[]): Generator<ProtocolRequest, EmitOutput, ProtocolResponse["result"]>;
|
|
736
|
+
};
|
|
737
|
+
getProject(): Project<Id>;
|
|
738
|
+
}
|
|
739
|
+
export interface BuildOrchestratorOptions {
|
|
740
|
+
cwd?: string | undefined;
|
|
741
|
+
dry?: boolean;
|
|
742
|
+
force?: boolean;
|
|
743
|
+
verbose?: boolean;
|
|
744
|
+
stopBuildOnErrors?: boolean;
|
|
745
|
+
overrideCompilerOptions?: OverrideCompilerOptions;
|
|
746
|
+
}
|
|
747
|
+
export interface OverrideCompilerOptions {
|
|
748
|
+
incremental?: boolean;
|
|
749
|
+
assumeChangesOnlyAffectDirectDependencies?: boolean;
|
|
750
|
+
declaration?: boolean;
|
|
751
|
+
declarationMap?: boolean;
|
|
752
|
+
emitDeclarationOnly?: boolean;
|
|
753
|
+
sourceMap?: boolean;
|
|
754
|
+
inlineSourceMap?: boolean;
|
|
755
|
+
traceResolution?: boolean;
|
|
756
|
+
}
|
|
757
|
+
export declare class BuildOrchestrator {
|
|
758
|
+
private client;
|
|
759
|
+
private id;
|
|
760
|
+
private disposed;
|
|
761
|
+
private disposePromise;
|
|
762
|
+
private onDispose;
|
|
763
|
+
constructor(client: Client, orchestratorResponse: CreateBuildOrchestratorResponse, onDispose: () => void);
|
|
764
|
+
[globalThis.Symbol.dispose](): void;
|
|
765
|
+
get dispose(): {
|
|
766
|
+
(): void;
|
|
767
|
+
gen(): Generator<ProtocolRequest, void, ProtocolResponse["result"]>;
|
|
768
|
+
};
|
|
769
|
+
private get disposeWorker();
|
|
770
|
+
get build(): {
|
|
771
|
+
(project?: string): BuildResponse;
|
|
772
|
+
gen(project?: string): Generator<ProtocolRequest, BuildResponse, ProtocolResponse["result"]>;
|
|
773
|
+
};
|
|
774
|
+
get buildReferences(): {
|
|
775
|
+
(project: string): BuildResponse;
|
|
776
|
+
gen(project: string): Generator<ProtocolRequest, BuildResponse, ProtocolResponse["result"]>;
|
|
777
|
+
};
|
|
778
|
+
get clean(): {
|
|
779
|
+
(project?: string): CleanBuildResponse;
|
|
780
|
+
gen(project?: string): Generator<ProtocolRequest, CleanBuildResponse, ProtocolResponse["result"]>;
|
|
781
|
+
};
|
|
782
|
+
get cleanReferences(): {
|
|
783
|
+
(project?: string): CleanBuildResponse;
|
|
784
|
+
gen(project?: string): Generator<ProtocolRequest, CleanBuildResponse, ProtocolResponse["result"]>;
|
|
785
|
+
};
|
|
786
|
+
isDisposed(): boolean;
|
|
787
|
+
private ensureNotDisposed;
|
|
206
788
|
}
|
|
207
789
|
export declare class Checker {
|
|
208
790
|
private snapshotId;
|
|
209
791
|
private project;
|
|
210
|
-
private client;
|
|
211
792
|
private objectRegistry;
|
|
212
793
|
private wellKnownSymbols;
|
|
213
|
-
|
|
794
|
+
private wellKnownSignatures;
|
|
795
|
+
private get client();
|
|
796
|
+
constructor(snapshotId: number, project: Project, objectRegistry: ProjectObjectRegistry);
|
|
214
797
|
dispose(): void;
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
798
|
+
/** Get the merged symbol, or the original symbol if it has not been merged. */
|
|
799
|
+
get getMergedSymbol(): {
|
|
800
|
+
(symbol: Symbol): Symbol;
|
|
801
|
+
gen(symbol: Symbol): Generator<ProtocolRequest, Symbol, ProtocolResponse["result"]>;
|
|
802
|
+
};
|
|
803
|
+
/**
|
|
804
|
+
* Get a node's merged symbol. For a declaration, prefer
|
|
805
|
+
* {@link Checker.getSymbolOfDeclaration} for a non-nullable result.
|
|
806
|
+
*/
|
|
807
|
+
get getSymbolOfNode(): {
|
|
808
|
+
(node: Node): Symbol | undefined;
|
|
809
|
+
gen(node: Node): Generator<ProtocolRequest, Symbol | undefined, ProtocolResponse["result"]>;
|
|
810
|
+
};
|
|
811
|
+
/** Get a declaration's merged symbol. */
|
|
812
|
+
get getSymbolOfDeclaration(): {
|
|
813
|
+
(node: Declaration): Symbol;
|
|
814
|
+
gen(node: Declaration): Generator<ProtocolRequest, Symbol, ProtocolResponse["result"]>;
|
|
815
|
+
};
|
|
816
|
+
/** Get a symbol's merged parent, if any. */
|
|
817
|
+
get getParentOfSymbol(): {
|
|
818
|
+
(symbol: Symbol): Symbol | undefined;
|
|
819
|
+
gen(symbol: Symbol): Generator<ProtocolRequest, Symbol | undefined, ProtocolResponse["result"]>;
|
|
820
|
+
};
|
|
821
|
+
get getSymbolAtLocation(): {
|
|
822
|
+
(node: Node): Symbol | undefined;
|
|
823
|
+
(nodes: readonly Node[]): (Symbol | undefined)[];
|
|
824
|
+
gen(node: Node): Generator<ProtocolRequest, Symbol | undefined, ProtocolResponse["result"]>;
|
|
825
|
+
gen(nodes: readonly Node[]): Generator<ProtocolRequest, (Symbol | undefined)[], ProtocolResponse["result"]>;
|
|
826
|
+
};
|
|
827
|
+
get getSymbolAtPosition(): {
|
|
828
|
+
(file: DocumentIdentifier, position: number): Symbol | undefined;
|
|
829
|
+
(file: DocumentIdentifier, positions: readonly number[]): (Symbol | undefined)[];
|
|
830
|
+
gen(file: DocumentIdentifier, position: number): Generator<ProtocolRequest, Symbol | undefined, ProtocolResponse["result"]>;
|
|
831
|
+
gen(file: DocumentIdentifier, positions: readonly number[]): Generator<ProtocolRequest, (Symbol | undefined)[], ProtocolResponse["result"]>;
|
|
832
|
+
};
|
|
833
|
+
get getSymbolOfSourceFile(): {
|
|
834
|
+
(file: DocumentIdentifier): Symbol | undefined;
|
|
835
|
+
(files: readonly DocumentIdentifier[]): (Symbol | undefined)[];
|
|
836
|
+
gen(file: DocumentIdentifier): Generator<ProtocolRequest, Symbol | undefined, ProtocolResponse["result"]>;
|
|
837
|
+
gen(files: readonly DocumentIdentifier[]): Generator<ProtocolRequest, (Symbol | undefined)[], ProtocolResponse["result"]>;
|
|
838
|
+
};
|
|
839
|
+
/**
|
|
840
|
+
* Get the type of a symbol. Always returns a type; for symbols whose type
|
|
841
|
+
* cannot be determined the checker yields the error type (use
|
|
842
|
+
* {@link Type.isErrorType} to detect it).
|
|
843
|
+
*/
|
|
844
|
+
get getTypeOfSymbol(): {
|
|
845
|
+
(symbol: Symbol): Type;
|
|
846
|
+
(symbols: readonly Symbol[]): Type[];
|
|
847
|
+
gen(symbol: Symbol): Generator<ProtocolRequest, Type, ProtocolResponse["result"]>;
|
|
848
|
+
gen(symbols: readonly Symbol[]): Generator<ProtocolRequest, Type[], ProtocolResponse["result"]>;
|
|
849
|
+
};
|
|
221
850
|
/**
|
|
222
851
|
* Get the declared type of a symbol. Always returns a type; for symbols whose
|
|
223
852
|
* declared type cannot be determined the checker yields the error type (use
|
|
224
853
|
* {@link Type.isErrorType} to detect it).
|
|
225
854
|
*/
|
|
226
|
-
getDeclaredTypeOfSymbol(
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
855
|
+
get getDeclaredTypeOfSymbol(): {
|
|
856
|
+
(symbol: Symbol): Type;
|
|
857
|
+
gen(symbol: Symbol): Generator<ProtocolRequest, Type, ProtocolResponse["result"]>;
|
|
858
|
+
};
|
|
859
|
+
/**
|
|
860
|
+
* Get the type of a symbol, excluding the missing type when
|
|
861
|
+
* `exactOptionalPropertyTypes: true` is set; for symbols whose
|
|
862
|
+
* type cannot be determined the checker yields the error type
|
|
863
|
+
* (use {@link Type.isErrorType} to detect it).
|
|
864
|
+
*/
|
|
865
|
+
get getNonMissingTypeOfSymbol(): {
|
|
866
|
+
(symbol: Symbol): Type;
|
|
867
|
+
gen(symbol: Symbol): Generator<ProtocolRequest, Type, ProtocolResponse["result"]>;
|
|
868
|
+
};
|
|
869
|
+
get getReferencesToSymbolInFile(): {
|
|
870
|
+
(file: DocumentIdentifier, symbol: Symbol): NodeHandle[];
|
|
871
|
+
gen(file: DocumentIdentifier, symbol: Symbol): Generator<ProtocolRequest, NodeHandle[], ProtocolResponse["result"]>;
|
|
872
|
+
};
|
|
873
|
+
/**
|
|
874
|
+
* Get the type at a node location. Always returns a type; for nodes whose
|
|
875
|
+
* type cannot be determined the checker yields the error type (use
|
|
876
|
+
* {@link Type.isErrorType} to detect it).
|
|
877
|
+
*/
|
|
878
|
+
get getTypeAtLocation(): {
|
|
879
|
+
(node: Node): Type;
|
|
880
|
+
(nodes: readonly Node[]): Type[];
|
|
881
|
+
gen(node: Node): Generator<ProtocolRequest, Type, ProtocolResponse["result"]>;
|
|
882
|
+
gen(nodes: readonly Node[]): Generator<ProtocolRequest, Type[], ProtocolResponse["result"]>;
|
|
883
|
+
};
|
|
884
|
+
get getSignaturesOfType(): {
|
|
885
|
+
(type: Type, kind: SignatureKind): readonly Signature[];
|
|
886
|
+
gen(type: Type, kind: SignatureKind): Generator<ProtocolRequest, readonly Signature[], ProtocolResponse["result"]>;
|
|
887
|
+
};
|
|
888
|
+
/**
|
|
889
|
+
* Get the resolved signature of a call-like expression. Always returns a
|
|
890
|
+
* signature; when a call cannot be resolved the checker yields the unknown
|
|
891
|
+
* signature (use {@link Checker.isUnknownSignature} to detect it).
|
|
892
|
+
*/
|
|
893
|
+
get getResolvedSignature(): {
|
|
894
|
+
(node: Node): Signature;
|
|
895
|
+
gen(node: Node): Generator<ProtocolRequest, Signature, ProtocolResponse["result"]>;
|
|
896
|
+
};
|
|
897
|
+
get getTypeAtPosition(): {
|
|
898
|
+
(file: DocumentIdentifier, position: number): Type | undefined;
|
|
899
|
+
(file: DocumentIdentifier, positions: readonly number[]): (Type | undefined)[];
|
|
900
|
+
gen(file: DocumentIdentifier, position: number): Generator<ProtocolRequest, Type | undefined, ProtocolResponse["result"]>;
|
|
901
|
+
gen(file: DocumentIdentifier, positions: readonly number[]): Generator<ProtocolRequest, (Type | undefined)[], ProtocolResponse["result"]>;
|
|
902
|
+
};
|
|
903
|
+
get resolveName(): {
|
|
904
|
+
(name: string, meaning: SymbolFlags, location?: Node | DocumentPosition, excludeGlobals?: boolean): Symbol | undefined;
|
|
905
|
+
gen(name: string, meaning: SymbolFlags, location?: Node | DocumentPosition, excludeGlobals?: boolean): Generator<ProtocolRequest, Symbol | undefined, ProtocolResponse["result"]>;
|
|
906
|
+
};
|
|
907
|
+
/**
|
|
908
|
+
* Returns all symbols with the given meaning that are visible at `location`.
|
|
909
|
+
*/
|
|
910
|
+
get getSymbolsInScope(): {
|
|
911
|
+
(location: Node | DocumentPosition, meaning: SymbolFlags): readonly Symbol[];
|
|
912
|
+
gen(location: Node | DocumentPosition, meaning: SymbolFlags): Generator<ProtocolRequest, readonly Symbol[], ProtocolResponse["result"]>;
|
|
913
|
+
};
|
|
914
|
+
get getResolvedSymbol(): {
|
|
915
|
+
(node: Identifier): Symbol | undefined;
|
|
916
|
+
gen(node: Identifier): Generator<ProtocolRequest, Symbol | undefined, ProtocolResponse["result"]>;
|
|
917
|
+
};
|
|
918
|
+
get getContextualType(): {
|
|
919
|
+
(node: Expression): Type | undefined;
|
|
920
|
+
gen(node: Expression): Generator<ProtocolRequest, Type | undefined, ProtocolResponse["result"]>;
|
|
921
|
+
};
|
|
922
|
+
get getContextualTypeForArgumentAtIndex(): {
|
|
923
|
+
(node: CallLikeExpression, argIndex: number): Type | undefined;
|
|
924
|
+
gen(node: CallLikeExpression, argIndex: number): Generator<ProtocolRequest, Type | undefined, ProtocolResponse["result"]>;
|
|
925
|
+
};
|
|
926
|
+
get getAwaitedType(): {
|
|
927
|
+
(type: Type): Type | undefined;
|
|
928
|
+
gen(type: Type): Generator<ProtocolRequest, Type | undefined, ProtocolResponse["result"]>;
|
|
929
|
+
};
|
|
930
|
+
/** Get the base type of a literal type (e.g. `number` for `42`). Always returns a type. */
|
|
931
|
+
get getBaseTypeOfLiteralType(): {
|
|
932
|
+
(type: Type): Type;
|
|
933
|
+
gen(type: Type): Generator<ProtocolRequest, Type, ProtocolResponse["result"]>;
|
|
934
|
+
};
|
|
935
|
+
/** Get the type with `null` and `undefined` removed. Always returns a type. */
|
|
936
|
+
get getNonNullableType(): {
|
|
937
|
+
(type: Type): Type;
|
|
938
|
+
gen(type: Type): Generator<ProtocolRequest, Type, ProtocolResponse["result"]>;
|
|
939
|
+
};
|
|
940
|
+
/**
|
|
941
|
+
* Get the type for a type node. Always returns a type; for type nodes whose
|
|
942
|
+
* type cannot be determined the checker yields the error type (use
|
|
943
|
+
* {@link Type.isErrorType} to detect it).
|
|
944
|
+
*/
|
|
945
|
+
get getTypeFromTypeNode(): {
|
|
946
|
+
(node: TypeNode): Type;
|
|
947
|
+
gen(node: TypeNode): Generator<ProtocolRequest, Type, ProtocolResponse["result"]>;
|
|
948
|
+
};
|
|
949
|
+
/** Get the widened type. Always returns a type. */
|
|
950
|
+
get getWidenedType(): {
|
|
951
|
+
(type: Type): Type;
|
|
952
|
+
gen(type: Type): Generator<ProtocolRequest, Type, ProtocolResponse["result"]>;
|
|
953
|
+
};
|
|
954
|
+
/**
|
|
955
|
+
* Get the type of the parameter at the given index in a signature. Always
|
|
956
|
+
* returns a type; an out-of-range index yields the `any` type.
|
|
957
|
+
*/
|
|
958
|
+
get getParameterType(): {
|
|
959
|
+
(signature: Signature, index: number): Type;
|
|
960
|
+
gen(signature: Signature, index: number): Generator<ProtocolRequest, Type, ProtocolResponse["result"]>;
|
|
961
|
+
};
|
|
962
|
+
get isArrayLikeType(): {
|
|
963
|
+
(type: Type): boolean;
|
|
964
|
+
gen(type: Type): Generator<ProtocolRequest, boolean, ProtocolResponse["result"]>;
|
|
965
|
+
};
|
|
966
|
+
get isTypeAssignableTo(): {
|
|
967
|
+
(source: Type, target: Type): boolean;
|
|
968
|
+
gen(source: Type, target: Type): Generator<ProtocolRequest, boolean, ProtocolResponse["result"]>;
|
|
969
|
+
};
|
|
970
|
+
get getShorthandAssignmentValueSymbol(): {
|
|
971
|
+
(node: Node): Symbol | undefined;
|
|
972
|
+
gen(node: Node): Generator<ProtocolRequest, Symbol | undefined, ProtocolResponse["result"]>;
|
|
973
|
+
};
|
|
248
974
|
/**
|
|
249
975
|
* Get the type of a symbol as narrowed at a specific location. Always returns
|
|
250
976
|
* a type; for symbols whose type cannot be determined the checker yields the
|
|
251
977
|
* error type (use {@link Type.isErrorType} to detect it).
|
|
252
978
|
*/
|
|
253
|
-
getTypeOfSymbolAtLocation(
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
979
|
+
get getTypeOfSymbolAtLocation(): {
|
|
980
|
+
(symbol: Symbol, location: Node): Type;
|
|
981
|
+
gen(symbol: Symbol, location: Node): Generator<ProtocolRequest, Type, ProtocolResponse["result"]>;
|
|
982
|
+
};
|
|
983
|
+
private get getIntrinsicType();
|
|
984
|
+
get getAnyType(): {
|
|
985
|
+
(): Type;
|
|
986
|
+
gen(): Generator<ProtocolRequest, Type, ProtocolResponse["result"]>;
|
|
987
|
+
};
|
|
988
|
+
get getStringType(): {
|
|
989
|
+
(): Type;
|
|
990
|
+
gen(): Generator<ProtocolRequest, Type, ProtocolResponse["result"]>;
|
|
991
|
+
};
|
|
992
|
+
get getNumberType(): {
|
|
993
|
+
(): Type;
|
|
994
|
+
gen(): Generator<ProtocolRequest, Type, ProtocolResponse["result"]>;
|
|
995
|
+
};
|
|
996
|
+
get getBooleanType(): {
|
|
997
|
+
(): Type;
|
|
998
|
+
gen(): Generator<ProtocolRequest, Type, ProtocolResponse["result"]>;
|
|
999
|
+
};
|
|
1000
|
+
get getVoidType(): {
|
|
1001
|
+
(): Type;
|
|
1002
|
+
gen(): Generator<ProtocolRequest, Type, ProtocolResponse["result"]>;
|
|
1003
|
+
};
|
|
1004
|
+
get getUndefinedType(): {
|
|
1005
|
+
(): Type;
|
|
1006
|
+
gen(): Generator<ProtocolRequest, Type, ProtocolResponse["result"]>;
|
|
1007
|
+
};
|
|
1008
|
+
get getNullType(): {
|
|
1009
|
+
(): Type;
|
|
1010
|
+
gen(): Generator<ProtocolRequest, Type, ProtocolResponse["result"]>;
|
|
1011
|
+
};
|
|
1012
|
+
get getNeverType(): {
|
|
1013
|
+
(): Type;
|
|
1014
|
+
gen(): Generator<ProtocolRequest, Type, ProtocolResponse["result"]>;
|
|
1015
|
+
};
|
|
1016
|
+
get getUnknownType(): {
|
|
1017
|
+
(): Type;
|
|
1018
|
+
gen(): Generator<ProtocolRequest, Type, ProtocolResponse["result"]>;
|
|
1019
|
+
};
|
|
1020
|
+
get getBigIntType(): {
|
|
1021
|
+
(): Type;
|
|
1022
|
+
gen(): Generator<ProtocolRequest, Type, ProtocolResponse["result"]>;
|
|
1023
|
+
};
|
|
1024
|
+
get getESSymbolType(): {
|
|
1025
|
+
(): Type;
|
|
1026
|
+
gen(): Generator<ProtocolRequest, Type, ProtocolResponse["result"]>;
|
|
1027
|
+
};
|
|
1028
|
+
get getNonPrimitiveType(): {
|
|
1029
|
+
(): Type;
|
|
1030
|
+
gen(): Generator<ProtocolRequest, Type, ProtocolResponse["result"]>;
|
|
1031
|
+
};
|
|
1032
|
+
get typeToTypeNode(): {
|
|
1033
|
+
(type: Type, enclosingDeclaration?: Node, flags?: number): TypeNode | undefined;
|
|
1034
|
+
gen(type: Type, enclosingDeclaration?: Node, flags?: number): Generator<ProtocolRequest, TypeNode | undefined, ProtocolResponse["result"]>;
|
|
1035
|
+
};
|
|
1036
|
+
get signatureToSignatureDeclaration(): {
|
|
1037
|
+
(signature: Signature, kind: SyntaxKind, enclosingDeclaration?: Node, flags?: NodeBuilderFlags): Node | undefined;
|
|
1038
|
+
gen(signature: Signature, kind: SyntaxKind, enclosingDeclaration?: Node, flags?: NodeBuilderFlags): Generator<ProtocolRequest, Node | undefined, ProtocolResponse["result"]>;
|
|
1039
|
+
};
|
|
1040
|
+
get typeToString(): {
|
|
1041
|
+
(type: Type, enclosingDeclaration?: Node, flags?: TypeFormatFlags): string;
|
|
1042
|
+
gen(type: Type, enclosingDeclaration?: Node, flags?: TypeFormatFlags): Generator<ProtocolRequest, string, ProtocolResponse["result"]>;
|
|
1043
|
+
};
|
|
1044
|
+
get isContextSensitive(): {
|
|
1045
|
+
(node: Node): boolean;
|
|
1046
|
+
gen(node: Node): Generator<ProtocolRequest, boolean, ProtocolResponse["result"]>;
|
|
1047
|
+
};
|
|
1048
|
+
get isArrayType(): {
|
|
1049
|
+
(type: Type): boolean;
|
|
1050
|
+
gen(type: Type): Generator<ProtocolRequest, boolean, ProtocolResponse["result"]>;
|
|
1051
|
+
};
|
|
1052
|
+
get isTupleType(): {
|
|
1053
|
+
(type: Type): boolean;
|
|
1054
|
+
gen(type: Type): Generator<ProtocolRequest, boolean, ProtocolResponse["result"]>;
|
|
1055
|
+
};
|
|
1056
|
+
get isTupleTypeTarget(): {
|
|
1057
|
+
(type: Type): boolean;
|
|
1058
|
+
gen(type: Type): Generator<ProtocolRequest, boolean, ProtocolResponse["result"]>;
|
|
1059
|
+
};
|
|
1060
|
+
/**
|
|
1061
|
+
* The following symbols are considered read-only:
|
|
1062
|
+
* - Properties with a `readonly` modifier
|
|
1063
|
+
* - Variables declared with `const`
|
|
1064
|
+
* - Get accessors without matching set accessors
|
|
1065
|
+
* - Enum members
|
|
1066
|
+
* - `Object.defineProperty` assignments with `writable: false` or no setter
|
|
1067
|
+
* - Unions and intersections of the above
|
|
1068
|
+
*/
|
|
1069
|
+
get isReadonlySymbol(): {
|
|
1070
|
+
(symbol: Symbol): boolean;
|
|
1071
|
+
gen(symbol: Symbol): Generator<ProtocolRequest, boolean, ProtocolResponse["result"]>;
|
|
1072
|
+
};
|
|
1073
|
+
/** Get the return type of a signature. Always returns a type. */
|
|
1074
|
+
get getReturnTypeOfSignature(): {
|
|
1075
|
+
(signature: Signature): Type;
|
|
1076
|
+
gen(signature: Signature): Generator<ProtocolRequest, Type, ProtocolResponse["result"]>;
|
|
1077
|
+
};
|
|
1078
|
+
/**
|
|
1079
|
+
* Get the rest type of a signature. Always returns a type; a signature with
|
|
1080
|
+
* no rest parameter yields the `any` type.
|
|
1081
|
+
*/
|
|
1082
|
+
get getRestTypeOfSignature(): {
|
|
1083
|
+
(signature: Signature): Type;
|
|
1084
|
+
gen(signature: Signature): Generator<ProtocolRequest, Type, ProtocolResponse["result"]>;
|
|
1085
|
+
};
|
|
1086
|
+
get getTypePredicateOfSignature(): {
|
|
1087
|
+
(signature: Signature): TypePredicate | undefined;
|
|
1088
|
+
gen(signature: Signature): Generator<ProtocolRequest, TypePredicate | undefined, ProtocolResponse["result"]>;
|
|
1089
|
+
};
|
|
275
1090
|
/**
|
|
276
1091
|
* Get the base types of a class or interface type. A type with no base types
|
|
277
1092
|
* yields an empty array.
|
|
278
1093
|
*/
|
|
279
|
-
getBaseTypes(
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
1094
|
+
get getBaseTypes(): {
|
|
1095
|
+
(type: InterfaceType): readonly Type[];
|
|
1096
|
+
gen(type: InterfaceType): Generator<ProtocolRequest, readonly Type[], ProtocolResponse["result"]>;
|
|
1097
|
+
};
|
|
1098
|
+
/** Get the apparent type of a type. Always returns a type. */
|
|
1099
|
+
get getApparentType(): {
|
|
1100
|
+
(type: Type): Type;
|
|
1101
|
+
gen(type: Type): Generator<ProtocolRequest, Type, ProtocolResponse["result"]>;
|
|
1102
|
+
};
|
|
1103
|
+
/** Get the reduced type of a type. Always returns a type. */
|
|
1104
|
+
get getReducedType(): {
|
|
1105
|
+
(type: Type): Type;
|
|
1106
|
+
gen(type: Type): Generator<ProtocolRequest, Type, ProtocolResponse["result"]>;
|
|
1107
|
+
};
|
|
1108
|
+
get getPropertiesOfType(): {
|
|
1109
|
+
(type: Type): readonly Symbol[];
|
|
1110
|
+
gen(type: Type): Generator<ProtocolRequest, readonly Symbol[], ProtocolResponse["result"]>;
|
|
1111
|
+
};
|
|
1112
|
+
get getIndexInfosOfType(): {
|
|
1113
|
+
(type: Type): readonly IndexInfo[];
|
|
1114
|
+
gen(type: Type): Generator<ProtocolRequest, readonly IndexInfo[], ProtocolResponse["result"]>;
|
|
1115
|
+
};
|
|
1116
|
+
get getIndexInfoOfType(): {
|
|
1117
|
+
(type: Type, kind: IndexKind): IndexInfo | undefined;
|
|
1118
|
+
gen(type: Type, kind: IndexKind): Generator<ProtocolRequest, IndexInfo | undefined, ProtocolResponse["result"]>;
|
|
1119
|
+
};
|
|
1120
|
+
get getIndexTypeOfType(): {
|
|
1121
|
+
(type: Type, kind: IndexKind): Type | undefined;
|
|
1122
|
+
gen(type: Type, kind: IndexKind): Generator<ProtocolRequest, Type | undefined, ProtocolResponse["result"]>;
|
|
1123
|
+
};
|
|
1124
|
+
get getTypeOfPropertyOfType(): {
|
|
1125
|
+
(type: Type, propertyName: string): Type | undefined;
|
|
1126
|
+
gen(type: Type, propertyName: string): Generator<ProtocolRequest, Type | undefined, ProtocolResponse["result"]>;
|
|
1127
|
+
};
|
|
283
1128
|
/**
|
|
284
1129
|
* Get the constraint of a type parameter (the `T` in `<U extends T>`), or
|
|
285
1130
|
* undefined if it has none.
|
|
286
1131
|
*/
|
|
287
|
-
getConstraintOfTypeParameter(
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
1132
|
+
get getConstraintOfTypeParameter(): {
|
|
1133
|
+
(type: TypeParameter): Type | undefined;
|
|
1134
|
+
gen(type: TypeParameter): Generator<ProtocolRequest, Type | undefined, ProtocolResponse["result"]>;
|
|
1135
|
+
};
|
|
1136
|
+
get getDefaultFromTypeParameter(): {
|
|
1137
|
+
(type: TypeParameter): Type | undefined;
|
|
1138
|
+
gen(type: TypeParameter): Generator<ProtocolRequest, Type | undefined, ProtocolResponse["result"]>;
|
|
1139
|
+
};
|
|
1140
|
+
get getBaseConstraintOfType(): {
|
|
1141
|
+
(type: Type): Type | undefined;
|
|
1142
|
+
gen(type: Type): Generator<ProtocolRequest, Type | undefined, ProtocolResponse["result"]>;
|
|
1143
|
+
};
|
|
1144
|
+
get getPropertyOfType(): {
|
|
1145
|
+
(type: Type, name: string): Symbol | undefined;
|
|
1146
|
+
gen(type: Type, name: string): Generator<ProtocolRequest, Symbol | undefined, ProtocolResponse["result"]>;
|
|
1147
|
+
};
|
|
1148
|
+
get getConstantValue(): {
|
|
1149
|
+
(node: Node): string | number | undefined;
|
|
1150
|
+
gen(node: Node): Generator<ProtocolRequest, string | number | undefined, ProtocolResponse["result"]>;
|
|
1151
|
+
};
|
|
1152
|
+
/** Get the signature of a function-like declaration. Always returns a signature. */
|
|
1153
|
+
get getSignatureFromDeclaration(): {
|
|
1154
|
+
(node: Node): Signature;
|
|
1155
|
+
gen(node: Node): Generator<ProtocolRequest, Signature, ProtocolResponse["result"]>;
|
|
1156
|
+
};
|
|
1157
|
+
get getExportSpecifierLocalTargetSymbol(): {
|
|
1158
|
+
(node: Node): Symbol | undefined;
|
|
1159
|
+
gen(node: Node): Generator<ProtocolRequest, Symbol | undefined, ProtocolResponse["result"]>;
|
|
1160
|
+
};
|
|
293
1161
|
/**
|
|
294
1162
|
* Follow all aliases to get the original symbol. Always returns a symbol; for
|
|
295
1163
|
* an unresolved alias the checker yields the unknown symbol (use
|
|
296
1164
|
* {@link Checker.isUnknownSymbol} to detect it).
|
|
297
1165
|
*/
|
|
298
|
-
getAliasedSymbol(
|
|
299
|
-
|
|
1166
|
+
get getAliasedSymbol(): {
|
|
1167
|
+
(symbol: Symbol): Symbol;
|
|
1168
|
+
gen(symbol: Symbol): Generator<ProtocolRequest, Symbol, ProtocolResponse["result"]>;
|
|
1169
|
+
};
|
|
1170
|
+
/**
|
|
1171
|
+
* Get the fully qualified name of a symbol, walking up its parent chain
|
|
1172
|
+
* (e.g. `"/path/to/module".Namespace.Name`).
|
|
1173
|
+
*/
|
|
1174
|
+
get getFullyQualifiedName(): {
|
|
1175
|
+
(symbol: Symbol): string;
|
|
1176
|
+
gen(symbol: Symbol): Generator<ProtocolRequest, string, ProtocolResponse["result"]>;
|
|
1177
|
+
};
|
|
1178
|
+
get getImmediateAliasedSymbol(): {
|
|
1179
|
+
(symbol: Symbol): Symbol | undefined;
|
|
1180
|
+
gen(symbol: Symbol): Generator<ProtocolRequest, Symbol | undefined, ProtocolResponse["result"]>;
|
|
1181
|
+
};
|
|
1182
|
+
/**
|
|
1183
|
+
* Get the target symbol if instantiated, or the provided symbol otherwise.
|
|
1184
|
+
*/
|
|
1185
|
+
get getTargetSymbol(): {
|
|
1186
|
+
(symbol: Symbol): Symbol;
|
|
1187
|
+
gen(symbol: Symbol): Generator<ProtocolRequest, Symbol, ProtocolResponse["result"]>;
|
|
1188
|
+
};
|
|
1189
|
+
get getExportSymbolOfSymbol(): {
|
|
1190
|
+
(symbol: Symbol): Symbol;
|
|
1191
|
+
gen(symbol: Symbol): Generator<ProtocolRequest, Symbol, ProtocolResponse["result"]>;
|
|
1192
|
+
};
|
|
300
1193
|
/**
|
|
301
1194
|
* Fetch (once, then cache) the handle ids of the per-checker singleton
|
|
302
1195
|
* symbols (unknown, undefined, arguments). These ids are stable for the life
|
|
303
1196
|
* of the project's checker, so identity checks against them are local after
|
|
304
1197
|
* the first call.
|
|
305
1198
|
*/
|
|
306
|
-
private getWellKnownSymbols;
|
|
1199
|
+
private get getWellKnownSymbols();
|
|
307
1200
|
/**
|
|
308
1201
|
* Returns `true` if the symbol is the checker's "unknown" symbol (e.g. the
|
|
309
1202
|
* result of {@link Checker.getAliasedSymbol} on an unresolved alias).
|
|
310
1203
|
*/
|
|
311
|
-
isUnknownSymbol(
|
|
1204
|
+
get isUnknownSymbol(): {
|
|
1205
|
+
(symbol: Symbol): boolean;
|
|
1206
|
+
gen(symbol: Symbol): Generator<ProtocolRequest, boolean, ProtocolResponse["result"]>;
|
|
1207
|
+
};
|
|
312
1208
|
/**
|
|
313
1209
|
* Returns `true` if the symbol is the checker's "undefined" symbol.
|
|
314
1210
|
*/
|
|
315
|
-
isUndefinedSymbol(
|
|
1211
|
+
get isUndefinedSymbol(): {
|
|
1212
|
+
(symbol: Symbol): boolean;
|
|
1213
|
+
gen(symbol: Symbol): Generator<ProtocolRequest, boolean, ProtocolResponse["result"]>;
|
|
1214
|
+
};
|
|
316
1215
|
/**
|
|
317
1216
|
* Returns `true` if the symbol is the checker's "arguments" symbol.
|
|
318
1217
|
*/
|
|
319
|
-
isArgumentsSymbol(
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
1218
|
+
get isArgumentsSymbol(): {
|
|
1219
|
+
(symbol: Symbol): boolean;
|
|
1220
|
+
gen(symbol: Symbol): Generator<ProtocolRequest, boolean, ProtocolResponse["result"]>;
|
|
1221
|
+
};
|
|
1222
|
+
/**
|
|
1223
|
+
* Fetch (once, then cache) the handle id of the per-checker unknown
|
|
1224
|
+
* signature. This id is stable for the life of the project's checker, so
|
|
1225
|
+
* identity checks against it are local after the first call.
|
|
1226
|
+
*/
|
|
1227
|
+
private get getWellKnownSignatures();
|
|
1228
|
+
/**
|
|
1229
|
+
* Returns `true` if the signature is the checker's "unknown" signature (e.g.
|
|
1230
|
+
* the result of {@link Checker.getResolvedSignature} on a call that cannot be
|
|
1231
|
+
* resolved).
|
|
1232
|
+
*/
|
|
1233
|
+
get isUnknownSignature(): {
|
|
1234
|
+
(signature: Signature): boolean;
|
|
1235
|
+
gen(signature: Signature): Generator<ProtocolRequest, boolean, ProtocolResponse["result"]>;
|
|
1236
|
+
};
|
|
1237
|
+
get getExportsOfModule(): {
|
|
1238
|
+
(symbol: Symbol): readonly Symbol[];
|
|
1239
|
+
gen(symbol: Symbol): Generator<ProtocolRequest, readonly Symbol[], ProtocolResponse["result"]>;
|
|
1240
|
+
};
|
|
1241
|
+
get getMemberInModuleExports(): {
|
|
1242
|
+
(symbol: Symbol, name: string): Symbol | undefined;
|
|
1243
|
+
gen(symbol: Symbol, name: string): Generator<ProtocolRequest, Symbol | undefined, ProtocolResponse["result"]>;
|
|
1244
|
+
};
|
|
1245
|
+
get getJsDocTagsOfSymbol(): {
|
|
1246
|
+
(symbol: Symbol): readonly JSDocTagInfo[];
|
|
1247
|
+
gen(symbol: Symbol): Generator<ProtocolRequest, readonly JSDocTagInfo[], ProtocolResponse["result"]>;
|
|
1248
|
+
};
|
|
1249
|
+
get getDocumentationCommentOfSymbol(): {
|
|
1250
|
+
(symbol: Symbol): string;
|
|
1251
|
+
gen(symbol: Symbol): Generator<ProtocolRequest, string, ProtocolResponse["result"]>;
|
|
1252
|
+
};
|
|
324
1253
|
/**
|
|
325
1254
|
* Get the type arguments of a type reference (e.g. the `string` in `Array<string>`).
|
|
326
1255
|
*/
|
|
327
|
-
getTypeArguments(
|
|
1256
|
+
get getTypeArguments(): {
|
|
1257
|
+
(type: TypeReference): readonly Type[];
|
|
1258
|
+
gen(type: TypeReference): Generator<ProtocolRequest, readonly Type[], ProtocolResponse["result"]>;
|
|
1259
|
+
};
|
|
328
1260
|
}
|
|
329
1261
|
export interface PrintNodeOptions {
|
|
330
1262
|
preserveSourceNewlines?: boolean | undefined;
|
|
331
1263
|
neverAsciiEscape?: boolean | undefined;
|
|
332
1264
|
terminateUnterminatedLiterals?: boolean | undefined;
|
|
333
1265
|
}
|
|
334
|
-
export declare class
|
|
1266
|
+
export declare class Printer {
|
|
335
1267
|
private client;
|
|
336
1268
|
constructor(client: Client);
|
|
337
|
-
printNode(
|
|
1269
|
+
get printNode(): {
|
|
1270
|
+
(node: Node, options?: PrintNodeOptions): string;
|
|
1271
|
+
gen(node: Node, options?: PrintNodeOptions): Generator<ProtocolRequest, string, ProtocolResponse["result"]>;
|
|
1272
|
+
};
|
|
1273
|
+
get printFile(): {
|
|
1274
|
+
(sourceFile: SourceFile, options?: PrintNodeOptions): string;
|
|
1275
|
+
gen(sourceFile: SourceFile, options?: PrintNodeOptions): Generator<ProtocolRequest, string, ProtocolResponse["result"]>;
|
|
1276
|
+
};
|
|
338
1277
|
}
|
|
339
|
-
export declare class NodeHandle {
|
|
1278
|
+
export declare class NodeHandle<out T extends Node = Node> {
|
|
340
1279
|
/**
|
|
341
1280
|
* The project this handle was produced in, used as the default for {@link resolve}.
|
|
342
1281
|
* Node handles are only meaningful within a project's program, so the producing project
|
|
343
1282
|
* is remembered so callers don't have to pass it explicitly.
|
|
344
1283
|
*/
|
|
345
1284
|
private readonly canonicalProject;
|
|
1285
|
+
/** The owning source file of a file-owned symbol's declaration. */
|
|
1286
|
+
private readonly fileOwner;
|
|
346
1287
|
readonly index: number;
|
|
347
1288
|
readonly kind: SyntaxKind;
|
|
348
|
-
readonly path:
|
|
349
|
-
constructor(handle: string, canonicalProject: Project);
|
|
1289
|
+
readonly path: PathKey;
|
|
1290
|
+
constructor(handle: string, canonicalProject: Project | undefined, fileOwner?: SourceFileOwner);
|
|
350
1291
|
/**
|
|
351
1292
|
* Resolve this handle to the actual AST node by fetching the source file from a project
|
|
352
1293
|
* and looking up the node by index. If no project is passed, the project that produced
|
|
353
|
-
* the handle is used.
|
|
1294
|
+
* the handle is used. Declarations of file-owned symbols identify an exact source file and
|
|
1295
|
+
* resolve through it, independently of any project.
|
|
354
1296
|
*/
|
|
355
|
-
resolve(
|
|
1297
|
+
get resolve(): {
|
|
1298
|
+
(project?: Project | undefined): T | undefined;
|
|
1299
|
+
gen(project?: Project | undefined): Generator<ProtocolRequest, T | undefined, ProtocolResponse["result"]>;
|
|
1300
|
+
};
|
|
1301
|
+
private get fetchOwnerFile();
|
|
356
1302
|
}
|
|
357
1303
|
/** A symbol definition paired with all of its reference nodes. */
|
|
358
1304
|
export interface ReferencedSymbolEntry {
|
|
@@ -370,64 +1316,94 @@ export interface SignatureUsage {
|
|
|
370
1316
|
/** The node handle for the call expression, if the reference is invoked. */
|
|
371
1317
|
call?: NodeHandle | undefined;
|
|
372
1318
|
}
|
|
1319
|
+
/** A cached source-file record and its owning API. */
|
|
1320
|
+
interface SourceFileOwner {
|
|
1321
|
+
readonly record: CachedSourceFile<Symbol>;
|
|
1322
|
+
readonly api: API<boolean>;
|
|
1323
|
+
}
|
|
1324
|
+
type SymbolStorage = {
|
|
1325
|
+
readonly kind: typeof SymbolOwnerKind.File;
|
|
1326
|
+
readonly owner: SourceFileOwner;
|
|
1327
|
+
} | {
|
|
1328
|
+
readonly kind: typeof SymbolOwnerKind.Snapshot;
|
|
1329
|
+
readonly registry: ProjectObjectRegistry;
|
|
1330
|
+
};
|
|
373
1331
|
export declare class Symbol {
|
|
374
|
-
private
|
|
375
|
-
|
|
376
|
-
* The project this symbol was first observed in, used as the default project for
|
|
377
|
-
* lookups that need a project context (members/exports/parent). Symbols are shared
|
|
378
|
-
* snapshot-wide, so these lookups can otherwise be ambiguous about which project to use.
|
|
379
|
-
*/
|
|
380
|
-
private readonly canonicalProject;
|
|
381
|
-
readonly id: number;
|
|
1332
|
+
private readonly storage;
|
|
1333
|
+
get id(): number;
|
|
382
1334
|
/** The escaped (`__String`) name, used as the key in member/export tables. */
|
|
383
1335
|
readonly escapedName: __String;
|
|
384
1336
|
/** The display name (escaped underscores removed). */
|
|
385
1337
|
readonly name: string;
|
|
386
1338
|
readonly flags: SymbolFlags;
|
|
387
|
-
readonly checkFlags:
|
|
388
|
-
readonly declarations: readonly NodeHandle[];
|
|
389
|
-
readonly valueDeclaration: NodeHandle | undefined;
|
|
1339
|
+
readonly checkFlags: CheckFlags;
|
|
1340
|
+
readonly declarations: readonly NodeHandle<Declaration>[];
|
|
1341
|
+
readonly valueDeclaration: NodeHandle<Declaration> | undefined;
|
|
390
1342
|
private readonly parent;
|
|
391
1343
|
private readonly exportSymbol;
|
|
392
1344
|
private membersCache;
|
|
393
1345
|
private exportsCache;
|
|
394
|
-
constructor(data: SymbolResponse,
|
|
395
|
-
getParent():
|
|
1346
|
+
constructor(data: SymbolResponse, storage: SymbolStorage);
|
|
1347
|
+
get getParent(): {
|
|
1348
|
+
(): Symbol | undefined;
|
|
1349
|
+
gen(): Generator<ProtocolRequest, Symbol | undefined, ProtocolResponse["result"]>;
|
|
1350
|
+
};
|
|
396
1351
|
/**
|
|
397
1352
|
* Get this symbol's members keyed by escaped name. The result is cached on
|
|
398
1353
|
* the symbol, so repeated calls do not round-trip to the server.
|
|
399
1354
|
*/
|
|
400
|
-
getMembers():
|
|
1355
|
+
get getMembers(): {
|
|
1356
|
+
(): ReadonlyMap<__String, Symbol>;
|
|
1357
|
+
gen(): Generator<ProtocolRequest, ReadonlyMap<__String, Symbol>, ProtocolResponse["result"]>;
|
|
1358
|
+
};
|
|
401
1359
|
/**
|
|
402
1360
|
* Get this symbol's exports keyed by escaped name. The result is cached on
|
|
403
1361
|
* the symbol, so repeated calls do not round-trip to the server.
|
|
404
1362
|
*/
|
|
405
|
-
getExports():
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
1363
|
+
get getExports(): {
|
|
1364
|
+
(): ReadonlyMap<__String, Symbol>;
|
|
1365
|
+
gen(): Generator<ProtocolRequest, ReadonlyMap<__String, Symbol>, ProtocolResponse["result"]>;
|
|
1366
|
+
};
|
|
1367
|
+
private get fetchSymbolTable();
|
|
1368
|
+
get getExportSymbol(): {
|
|
1369
|
+
(): Symbol;
|
|
1370
|
+
gen(): Generator<ProtocolRequest, Symbol, ProtocolResponse["result"]>;
|
|
1371
|
+
};
|
|
1372
|
+
get getJsDocTags(): {
|
|
1373
|
+
(checker: Checker): readonly JSDocTagInfo[];
|
|
1374
|
+
gen(checker: Checker): Generator<ProtocolRequest, readonly JSDocTagInfo[], ProtocolResponse["result"]>;
|
|
1375
|
+
};
|
|
1376
|
+
get getDocumentationComment(): {
|
|
1377
|
+
(checker: Checker): string;
|
|
1378
|
+
gen(checker: Checker): Generator<ProtocolRequest, string, ProtocolResponse["result"]>;
|
|
1379
|
+
};
|
|
1380
|
+
private get fetchSymbol();
|
|
1381
|
+
private get fetchSymbols();
|
|
1382
|
+
private internFileSymbol;
|
|
410
1383
|
}
|
|
411
1384
|
declare class TypeObject implements Type {
|
|
412
1385
|
private objectRegistry;
|
|
413
1386
|
readonly id: number;
|
|
414
1387
|
readonly flags: TypeFlags;
|
|
415
1388
|
readonly objectFlags: ObjectFlags;
|
|
416
|
-
readonly symbol:
|
|
1389
|
+
readonly symbol: CompactSymbolReference;
|
|
417
1390
|
readonly value: string | number | boolean | bigint;
|
|
418
1391
|
readonly intrinsicName: string;
|
|
419
1392
|
readonly isThisType: boolean;
|
|
420
1393
|
readonly freshType: number;
|
|
421
1394
|
readonly regularType: number;
|
|
422
1395
|
readonly target: number;
|
|
1396
|
+
private readonly tupleType;
|
|
423
1397
|
readonly typeParameters: readonly number[];
|
|
424
1398
|
readonly outerTypeParameters: readonly number[];
|
|
425
1399
|
readonly localTypeParameters: readonly number[];
|
|
1400
|
+
readonly thisType: number;
|
|
426
1401
|
readonly aliasTypeArguments: readonly number[];
|
|
427
|
-
readonly aliasSymbol:
|
|
1402
|
+
readonly aliasSymbol: CompactSymbolReference;
|
|
428
1403
|
readonly elementFlags: readonly ElementFlags[];
|
|
429
1404
|
readonly fixedLength: number;
|
|
430
1405
|
readonly readonly: boolean;
|
|
1406
|
+
readonly labeledElementDeclarations?: readonly (NodeHandle<NamedTupleMember | ParameterDeclaration> | undefined)[];
|
|
431
1407
|
readonly texts: readonly string[];
|
|
432
1408
|
readonly objectType: number;
|
|
433
1409
|
readonly indexType: number;
|
|
@@ -435,32 +1411,177 @@ declare class TypeObject implements Type {
|
|
|
435
1411
|
readonly extendsType: number;
|
|
436
1412
|
readonly baseType: number;
|
|
437
1413
|
readonly substConstraint: number;
|
|
1414
|
+
readonly typeParameter: number;
|
|
1415
|
+
readonly constraintType: number;
|
|
1416
|
+
readonly nameType: number;
|
|
1417
|
+
readonly templateType: number;
|
|
438
1418
|
private trueType;
|
|
439
1419
|
private falseType;
|
|
1420
|
+
private constraint;
|
|
1421
|
+
private default;
|
|
1422
|
+
private nonNullableType;
|
|
1423
|
+
private apparentType;
|
|
1424
|
+
private reducedType;
|
|
1425
|
+
private properties;
|
|
1426
|
+
private apparentProperties;
|
|
1427
|
+
private callSignatures;
|
|
1428
|
+
private constructSignatures;
|
|
1429
|
+
private indexInfos;
|
|
1430
|
+
private baseTypes;
|
|
1431
|
+
private types;
|
|
1432
|
+
private stringIndexType;
|
|
1433
|
+
private numberIndexType;
|
|
440
1434
|
constructor(data: TypeResponse, objectRegistry: ProjectObjectRegistry);
|
|
441
|
-
getSymbol():
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
1435
|
+
get getSymbol(): {
|
|
1436
|
+
(): Symbol | undefined;
|
|
1437
|
+
gen(): Generator<ProtocolRequest, Symbol | undefined, ProtocolResponse["result"]>;
|
|
1438
|
+
};
|
|
1439
|
+
get getProperties(): {
|
|
1440
|
+
(): readonly Symbol[];
|
|
1441
|
+
gen(): Generator<ProtocolRequest, readonly Symbol[], ProtocolResponse["result"]>;
|
|
1442
|
+
};
|
|
1443
|
+
get getProperty(): {
|
|
1444
|
+
(propertyName: string): Symbol | undefined;
|
|
1445
|
+
gen(propertyName: string): Generator<ProtocolRequest, Symbol | undefined, ProtocolResponse["result"]>;
|
|
1446
|
+
};
|
|
1447
|
+
get getApparentProperties(): {
|
|
1448
|
+
(): readonly Symbol[];
|
|
1449
|
+
gen(): Generator<ProtocolRequest, readonly Symbol[], ProtocolResponse["result"]>;
|
|
1450
|
+
};
|
|
1451
|
+
get getCallSignatures(): {
|
|
1452
|
+
(): readonly Signature[];
|
|
1453
|
+
gen(): Generator<ProtocolRequest, readonly Signature[], ProtocolResponse["result"]>;
|
|
1454
|
+
};
|
|
1455
|
+
get getConstructSignatures(): {
|
|
1456
|
+
(): readonly Signature[];
|
|
1457
|
+
gen(): Generator<ProtocolRequest, readonly Signature[], ProtocolResponse["result"]>;
|
|
1458
|
+
};
|
|
1459
|
+
get getNonNullableType(): {
|
|
1460
|
+
(): Type;
|
|
1461
|
+
gen(): Generator<ProtocolRequest, Type, ProtocolResponse["result"]>;
|
|
1462
|
+
};
|
|
1463
|
+
get getStringIndexType(): {
|
|
1464
|
+
(): Type | undefined;
|
|
1465
|
+
gen(): Generator<ProtocolRequest, Type | undefined, ProtocolResponse["result"]>;
|
|
1466
|
+
};
|
|
1467
|
+
private get getStringIndexTypeWorker();
|
|
1468
|
+
get getNumberIndexType(): {
|
|
1469
|
+
(): Type | undefined;
|
|
1470
|
+
gen(): Generator<ProtocolRequest, Type | undefined, ProtocolResponse["result"]>;
|
|
1471
|
+
};
|
|
1472
|
+
private get getNumberIndexTypeWorker();
|
|
1473
|
+
get getApparentType(): {
|
|
1474
|
+
(): Type;
|
|
1475
|
+
gen(): Generator<ProtocolRequest, Type, ProtocolResponse["result"]>;
|
|
1476
|
+
};
|
|
1477
|
+
get getReducedType(): {
|
|
1478
|
+
(): Type;
|
|
1479
|
+
gen(): Generator<ProtocolRequest, Type, ProtocolResponse["result"]>;
|
|
1480
|
+
};
|
|
1481
|
+
get getIndexInfos(): {
|
|
1482
|
+
(): readonly IndexInfo[];
|
|
1483
|
+
gen(): Generator<ProtocolRequest, readonly IndexInfo[], ProtocolResponse["result"]>;
|
|
1484
|
+
};
|
|
1485
|
+
get getAliasSymbol(): {
|
|
1486
|
+
(): Symbol | undefined;
|
|
1487
|
+
gen(): Generator<ProtocolRequest, Symbol | undefined, ProtocolResponse["result"]>;
|
|
1488
|
+
};
|
|
1489
|
+
get getTarget(): {
|
|
1490
|
+
(): Type;
|
|
1491
|
+
gen(): Generator<ProtocolRequest, Type, ProtocolResponse["result"]>;
|
|
1492
|
+
};
|
|
1493
|
+
get getFreshType(): {
|
|
1494
|
+
(): FreshableType | undefined;
|
|
1495
|
+
gen(): Generator<ProtocolRequest, FreshableType | undefined, ProtocolResponse["result"]>;
|
|
1496
|
+
};
|
|
1497
|
+
get getRegularType(): {
|
|
1498
|
+
(): FreshableType | undefined;
|
|
1499
|
+
gen(): Generator<ProtocolRequest, FreshableType | undefined, ProtocolResponse["result"]>;
|
|
1500
|
+
};
|
|
1501
|
+
get getTypes(): {
|
|
1502
|
+
(): readonly Type[] | undefined;
|
|
1503
|
+
gen(): Generator<ProtocolRequest, readonly Type[] | undefined, ProtocolResponse["result"]>;
|
|
1504
|
+
};
|
|
1505
|
+
get getTypeParameters(): {
|
|
1506
|
+
(): readonly TypeParameter[];
|
|
1507
|
+
gen(): Generator<ProtocolRequest, readonly TypeParameter[], ProtocolResponse["result"]>;
|
|
1508
|
+
};
|
|
1509
|
+
get getOuterTypeParameters(): {
|
|
1510
|
+
(): readonly TypeParameter[];
|
|
1511
|
+
gen(): Generator<ProtocolRequest, readonly TypeParameter[], ProtocolResponse["result"]>;
|
|
1512
|
+
};
|
|
1513
|
+
get getLocalTypeParameters(): {
|
|
1514
|
+
(): readonly TypeParameter[];
|
|
1515
|
+
gen(): Generator<ProtocolRequest, readonly TypeParameter[], ProtocolResponse["result"]>;
|
|
1516
|
+
};
|
|
1517
|
+
get getThisType(): {
|
|
1518
|
+
(): TypeParameter | undefined;
|
|
1519
|
+
gen(): Generator<ProtocolRequest, TypeParameter | undefined, ProtocolResponse["result"]>;
|
|
1520
|
+
};
|
|
1521
|
+
get getAliasTypeArguments(): {
|
|
1522
|
+
(): readonly Type[];
|
|
1523
|
+
gen(): Generator<ProtocolRequest, readonly Type[], ProtocolResponse["result"]>;
|
|
1524
|
+
};
|
|
1525
|
+
get getTypeParameter(): {
|
|
1526
|
+
(): TypeParameter;
|
|
1527
|
+
gen(): Generator<ProtocolRequest, TypeParameter, ProtocolResponse["result"]>;
|
|
1528
|
+
};
|
|
1529
|
+
get getConstraintType(): {
|
|
1530
|
+
(): Type;
|
|
1531
|
+
gen(): Generator<ProtocolRequest, Type, ProtocolResponse["result"]>;
|
|
1532
|
+
};
|
|
1533
|
+
get getNameType(): {
|
|
1534
|
+
(): Type | undefined;
|
|
1535
|
+
gen(): Generator<ProtocolRequest, Type | undefined, ProtocolResponse["result"]>;
|
|
1536
|
+
};
|
|
1537
|
+
get getTemplateType(): {
|
|
1538
|
+
(): Type;
|
|
1539
|
+
gen(): Generator<ProtocolRequest, Type, ProtocolResponse["result"]>;
|
|
1540
|
+
};
|
|
1541
|
+
get getObjectType(): {
|
|
1542
|
+
(): Type;
|
|
1543
|
+
gen(): Generator<ProtocolRequest, Type, ProtocolResponse["result"]>;
|
|
1544
|
+
};
|
|
1545
|
+
get getIndexType(): {
|
|
1546
|
+
(): Type;
|
|
1547
|
+
gen(): Generator<ProtocolRequest, Type, ProtocolResponse["result"]>;
|
|
1548
|
+
};
|
|
1549
|
+
get getCheckType(): {
|
|
1550
|
+
(): Type;
|
|
1551
|
+
gen(): Generator<ProtocolRequest, Type, ProtocolResponse["result"]>;
|
|
1552
|
+
};
|
|
1553
|
+
get getExtendsType(): {
|
|
1554
|
+
(): Type;
|
|
1555
|
+
gen(): Generator<ProtocolRequest, Type, ProtocolResponse["result"]>;
|
|
1556
|
+
};
|
|
1557
|
+
get getBaseType(): {
|
|
1558
|
+
(): Type;
|
|
1559
|
+
gen(): Generator<ProtocolRequest, Type, ProtocolResponse["result"]>;
|
|
1560
|
+
};
|
|
1561
|
+
get getConstraint(): {
|
|
1562
|
+
(): Type | undefined;
|
|
1563
|
+
gen(): Generator<ProtocolRequest, Type | undefined, ProtocolResponse["result"]>;
|
|
1564
|
+
};
|
|
1565
|
+
get getDefault(): {
|
|
1566
|
+
(): Type | undefined;
|
|
1567
|
+
gen(): Generator<ProtocolRequest, Type | undefined, ProtocolResponse["result"]>;
|
|
1568
|
+
};
|
|
1569
|
+
get getTrueType(): {
|
|
1570
|
+
(): Type;
|
|
1571
|
+
gen(): Generator<ProtocolRequest, Type, ProtocolResponse["result"]>;
|
|
1572
|
+
};
|
|
1573
|
+
get getFalseType(): {
|
|
1574
|
+
(): Type;
|
|
1575
|
+
gen(): Generator<ProtocolRequest, Type, ProtocolResponse["result"]>;
|
|
1576
|
+
};
|
|
459
1577
|
/**
|
|
460
1578
|
* Get the base types of this type. Returns `undefined` for any type that is
|
|
461
1579
|
* not a class or interface.
|
|
462
1580
|
*/
|
|
463
|
-
getBaseTypes():
|
|
1581
|
+
get getBaseTypes(): {
|
|
1582
|
+
(): readonly Type[] | undefined;
|
|
1583
|
+
gen(): Generator<ProtocolRequest, readonly Type[] | undefined, ProtocolResponse["result"]>;
|
|
1584
|
+
};
|
|
464
1585
|
isClassOrInterface(): this is InterfaceType;
|
|
465
1586
|
isUnionType(): this is UnionType;
|
|
466
1587
|
isIntersectionType(): this is IntersectionType;
|
|
@@ -473,7 +1594,8 @@ declare class TypeObject implements Type {
|
|
|
473
1594
|
isBigIntLiteralType(): this is BigIntLiteralType;
|
|
474
1595
|
isBooleanLiteralType(): this is BooleanLiteralType;
|
|
475
1596
|
isTypeReference(): this is TypeReference;
|
|
476
|
-
isTupleType(): this is
|
|
1597
|
+
isTupleType(): this is TupleTypeReference;
|
|
1598
|
+
isTupleTypeTarget(): this is TupleType;
|
|
477
1599
|
isIndexType(): this is IndexType;
|
|
478
1600
|
isIndexedAccessType(): this is IndexedAccessType;
|
|
479
1601
|
isConditionalType(): this is ConditionalType;
|
|
@@ -481,6 +1603,7 @@ declare class TypeObject implements Type {
|
|
|
481
1603
|
isTemplateLiteralType(): this is TemplateLiteralType;
|
|
482
1604
|
isStringMappingType(): this is StringMappingType;
|
|
483
1605
|
isTypeParameter(): this is TypeParameter;
|
|
1606
|
+
isMappedType(): this is MappedType;
|
|
484
1607
|
}
|
|
485
1608
|
export declare function isUnionType(type: Type): type is UnionType;
|
|
486
1609
|
export declare function isIntersectionType(type: Type): type is IntersectionType;
|
|
@@ -500,7 +1623,8 @@ export declare function isNumberLiteralType(type: Type): type is NumberLiteralTy
|
|
|
500
1623
|
export declare function isBigIntLiteralType(type: Type): type is BigIntLiteralType;
|
|
501
1624
|
export declare function isBooleanLiteralType(type: Type): type is BooleanLiteralType;
|
|
502
1625
|
export declare function isTypeReference(type: Type): type is TypeReference;
|
|
503
|
-
export declare function isTupleType(type: Type): type is
|
|
1626
|
+
export declare function isTupleType(type: Type): type is TupleTypeReference;
|
|
1627
|
+
export declare function isTupleTypeTarget(type: Type): type is TupleType;
|
|
504
1628
|
export declare function isIndexType(type: Type): type is IndexType;
|
|
505
1629
|
export declare function isIndexedAccessType(type: Type): type is IndexedAccessType;
|
|
506
1630
|
export declare function isConditionalType(type: Type): type is ConditionalType;
|
|
@@ -512,16 +1636,37 @@ export declare class Signature {
|
|
|
512
1636
|
private flags;
|
|
513
1637
|
private objectRegistry;
|
|
514
1638
|
readonly id: number;
|
|
515
|
-
readonly declaration?: NodeHandle | undefined;
|
|
1639
|
+
readonly declaration?: NodeHandle<Declaration> | undefined;
|
|
516
1640
|
readonly typeParameters?: readonly number[] | undefined;
|
|
517
|
-
readonly parameters: readonly
|
|
518
|
-
readonly thisParameter?:
|
|
1641
|
+
readonly parameters: readonly CompactSymbolReference[];
|
|
1642
|
+
readonly thisParameter?: CompactSymbolReference | undefined;
|
|
519
1643
|
readonly target?: number | undefined;
|
|
1644
|
+
private returnType;
|
|
520
1645
|
constructor(data: SignatureResponse, project: Project, objectRegistry: ProjectObjectRegistry);
|
|
521
|
-
getTypeParameters():
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
1646
|
+
get getTypeParameters(): {
|
|
1647
|
+
(): readonly TypeParameter[];
|
|
1648
|
+
gen(): Generator<ProtocolRequest, readonly TypeParameter[], ProtocolResponse["result"]>;
|
|
1649
|
+
};
|
|
1650
|
+
get getParameters(): {
|
|
1651
|
+
(): readonly Symbol[];
|
|
1652
|
+
gen(): Generator<ProtocolRequest, readonly Symbol[], ProtocolResponse["result"]>;
|
|
1653
|
+
};
|
|
1654
|
+
get getThisParameter(): {
|
|
1655
|
+
(): Symbol | undefined;
|
|
1656
|
+
gen(): Generator<ProtocolRequest, Symbol | undefined, ProtocolResponse["result"]>;
|
|
1657
|
+
};
|
|
1658
|
+
get getTarget(): {
|
|
1659
|
+
(): Signature | undefined;
|
|
1660
|
+
gen(): Generator<ProtocolRequest, Signature | undefined, ProtocolResponse["result"]>;
|
|
1661
|
+
};
|
|
1662
|
+
get getReturnType(): {
|
|
1663
|
+
(): Type;
|
|
1664
|
+
gen(): Generator<ProtocolRequest, Type, ProtocolResponse["result"]>;
|
|
1665
|
+
};
|
|
1666
|
+
get getTypeParameterAtPosition(): {
|
|
1667
|
+
(pos: number): Type;
|
|
1668
|
+
gen(pos: number): Generator<ProtocolRequest, Type, ProtocolResponse["result"]>;
|
|
1669
|
+
};
|
|
525
1670
|
get hasRestParameter(): boolean;
|
|
526
1671
|
get isConstruct(): boolean;
|
|
527
1672
|
get isAbstract(): boolean;
|