forked from microsoft/typespec
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtypes.ts
56 lines (49 loc) · 1.4 KB
/
types.ts
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
export const enum SettingName {
TspServerPath = "typespec.tsp-server.path",
InitTemplatesUrls = "typespec.initTemplatesUrls",
}
export const enum CommandName {
ShowOutputChannel = "typespec.showOutputChannel",
RestartServer = "typespec.restartServer",
InstallGlobalCompilerCli = "typespec.installGlobalCompilerCli",
CreateProject = "typespec.createProject",
OpenUrl = "typespec.openUrl",
GenerateCode = "typespec.generateCode",
ImportFromOpenApi3 = "typespec.importFromOpenApi3",
}
export interface InstallGlobalCliCommandArgs {
/**
* whether to confirm with end user before action
* default: false
*/
confirm: boolean;
confirmTitle?: string;
confirmPlaceholder?: string;
/**
* set to true to disable popup notification and show output channel when running the command
*/
silentMode?: boolean;
}
export interface RestartServerCommandArgs {
/**
* whether to recreate TspLanguageClient instead of just restarting it
*/
forceRecreate: boolean;
notificationMessage?: string;
}
export const enum ResultCode {
Success = "success",
Fail = "fail",
Cancelled = "cancelled",
Timeout = "timeout",
}
interface SuccessResult<T> {
code: ResultCode.Success;
value: T;
details?: any;
}
interface UnsuccessResult {
code: ResultCode.Fail | ResultCode.Cancelled | ResultCode.Timeout;
details?: any;
}
export type Result<T = void> = SuccessResult<T> | UnsuccessResult;