@redocly/openapi-language-server 0.6.24 → 0.6.26
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/lib/index.js +41 -41
- package/package.json +5 -5
- package/lib/index.d.ts +0 -665
package/lib/index.d.ts
DELETED
|
@@ -1,665 +0,0 @@
|
|
|
1
|
-
declare module '@redocly/openapi-language-server/config' {
|
|
2
|
-
import { TextDocuments } from 'vscode-languageserver/browser';
|
|
3
|
-
import { TextDocument } from 'vscode-languageserver-textdocument';
|
|
4
|
-
import { URI } from 'vscode-uri';
|
|
5
|
-
import { type ResolvedConfig } from '@redocly/openapi-core';
|
|
6
|
-
export interface SupportedLanguage {
|
|
7
|
-
languageId: string;
|
|
8
|
-
filePattern: RegExp;
|
|
9
|
-
}
|
|
10
|
-
export const yamlLanguage: SupportedLanguage;
|
|
11
|
-
export const jsonLanguage: SupportedLanguage;
|
|
12
|
-
export interface FileSystemProvider {
|
|
13
|
-
readFile(uri: URI, encoding?: string): Promise<string>;
|
|
14
|
-
readDir(uri: URI): Promise<any>;
|
|
15
|
-
stat(uri: URI): Promise<{
|
|
16
|
-
isFile(): boolean;
|
|
17
|
-
isDirectory(): boolean;
|
|
18
|
-
}>;
|
|
19
|
-
exists(uri: URI): Promise<boolean>;
|
|
20
|
-
}
|
|
21
|
-
type ConfigFinder = (uri: string) => Promise<string | undefined>;
|
|
22
|
-
interface RemoteScorecardAndPlugins {
|
|
23
|
-
scorecard: ResolvedConfig['scorecard'];
|
|
24
|
-
plugins: string | undefined;
|
|
25
|
-
}
|
|
26
|
-
export class Configuration {
|
|
27
|
-
private _fs;
|
|
28
|
-
private _documentManager;
|
|
29
|
-
private _findConfig;
|
|
30
|
-
private _getRootWorkspaceFolderURI;
|
|
31
|
-
private _scorecardStatus;
|
|
32
|
-
private _remoteScorecardAndPlugins;
|
|
33
|
-
constructor();
|
|
34
|
-
supportedLanguages: SupportedLanguage[];
|
|
35
|
-
registerFileSystemProvider(fsProvider: FileSystemProvider): void;
|
|
36
|
-
registerDocumentsProvider(documentProvider: TextDocuments<TextDocument>): void;
|
|
37
|
-
registerConfigFinder(configFinder: ConfigFinder): void;
|
|
38
|
-
registerRootWorkspaceFolderURIGetter(rootWorkspaceFolderURIGetter: () => Promise<string>): void;
|
|
39
|
-
registerRemoteScorecardAndPlugins(remoteScorecardAndPlugins: RemoteScorecardAndPlugins | undefined): void;
|
|
40
|
-
get remoteScorecardAndPlugins(): RemoteScorecardAndPlugins | undefined;
|
|
41
|
-
get fs(): FileSystemProvider;
|
|
42
|
-
get documents(): TextDocuments<TextDocument>;
|
|
43
|
-
get findConfig(): ConfigFinder;
|
|
44
|
-
get getRootWorkspaceFolderURI(): () => Promise<string>;
|
|
45
|
-
setScorecardStatus(status: 'pending' | 'enabled' | 'disabled'): void;
|
|
46
|
-
get scorecardStatus(): "pending" | "enabled" | "disabled";
|
|
47
|
-
}
|
|
48
|
-
export const languageServerConfig: Configuration;
|
|
49
|
-
export {};
|
|
50
|
-
|
|
51
|
-
}
|
|
52
|
-
declare module '@redocly/openapi-language-server/esbuild' {
|
|
53
|
-
export {};
|
|
54
|
-
|
|
55
|
-
}
|
|
56
|
-
declare module '@redocly/openapi-language-server/index' {
|
|
57
|
-
import { CompletionItem, type CompletionParams, type DefinitionParams, type DidChangeWatchedFilesParams, LocationLink } from 'vscode-languageserver/browser';
|
|
58
|
-
import { TextDocument } from 'vscode-languageserver-textdocument';
|
|
59
|
-
import { loadOpenAPIConfig, isConfigFile, getConfigData } from '@redocly/openapi-language-server/server/openapi-config';
|
|
60
|
-
import { isEntityFile } from '@redocly/openapi-language-server/server/documents';
|
|
61
|
-
import { revalidateAllDocuments } from '@redocly/openapi-language-server/server/validation/index';
|
|
62
|
-
export { revalidateAllDocuments, loadOpenAPIConfig, isConfigFile, getConfigData, isEntityFile };
|
|
63
|
-
export { languageServerConfig } from '@redocly/openapi-language-server/config';
|
|
64
|
-
export { getDocumentByURI, isYamlFile } from '@redocly/openapi-language-server/server/documents';
|
|
65
|
-
export { getContextData, getSpecVersion } from '@redocly/openapi-language-server/server/context-core';
|
|
66
|
-
export { parseUri, uriToAbsFSPath, isHttpPath } from '@redocly/openapi-language-server/server/path';
|
|
67
|
-
export { removeCirculars } from '@redocly/openapi-language-server/server/utils';
|
|
68
|
-
export * from '@redocly/openapi-language-server/server/types/context-core';
|
|
69
|
-
export { type DefinitionData, type BundleData, bundleOpenAPI, getBundles } from '@redocly/openapi-language-server/server/bundle';
|
|
70
|
-
export class OpenapiLanguageServer {
|
|
71
|
-
onCompletion(params: CompletionParams): Promise<CompletionItem[]>;
|
|
72
|
-
onCompletionResolve(item: CompletionItem): Promise<CompletionItem>;
|
|
73
|
-
validateOpenAPI(textDocument: TextDocument): Promise<import("vscode-languageserver/browser").PublishDiagnosticsParams[]>;
|
|
74
|
-
onDidChangeWatchedFiles(params: DidChangeWatchedFilesParams): Promise<(Promise<import("vscode-languageserver/browser").PublishDiagnosticsParams[]> | Promise<Promise<import("vscode-languageserver/browser").PublishDiagnosticsParams[]>>)[] | undefined>;
|
|
75
|
-
onDidConfigChange(uri: string): Promise<(Promise<import("vscode-languageserver/browser").PublishDiagnosticsParams[]> | Promise<Promise<import("vscode-languageserver/browser").PublishDiagnosticsParams[]>>)[]>;
|
|
76
|
-
onDidChangeConfiguration(): Promise<(Promise<import("vscode-languageserver/browser").PublishDiagnosticsParams[]> | Promise<Promise<import("vscode-languageserver/browser").PublishDiagnosticsParams[]>>)[]>;
|
|
77
|
-
onDefinition(params: DefinitionParams): Promise<LocationLink[]>;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
}
|
|
81
|
-
declare module '@redocly/openapi-language-server/server/__tests__/context-core.test' {
|
|
82
|
-
export {};
|
|
83
|
-
|
|
84
|
-
}
|
|
85
|
-
declare module '@redocly/openapi-language-server/server/__tests__/documents.test' {
|
|
86
|
-
export {};
|
|
87
|
-
|
|
88
|
-
}
|
|
89
|
-
declare module '@redocly/openapi-language-server/server/__tests__/external-resolver.test' {
|
|
90
|
-
export {};
|
|
91
|
-
|
|
92
|
-
}
|
|
93
|
-
declare module '@redocly/openapi-language-server/server/__tests__/openapi-config.test' {
|
|
94
|
-
export {};
|
|
95
|
-
|
|
96
|
-
}
|
|
97
|
-
declare module '@redocly/openapi-language-server/server/__tests__/path-completion.test' {
|
|
98
|
-
export {};
|
|
99
|
-
|
|
100
|
-
}
|
|
101
|
-
declare module '@redocly/openapi-language-server/server/__tests__/path-resolver-context.test' {
|
|
102
|
-
export {};
|
|
103
|
-
|
|
104
|
-
}
|
|
105
|
-
declare module '@redocly/openapi-language-server/server/__tests__/path.test' {
|
|
106
|
-
export {};
|
|
107
|
-
|
|
108
|
-
}
|
|
109
|
-
declare module '@redocly/openapi-language-server/server/__tests__/utils.test' {
|
|
110
|
-
export {};
|
|
111
|
-
|
|
112
|
-
}
|
|
113
|
-
declare module '@redocly/openapi-language-server/server/bundle' {
|
|
114
|
-
import { type NormalizedProblem, type NormalizedNodeType } from '@redocly/openapi-core';
|
|
115
|
-
import { TextDocument } from 'vscode-languageserver-textdocument';
|
|
116
|
-
export type DefinitionData = {
|
|
117
|
-
name: string;
|
|
118
|
-
uri: string;
|
|
119
|
-
};
|
|
120
|
-
export type BundleData = DefinitionData & {
|
|
121
|
-
definition: Record<string, any>;
|
|
122
|
-
rootType: NormalizedNodeType;
|
|
123
|
-
refTypes: [string, NormalizedNodeType][];
|
|
124
|
-
htmlTempalteStyles?: string | null;
|
|
125
|
-
errors?: NormalizedProblem[];
|
|
126
|
-
};
|
|
127
|
-
export function bundleOpenAPI(textDocument: TextDocument, errors: NormalizedProblem[]): Promise<void>;
|
|
128
|
-
export function getBundles(): BundleData[];
|
|
129
|
-
export function getRefTypes(path: string): NormalizedNodeType | undefined | null;
|
|
130
|
-
|
|
131
|
-
}
|
|
132
|
-
declare module '@redocly/openapi-language-server/server/completion/yaml/KeyCompletion' {
|
|
133
|
-
import { CompletionItem, CompletionItemKind, InsertTextFormat, Command } from 'vscode-languageserver/browser';
|
|
134
|
-
import type { CompletionItemOptions } from '@redocly/openapi-language-server/server/types/completion';
|
|
135
|
-
export interface KeyCompletionOptions extends CompletionItemOptions {
|
|
136
|
-
insertTextFormat?: InsertTextFormat;
|
|
137
|
-
data?: any;
|
|
138
|
-
}
|
|
139
|
-
export class KeyCompletion implements CompletionItem {
|
|
140
|
-
kind: CompletionItemKind;
|
|
141
|
-
label: string;
|
|
142
|
-
insertText: string;
|
|
143
|
-
filterText: string;
|
|
144
|
-
sortText?: string;
|
|
145
|
-
command?: Command;
|
|
146
|
-
insertTextFormat: InsertTextFormat;
|
|
147
|
-
data?: any;
|
|
148
|
-
constructor({ kind, label, insertText, insertTextFormat, filterText, sortText, data, }: KeyCompletionOptions);
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
}
|
|
152
|
-
declare module '@redocly/openapi-language-server/server/completion/yaml/LocalFileCompletion' {
|
|
153
|
-
import { ValueCompletion, ValueCompletionOptions } from '@redocly/openapi-language-server/server/completion/yaml/ValueCompletion';
|
|
154
|
-
export class LocalFileCompletion extends ValueCompletion {
|
|
155
|
-
constructor(completionOptions: ValueCompletionOptions);
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
}
|
|
159
|
-
declare module '@redocly/openapi-language-server/server/completion/yaml/LocalFolderCompletion' {
|
|
160
|
-
import { Command } from 'vscode-languageserver/browser';
|
|
161
|
-
import { ValueCompletion, ValueCompletionOptions } from '@redocly/openapi-language-server/server/completion/yaml/ValueCompletion';
|
|
162
|
-
export class LocalFolderCompletion extends ValueCompletion {
|
|
163
|
-
command: Command;
|
|
164
|
-
constructor(completionOptions: ValueCompletionOptions);
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
}
|
|
168
|
-
declare module '@redocly/openapi-language-server/server/completion/yaml/ValueCompletion' {
|
|
169
|
-
import { YAMLScalar } from '@redocly/yaml-language-server-parser';
|
|
170
|
-
import { CompletionItem, CompletionItemKind, TextEdit, InsertReplaceEdit, Position, Command } from 'vscode-languageserver/browser';
|
|
171
|
-
import type { CompletionItemOptions } from '@redocly/openapi-language-server/server/types/completion';
|
|
172
|
-
export interface ValueCompletionDataOptions {
|
|
173
|
-
position?: Position;
|
|
174
|
-
node?: YAMLScalar;
|
|
175
|
-
lineOffset?: number;
|
|
176
|
-
}
|
|
177
|
-
export interface ValueCompletionOptions extends CompletionItemOptions {
|
|
178
|
-
value?: string;
|
|
179
|
-
data: ValueCompletionDataOptions;
|
|
180
|
-
}
|
|
181
|
-
export class ValueCompletion implements CompletionItem {
|
|
182
|
-
kind: CompletionItemKind;
|
|
183
|
-
label: string;
|
|
184
|
-
insertText: string;
|
|
185
|
-
filterText: string;
|
|
186
|
-
sortText?: string;
|
|
187
|
-
command?: Command;
|
|
188
|
-
textEdit?: TextEdit | InsertReplaceEdit;
|
|
189
|
-
constructor({ kind, label, value, textEdit, filterText, sortText, data, }: ValueCompletionOptions);
|
|
190
|
-
getTextEdit(node: YAMLScalar, position: Position, lineOffset: number): TextEdit | InsertReplaceEdit;
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
}
|
|
194
|
-
declare module '@redocly/openapi-language-server/server/completion/yaml/__tests__/KeyCompletion.test' {
|
|
195
|
-
export {};
|
|
196
|
-
|
|
197
|
-
}
|
|
198
|
-
declare module '@redocly/openapi-language-server/server/completion/yaml/__tests__/insert-snippet-utils.test' {
|
|
199
|
-
export {};
|
|
200
|
-
|
|
201
|
-
}
|
|
202
|
-
declare module '@redocly/openapi-language-server/server/completion/yaml/common' {
|
|
203
|
-
export const fieldNames: {
|
|
204
|
-
example: string;
|
|
205
|
-
default: string;
|
|
206
|
-
enum: string;
|
|
207
|
-
ref: string;
|
|
208
|
-
};
|
|
209
|
-
export const userEnumCompletionKeys: string[];
|
|
210
|
-
|
|
211
|
-
}
|
|
212
|
-
declare module '@redocly/openapi-language-server/server/completion/yaml/completion' {
|
|
213
|
-
import { CompletionItem, Position } from 'vscode-languageserver/browser';
|
|
214
|
-
import { type DocumentUri } from 'vscode-languageserver-textdocument';
|
|
215
|
-
import type * as yamlAst from '@redocly/yaml-language-server-parser';
|
|
216
|
-
import { ValueCompletion } from '@redocly/openapi-language-server/server/completion/yaml/ValueCompletion';
|
|
217
|
-
import { YamlCompletionContext } from '@redocly/openapi-language-server/server/completion/yaml/context';
|
|
218
|
-
export function getCompletionKeys(completionContext: YamlCompletionContext): CompletionItem[];
|
|
219
|
-
export function getCompletionValues(uri: DocumentUri, completionContext: YamlCompletionContext<yamlAst.YAMLScalar>): Promise<ValueCompletion[]>;
|
|
220
|
-
export function getCompletion(uri: DocumentUri, position: Position): Promise<CompletionItem[]>;
|
|
221
|
-
export function resolveCompletion(item: CompletionItem): CompletionItem;
|
|
222
|
-
|
|
223
|
-
}
|
|
224
|
-
declare module '@redocly/openapi-language-server/server/completion/yaml/context' {
|
|
225
|
-
import { type DocumentUri, type Position } from 'vscode-languageserver-textdocument';
|
|
226
|
-
import { YAMLNode } from '@redocly/yaml-language-server-parser';
|
|
227
|
-
import { URI } from 'vscode-uri';
|
|
228
|
-
import { type NodePath } from '@redocly/openapi-language-server/server/types/context-core';
|
|
229
|
-
import { type ExtendedNormalizedNodeType } from '@redocly/openapi-language-server/server/types/completion';
|
|
230
|
-
export interface YamlCompletionContext<NodeType = YAMLNode> {
|
|
231
|
-
currentAst: YAMLNode;
|
|
232
|
-
node: NodeType;
|
|
233
|
-
nodePath: NodePath;
|
|
234
|
-
position: Position;
|
|
235
|
-
lineText: string;
|
|
236
|
-
lineOffset: number;
|
|
237
|
-
openApiType: ExtendedNormalizedNodeType | null;
|
|
238
|
-
}
|
|
239
|
-
export interface RefPathResolverContext {
|
|
240
|
-
docAbsolutePath: URI;
|
|
241
|
-
docAbsoluteDirPath: URI;
|
|
242
|
-
refPath: string;
|
|
243
|
-
refDirPath: URI;
|
|
244
|
-
refDirAbsolutePath: URI;
|
|
245
|
-
isAbsolutePath: boolean;
|
|
246
|
-
root: string;
|
|
247
|
-
}
|
|
248
|
-
export function createCompletionContext<NodeType = YAMLNode>(uri: DocumentUri, position: Position): Promise<YamlCompletionContext<NodeType>>;
|
|
249
|
-
export function createRefPathResolverContext(uri: DocumentUri, refPath: string): Promise<RefPathResolverContext>;
|
|
250
|
-
|
|
251
|
-
}
|
|
252
|
-
declare module '@redocly/openapi-language-server/server/completion/yaml/insert-snippet-utils' {
|
|
253
|
-
import { type NormalizedNodeType } from '@redocly/openapi-core';
|
|
254
|
-
export type PartialNodeType = {
|
|
255
|
-
items?: NormalizedNodeType['items'];
|
|
256
|
-
required?: NormalizedNodeType['required'];
|
|
257
|
-
};
|
|
258
|
-
function getKeyValue(key: string, type?: PartialNodeType): string;
|
|
259
|
-
function getBeforeKeyValue(key: string, value: string, beforeKey: string, type?: PartialNodeType): string;
|
|
260
|
-
function getAfterKeyValue(key: string): "" | ": ";
|
|
261
|
-
function getBeforeKey(lineText?: string): "" | " " | "\n ";
|
|
262
|
-
function getAfterValue(beforeKey: string, properties?: NormalizedNodeType['properties']): "" | "\n " | "\n ";
|
|
263
|
-
function getInsertSnippet(key: string, data?: {
|
|
264
|
-
properties?: NormalizedNodeType['properties'];
|
|
265
|
-
lineText: string;
|
|
266
|
-
} & PartialNodeType, addNewLine?: boolean): string;
|
|
267
|
-
export { getInsertSnippet, getAfterKeyValue, getAfterValue, getKeyValue, getBeforeKey, getBeforeKeyValue, };
|
|
268
|
-
|
|
269
|
-
}
|
|
270
|
-
declare module '@redocly/openapi-language-server/server/completion/yaml/paths' {
|
|
271
|
-
import { DocumentUri } from 'vscode-languageserver-textdocument';
|
|
272
|
-
import { YAMLScalar } from '@redocly/yaml-language-server-parser';
|
|
273
|
-
import { SupportedLanguage } from '@redocly/openapi-language-server/config';
|
|
274
|
-
import { LocalFolderCompletion } from '@redocly/openapi-language-server/server/completion/yaml/LocalFolderCompletion';
|
|
275
|
-
import { LocalFileCompletion } from '@redocly/openapi-language-server/server/completion/yaml/LocalFileCompletion';
|
|
276
|
-
import { YamlCompletionContext, RefPathResolverContext } from '@redocly/openapi-language-server/server/completion/yaml/context';
|
|
277
|
-
export const LOCAL_FILES_SUPPORTED_SUGGESTIONS: SupportedLanguage[];
|
|
278
|
-
export enum FsNodeType {
|
|
279
|
-
File = 0,
|
|
280
|
-
Folder = 1
|
|
281
|
-
}
|
|
282
|
-
export interface RefFileStat {
|
|
283
|
-
type: FsNodeType;
|
|
284
|
-
name: string;
|
|
285
|
-
}
|
|
286
|
-
export interface RefPathOption extends RefFileStat {
|
|
287
|
-
value: string;
|
|
288
|
-
matchBy: string;
|
|
289
|
-
sortBy: string;
|
|
290
|
-
}
|
|
291
|
-
export function getToTopOption(pathResolverContext: RefPathResolverContext): RefPathOption;
|
|
292
|
-
export function getChildrenOfPath(files: string[], config: {
|
|
293
|
-
supportedFiles: SupportedLanguage[];
|
|
294
|
-
}, pathResolverContext: RefPathResolverContext): Promise<RefFileStat[]>;
|
|
295
|
-
export function getRefPathOptions(fileStats: RefFileStat[], pathResolverContext: RefPathResolverContext): RefPathOption[];
|
|
296
|
-
export function getLocalFsRefs(uri: DocumentUri, completionContext: YamlCompletionContext<YAMLScalar>): Promise<(LocalFolderCompletion | LocalFileCompletion)[]>;
|
|
297
|
-
|
|
298
|
-
}
|
|
299
|
-
declare module '@redocly/openapi-language-server/server/context-core' {
|
|
300
|
-
import { type SpecVersion, type SpecMajorVersion, type NormalizedNodeType } from '@redocly/openapi-core';
|
|
301
|
-
import * as yamlAst from '@redocly/yaml-language-server-parser';
|
|
302
|
-
import { type Position } from 'vscode-languageserver/browser';
|
|
303
|
-
import { type ContextData, type ExistingValues, type OpenApiVersion, type TextDocumentWithLineOffset, type NodeWithPath, type NodePath, NodeWithItems } from '@redocly/openapi-language-server/server/types/context-core';
|
|
304
|
-
export function getContextData(uri: string, position: Position): Promise<ContextData>;
|
|
305
|
-
export function getSpecVersion(uri: string): Promise<OpenApiVersion<"oas2" | "oas3_0" | "oas3_1" | "oas3_2" | "async2" | "async3" | "arazzo1" | "overlay1" | "openrpc1">>;
|
|
306
|
-
export function getAstNodeByPath(currentAst: yamlAst.YAMLNode | null, path: (number | string)[]): yamlAst.YAMLNode | null;
|
|
307
|
-
export function getAstNodeByPosition(start: NodeWithPath, position: Position, document: TextDocumentWithLineOffset, isContextData?: boolean): NodeWithPath;
|
|
308
|
-
export function getNodeLineIndent(node: yamlAst.YAMLNode | null | undefined, document: TextDocumentWithLineOffset): number;
|
|
309
|
-
export function getTypesByNodePath(types: any, nodePath: NodePath, currentAst: NodeWithItems): {
|
|
310
|
-
currentType: NormalizedNodeType | null;
|
|
311
|
-
parentType: NormalizedNodeType | null;
|
|
312
|
-
endPath?: string | number;
|
|
313
|
-
};
|
|
314
|
-
export function getRootTypes(ast: NodeWithItems, uri: string): Promise<NormalizedNodeType | null>;
|
|
315
|
-
export function getDescriptionVersion(ast: yamlAst.YAMLNode): OpenApiVersion<SpecVersion>;
|
|
316
|
-
export function getDescriptionMajorVersion(ast: yamlAst.YAMLNode): OpenApiVersion<SpecMajorVersion>;
|
|
317
|
-
export function getChildNodes(node?: yamlAst.YAMLNode | null): yamlAst.YAMLNode[];
|
|
318
|
-
export function getExistingValues(node: yamlAst.YAMLSequence, values?: ExistingValues, indent?: number): ExistingValues;
|
|
319
|
-
|
|
320
|
-
}
|
|
321
|
-
declare module '@redocly/openapi-language-server/server/documents' {
|
|
322
|
-
import { DocumentUri } from 'vscode-languageserver/browser';
|
|
323
|
-
import { TextDocument } from 'vscode-languageserver-textdocument';
|
|
324
|
-
import * as yamlAst from '@redocly/yaml-language-server-parser';
|
|
325
|
-
export type DocumentStats = {
|
|
326
|
-
dependencyPaths: Set<string>;
|
|
327
|
-
durationMS: number;
|
|
328
|
-
};
|
|
329
|
-
export type DependencyStats = {
|
|
330
|
-
documentPath: string;
|
|
331
|
-
durationMS: number;
|
|
332
|
-
};
|
|
333
|
-
export function updateDependencyMap(path: string, stats: DocumentStats): Map<string, DocumentStats>;
|
|
334
|
-
export function getPathsByDependency(depPath: string): DependencyStats[];
|
|
335
|
-
export function getDocumentLanguageId(uri: DocumentUri): string;
|
|
336
|
-
export function getDocumentByURI(uri: DocumentUri): Promise<TextDocument>;
|
|
337
|
-
export function isJsonFile(uri: DocumentUri): boolean;
|
|
338
|
-
export function isYamlFile(uri: DocumentUri): boolean;
|
|
339
|
-
export function isEntityFile({ uri, ast, textDocument, }: {
|
|
340
|
-
uri: DocumentUri;
|
|
341
|
-
ast?: yamlAst.YAMLNode;
|
|
342
|
-
textDocument?: TextDocument;
|
|
343
|
-
}): boolean;
|
|
344
|
-
|
|
345
|
-
}
|
|
346
|
-
declare module '@redocly/openapi-language-server/server/external-resolver' {
|
|
347
|
-
import { BaseResolver, Source } from '@redocly/openapi-core';
|
|
348
|
-
export class ExternalResolver extends BaseResolver {
|
|
349
|
-
resolveExternalRef(base: string | null, ref: string): string;
|
|
350
|
-
loadExternalRef(absoluteRef: string): Promise<Source>;
|
|
351
|
-
}
|
|
352
|
-
|
|
353
|
-
}
|
|
354
|
-
declare module '@redocly/openapi-language-server/server/fixtures/dir1/file1' {
|
|
355
|
-
|
|
356
|
-
}
|
|
357
|
-
declare module '@redocly/openapi-language-server/server/handlers/yaml-definition-handler' {
|
|
358
|
-
import { LocationLink } from 'vscode-languageserver';
|
|
359
|
-
import type { DefinitionParams } from 'vscode-languageserver';
|
|
360
|
-
export function handleDefinition({ position, textDocument, }: DefinitionParams): Promise<LocationLink[] | void>;
|
|
361
|
-
|
|
362
|
-
}
|
|
363
|
-
declare module '@redocly/openapi-language-server/server/hints' {
|
|
364
|
-
import { CompletionItem } from 'vscode-languageserver/browser';
|
|
365
|
-
import { ExtendedNormalizedNodeType } from '@redocly/openapi-language-server/server/types/completion';
|
|
366
|
-
export const START_SEQ_LABEL = "newItem";
|
|
367
|
-
export const START_MAP_LABEL = "propertyName";
|
|
368
|
-
export const ADD_NEW_LINE = "newLine";
|
|
369
|
-
export function hasHints(type: ExtendedNormalizedNodeType): boolean;
|
|
370
|
-
export function getAdditionalCompletionItem(name: string): CompletionItem[];
|
|
371
|
-
|
|
372
|
-
}
|
|
373
|
-
declare module '@redocly/openapi-language-server/server/openapi-config' {
|
|
374
|
-
import { type Config } from '@redocly/openapi-core';
|
|
375
|
-
export function loadOpenAPIConfig(uri: string | undefined, opts?: {
|
|
376
|
-
createEventHandleLoadConfigError?: (message: string) => void;
|
|
377
|
-
}): Promise<Config>;
|
|
378
|
-
export function getConfigData(url?: string): Promise<Config>;
|
|
379
|
-
export function isConfigFile(uri: string): Promise<boolean>;
|
|
380
|
-
export function isRootConfigFile(uri: string): Promise<boolean>;
|
|
381
|
-
|
|
382
|
-
}
|
|
383
|
-
declare module '@redocly/openapi-language-server/server/openapi-extensions' {
|
|
384
|
-
import { mapTypeToComponent } from '@redocly/openapi-core';
|
|
385
|
-
import { ExtendedNormalizedNodeType } from '@redocly/openapi-language-server/server/types/completion';
|
|
386
|
-
const typeExtensions: {
|
|
387
|
-
Schema: {
|
|
388
|
-
name: string;
|
|
389
|
-
value: {
|
|
390
|
-
type: string;
|
|
391
|
-
name: string;
|
|
392
|
-
};
|
|
393
|
-
}[];
|
|
394
|
-
PathItem: {
|
|
395
|
-
name: string;
|
|
396
|
-
value: {
|
|
397
|
-
type: string;
|
|
398
|
-
name: string;
|
|
399
|
-
};
|
|
400
|
-
}[];
|
|
401
|
-
Parameter: {
|
|
402
|
-
name: string;
|
|
403
|
-
value: {
|
|
404
|
-
type: string;
|
|
405
|
-
name: string;
|
|
406
|
-
};
|
|
407
|
-
}[];
|
|
408
|
-
Response: {
|
|
409
|
-
name: string;
|
|
410
|
-
value: {
|
|
411
|
-
type: string;
|
|
412
|
-
name: string;
|
|
413
|
-
};
|
|
414
|
-
}[];
|
|
415
|
-
Example: {
|
|
416
|
-
name: string;
|
|
417
|
-
value: {
|
|
418
|
-
type: string;
|
|
419
|
-
name: string;
|
|
420
|
-
};
|
|
421
|
-
}[];
|
|
422
|
-
RequestBody: {
|
|
423
|
-
name: string;
|
|
424
|
-
value: {
|
|
425
|
-
type: string;
|
|
426
|
-
name: string;
|
|
427
|
-
};
|
|
428
|
-
}[];
|
|
429
|
-
Header: {
|
|
430
|
-
name: string;
|
|
431
|
-
value: {
|
|
432
|
-
type: string;
|
|
433
|
-
name: string;
|
|
434
|
-
};
|
|
435
|
-
}[];
|
|
436
|
-
SecuritySchema: {
|
|
437
|
-
name: string;
|
|
438
|
-
value: {
|
|
439
|
-
type: string;
|
|
440
|
-
name: string;
|
|
441
|
-
};
|
|
442
|
-
}[];
|
|
443
|
-
Link: {
|
|
444
|
-
name: string;
|
|
445
|
-
value: {
|
|
446
|
-
type: string;
|
|
447
|
-
name: string;
|
|
448
|
-
};
|
|
449
|
-
}[];
|
|
450
|
-
Callback: {
|
|
451
|
-
name: string;
|
|
452
|
-
value: {
|
|
453
|
-
type: string;
|
|
454
|
-
name: string;
|
|
455
|
-
};
|
|
456
|
-
}[];
|
|
457
|
-
};
|
|
458
|
-
function extendOASType(type: ExtendedNormalizedNodeType): ExtendedNormalizedNodeType;
|
|
459
|
-
export { typeExtensions, extendOASType, mapTypeToComponent };
|
|
460
|
-
|
|
461
|
-
}
|
|
462
|
-
declare module '@redocly/openapi-language-server/server/path' {
|
|
463
|
-
import { DocumentUri } from 'vscode-languageserver/browser';
|
|
464
|
-
import { URI } from 'vscode-uri';
|
|
465
|
-
export function arePathsEqual(path1: string, path2: string): boolean;
|
|
466
|
-
export function parseUri(path: string): URI;
|
|
467
|
-
export function uriToAbsFSPath(uri: DocumentUri): string;
|
|
468
|
-
export function isHttpPath(path: string): boolean;
|
|
469
|
-
export function uriBaseName(uri: DocumentUri): string;
|
|
470
|
-
export function getFileExtension(uri: DocumentUri): string;
|
|
471
|
-
export function noTrailingSlash(path: string): string;
|
|
472
|
-
export function getClosestExistingDir(uri: URI, baseDir?: string): Promise<URI>;
|
|
473
|
-
|
|
474
|
-
}
|
|
475
|
-
declare module '@redocly/openapi-language-server/server/sort' {
|
|
476
|
-
export function getSortText(typeName: string | null, label?: string): string;
|
|
477
|
-
export enum SortTypes {
|
|
478
|
-
FileCompletion = "FileCompletion",
|
|
479
|
-
FolderCompletion = "FolderCompletion",
|
|
480
|
-
LocalComponentCompletion = "LocalComponentCompletion",
|
|
481
|
-
NewLine = "newLine",
|
|
482
|
-
PropertyName = "propertyName",
|
|
483
|
-
NewItem = "newItem",
|
|
484
|
-
PathMap = "PathMap",
|
|
485
|
-
MediaTypeMap = "MediaTypeMap",
|
|
486
|
-
Root = "Root",
|
|
487
|
-
RootOpenapi = "Root_openapi",
|
|
488
|
-
RootInfo = "Root_info",
|
|
489
|
-
RootJsonSchemaDialect = "Root_jsonSchemaDialect",
|
|
490
|
-
RootServers = "Root_servers",
|
|
491
|
-
RootPaths = "Root_paths",
|
|
492
|
-
RootWebhooks = "Root_webhooks",
|
|
493
|
-
RootComponents = "Root_components",
|
|
494
|
-
RootSecurity = "Root_security",
|
|
495
|
-
RootTags = "Root_tags",
|
|
496
|
-
RootExternalDocs = "Root_externalDocs",
|
|
497
|
-
Info = "Info",
|
|
498
|
-
InfoTitle = "Info_title",
|
|
499
|
-
InfoSummary = "Info_summary",
|
|
500
|
-
InfoDescription = "Info_description",
|
|
501
|
-
InfoTermsOfService = "Info_termsOfService",
|
|
502
|
-
InfoContact = "Info_contact",
|
|
503
|
-
ContactName = "Contact_name",
|
|
504
|
-
ContactUrl = "Contact_url",
|
|
505
|
-
ContactEmail = "Contact_email",
|
|
506
|
-
InfoLicense = "Info_license",
|
|
507
|
-
LicenseName = "License_name",
|
|
508
|
-
LicenseIdentifier = "License_identifier",
|
|
509
|
-
LicenseUrl = "License_url",
|
|
510
|
-
InfoVersion = "Info_version",
|
|
511
|
-
jsonSchemaDialect = "jsonSchemaDialect",
|
|
512
|
-
ServerList = "Server_List",
|
|
513
|
-
ServerUrl = "Server_url",
|
|
514
|
-
ServerDescription = "Server_description",
|
|
515
|
-
ServerVariables = "Server_variables",
|
|
516
|
-
Default = "Default"
|
|
517
|
-
}
|
|
518
|
-
export const sortLabelObject: Record<SortTypes, string>;
|
|
519
|
-
|
|
520
|
-
}
|
|
521
|
-
declare module '@redocly/openapi-language-server/server/types/completion' {
|
|
522
|
-
import { CompletionItemKind, TextEdit, InsertReplaceEdit } from 'vscode-languageserver/browser';
|
|
523
|
-
import { type NormalizedNodeType } from '@redocly/openapi-core';
|
|
524
|
-
type ExtendedNormalizedNodeType = NormalizedNodeType & {
|
|
525
|
-
isExample?: true;
|
|
526
|
-
enum?: string[];
|
|
527
|
-
type?: string;
|
|
528
|
-
};
|
|
529
|
-
interface CompletionItemOptions {
|
|
530
|
-
label: string;
|
|
531
|
-
kind?: CompletionItemKind;
|
|
532
|
-
sortText?: string;
|
|
533
|
-
textEdit?: TextEdit | InsertReplaceEdit;
|
|
534
|
-
insertText?: string;
|
|
535
|
-
filterText?: string;
|
|
536
|
-
}
|
|
537
|
-
export type { ExtendedNormalizedNodeType, CompletionItemOptions };
|
|
538
|
-
|
|
539
|
-
}
|
|
540
|
-
declare module '@redocly/openapi-language-server/server/types/context-core' {
|
|
541
|
-
import yamlAst from '@redocly/yaml-language-server-parser';
|
|
542
|
-
import type { TextDocument } from 'vscode-languageserver-textdocument';
|
|
543
|
-
import type { NormalizedNodeType, SpecMajorVersion } from '@redocly/openapi-core';
|
|
544
|
-
export enum ContextErrorCodes {
|
|
545
|
-
FILE_TYPE_NOT_SUPPORTED = 0
|
|
546
|
-
}
|
|
547
|
-
export type ContextError = {
|
|
548
|
-
error: {
|
|
549
|
-
code: ContextErrorCodes;
|
|
550
|
-
message: string;
|
|
551
|
-
};
|
|
552
|
-
};
|
|
553
|
-
export type ExistingValues = {
|
|
554
|
-
[key: string]: {
|
|
555
|
-
value: string | null;
|
|
556
|
-
startOffset: number;
|
|
557
|
-
endOffset: number | null;
|
|
558
|
-
indent: number;
|
|
559
|
-
type?: 'scalar' | 'map' | 'sequence';
|
|
560
|
-
rawValue?: string;
|
|
561
|
-
};
|
|
562
|
-
};
|
|
563
|
-
export type ContextData = {
|
|
564
|
-
nodePath: (string | number)[];
|
|
565
|
-
endPath?: string | number;
|
|
566
|
-
type: NormalizedNodeType | null;
|
|
567
|
-
existingValues: ExistingValues;
|
|
568
|
-
types: NormalizedNodeType | null;
|
|
569
|
-
descriptionVersion: SpecMajorVersion | null;
|
|
570
|
-
};
|
|
571
|
-
export type OpenApiVersion<T> = {
|
|
572
|
-
version: T;
|
|
573
|
-
isDefault: boolean;
|
|
574
|
-
};
|
|
575
|
-
export type NodePath = (string | number)[];
|
|
576
|
-
export type NodeWithPath = {
|
|
577
|
-
node: yamlAst.YAMLNode | null;
|
|
578
|
-
nodePath: NodePath;
|
|
579
|
-
};
|
|
580
|
-
export type NodeWithItems = yamlAst.YAMLNode & {
|
|
581
|
-
items?: yamlAst.YAMLNode[];
|
|
582
|
-
};
|
|
583
|
-
export type TextDocumentWithLineOffset = TextDocument & {
|
|
584
|
-
_lineOffsets: number[];
|
|
585
|
-
};
|
|
586
|
-
|
|
587
|
-
}
|
|
588
|
-
declare module '@redocly/openapi-language-server/server/utils' {
|
|
589
|
-
import { YAMLNode } from '@redocly/yaml-language-server-parser';
|
|
590
|
-
import { type ResolvedConfig } from '@redocly/openapi-core';
|
|
591
|
-
import { type TextDocument } from 'vscode-languageserver-textdocument';
|
|
592
|
-
type Func<T> = (textDocument: TextDocument) => T | Promise<T>;
|
|
593
|
-
export function debounceDocument<T>(func: Func<T>, wait?: number, immediate?: boolean): Func<Promise<T>>;
|
|
594
|
-
export function removeCirculars(object: any): any;
|
|
595
|
-
export function isRefField(field: string): boolean;
|
|
596
|
-
export function getRootFilePath(apiRoot: string, rootFolderURI: string): Promise<string>;
|
|
597
|
-
export function getCurrentApiAlias(apis: ResolvedConfig['apis'], rootFilePath: string, rootFolderURI: string): Promise<string | undefined>;
|
|
598
|
-
export function isString<T>(value: T): boolean;
|
|
599
|
-
export function isFunction<T>(f: T): boolean;
|
|
600
|
-
export function isPromise<T>(value: T): boolean;
|
|
601
|
-
export function isYamlMap(node: YAMLNode | null): boolean;
|
|
602
|
-
export function isYamlMapping(node: YAMLNode | null): boolean;
|
|
603
|
-
export function isYamlSequence(node: YAMLNode | null): boolean;
|
|
604
|
-
export function surroundByNodeQuotes(valueToSurround: string, options: Record<string, any> & {
|
|
605
|
-
singleQuoted?: boolean;
|
|
606
|
-
}): string;
|
|
607
|
-
export function isAbsoluteUrl(ref: string): boolean;
|
|
608
|
-
export {};
|
|
609
|
-
|
|
610
|
-
}
|
|
611
|
-
declare module '@redocly/openapi-language-server/server/validation/__tests__/__fixtures__/plugins' {
|
|
612
|
-
export { plugins_default as default };
|
|
613
|
-
var plugins_default: (typeof myRulesPlugin)[];
|
|
614
|
-
function myRulesPlugin(): {
|
|
615
|
-
id: string;
|
|
616
|
-
rules: {
|
|
617
|
-
oas3: {
|
|
618
|
-
'opid-not-test': typeof OperationIdNotTest;
|
|
619
|
-
};
|
|
620
|
-
};
|
|
621
|
-
};
|
|
622
|
-
function OperationIdNotTest(): {
|
|
623
|
-
Operation: {
|
|
624
|
-
enter(operation: any, ctx: any): void;
|
|
625
|
-
};
|
|
626
|
-
};
|
|
627
|
-
|
|
628
|
-
}
|
|
629
|
-
declare module '@redocly/openapi-language-server/server/validation/__tests__/index.test' {
|
|
630
|
-
export {};
|
|
631
|
-
|
|
632
|
-
}
|
|
633
|
-
declare module '@redocly/openapi-language-server/server/validation/__tests__/scorecard.test' {
|
|
634
|
-
export {};
|
|
635
|
-
|
|
636
|
-
}
|
|
637
|
-
declare module '@redocly/openapi-language-server/server/validation/index' {
|
|
638
|
-
import { type NormalizedProblem } from '@redocly/openapi-core';
|
|
639
|
-
import { type PublishDiagnosticsParams } from 'vscode-languageserver/browser';
|
|
640
|
-
import { TextDocument } from 'vscode-languageserver-textdocument';
|
|
641
|
-
export const validateOpenAPI: (textDocument: TextDocument) => Promise<PublishDiagnosticsParams[]> | Promise<Promise<PublishDiagnosticsParams[]>>;
|
|
642
|
-
export function isSpecFile(fileContent: unknown): boolean;
|
|
643
|
-
export function revalidateAllDocuments(): (Promise<PublishDiagnosticsParams[]> | Promise<Promise<PublishDiagnosticsParams[]>>)[];
|
|
644
|
-
export function handleUnexpectedError(fileURI: string, error: any, diagnosticsParams?: PublishDiagnosticsParams[]): PublishDiagnosticsParams[];
|
|
645
|
-
export function getValidationErrorsForBundle(problems: NormalizedProblem[]): NormalizedProblem[];
|
|
646
|
-
|
|
647
|
-
}
|
|
648
|
-
declare module '@redocly/openapi-language-server/server/validation/scorecard' {
|
|
649
|
-
import { type ScorecardConfig } from '@redocly/config';
|
|
650
|
-
import { BaseResolver, type NormalizedProblem, type Document, type Plugin } from '@redocly/openapi-core';
|
|
651
|
-
export function validateScorecard(document: Document, externalRefResolver: BaseResolver, scorecardConfig: ScorecardConfig, configPath?: string, pluginsCodeOrPlugins?: string | Plugin[]): Promise<(NormalizedProblem & {
|
|
652
|
-
scorecardLevel?: string;
|
|
653
|
-
})[]>;
|
|
654
|
-
export function evaluatePluginsFromCode(pluginsCode?: string): Promise<Plugin[]>;
|
|
655
|
-
|
|
656
|
-
}
|
|
657
|
-
declare module '@redocly/openapi-language-server/vitest.config' {
|
|
658
|
-
const _default: import("vite").UserConfig;
|
|
659
|
-
export default _default;
|
|
660
|
-
|
|
661
|
-
}
|
|
662
|
-
declare module '@redocly/openapi-language-server' {
|
|
663
|
-
import main = require('@redocly/openapi-language-server/index');
|
|
664
|
-
export = main;
|
|
665
|
-
}
|