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/async/api.d.ts
CHANGED
|
@@ -1,44 +1,154 @@
|
|
|
1
|
-
|
|
1
|
+
import { CheckFlags } from "#enums/checkFlags";
|
|
2
2
|
import { CompletionItemKind } from "#enums/completionItemKind";
|
|
3
3
|
import { DiagnosticCategory } from "#enums/diagnosticCategory";
|
|
4
4
|
import { ElementFlags } from "#enums/elementFlags";
|
|
5
|
+
import { EmitOnly } from "#enums/emitOnly";
|
|
6
|
+
import { IndexKind } from "#enums/indexKind";
|
|
7
|
+
import { JsxEmit } from "#enums/jsxEmit";
|
|
5
8
|
import { ModuleKind } from "#enums/moduleKind";
|
|
9
|
+
import { ModuleResolutionKind } from "#enums/moduleResolutionKind";
|
|
6
10
|
import { NodeBuilderFlags } from "#enums/nodeBuilderFlags";
|
|
7
11
|
import { ObjectFlags } from "#enums/objectFlags";
|
|
12
|
+
import { ScriptKind } from "#enums/scriptKind";
|
|
8
13
|
import { SignatureFlags } from "#enums/signatureFlags";
|
|
9
14
|
import { SignatureKind } from "#enums/signatureKind";
|
|
10
15
|
import { SymbolFlags } from "#enums/symbolFlags";
|
|
16
|
+
import { SymbolOwnerKind } from "#enums/symbolOwnerKind";
|
|
11
17
|
import { TypeFlags } from "#enums/typeFlags";
|
|
18
|
+
import { TypeFormatFlags } from "#enums/typeFormatFlags";
|
|
12
19
|
import { TypePredicateKind } from "#enums/typePredicateKind";
|
|
13
|
-
import { type __String, type Expression, type Identifier, ModifierFlags, type Node, type
|
|
20
|
+
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
21
|
import type { APIOptions, LSPConnectionOptions } from "../options.ts";
|
|
15
|
-
import type { CompilerOptions,
|
|
16
|
-
import {
|
|
22
|
+
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";
|
|
23
|
+
import { type CachedSourceFile } from "../sourceFileCache.ts";
|
|
17
24
|
import type { RequestTiming, TimingAccumulators, TimingInfo } from "../timing.ts";
|
|
18
25
|
import { Client, type ClientSocketOptions, type ClientSpawnOptions } from "./client.ts";
|
|
19
|
-
import type { AssertsIdentifierTypePredicate, AssertsThisTypePredicate, BigIntLiteralType, BooleanLiteralType, CompletionEntry, CompletionInfo, CompletionOptions, ConditionalType,
|
|
26
|
+
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";
|
|
27
|
+
export { formatDiagnostics, formatDiagnosticsWithColorAndContext } from "../diagnosticFormatter.ts";
|
|
20
28
|
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
|
-
|
|
29
|
+
export { CheckFlags, CompletionItemKind, DiagnosticCategory, ElementFlags, EmitOnly, IndexKind, JsxEmit, ModifierFlags, ModuleKind, ModuleResolutionKind, NodeBuilderFlags, ObjectFlags, ScriptKind, SignatureFlags, SignatureKind, SymbolFlags, SymbolOwnerKind, TypeFlags, TypeFormatFlags, TypePredicateKind };
|
|
30
|
+
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, };
|
|
31
|
+
export interface ModuleResolverOptions {
|
|
32
|
+
moduleResolutions?: ModuleResolutionSpec | undefined;
|
|
33
|
+
resolveModuleName?: ResolveModuleNameCallback | undefined;
|
|
34
|
+
}
|
|
35
|
+
export interface ResolveModuleNameCallbackOptions {
|
|
36
|
+
snapshot: Snapshot | InProgressSnapshot | undefined;
|
|
37
|
+
}
|
|
38
|
+
declare const inProgressSnapshotBrand: unique symbol;
|
|
39
|
+
export type InProgressSnapshot = number & {
|
|
40
|
+
readonly [inProgressSnapshotBrand]: never;
|
|
41
|
+
};
|
|
42
|
+
export type ResolveModuleNameCallback = (moduleName: string, containingDirectory: string, resolutionMode: ResolutionMode | undefined, options: ResolveModuleNameCallbackOptions) => StaticModuleResolution | undefined | Promise<StaticModuleResolution | undefined>;
|
|
43
|
+
export type CreateProgramOptions = Omit<ProtocolCreateProgramOptions, "moduleResolver" | "projectReferences"> & {
|
|
44
|
+
moduleResolver?: ModuleResolver | undefined;
|
|
45
|
+
projectReferences?: readonly (Omit<ProjectReference, "path"> & {
|
|
46
|
+
path: string;
|
|
47
|
+
})[] | undefined;
|
|
48
|
+
};
|
|
49
|
+
export type CreateSnapshotProgramParams = Omit<ProtocolCreateSnapshotProgramParams, "options"> & {
|
|
50
|
+
options?: CreateProgramOptions | undefined;
|
|
51
|
+
};
|
|
52
|
+
export type ReconfigureSnapshotProgramParams = Omit<ProtocolReconfigureSnapshotProgramParams, "options"> & {
|
|
53
|
+
options?: CreateProgramOptions | undefined;
|
|
54
|
+
};
|
|
55
|
+
export type CreateSnapshotParams = Omit<ProtocolCreateSnapshotParams, "createPrograms" | "reconfigurePrograms"> & {
|
|
56
|
+
createPrograms?: readonly CreateSnapshotProgramParams[] | undefined;
|
|
57
|
+
reconfigurePrograms?: readonly ReconfigureSnapshotProgramParams[] | undefined;
|
|
58
|
+
};
|
|
59
|
+
export type LanguageServerSnapshotChanges = Omit<ProtocolLanguageServerSnapshotChanges, "createPrograms" | "reconfigurePrograms"> & {
|
|
60
|
+
createPrograms?: readonly CreateSnapshotProgramParams[] | undefined;
|
|
61
|
+
reconfigurePrograms?: readonly ReconfigureSnapshotProgramParams[] | undefined;
|
|
62
|
+
};
|
|
63
|
+
export interface TranspileOptions {
|
|
64
|
+
compilerOptions?: RawCompilerOptions | undefined;
|
|
65
|
+
fileName?: string | undefined;
|
|
66
|
+
reportDiagnostics?: boolean | undefined;
|
|
67
|
+
}
|
|
68
|
+
export interface TranspileOutput {
|
|
69
|
+
outputText: string;
|
|
70
|
+
diagnostics?: readonly Diagnostic[] | undefined;
|
|
71
|
+
sourceMapText?: string | undefined;
|
|
72
|
+
}
|
|
73
|
+
export declare class API<FromLSP extends boolean = false> implements FormatDiagnosticsHost {
|
|
26
74
|
private toPath;
|
|
75
|
+
private readonly decoder;
|
|
76
|
+
private currentDirectory;
|
|
77
|
+
private caseSensitivity;
|
|
27
78
|
private initialized;
|
|
79
|
+
private initializing;
|
|
28
80
|
private activeSnapshots;
|
|
29
|
-
private
|
|
30
|
-
|
|
81
|
+
private activeBuildOrchestrators;
|
|
82
|
+
private activeSourceFileLeases;
|
|
83
|
+
readonly printer: Printer;
|
|
84
|
+
readonly debug: DebugHandlers;
|
|
31
85
|
constructor(options?: APIOptions | LSPConnectionOptions);
|
|
86
|
+
/**
|
|
87
|
+
* Looks up a remote declaration's binder symbol. Throws for synthesized or configuration ASTs.
|
|
88
|
+
*/
|
|
89
|
+
getSymbol(declaration: Declaration): Promise<Symbol>;
|
|
90
|
+
private fetchDeclarationSymbol;
|
|
32
91
|
/**
|
|
33
92
|
* Create an API instance from an existing LSP connection's API session.
|
|
34
93
|
* Use this when connecting to an API pipe provided by an LSP server via custom/initializeAPISession.
|
|
35
94
|
*/
|
|
36
95
|
static fromLSPConnection(options: LSPConnectionOptions): Promise<API<true>>;
|
|
96
|
+
batchContext(): {
|
|
97
|
+
[globalThis.Symbol.dispose](): void;
|
|
98
|
+
};
|
|
37
99
|
private ensureInitialized;
|
|
38
|
-
|
|
39
|
-
|
|
100
|
+
private initializeWorker;
|
|
101
|
+
getCurrentDirectory(): RootedDirectoryPath;
|
|
102
|
+
getCanonicalFileName(fileName: string): string;
|
|
103
|
+
private getCaseSensitivity;
|
|
104
|
+
getNewLine(): string;
|
|
105
|
+
parseConfigFile(file: DocumentIdentifier): Promise<ParsedCommandLine>;
|
|
106
|
+
parseCommandLine(commandLine: readonly string[]): Promise<ParsedCommandLine>;
|
|
107
|
+
readConfigFile(file: DocumentIdentifier): Promise<ReadConfigFileResponse>;
|
|
108
|
+
parseJsonConfigFileContent(json: any, options: {
|
|
109
|
+
configDirectory: string;
|
|
110
|
+
configFileName?: never;
|
|
111
|
+
} | {
|
|
112
|
+
configFileName: DocumentIdentifier;
|
|
113
|
+
configDirectory?: never;
|
|
114
|
+
}): Promise<ParsedCommandLine>;
|
|
115
|
+
/**
|
|
116
|
+
* Create and retain a source file independently of a program.
|
|
117
|
+
* Dispose the returned lease when the source file no longer needs to remain available remotely.
|
|
118
|
+
*/
|
|
119
|
+
createSourceFile(fileName: string, sourceText: string, options?: CreateSourceFileOptions): Promise<RetainedSourceFile>;
|
|
120
|
+
/**
|
|
121
|
+
* Read, create, and retain a source file independently of a program.
|
|
122
|
+
* Dispose the returned lease when the source file no longer needs to remain available remotely.
|
|
123
|
+
*/
|
|
124
|
+
createSourceFileFromFile(file: DocumentIdentifier, options?: CreateSourceFileOptions): Promise<RetainedSourceFile>;
|
|
125
|
+
/**
|
|
126
|
+
* Retain an ordinary remote source file independently of the snapshot or lease that produced it.
|
|
127
|
+
*/
|
|
128
|
+
retainSourceFile(sourceFile: SourceFile): Promise<RetainedSourceFile>;
|
|
129
|
+
private retainSourceFileResponse;
|
|
130
|
+
private addSourceFileLease;
|
|
131
|
+
transpileModule(input: string, options?: TranspileOptions): Promise<TranspileOutput>;
|
|
132
|
+
transpileModuleFromFile(file: DocumentIdentifier, options?: TranspileOptions): Promise<TranspileOutput>;
|
|
133
|
+
transpileDeclaration(input: string, options?: TranspileOptions): Promise<TranspileOutput>;
|
|
134
|
+
transpileDeclarationFromFile(file: DocumentIdentifier, options?: TranspileOptions): Promise<TranspileOutput>;
|
|
135
|
+
createSnapshot<const CreatePrograms extends CreateSnapshotParams["createPrograms"] = undefined, const OpenFiles extends CreateSnapshotParams["openFiles"] = undefined>(params: SnapshotOperationParams<CreateSnapshotParams, CreatePrograms, OpenFiles>): Promise<SnapshotForOperationResults<CreatePrograms, OpenFiles>>;
|
|
136
|
+
createSnapshot(): Promise<Snapshot>;
|
|
137
|
+
private updateSnapshot;
|
|
138
|
+
private prepareCreateSnapshotParams;
|
|
139
|
+
private prepareLanguageServerSnapshotChanges;
|
|
140
|
+
private createSnapshotUpdater;
|
|
141
|
+
/**
|
|
142
|
+
* Returns the language server's current canonical snapshot after atomically
|
|
143
|
+
* adopting any supplied API-driven changes. Only available on LSP-connected APIs.
|
|
144
|
+
*/
|
|
145
|
+
getCurrentLanguageServerSnapshot<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]): Promise<SnapshotForOperationResults<CreatePrograms, OpenFiles>>;
|
|
146
|
+
getCurrentLanguageServerSnapshot(...args: FromLSP extends true ? [changes?: LanguageServerSnapshotChanges, baseSnapshot?: Snapshot] : [changes: never, baseSnapshot?: never]): Promise<Snapshot>;
|
|
147
|
+
[globalThis.Symbol.asyncDispose](): Promise<void>;
|
|
40
148
|
close(): Promise<void>;
|
|
149
|
+
createModuleResolver(compilerOptions: RawCompilerOptions, options?: ModuleResolverOptions): Promise<ModuleResolver>;
|
|
41
150
|
clearSourceFileCache(): void;
|
|
151
|
+
runWithTemporaryFileUpdate(baseSnapshot: Snapshot, file: DocumentIdentifier, newText: string, cb: (newSnapshot: Snapshot) => void | Promise<void>): Promise<void>;
|
|
42
152
|
/**
|
|
43
153
|
* Returns a snapshot of collected timing information for requests made
|
|
44
154
|
* through this API instance: client-measured round-trip latency and bytes
|
|
@@ -47,113 +157,256 @@ export declare class API<FromLSP extends boolean = false> {
|
|
|
47
157
|
*
|
|
48
158
|
* Fetching the snapshot issues a lightweight request to the server to
|
|
49
159
|
* retrieve its timing collection. Collection must be enabled via the
|
|
50
|
-
* `collectTiming` option
|
|
51
|
-
* `enabled: false` and zeroed totals.
|
|
160
|
+
* `collectTiming` option or `TS_API_TIMING_DIR` environment variable; when
|
|
161
|
+
* it is not, the returned snapshot has `enabled: false` and zeroed totals.
|
|
52
162
|
*/
|
|
53
163
|
getTimingInfo(): Promise<TimingInfo>;
|
|
54
164
|
/** Clears all accumulated timing totals and recent-request history, on both the client and the server. */
|
|
55
165
|
resetTimingInfo(): Promise<void>;
|
|
166
|
+
/** Creates a program from current filesystem state. */
|
|
167
|
+
createProgram(rootFiles: readonly DocumentIdentifier[], compilerOptions: RawCompilerOptions, createProgramOptions?: CreateProgramOptions): Promise<Program>;
|
|
56
168
|
}
|
|
57
|
-
|
|
169
|
+
type EnsureInitialized = () => Promise<void>;
|
|
170
|
+
/** Returns whether a node is backed by a remote compiler response. */
|
|
171
|
+
export declare function isRemoteNode(node: Node): boolean;
|
|
172
|
+
/** Looks up a remote declaration's binder symbol through its API. Throws for non-remote declarations. */
|
|
173
|
+
export declare function getSymbol(declaration: Declaration): Promise<Symbol>;
|
|
174
|
+
/** An independently retained source file and its disposable remote-lifetime lease. */
|
|
175
|
+
export declare class RetainedSourceFile {
|
|
176
|
+
readonly sourceFile: SourceFile;
|
|
177
|
+
private readonly lease;
|
|
178
|
+
private readonly onDispose;
|
|
179
|
+
private disposed;
|
|
180
|
+
private disposePromise;
|
|
181
|
+
constructor(sourceFile: SourceFile, lease: number, onDispose: () => void);
|
|
182
|
+
[globalThis.Symbol.asyncDispose](): Promise<void>;
|
|
183
|
+
dispose(): Promise<void>;
|
|
184
|
+
private disposeWorker;
|
|
185
|
+
}
|
|
186
|
+
export declare class DebugHandlers {
|
|
58
187
|
private client;
|
|
59
188
|
private ensureInitialized;
|
|
60
|
-
|
|
61
|
-
constructor(client: Client, ensureInitialized: () => Promise<void>);
|
|
189
|
+
constructor(client: Client, ensureInitialized: EnsureInitialized);
|
|
62
190
|
startCPUProfile(dir: string): Promise<void>;
|
|
63
|
-
stopCPUProfile(): Promise<
|
|
64
|
-
saveHeapProfile(dir: string): Promise<
|
|
191
|
+
stopCPUProfile(): Promise<RootedFilePath>;
|
|
192
|
+
saveHeapProfile(dir: string): Promise<RootedFilePath>;
|
|
193
|
+
}
|
|
194
|
+
type SnapshotUpdater = (params: CreateSnapshotParams) => Promise<Snapshot>;
|
|
195
|
+
export interface SnapshotOperation {
|
|
196
|
+
readonly createdPrograms?: readonly Program<SyntheticProjectId>[] | undefined;
|
|
197
|
+
readonly openedFiles?: readonly SnapshotOpenedFileOperation[] | undefined;
|
|
65
198
|
}
|
|
199
|
+
export interface SnapshotOpenedFileOperation {
|
|
200
|
+
readonly project: Project;
|
|
201
|
+
}
|
|
202
|
+
/** Replaces every element of a tuple while preserving its length and index structure. */
|
|
203
|
+
type MapTupleTo<Tuple extends readonly unknown[], Result> = {
|
|
204
|
+
readonly [Index in keyof Tuple]: Result;
|
|
205
|
+
};
|
|
206
|
+
/**
|
|
207
|
+
* Keeps `Tuple` as an inference target while contextually typing each element from
|
|
208
|
+
* `Elements`. The mapped intersection supplies nested completions and excess-property
|
|
209
|
+
* checks without widening an inferred tuple to an array.
|
|
210
|
+
*/
|
|
211
|
+
type ContextualizeTuple<Tuple extends readonly unknown[] | undefined, Elements extends readonly unknown[] | undefined> = Tuple & {
|
|
212
|
+
readonly [Index in keyof Tuple]: NonNullable<Elements>[number];
|
|
213
|
+
};
|
|
214
|
+
/** Substitutes the operation arrays with contextually typed, tuple-preserving versions. */
|
|
215
|
+
type SnapshotOperationParams<Params extends {
|
|
216
|
+
createPrograms?: readonly unknown[] | undefined;
|
|
217
|
+
openFiles?: readonly unknown[] | undefined;
|
|
218
|
+
}, CreatePrograms extends Params["createPrograms"], OpenFiles extends Params["openFiles"]> = Omit<Params, "createPrograms" | "openFiles"> & {
|
|
219
|
+
createPrograms?: ContextualizeTuple<CreatePrograms, Params["createPrograms"]> | undefined;
|
|
220
|
+
openFiles?: ContextualizeTuple<OpenFiles, Params["openFiles"]> | undefined;
|
|
221
|
+
};
|
|
222
|
+
/**
|
|
223
|
+
* Refines a snapshot's operation results to required tuples when the corresponding
|
|
224
|
+
* operation arrays were supplied, preserving their lengths for indexed access.
|
|
225
|
+
*/
|
|
226
|
+
type SnapshotForOperationResults<CreatePrograms extends readonly unknown[] | undefined, OpenFiles extends readonly unknown[] | undefined> = Snapshot & {
|
|
227
|
+
readonly operation: SnapshotOperation & (CreatePrograms extends readonly unknown[] ? {
|
|
228
|
+
readonly createdPrograms: MapTupleTo<CreatePrograms, Program<SyntheticProjectId>>;
|
|
229
|
+
} : unknown) & (OpenFiles extends readonly unknown[] ? {
|
|
230
|
+
readonly openedFiles: MapTupleTo<OpenFiles, SnapshotOpenedFileOperation>;
|
|
231
|
+
} : unknown);
|
|
232
|
+
};
|
|
233
|
+
/** Derives the refined snapshot result type from a complete operation parameter type. */
|
|
234
|
+
export type SnapshotForOperation<Params extends CreateSnapshotParams> = SnapshotForOperationResults<Params extends {
|
|
235
|
+
createPrograms: infer CreatePrograms extends readonly unknown[];
|
|
236
|
+
} ? CreatePrograms : undefined, Params extends {
|
|
237
|
+
openFiles: infer OpenFiles extends readonly unknown[];
|
|
238
|
+
} ? OpenFiles : undefined>;
|
|
66
239
|
export declare class Snapshot {
|
|
67
240
|
readonly id: number;
|
|
241
|
+
readonly operation: SnapshotOperation;
|
|
68
242
|
private projectMap;
|
|
69
243
|
private toPath;
|
|
70
|
-
private
|
|
244
|
+
private readonly api;
|
|
71
245
|
private disposed;
|
|
246
|
+
private disposePromise;
|
|
72
247
|
private onDispose;
|
|
73
248
|
private snapshotRegistry;
|
|
74
|
-
|
|
249
|
+
private projectDataMap;
|
|
250
|
+
private updateSnapshot;
|
|
251
|
+
private get client();
|
|
252
|
+
constructor(data: CreateSnapshotResponse, toPath: (fileName: string, basePath?: string) => PathKey, api: API<boolean>, onDispose: () => void, updateSnapshot: SnapshotUpdater, baseSnapshot?: Snapshot);
|
|
75
253
|
getProjects(): readonly Project[];
|
|
76
|
-
|
|
254
|
+
getConfiguredProject(configFileName: string): Project<ConfiguredProjectId> | undefined;
|
|
255
|
+
getProject<Id extends ProjectId>(projectId: Id): Project<Id> | undefined;
|
|
256
|
+
getProgram<Id extends ProjectId>(projectId: Id): Program<Id> | undefined;
|
|
257
|
+
update<const CreatePrograms extends CreateSnapshotParams["createPrograms"] = undefined, const OpenFiles extends CreateSnapshotParams["openFiles"] = undefined>(params: SnapshotOperationParams<CreateSnapshotParams, CreatePrograms, OpenFiles>): Promise<SnapshotForOperationResults<CreatePrograms, OpenFiles>>;
|
|
258
|
+
update(params: CreateSnapshotParams): Promise<Snapshot>;
|
|
259
|
+
/**
|
|
260
|
+
* Gets the default project for a given file from the configured projects and
|
|
261
|
+
* inferred project already loaded in the snapshot. Synthetic projects are not
|
|
262
|
+
* considered. Files that have been opened with `openFiles` are guaranteed to
|
|
263
|
+
* have a result.
|
|
264
|
+
*/
|
|
77
265
|
getDefaultProjectForFile(file: DocumentIdentifier): Promise<Project | undefined>;
|
|
78
|
-
[globalThis.Symbol.
|
|
266
|
+
[globalThis.Symbol.asyncDispose](): Promise<void>;
|
|
79
267
|
dispose(): Promise<void>;
|
|
268
|
+
private disposeWorker;
|
|
80
269
|
isDisposed(): boolean;
|
|
81
270
|
private ensureNotDisposed;
|
|
271
|
+
private requireProject;
|
|
272
|
+
}
|
|
273
|
+
export declare class ModuleResolver {
|
|
274
|
+
readonly id: number;
|
|
275
|
+
private readonly client;
|
|
276
|
+
private readonly disposeCallback;
|
|
277
|
+
private disposed;
|
|
278
|
+
constructor(id: number, client: Client, disposeCallback: (() => void) | undefined);
|
|
279
|
+
resolveModuleName(moduleName: string, containingDirectory: DocumentIdentifier, resolutionMode?: ResolutionMode, options?: {
|
|
280
|
+
snapshot?: Snapshot | InProgressSnapshot | undefined;
|
|
281
|
+
}): Promise<ResolveModuleNameResult>;
|
|
282
|
+
[globalThis.Symbol.asyncDispose](): Promise<void>;
|
|
283
|
+
dispose(): Promise<void>;
|
|
82
284
|
}
|
|
83
285
|
declare class SnapshotObjectRegistry {
|
|
84
286
|
private readonly symbols;
|
|
85
|
-
private readonly
|
|
287
|
+
private readonly projectRegistries;
|
|
86
288
|
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;
|
|
289
|
+
constructor(snapshotId: number);
|
|
290
|
+
addProjectRegistry(registry: ProjectObjectRegistry): void;
|
|
91
291
|
getOrCreateSymbol(data: SymbolResponse): Symbol;
|
|
92
292
|
getSymbol(id: number): Symbol | undefined;
|
|
93
293
|
clear(): void;
|
|
94
|
-
fetchSymbol(source: Symbol | Signature | Type, method: string, handle: number | undefined, projectId?: Path): Promise<Symbol>;
|
|
95
|
-
fetchSymbols(source: Symbol | Signature | Type, method: string, handles?: readonly number[], projectId?: Path): Promise<readonly Symbol[]>;
|
|
96
294
|
}
|
|
97
295
|
declare class ProjectObjectRegistry {
|
|
98
|
-
private client;
|
|
99
296
|
private snapshotId;
|
|
100
|
-
|
|
297
|
+
readonly project: Project;
|
|
101
298
|
private snapshotRegistry;
|
|
102
299
|
private types;
|
|
103
300
|
private signatures;
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
301
|
+
private disposed;
|
|
302
|
+
private get client();
|
|
303
|
+
private get sourceFileCache();
|
|
304
|
+
constructor(snapshotId: number, project: Project, snapshotRegistry: SnapshotObjectRegistry);
|
|
305
|
+
getOrCreateSymbol(data: ProtocolSymbolResponse): Symbol;
|
|
306
|
+
/** Find an already-interned symbol and retain its file record for this registry. */
|
|
307
|
+
getCachedSymbol(reference: CompactSymbolReference): Symbol | undefined;
|
|
107
308
|
getOrCreateType(data: TypeResponse): TypeObject;
|
|
108
309
|
getType(id: number): TypeObject | undefined;
|
|
310
|
+
createNodeHandle<T extends Node>(handle: string): NodeHandle<T>;
|
|
109
311
|
getOrCreateSignature(data: SignatureResponse): Signature;
|
|
110
312
|
getSignature(id: number): Signature | undefined;
|
|
111
313
|
clear(): void;
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
314
|
+
private ensureNotDisposed;
|
|
315
|
+
fetchOptionalType<T extends Type>(source: Symbol | Signature | Type, method: TypePropertyMethod, handle: number | false | undefined): Promise<T | undefined>;
|
|
316
|
+
fetchType<T extends Type>(source: Symbol | Signature | Type, method: TypePropertyMethod, handle: number | false | undefined): Promise<T>;
|
|
317
|
+
fetchSymbol(source: Symbol | Signature | Type, method: SymbolPropertyMethod, reference: CompactSymbolReference | undefined): Promise<Symbol>;
|
|
318
|
+
fetchSignature(source: Symbol | Signature | Type, method: SignaturePropertyMethod, handle: number | undefined): Promise<Signature>;
|
|
319
|
+
fetchTypes(source: Symbol | Signature | Type, method: TypesPropertyMethod, handles?: readonly number[]): Promise<readonly Type[]>;
|
|
320
|
+
fetchSymbols(source: Symbol | Signature | Type, method: SymbolsPropertyMethod, references?: readonly CompactSymbolReference[]): Promise<readonly Symbol[]>;
|
|
321
|
+
private fetchSymbolsFromServer;
|
|
117
322
|
fetchBaseTypes(source: Type): Promise<readonly Type[]>;
|
|
323
|
+
fetchPropertiesOfType(source: Type): Promise<readonly Symbol[]>;
|
|
324
|
+
fetchApparentPropertiesOfType(source: Type): Promise<readonly Symbol[]>;
|
|
325
|
+
fetchPropertyOfType(source: Type, name: string): Promise<Symbol | undefined>;
|
|
326
|
+
fetchSignaturesOfType(source: Type, kind: SignatureKind): Promise<readonly Signature[]>;
|
|
327
|
+
fetchIndexInfosOfType(source: Type): Promise<readonly IndexInfo[]>;
|
|
328
|
+
fetchTypeParameterAtPosition(source: Signature, pos: number): Promise<Type>;
|
|
118
329
|
}
|
|
119
|
-
export declare class Project {
|
|
120
|
-
readonly id:
|
|
121
|
-
readonly configFileName:
|
|
122
|
-
readonly
|
|
123
|
-
readonly
|
|
124
|
-
readonly
|
|
330
|
+
export declare class Project<Id extends ProjectId = ProjectId> {
|
|
331
|
+
readonly id: Id;
|
|
332
|
+
readonly configFileName: RootedFilePath | undefined;
|
|
333
|
+
readonly currentDirectory: RootedDirectoryPath;
|
|
334
|
+
readonly dirty: boolean;
|
|
335
|
+
readonly parsedCommandLine: ParsedCommandLine;
|
|
336
|
+
readonly program: Program<Id>;
|
|
125
337
|
readonly checker: Checker;
|
|
126
|
-
readonly
|
|
127
|
-
|
|
128
|
-
constructor(data: ProjectResponse, snapshotId: number, client: Client, sourceFileCache: SourceFileCache, toPath: (fileName: string) => Path, snapshotRegistry: SnapshotObjectRegistry);
|
|
338
|
+
readonly languageService: LanguageService;
|
|
339
|
+
constructor(data: ProjectResponse, snapshotId: number, toPath: (fileName: string, basePath?: string) => PathKey, api: API<boolean>, snapshotRegistry: SnapshotObjectRegistry);
|
|
129
340
|
dispose(): void;
|
|
130
341
|
}
|
|
131
|
-
export declare class
|
|
342
|
+
export declare class LanguageService {
|
|
132
343
|
private snapshotId;
|
|
133
344
|
private project;
|
|
134
|
-
private
|
|
135
|
-
private
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
345
|
+
private objectRegistry;
|
|
346
|
+
private get client();
|
|
347
|
+
constructor(snapshotId: number, project: Project, objectRegistry: ProjectObjectRegistry);
|
|
348
|
+
getImportAdderEdits(file: DocumentIdentifier, actions: readonly APIImportAdderAction[]): Promise<readonly TextEdit[]>;
|
|
349
|
+
getImportEditsForSymbols(file: DocumentIdentifier, symbols: readonly Symbol[], options?: GetImportEditsForSymbolsOptions): Promise<readonly TextEdit[]>;
|
|
350
|
+
getReferencedSymbolsForNode(node: Node, position: number): Promise<ReferencedSymbolEntry[]>;
|
|
351
|
+
getSignatureUsage(signatureDecl: Node): Promise<SignatureUsage[]>;
|
|
352
|
+
getCompletionsAtPosition(document: string, position: number, options?: CompletionOptions): Promise<CompletionInfo | undefined>;
|
|
353
|
+
/**
|
|
354
|
+
* Format a synthesized node with the correct indentation for insertion at a
|
|
355
|
+
* specific position in an existing source file.
|
|
356
|
+
*
|
|
357
|
+
* @param node The synthesized AST node to format.
|
|
358
|
+
* @param file The target file where the node will be inserted.
|
|
359
|
+
* @param position The UTF-16 code-unit offset in the target file for insertion.
|
|
360
|
+
* @returns The formatted text of the node, indented for the insertion position.
|
|
361
|
+
*/
|
|
362
|
+
formatNodeForInsertion(node: Node, file: DocumentIdentifier, position: number): Promise<string>;
|
|
363
|
+
}
|
|
364
|
+
export declare class Program<Id extends ProjectId = ProjectId> implements FormatDiagnosticsHost {
|
|
365
|
+
readonly id: Id;
|
|
366
|
+
private readonly project;
|
|
367
|
+
private readonly toPath;
|
|
368
|
+
private readonly decoder;
|
|
369
|
+
private readonly sourceFileMetadataCache;
|
|
370
|
+
private ownedSnapshot;
|
|
371
|
+
private disposePromise;
|
|
372
|
+
private get client();
|
|
373
|
+
private get sourceFileCache();
|
|
374
|
+
constructor(snapshotId: number, project: Project<Id>, toPath: (fileName: string, basePath?: string) => PathKey);
|
|
375
|
+
getCurrentDirectory(): RootedDirectoryPath;
|
|
376
|
+
getCanonicalFileName(fileName: string): string;
|
|
377
|
+
getNewLine(): string;
|
|
378
|
+
[globalThis.Symbol.asyncDispose](): Promise<void>;
|
|
379
|
+
dispose(): Promise<void>;
|
|
380
|
+
private disposeWorker;
|
|
140
381
|
getCompilerOptions(): CompilerOptions;
|
|
141
382
|
getSourceFile(file: DocumentIdentifier): Promise<SourceFile | undefined>;
|
|
142
|
-
|
|
383
|
+
/**
|
|
384
|
+
* Returns the source file for an already-canonical path.
|
|
385
|
+
*/
|
|
386
|
+
getSourceFileByPath(path: PathKey): Promise<SourceFile | undefined>;
|
|
387
|
+
private getSourceFileWorker;
|
|
388
|
+
getResolvedModule(file: DocumentIdentifier, moduleName: string, mode: ModuleKind): Promise<ResolvedModule | undefined>;
|
|
389
|
+
getModeForUsageLocation(file: DocumentIdentifier, usage: StringLiteralLikeNode): Promise<ModuleKind>;
|
|
390
|
+
getModeForResolutionAtIndex(file: DocumentIdentifier, index: number): Promise<ModuleKind>;
|
|
391
|
+
getResolvedModuleFromModuleSpecifier(moduleSpecifier: StringLiteralLikeNode, sourceFile?: DocumentIdentifier): Promise<ResolvedModule | undefined>;
|
|
392
|
+
getResolvedTypeReferenceDirective(file: DocumentIdentifier, typeDirectiveName: string, mode: ModuleKind): Promise<ResolvedTypeReferenceDirective | undefined>;
|
|
393
|
+
getResolvedTypeReferenceDirectiveFromTypeReferenceDirective(typeReferenceDirective: FileReference, sourceFile: DocumentIdentifier): Promise<ResolvedTypeReferenceDirective | undefined>;
|
|
394
|
+
getSourceFileNames(): Promise<readonly RootedFilePath[]>;
|
|
143
395
|
/**
|
|
144
396
|
* Returns program-stored metadata for the given source file, or `undefined` if the file
|
|
145
397
|
* is not part of the program. Metadata is fetched lazily per file and cached on this
|
|
146
398
|
* `Program` instance.
|
|
147
399
|
*/
|
|
148
|
-
getSourceFileMetadata(
|
|
400
|
+
getSourceFileMetadata(file: DocumentIdentifier): Promise<SourceFileMetadata | undefined>;
|
|
149
401
|
/**
|
|
150
402
|
* Returns program-stored metadata for the source file at the given path, or `undefined`
|
|
151
403
|
* if the file is not part of the program. Like {@link getSourceFileMetadata}, but skips
|
|
152
404
|
* the file name to path conversion. Metadata is fetched lazily per file and cached on
|
|
153
405
|
* this `Program` instance.
|
|
154
406
|
*/
|
|
155
|
-
getSourceFileMetadataByPath(path:
|
|
407
|
+
getSourceFileMetadataByPath(path: PathKey): Promise<SourceFileMetadata | undefined>;
|
|
156
408
|
private fetchSourceFileMetadata;
|
|
409
|
+
private pathKeyForFileName;
|
|
157
410
|
/**
|
|
158
411
|
* Returns whether the given source file was loaded as part of an external library
|
|
159
412
|
* (e.g. a dependency resolved from `node_modules`). The underlying program metadata is
|
|
@@ -167,30 +420,40 @@ export declare class Program {
|
|
|
167
420
|
*/
|
|
168
421
|
isSourceFileDefaultLibrary(file: SourceFile): Promise<boolean>;
|
|
169
422
|
/**
|
|
170
|
-
* Get
|
|
171
|
-
*
|
|
423
|
+
* Get all config source file names associated with this program's project config.
|
|
424
|
+
* Includes the root config file and any extended config files.
|
|
425
|
+
*/
|
|
426
|
+
getConfigFileNames(): Promise<readonly RootedFilePath[]>;
|
|
427
|
+
/**
|
|
428
|
+
* Get a config source file by file name/URI.
|
|
429
|
+
* This can return the project's root tsconfig file or one of its extended config files.
|
|
172
430
|
*/
|
|
173
|
-
|
|
431
|
+
getConfigSourceFile(file: DocumentIdentifier): Promise<SourceFile | undefined>;
|
|
174
432
|
/**
|
|
175
|
-
* Get
|
|
176
|
-
* @param file - Optional file to get diagnostics for. If omitted, returns diagnostics for all files.
|
|
433
|
+
* Get syntactic (parse) diagnostics for specific files or all files.
|
|
434
|
+
* @param file - Optional file(s) to get diagnostics for. If omitted, returns diagnostics for all files.
|
|
177
435
|
*/
|
|
178
|
-
|
|
436
|
+
getSyntacticDiagnostics(file?: DocumentIdentifier | readonly DocumentIdentifier[]): Promise<readonly Diagnostic[]>;
|
|
179
437
|
/**
|
|
180
|
-
* Get
|
|
181
|
-
* @param file - Optional file to get diagnostics for. If omitted, returns diagnostics for all files.
|
|
438
|
+
* Get binder diagnostics for specific files or all files.
|
|
439
|
+
* @param file - Optional file(s) to get diagnostics for. If omitted, returns diagnostics for all files.
|
|
182
440
|
*/
|
|
183
|
-
|
|
441
|
+
getBindDiagnostics(file?: DocumentIdentifier | readonly DocumentIdentifier[]): Promise<readonly Diagnostic[]>;
|
|
184
442
|
/**
|
|
185
|
-
* Get
|
|
186
|
-
* @param file - Optional file to get diagnostics for. If omitted, returns diagnostics for all files.
|
|
443
|
+
* Get semantic (type-check) diagnostics for specific files or all files.
|
|
444
|
+
* @param file - Optional file(s) to get diagnostics for. If omitted, returns diagnostics for all files.
|
|
187
445
|
*/
|
|
188
|
-
|
|
446
|
+
getSemanticDiagnostics(file?: DocumentIdentifier | readonly DocumentIdentifier[]): Promise<readonly Diagnostic[]>;
|
|
189
447
|
/**
|
|
190
|
-
* Get
|
|
191
|
-
* @param file - Optional file to get diagnostics for. If omitted, returns diagnostics for all files.
|
|
448
|
+
* Get suggestion diagnostics for specific files or all files.
|
|
449
|
+
* @param file - Optional file(s) to get diagnostics for. If omitted, returns diagnostics for all files.
|
|
192
450
|
*/
|
|
193
|
-
|
|
451
|
+
getSuggestionDiagnostics(file?: DocumentIdentifier | readonly DocumentIdentifier[]): Promise<readonly Diagnostic[]>;
|
|
452
|
+
/**
|
|
453
|
+
* Get declaration emit diagnostics for specific files or all files.
|
|
454
|
+
* @param file - Optional file(s) to get diagnostics for. If omitted, returns diagnostics for all files.
|
|
455
|
+
*/
|
|
456
|
+
getDeclarationDiagnostics(file?: DocumentIdentifier | readonly DocumentIdentifier[]): Promise<readonly Diagnostic[]>;
|
|
194
457
|
/**
|
|
195
458
|
* Get program-wide diagnostics for the project, including compiler options diagnostics.
|
|
196
459
|
*/
|
|
@@ -203,45 +466,150 @@ export declare class Program {
|
|
|
203
466
|
* Get config file parsing diagnostics for the project.
|
|
204
467
|
*/
|
|
205
468
|
getConfigFileParsingDiagnostics(): Promise<readonly Diagnostic[]>;
|
|
469
|
+
/**
|
|
470
|
+
* Emits files to the configured filesystem. Layer and host filesystems are
|
|
471
|
+
* written through; full filesystems remain immutable and return emitted
|
|
472
|
+
* files in {@link EmitResult.fileSystem}.
|
|
473
|
+
*/
|
|
474
|
+
emit(emitOnly?: EmitOnly): Promise<EmitResult>;
|
|
475
|
+
/**
|
|
476
|
+
* Emits files and returns their contents without writing to the filesystem.
|
|
477
|
+
*/
|
|
478
|
+
emitToString(emitOnly?: EmitOnly): Promise<EmitOutput>;
|
|
479
|
+
/**
|
|
480
|
+
* Gets JavaScript output for selected files regardless of project `noEmit`, `emitDeclarationOnly`, and `noEmitOnError` settings.
|
|
481
|
+
*/
|
|
482
|
+
getJavaScriptEmit(files: readonly DocumentIdentifier[]): Promise<EmitOutput>;
|
|
483
|
+
/**
|
|
484
|
+
* Gets declaration output for selected files regardless of project `noEmit`, `declaration`, `emitDeclarationOnly`, and `noEmitOnError` settings.
|
|
485
|
+
*/
|
|
486
|
+
getDeclarationEmit(files: readonly DocumentIdentifier[]): Promise<EmitOutput>;
|
|
487
|
+
getProject(): Project<Id>;
|
|
488
|
+
}
|
|
489
|
+
export interface BuildOrchestratorOptions {
|
|
490
|
+
cwd?: string | undefined;
|
|
491
|
+
dry?: boolean;
|
|
492
|
+
force?: boolean;
|
|
493
|
+
verbose?: boolean;
|
|
494
|
+
stopBuildOnErrors?: boolean;
|
|
495
|
+
overrideCompilerOptions?: OverrideCompilerOptions;
|
|
496
|
+
}
|
|
497
|
+
export interface OverrideCompilerOptions {
|
|
498
|
+
incremental?: boolean;
|
|
499
|
+
assumeChangesOnlyAffectDirectDependencies?: boolean;
|
|
500
|
+
declaration?: boolean;
|
|
501
|
+
declarationMap?: boolean;
|
|
502
|
+
emitDeclarationOnly?: boolean;
|
|
503
|
+
sourceMap?: boolean;
|
|
504
|
+
inlineSourceMap?: boolean;
|
|
505
|
+
traceResolution?: boolean;
|
|
506
|
+
}
|
|
507
|
+
export declare class BuildOrchestrator {
|
|
508
|
+
private client;
|
|
509
|
+
private id;
|
|
510
|
+
private disposed;
|
|
511
|
+
private disposePromise;
|
|
512
|
+
private onDispose;
|
|
513
|
+
constructor(client: Client, orchestratorResponse: CreateBuildOrchestratorResponse, onDispose: () => void);
|
|
514
|
+
[globalThis.Symbol.asyncDispose](): Promise<void>;
|
|
515
|
+
dispose(): Promise<void>;
|
|
516
|
+
private disposeWorker;
|
|
517
|
+
build(project?: string): Promise<BuildResponse>;
|
|
518
|
+
buildReferences(project: string): Promise<BuildResponse>;
|
|
519
|
+
clean(project?: string): Promise<CleanBuildResponse>;
|
|
520
|
+
cleanReferences(project?: string): Promise<CleanBuildResponse>;
|
|
521
|
+
isDisposed(): boolean;
|
|
522
|
+
private ensureNotDisposed;
|
|
206
523
|
}
|
|
207
524
|
export declare class Checker {
|
|
208
525
|
private snapshotId;
|
|
209
526
|
private project;
|
|
210
|
-
private client;
|
|
211
527
|
private objectRegistry;
|
|
212
528
|
private wellKnownSymbols;
|
|
213
|
-
|
|
529
|
+
private wellKnownSignatures;
|
|
530
|
+
private get client();
|
|
531
|
+
constructor(snapshotId: number, project: Project, objectRegistry: ProjectObjectRegistry);
|
|
214
532
|
dispose(): void;
|
|
533
|
+
/** Get the merged symbol, or the original symbol if it has not been merged. */
|
|
534
|
+
getMergedSymbol(symbol: Symbol): Promise<Symbol>;
|
|
535
|
+
/**
|
|
536
|
+
* Get a node's merged symbol. For a declaration, prefer
|
|
537
|
+
* {@link Checker.getSymbolOfDeclaration} for a non-nullable result.
|
|
538
|
+
*/
|
|
539
|
+
getSymbolOfNode(node: Node): Promise<Symbol | undefined>;
|
|
540
|
+
/** Get a declaration's merged symbol. */
|
|
541
|
+
getSymbolOfDeclaration(node: Declaration): Promise<Symbol>;
|
|
542
|
+
/** Get a symbol's merged parent, if any. */
|
|
543
|
+
getParentOfSymbol(symbol: Symbol): Promise<Symbol | undefined>;
|
|
215
544
|
getSymbolAtLocation(node: Node): Promise<Symbol | undefined>;
|
|
216
545
|
getSymbolAtLocation(nodes: readonly Node[]): Promise<(Symbol | undefined)[]>;
|
|
217
546
|
getSymbolAtPosition(file: DocumentIdentifier, position: number): Promise<Symbol | undefined>;
|
|
218
547
|
getSymbolAtPosition(file: DocumentIdentifier, positions: readonly number[]): Promise<(Symbol | undefined)[]>;
|
|
219
|
-
|
|
220
|
-
|
|
548
|
+
getSymbolOfSourceFile(file: DocumentIdentifier): Promise<Symbol | undefined>;
|
|
549
|
+
getSymbolOfSourceFile(files: readonly DocumentIdentifier[]): Promise<(Symbol | undefined)[]>;
|
|
550
|
+
/**
|
|
551
|
+
* Get the type of a symbol. Always returns a type; for symbols whose type
|
|
552
|
+
* cannot be determined the checker yields the error type (use
|
|
553
|
+
* {@link Type.isErrorType} to detect it).
|
|
554
|
+
*/
|
|
555
|
+
getTypeOfSymbol(symbol: Symbol): Promise<Type>;
|
|
556
|
+
getTypeOfSymbol(symbols: readonly Symbol[]): Promise<Type[]>;
|
|
221
557
|
/**
|
|
222
558
|
* Get the declared type of a symbol. Always returns a type; for symbols whose
|
|
223
559
|
* declared type cannot be determined the checker yields the error type (use
|
|
224
560
|
* {@link Type.isErrorType} to detect it).
|
|
225
561
|
*/
|
|
226
562
|
getDeclaredTypeOfSymbol(symbol: Symbol): Promise<Type>;
|
|
563
|
+
/**
|
|
564
|
+
* Get the type of a symbol, excluding the missing type when
|
|
565
|
+
* `exactOptionalPropertyTypes: true` is set; for symbols whose
|
|
566
|
+
* type cannot be determined the checker yields the error type
|
|
567
|
+
* (use {@link Type.isErrorType} to detect it).
|
|
568
|
+
*/
|
|
569
|
+
getNonMissingTypeOfSymbol(symbol: Symbol): Promise<Type>;
|
|
227
570
|
getReferencesToSymbolInFile(file: DocumentIdentifier, symbol: Symbol): Promise<NodeHandle[]>;
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
571
|
+
/**
|
|
572
|
+
* Get the type at a node location. Always returns a type; for nodes whose
|
|
573
|
+
* type cannot be determined the checker yields the error type (use
|
|
574
|
+
* {@link Type.isErrorType} to detect it).
|
|
575
|
+
*/
|
|
576
|
+
getTypeAtLocation(node: Node): Promise<Type>;
|
|
577
|
+
getTypeAtLocation(nodes: readonly Node[]): Promise<Type[]>;
|
|
233
578
|
getSignaturesOfType(type: Type, kind: SignatureKind): Promise<readonly Signature[]>;
|
|
234
|
-
|
|
579
|
+
/**
|
|
580
|
+
* Get the resolved signature of a call-like expression. Always returns a
|
|
581
|
+
* signature; when a call cannot be resolved the checker yields the unknown
|
|
582
|
+
* signature (use {@link Checker.isUnknownSignature} to detect it).
|
|
583
|
+
*/
|
|
584
|
+
getResolvedSignature(node: Node): Promise<Signature>;
|
|
235
585
|
getTypeAtPosition(file: DocumentIdentifier, position: number): Promise<Type | undefined>;
|
|
236
586
|
getTypeAtPosition(file: DocumentIdentifier, positions: readonly number[]): Promise<(Type | undefined)[]>;
|
|
237
587
|
resolveName(name: string, meaning: SymbolFlags, location?: Node | DocumentPosition, excludeGlobals?: boolean): Promise<Symbol | undefined>;
|
|
588
|
+
/**
|
|
589
|
+
* Returns all symbols with the given meaning that are visible at `location`.
|
|
590
|
+
*/
|
|
591
|
+
getSymbolsInScope(location: Node | DocumentPosition, meaning: SymbolFlags): Promise<readonly Symbol[]>;
|
|
238
592
|
getResolvedSymbol(node: Identifier): Promise<Symbol | undefined>;
|
|
239
593
|
getContextualType(node: Expression): Promise<Type | undefined>;
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
594
|
+
getContextualTypeForArgumentAtIndex(node: CallLikeExpression, argIndex: number): Promise<Type | undefined>;
|
|
595
|
+
getAwaitedType(type: Type): Promise<Type | undefined>;
|
|
596
|
+
/** Get the base type of a literal type (e.g. `number` for `42`). Always returns a type. */
|
|
597
|
+
getBaseTypeOfLiteralType(type: Type): Promise<Type>;
|
|
598
|
+
/** Get the type with `null` and `undefined` removed. Always returns a type. */
|
|
599
|
+
getNonNullableType(type: Type): Promise<Type>;
|
|
600
|
+
/**
|
|
601
|
+
* Get the type for a type node. Always returns a type; for type nodes whose
|
|
602
|
+
* type cannot be determined the checker yields the error type (use
|
|
603
|
+
* {@link Type.isErrorType} to detect it).
|
|
604
|
+
*/
|
|
605
|
+
getTypeFromTypeNode(node: TypeNode): Promise<Type>;
|
|
606
|
+
/** Get the widened type. Always returns a type. */
|
|
607
|
+
getWidenedType(type: Type): Promise<Type>;
|
|
608
|
+
/**
|
|
609
|
+
* Get the type of the parameter at the given index in a signature. Always
|
|
610
|
+
* returns a type; an out-of-range index yields the `any` type.
|
|
611
|
+
*/
|
|
612
|
+
getParameterType(signature: Signature, index: number): Promise<Type>;
|
|
245
613
|
isArrayLikeType(type: Type): Promise<boolean>;
|
|
246
614
|
isTypeAssignableTo(source: Type, target: Type): Promise<boolean>;
|
|
247
615
|
getShorthandAssignmentValueSymbol(node: Node): Promise<Symbol | undefined>;
|
|
@@ -263,32 +631,57 @@ export declare class Checker {
|
|
|
263
631
|
getUnknownType(): Promise<Type>;
|
|
264
632
|
getBigIntType(): Promise<Type>;
|
|
265
633
|
getESSymbolType(): Promise<Type>;
|
|
634
|
+
getNonPrimitiveType(): Promise<Type>;
|
|
266
635
|
typeToTypeNode(type: Type, enclosingDeclaration?: Node, flags?: number): Promise<TypeNode | undefined>;
|
|
267
636
|
signatureToSignatureDeclaration(signature: Signature, kind: SyntaxKind, enclosingDeclaration?: Node, flags?: NodeBuilderFlags): Promise<Node | undefined>;
|
|
268
|
-
typeToString(type: Type, enclosingDeclaration?: Node, flags?:
|
|
637
|
+
typeToString(type: Type, enclosingDeclaration?: Node, flags?: TypeFormatFlags): Promise<string>;
|
|
269
638
|
isContextSensitive(node: Node): Promise<boolean>;
|
|
270
639
|
isArrayType(type: Type): Promise<boolean>;
|
|
271
640
|
isTupleType(type: Type): Promise<boolean>;
|
|
272
|
-
|
|
273
|
-
|
|
641
|
+
isTupleTypeTarget(type: Type): Promise<boolean>;
|
|
642
|
+
/**
|
|
643
|
+
* The following symbols are considered read-only:
|
|
644
|
+
* - Properties with a `readonly` modifier
|
|
645
|
+
* - Variables declared with `const`
|
|
646
|
+
* - Get accessors without matching set accessors
|
|
647
|
+
* - Enum members
|
|
648
|
+
* - `Object.defineProperty` assignments with `writable: false` or no setter
|
|
649
|
+
* - Unions and intersections of the above
|
|
650
|
+
*/
|
|
651
|
+
isReadonlySymbol(symbol: Symbol): Promise<boolean>;
|
|
652
|
+
/** Get the return type of a signature. Always returns a type. */
|
|
653
|
+
getReturnTypeOfSignature(signature: Signature): Promise<Type>;
|
|
654
|
+
/**
|
|
655
|
+
* Get the rest type of a signature. Always returns a type; a signature with
|
|
656
|
+
* no rest parameter yields the `any` type.
|
|
657
|
+
*/
|
|
658
|
+
getRestTypeOfSignature(signature: Signature): Promise<Type>;
|
|
274
659
|
getTypePredicateOfSignature(signature: Signature): Promise<TypePredicate | undefined>;
|
|
275
660
|
/**
|
|
276
661
|
* Get the base types of a class or interface type. A type with no base types
|
|
277
662
|
* yields an empty array.
|
|
278
663
|
*/
|
|
279
664
|
getBaseTypes(type: InterfaceType): Promise<readonly Type[]>;
|
|
280
|
-
|
|
665
|
+
/** Get the apparent type of a type. Always returns a type. */
|
|
666
|
+
getApparentType(type: Type): Promise<Type>;
|
|
667
|
+
/** Get the reduced type of a type. Always returns a type. */
|
|
668
|
+
getReducedType(type: Type): Promise<Type>;
|
|
281
669
|
getPropertiesOfType(type: Type): Promise<readonly Symbol[]>;
|
|
282
670
|
getIndexInfosOfType(type: Type): Promise<readonly IndexInfo[]>;
|
|
671
|
+
getIndexInfoOfType(type: Type, kind: IndexKind): Promise<IndexInfo | undefined>;
|
|
672
|
+
getIndexTypeOfType(type: Type, kind: IndexKind): Promise<Type | undefined>;
|
|
673
|
+
getTypeOfPropertyOfType(type: Type, propertyName: string): Promise<Type | undefined>;
|
|
283
674
|
/**
|
|
284
675
|
* Get the constraint of a type parameter (the `T` in `<U extends T>`), or
|
|
285
676
|
* undefined if it has none.
|
|
286
677
|
*/
|
|
287
678
|
getConstraintOfTypeParameter(type: TypeParameter): Promise<Type | undefined>;
|
|
679
|
+
getDefaultFromTypeParameter(type: TypeParameter): Promise<Type | undefined>;
|
|
288
680
|
getBaseConstraintOfType(type: Type): Promise<Type | undefined>;
|
|
289
681
|
getPropertyOfType(type: Type, name: string): Promise<Symbol | undefined>;
|
|
290
682
|
getConstantValue(node: Node): Promise<string | number | undefined>;
|
|
291
|
-
|
|
683
|
+
/** Get the signature of a function-like declaration. Always returns a signature. */
|
|
684
|
+
getSignatureFromDeclaration(node: Node): Promise<Signature>;
|
|
292
685
|
getExportSpecifierLocalTargetSymbol(node: Node): Promise<Symbol | undefined>;
|
|
293
686
|
/**
|
|
294
687
|
* Follow all aliases to get the original symbol. Always returns a symbol; for
|
|
@@ -296,7 +689,17 @@ export declare class Checker {
|
|
|
296
689
|
* {@link Checker.isUnknownSymbol} to detect it).
|
|
297
690
|
*/
|
|
298
691
|
getAliasedSymbol(symbol: Symbol): Promise<Symbol>;
|
|
692
|
+
/**
|
|
693
|
+
* Get the fully qualified name of a symbol, walking up its parent chain
|
|
694
|
+
* (e.g. `"/path/to/module".Namespace.Name`).
|
|
695
|
+
*/
|
|
696
|
+
getFullyQualifiedName(symbol: Symbol): Promise<string>;
|
|
299
697
|
getImmediateAliasedSymbol(symbol: Symbol): Promise<Symbol | undefined>;
|
|
698
|
+
/**
|
|
699
|
+
* Get the target symbol if instantiated, or the provided symbol otherwise.
|
|
700
|
+
*/
|
|
701
|
+
getTargetSymbol(symbol: Symbol): Promise<Symbol>;
|
|
702
|
+
getExportSymbolOfSymbol(symbol: Symbol): Promise<Symbol>;
|
|
300
703
|
/**
|
|
301
704
|
* Fetch (once, then cache) the handle ids of the per-checker singleton
|
|
302
705
|
* symbols (unknown, undefined, arguments). These ids are stable for the life
|
|
@@ -317,6 +720,18 @@ export declare class Checker {
|
|
|
317
720
|
* Returns `true` if the symbol is the checker's "arguments" symbol.
|
|
318
721
|
*/
|
|
319
722
|
isArgumentsSymbol(symbol: Symbol): Promise<boolean>;
|
|
723
|
+
/**
|
|
724
|
+
* Fetch (once, then cache) the handle id of the per-checker unknown
|
|
725
|
+
* signature. This id is stable for the life of the project's checker, so
|
|
726
|
+
* identity checks against it are local after the first call.
|
|
727
|
+
*/
|
|
728
|
+
private getWellKnownSignatures;
|
|
729
|
+
/**
|
|
730
|
+
* Returns `true` if the signature is the checker's "unknown" signature (e.g.
|
|
731
|
+
* the result of {@link Checker.getResolvedSignature} on a call that cannot be
|
|
732
|
+
* resolved).
|
|
733
|
+
*/
|
|
734
|
+
isUnknownSignature(signature: Signature): Promise<boolean>;
|
|
320
735
|
getExportsOfModule(symbol: Symbol): Promise<readonly Symbol[]>;
|
|
321
736
|
getMemberInModuleExports(symbol: Symbol, name: string): Promise<Symbol | undefined>;
|
|
322
737
|
getJsDocTagsOfSymbol(symbol: Symbol): Promise<readonly JSDocTagInfo[]>;
|
|
@@ -331,28 +746,33 @@ export interface PrintNodeOptions {
|
|
|
331
746
|
neverAsciiEscape?: boolean | undefined;
|
|
332
747
|
terminateUnterminatedLiterals?: boolean | undefined;
|
|
333
748
|
}
|
|
334
|
-
export declare class
|
|
749
|
+
export declare class Printer {
|
|
335
750
|
private client;
|
|
336
751
|
constructor(client: Client);
|
|
337
752
|
printNode(node: Node, options?: PrintNodeOptions): Promise<string>;
|
|
753
|
+
printFile(sourceFile: SourceFile, options?: PrintNodeOptions): Promise<string>;
|
|
338
754
|
}
|
|
339
|
-
export declare class NodeHandle {
|
|
755
|
+
export declare class NodeHandle<out T extends Node = Node> {
|
|
340
756
|
/**
|
|
341
757
|
* The project this handle was produced in, used as the default for {@link resolve}.
|
|
342
758
|
* Node handles are only meaningful within a project's program, so the producing project
|
|
343
759
|
* is remembered so callers don't have to pass it explicitly.
|
|
344
760
|
*/
|
|
345
761
|
private readonly canonicalProject;
|
|
762
|
+
/** The owning source file of a file-owned symbol's declaration. */
|
|
763
|
+
private readonly fileOwner;
|
|
346
764
|
readonly index: number;
|
|
347
765
|
readonly kind: SyntaxKind;
|
|
348
|
-
readonly path:
|
|
349
|
-
constructor(handle: string, canonicalProject: Project);
|
|
766
|
+
readonly path: PathKey;
|
|
767
|
+
constructor(handle: string, canonicalProject: Project | undefined, fileOwner?: SourceFileOwner);
|
|
350
768
|
/**
|
|
351
769
|
* Resolve this handle to the actual AST node by fetching the source file from a project
|
|
352
770
|
* and looking up the node by index. If no project is passed, the project that produced
|
|
353
|
-
* the handle is used.
|
|
771
|
+
* the handle is used. Declarations of file-owned symbols identify an exact source file and
|
|
772
|
+
* resolve through it, independently of any project.
|
|
354
773
|
*/
|
|
355
|
-
resolve(project?: Project): Promise<
|
|
774
|
+
resolve(project?: Project | undefined): Promise<T | undefined>;
|
|
775
|
+
private fetchOwnerFile;
|
|
356
776
|
}
|
|
357
777
|
/** A symbol definition paired with all of its reference nodes. */
|
|
358
778
|
export interface ReferencedSymbolEntry {
|
|
@@ -370,28 +790,34 @@ export interface SignatureUsage {
|
|
|
370
790
|
/** The node handle for the call expression, if the reference is invoked. */
|
|
371
791
|
call?: NodeHandle | undefined;
|
|
372
792
|
}
|
|
793
|
+
/** A cached source-file record and its owning API. */
|
|
794
|
+
interface SourceFileOwner {
|
|
795
|
+
readonly record: CachedSourceFile<Symbol>;
|
|
796
|
+
readonly api: API<boolean>;
|
|
797
|
+
}
|
|
798
|
+
type SymbolStorage = {
|
|
799
|
+
readonly kind: typeof SymbolOwnerKind.File;
|
|
800
|
+
readonly owner: SourceFileOwner;
|
|
801
|
+
} | {
|
|
802
|
+
readonly kind: typeof SymbolOwnerKind.Snapshot;
|
|
803
|
+
readonly registry: ProjectObjectRegistry;
|
|
804
|
+
};
|
|
373
805
|
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;
|
|
806
|
+
private readonly storage;
|
|
807
|
+
get id(): number;
|
|
382
808
|
/** The escaped (`__String`) name, used as the key in member/export tables. */
|
|
383
809
|
readonly escapedName: __String;
|
|
384
810
|
/** The display name (escaped underscores removed). */
|
|
385
811
|
readonly name: string;
|
|
386
812
|
readonly flags: SymbolFlags;
|
|
387
|
-
readonly checkFlags:
|
|
388
|
-
readonly declarations: readonly NodeHandle[];
|
|
389
|
-
readonly valueDeclaration: NodeHandle | undefined;
|
|
813
|
+
readonly checkFlags: CheckFlags;
|
|
814
|
+
readonly declarations: readonly NodeHandle<Declaration>[];
|
|
815
|
+
readonly valueDeclaration: NodeHandle<Declaration> | undefined;
|
|
390
816
|
private readonly parent;
|
|
391
817
|
private readonly exportSymbol;
|
|
392
818
|
private membersCache;
|
|
393
819
|
private exportsCache;
|
|
394
|
-
constructor(data: SymbolResponse,
|
|
820
|
+
constructor(data: SymbolResponse, storage: SymbolStorage);
|
|
395
821
|
getParent(): Promise<Symbol | undefined>;
|
|
396
822
|
/**
|
|
397
823
|
* Get this symbol's members keyed by escaped name. The result is cached on
|
|
@@ -407,27 +833,33 @@ export declare class Symbol {
|
|
|
407
833
|
getExportSymbol(): Promise<Symbol>;
|
|
408
834
|
getJsDocTags(checker: Checker): Promise<readonly JSDocTagInfo[]>;
|
|
409
835
|
getDocumentationComment(checker: Checker): Promise<string>;
|
|
836
|
+
private fetchSymbol;
|
|
837
|
+
private fetchSymbols;
|
|
838
|
+
private internFileSymbol;
|
|
410
839
|
}
|
|
411
840
|
declare class TypeObject implements Type {
|
|
412
841
|
private objectRegistry;
|
|
413
842
|
readonly id: number;
|
|
414
843
|
readonly flags: TypeFlags;
|
|
415
844
|
readonly objectFlags: ObjectFlags;
|
|
416
|
-
readonly symbol:
|
|
845
|
+
readonly symbol: CompactSymbolReference;
|
|
417
846
|
readonly value: string | number | boolean | bigint;
|
|
418
847
|
readonly intrinsicName: string;
|
|
419
848
|
readonly isThisType: boolean;
|
|
420
849
|
readonly freshType: number;
|
|
421
850
|
readonly regularType: number;
|
|
422
851
|
readonly target: number;
|
|
852
|
+
private readonly tupleType;
|
|
423
853
|
readonly typeParameters: readonly number[];
|
|
424
854
|
readonly outerTypeParameters: readonly number[];
|
|
425
855
|
readonly localTypeParameters: readonly number[];
|
|
856
|
+
readonly thisType: number;
|
|
426
857
|
readonly aliasTypeArguments: readonly number[];
|
|
427
|
-
readonly aliasSymbol:
|
|
858
|
+
readonly aliasSymbol: CompactSymbolReference;
|
|
428
859
|
readonly elementFlags: readonly ElementFlags[];
|
|
429
860
|
readonly fixedLength: number;
|
|
430
861
|
readonly readonly: boolean;
|
|
862
|
+
readonly labeledElementDeclarations?: readonly (NodeHandle<NamedTupleMember | ParameterDeclaration> | undefined)[];
|
|
431
863
|
readonly texts: readonly string[];
|
|
432
864
|
readonly objectType: number;
|
|
433
865
|
readonly indexType: number;
|
|
@@ -435,10 +867,41 @@ declare class TypeObject implements Type {
|
|
|
435
867
|
readonly extendsType: number;
|
|
436
868
|
readonly baseType: number;
|
|
437
869
|
readonly substConstraint: number;
|
|
870
|
+
readonly typeParameter: number;
|
|
871
|
+
readonly constraintType: number;
|
|
872
|
+
readonly nameType: number;
|
|
873
|
+
readonly templateType: number;
|
|
438
874
|
private trueType;
|
|
439
875
|
private falseType;
|
|
876
|
+
private constraint;
|
|
877
|
+
private default;
|
|
878
|
+
private nonNullableType;
|
|
879
|
+
private apparentType;
|
|
880
|
+
private reducedType;
|
|
881
|
+
private properties;
|
|
882
|
+
private apparentProperties;
|
|
883
|
+
private callSignatures;
|
|
884
|
+
private constructSignatures;
|
|
885
|
+
private indexInfos;
|
|
886
|
+
private baseTypes;
|
|
887
|
+
private types;
|
|
888
|
+
private stringIndexType;
|
|
889
|
+
private numberIndexType;
|
|
440
890
|
constructor(data: TypeResponse, objectRegistry: ProjectObjectRegistry);
|
|
441
891
|
getSymbol(): Promise<Symbol | undefined>;
|
|
892
|
+
getProperties(): Promise<readonly Symbol[]>;
|
|
893
|
+
getProperty(propertyName: string): Promise<Symbol | undefined>;
|
|
894
|
+
getApparentProperties(): Promise<readonly Symbol[]>;
|
|
895
|
+
getCallSignatures(): Promise<readonly Signature[]>;
|
|
896
|
+
getConstructSignatures(): Promise<readonly Signature[]>;
|
|
897
|
+
getNonNullableType(): Promise<Type>;
|
|
898
|
+
getStringIndexType(): Promise<Type | undefined>;
|
|
899
|
+
private getStringIndexTypeWorker;
|
|
900
|
+
getNumberIndexType(): Promise<Type | undefined>;
|
|
901
|
+
private getNumberIndexTypeWorker;
|
|
902
|
+
getApparentType(): Promise<Type>;
|
|
903
|
+
getReducedType(): Promise<Type>;
|
|
904
|
+
getIndexInfos(): Promise<readonly IndexInfo[]>;
|
|
442
905
|
getAliasSymbol(): Promise<Symbol | undefined>;
|
|
443
906
|
getTarget(): Promise<Type>;
|
|
444
907
|
getFreshType(): Promise<FreshableType | undefined>;
|
|
@@ -447,13 +910,19 @@ declare class TypeObject implements Type {
|
|
|
447
910
|
getTypeParameters(): Promise<readonly TypeParameter[]>;
|
|
448
911
|
getOuterTypeParameters(): Promise<readonly TypeParameter[]>;
|
|
449
912
|
getLocalTypeParameters(): Promise<readonly TypeParameter[]>;
|
|
913
|
+
getThisType(): Promise<TypeParameter | undefined>;
|
|
450
914
|
getAliasTypeArguments(): Promise<readonly Type[]>;
|
|
915
|
+
getTypeParameter(): Promise<TypeParameter>;
|
|
916
|
+
getConstraintType(): Promise<Type>;
|
|
917
|
+
getNameType(): Promise<Type | undefined>;
|
|
918
|
+
getTemplateType(): Promise<Type>;
|
|
451
919
|
getObjectType(): Promise<Type>;
|
|
452
920
|
getIndexType(): Promise<Type>;
|
|
453
921
|
getCheckType(): Promise<Type>;
|
|
454
922
|
getExtendsType(): Promise<Type>;
|
|
455
923
|
getBaseType(): Promise<Type>;
|
|
456
|
-
getConstraint(): Promise<Type>;
|
|
924
|
+
getConstraint(): Promise<Type | undefined>;
|
|
925
|
+
getDefault(): Promise<Type | undefined>;
|
|
457
926
|
getTrueType(): Promise<Type>;
|
|
458
927
|
getFalseType(): Promise<Type>;
|
|
459
928
|
/**
|
|
@@ -473,7 +942,8 @@ declare class TypeObject implements Type {
|
|
|
473
942
|
isBigIntLiteralType(): this is BigIntLiteralType;
|
|
474
943
|
isBooleanLiteralType(): this is BooleanLiteralType;
|
|
475
944
|
isTypeReference(): this is TypeReference;
|
|
476
|
-
isTupleType(): this is
|
|
945
|
+
isTupleType(): this is TupleTypeReference;
|
|
946
|
+
isTupleTypeTarget(): this is TupleType;
|
|
477
947
|
isIndexType(): this is IndexType;
|
|
478
948
|
isIndexedAccessType(): this is IndexedAccessType;
|
|
479
949
|
isConditionalType(): this is ConditionalType;
|
|
@@ -481,6 +951,7 @@ declare class TypeObject implements Type {
|
|
|
481
951
|
isTemplateLiteralType(): this is TemplateLiteralType;
|
|
482
952
|
isStringMappingType(): this is StringMappingType;
|
|
483
953
|
isTypeParameter(): this is TypeParameter;
|
|
954
|
+
isMappedType(): this is MappedType;
|
|
484
955
|
}
|
|
485
956
|
export declare function isUnionType(type: Type): type is UnionType;
|
|
486
957
|
export declare function isIntersectionType(type: Type): type is IntersectionType;
|
|
@@ -500,7 +971,8 @@ export declare function isNumberLiteralType(type: Type): type is NumberLiteralTy
|
|
|
500
971
|
export declare function isBigIntLiteralType(type: Type): type is BigIntLiteralType;
|
|
501
972
|
export declare function isBooleanLiteralType(type: Type): type is BooleanLiteralType;
|
|
502
973
|
export declare function isTypeReference(type: Type): type is TypeReference;
|
|
503
|
-
export declare function isTupleType(type: Type): type is
|
|
974
|
+
export declare function isTupleType(type: Type): type is TupleTypeReference;
|
|
975
|
+
export declare function isTupleTypeTarget(type: Type): type is TupleType;
|
|
504
976
|
export declare function isIndexType(type: Type): type is IndexType;
|
|
505
977
|
export declare function isIndexedAccessType(type: Type): type is IndexedAccessType;
|
|
506
978
|
export declare function isConditionalType(type: Type): type is ConditionalType;
|
|
@@ -512,16 +984,19 @@ export declare class Signature {
|
|
|
512
984
|
private flags;
|
|
513
985
|
private objectRegistry;
|
|
514
986
|
readonly id: number;
|
|
515
|
-
readonly declaration?: NodeHandle | undefined;
|
|
987
|
+
readonly declaration?: NodeHandle<Declaration> | undefined;
|
|
516
988
|
readonly typeParameters?: readonly number[] | undefined;
|
|
517
|
-
readonly parameters: readonly
|
|
518
|
-
readonly thisParameter?:
|
|
989
|
+
readonly parameters: readonly CompactSymbolReference[];
|
|
990
|
+
readonly thisParameter?: CompactSymbolReference | undefined;
|
|
519
991
|
readonly target?: number | undefined;
|
|
992
|
+
private returnType;
|
|
520
993
|
constructor(data: SignatureResponse, project: Project, objectRegistry: ProjectObjectRegistry);
|
|
521
994
|
getTypeParameters(): Promise<readonly TypeParameter[]>;
|
|
522
995
|
getParameters(): Promise<readonly Symbol[]>;
|
|
523
996
|
getThisParameter(): Promise<Symbol | undefined>;
|
|
524
997
|
getTarget(): Promise<Signature | undefined>;
|
|
998
|
+
getReturnType(): Promise<Type>;
|
|
999
|
+
getTypeParameterAtPosition(pos: number): Promise<Type>;
|
|
525
1000
|
get hasRestParameter(): boolean;
|
|
526
1001
|
get isConstruct(): boolean;
|
|
527
1002
|
get isAbstract(): boolean;
|