-
-
Notifications
You must be signed in to change notification settings - Fork 70
Expand file tree
/
Copy pathindex.ts
More file actions
67 lines (60 loc) · 1.93 KB
/
index.ts
File metadata and controls
67 lines (60 loc) · 1.93 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
export * from './lib/common';
export * from './lib/node/decorateLanguageServiceHost';
export * from './lib/node/decorateProgram';
export * from './lib/node/proxyCreateProgram';
export * from './lib/node/proxyLanguageService';
export * from './lib/protocol/createProject';
export * from './lib/protocol/createSys';
import type { VirtualCode } from '@volar/language-core';
import type * as ts from 'typescript';
import { type URI } from 'vscode-uri';
declare module '@volar/language-service' {
export interface ProjectContext {
typescript?: {
configFileName: string | undefined;
sys: ts.System & {
version?: number;
sync?(): Promise<number>;
};
languageServiceHost: ts.LanguageServiceHost;
getExtraServiceScript(fileName: string): TypeScriptExtraServiceScript | undefined;
uriConverter: {
asUri(fileName: string): URI;
asFileName(uri: URI): string;
};
};
}
}
declare module '@volar/language-core' {
export interface LanguagePlugin {
typescript?: TypeScriptGenericOptions & TypeScriptNonTSPluginOptions;
}
}
/**
* The following options available to all situations.
*/
interface TypeScriptGenericOptions {
extraFileExtensions: ts.FileExtensionInfo[];
resolveHiddenExtensions?: boolean;
getServiceScript(root: VirtualCode): TypeScriptServiceScript | undefined;
}
/**
* The following options will not be available in TS plugin.
*/
interface TypeScriptNonTSPluginOptions {
getExtraServiceScripts?(fileName: string, root: VirtualCode): TypeScriptExtraServiceScript[];
/**
* @deprecated Remove in 2.5.0
*/
resolveLanguageServiceHost?(host: ts.LanguageServiceHost): ts.LanguageServiceHost;
}
export interface TypeScriptServiceScript {
code: VirtualCode;
extension: '.ts' | '.js' | '.mts' | '.mjs' | '.cjs' | '.cts' | '.d.ts' | string;
scriptKind: ts.ScriptKind;
/** See #188 */
preventLeadingOffset?: boolean;
}
export interface TypeScriptExtraServiceScript extends TypeScriptServiceScript {
fileName: string;
}