forked from redhat-developer/yaml-language-server
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrequestTypes.ts
More file actions
82 lines (68 loc) · 2.83 KB
/
requestTypes.ts
File metadata and controls
82 lines (68 loc) · 2.83 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
/* eslint-disable @typescript-eslint/ban-types */
/* eslint-disable @typescript-eslint/no-namespace */
import { NotificationType, RequestType } from 'vscode-languageserver';
import { SchemaAdditions, SchemaDeletions } from './languageservice/services/yamlSchemaService';
import { SchemaConfiguration } from './languageservice/yamlLanguageService';
import { SchemaVersions } from './languageservice/yamlTypes';
export type ISchemaAssociations = Record<string, string[]>;
export interface JSONSchemaDescription {
/**
* Schema URI
*/
uri: string;
/**
* Schema name, from schema store
*/
name?: string;
/**
* Schema description, from schema store
*/
description?: string;
}
export interface JSONSchemaDescriptionExt extends JSONSchemaDescription {
/**
* Is schema used for current document
*/
usedForCurrentFile: boolean;
/**
* Is schema from schema store
*/
fromStore: boolean;
versions?: SchemaVersions;
}
export namespace SchemaAssociationNotification {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export const type: NotificationType<ISchemaAssociations | SchemaConfiguration[]> = new NotificationType(
'json/schemaAssociations'
);
}
export namespace DynamicCustomSchemaRequestRegistration {
export const type: NotificationType<{}> = new NotificationType('yaml/registerCustomSchemaRequest');
}
export namespace VSCodeContentRequestRegistration {
export const type: NotificationType<{}> = new NotificationType('yaml/registerContentRequest');
}
export namespace ResultLimitReachedNotification {
export const type: NotificationType<string> = new NotificationType('yaml/resultLimitReached');
}
export namespace VSCodeContentRequest {
export const type: RequestType<string, string, {}> = new RequestType('vscode/content');
}
export namespace CustomSchemaContentRequest {
export const type: RequestType<string, string, {}> = new RequestType('custom/schema/content');
}
export namespace CustomSchemaRequest {
export const type: RequestType<{}, {}, {}> = new RequestType('custom/schema/request');
}
export namespace ColorSymbolRequest {
export const type: RequestType<{}, {}, {}> = new RequestType('json/colorSymbols');
}
export namespace SchemaModificationNotification {
export const type: RequestType<SchemaAdditions | SchemaDeletions, void, {}> = new RequestType('json/schema/modify');
}
export namespace SchemaSelectionRequests {
export const type: NotificationType<void> = new NotificationType('yaml/supportSchemaSelection');
export const getSchema: RequestType<string, JSONSchemaDescription[], {}> = new RequestType('yaml/get/jsonSchema');
export const getAllSchemas: RequestType<string, JSONSchemaDescriptionExt[], {}> = new RequestType('yaml/get/all/jsonSchemas');
export const schemaStoreInitialized: NotificationType<{}> = new NotificationType('yaml/schema/store/initialized');
}