summaryrefslogtreecommitdiff
path: root/cli/tsc/compiler.d.ts
diff options
context:
space:
mode:
authorKitson Kelly <me@kitsonkelly.com>2020-12-07 21:46:39 +1100
committerGitHub <noreply@github.com>2020-12-07 21:46:39 +1100
commit301d3e4b6849d24154ac2d65c00a9b30223d000e (patch)
treeab3bc074493e6c9be8d1875233bc141bdc0da3b4 /cli/tsc/compiler.d.ts
parentc8e9b2654ec0d54c77bb3f49fa31c3986203d517 (diff)
feat: add mvp language server (#8515)
Resolves #8400
Diffstat (limited to 'cli/tsc/compiler.d.ts')
-rw-r--r--cli/tsc/compiler.d.ts103
1 files changed, 103 insertions, 0 deletions
diff --git a/cli/tsc/compiler.d.ts b/cli/tsc/compiler.d.ts
new file mode 100644
index 000000000..1a899c291
--- /dev/null
+++ b/cli/tsc/compiler.d.ts
@@ -0,0 +1,103 @@
+// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
+
+// Contains types that can be used to validate and check `99_main_compiler.js`
+
+import * as _ts from "../dts/typescript";
+
+declare global {
+ // deno-lint-ignore no-namespace
+ namespace ts {
+ var libs: string[];
+ var libMap: Map<string, string>;
+
+ interface SourceFile {
+ version?: string;
+ }
+
+ interface Performance {
+ enable(): void;
+ getDuration(value: string): number;
+ }
+
+ var performance: Performance;
+ }
+
+ // deno-lint-ignore no-namespace
+ namespace ts {
+ export = _ts;
+ }
+
+ interface Object {
+ // deno-lint-ignore no-explicit-any
+ __proto__: any;
+ }
+
+ interface DenoCore {
+ // deno-lint-ignore no-explicit-any
+ jsonOpSync<T>(name: string, params: T): any;
+ ops(): void;
+ print(msg: string): void;
+ registerErrorClass(name: string, Ctor: typeof Error): void;
+ }
+
+ type LanguageServerRequest =
+ | ConfigureRequest
+ | GetSyntacticDiagnosticsRequest
+ | GetSemanticDiagnosticsRequest
+ | GetSuggestionDiagnosticsRequest
+ | GetQuickInfoRequest
+ | GetDocumentHighlightsRequest
+ | GetReferencesRequest
+ | GetDefinitionRequest;
+
+ interface BaseLanguageServerRequest {
+ id: number;
+ method: string;
+ }
+
+ interface ConfigureRequest extends BaseLanguageServerRequest {
+ method: "configure";
+ // deno-lint-ignore no-explicit-any
+ compilerOptions: Record<string, any>;
+ }
+
+ interface GetSyntacticDiagnosticsRequest extends BaseLanguageServerRequest {
+ method: "getSyntacticDiagnostics";
+ specifier: string;
+ }
+
+ interface GetSemanticDiagnosticsRequest extends BaseLanguageServerRequest {
+ method: "getSemanticDiagnostics";
+ specifier: string;
+ }
+
+ interface GetSuggestionDiagnosticsRequest extends BaseLanguageServerRequest {
+ method: "getSuggestionDiagnostics";
+ specifier: string;
+ }
+
+ interface GetQuickInfoRequest extends BaseLanguageServerRequest {
+ method: "getQuickInfo";
+ specifier: string;
+ position: number;
+ }
+
+ interface GetDocumentHighlightsRequest extends BaseLanguageServerRequest {
+ method: "getDocumentHighlights";
+ specifier: string;
+ position: number;
+ filesToSearch: string[];
+ }
+
+ interface GetReferencesRequest extends BaseLanguageServerRequest {
+ method: "getReferences";
+ specifier: string;
+ position: number;
+ }
+
+ interface GetDefinitionRequest extends BaseLanguageServerRequest {
+ method: "getDefinition";
+ specifier: string;
+ position: number;
+ }
+}