@redocly/openapi-language-server 0.0.7 → 0.1.0
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.d.ts +26 -12
- package/lib/index.js +60 -56
- package/package.json +3 -2
package/lib/index.d.ts
CHANGED
|
@@ -26,23 +26,23 @@ declare module '@redocly/openapi-language-server/config' {
|
|
|
26
26
|
get fs(): FileSystemProvider;
|
|
27
27
|
get documents(): TextDocuments<TextDocument>;
|
|
28
28
|
}
|
|
29
|
-
export const
|
|
29
|
+
export const languageServerConfig: Configuration;
|
|
30
30
|
|
|
31
31
|
}
|
|
32
32
|
declare module '@redocly/openapi-language-server/index' {
|
|
33
33
|
import { CompletionItem, CompletionParams, DidChangeWatchedFilesParams } from 'vscode-languageserver/browser';
|
|
34
34
|
import { isConfigFile } from '@redocly/openapi-language-server/server/openapi-config';
|
|
35
35
|
import { TextDocument } from 'vscode-languageserver-textdocument';
|
|
36
|
-
import {
|
|
36
|
+
import { languageServerConfig } from '@redocly/openapi-language-server/config';
|
|
37
37
|
class OpenapiLanguageServer {
|
|
38
38
|
onCompletion(params: CompletionParams): Promise<CompletionItem[]>;
|
|
39
39
|
onCompletionResolve(item: CompletionItem): Promise<CompletionItem>;
|
|
40
40
|
validateOpenAPI(textDocument: TextDocument): Promise<import("vscode-languageserver/browser").PublishDiagnosticsParams[]>;
|
|
41
41
|
onDidChangeWatchedFiles(params: DidChangeWatchedFilesParams): Promise<(Promise<import("vscode-languageserver/browser").PublishDiagnosticsParams[]> | Promise<Promise<import("vscode-languageserver/browser").PublishDiagnosticsParams[]>>)[]>;
|
|
42
|
-
onDidConfigChange(): Promise<(Promise<import("vscode-languageserver/browser").PublishDiagnosticsParams[]> | Promise<Promise<import("vscode-languageserver/browser").PublishDiagnosticsParams[]>>)[]>;
|
|
42
|
+
onDidConfigChange(uri: string): Promise<(Promise<import("vscode-languageserver/browser").PublishDiagnosticsParams[]> | Promise<Promise<import("vscode-languageserver/browser").PublishDiagnosticsParams[]>>)[]>;
|
|
43
43
|
onDidChangeConfiguration(): Promise<(Promise<import("vscode-languageserver/browser").PublishDiagnosticsParams[]> | Promise<Promise<import("vscode-languageserver/browser").PublishDiagnosticsParams[]>>)[]>;
|
|
44
44
|
}
|
|
45
|
-
export { OpenapiLanguageServer,
|
|
45
|
+
export { OpenapiLanguageServer, languageServerConfig, isConfigFile };
|
|
46
46
|
|
|
47
47
|
}
|
|
48
48
|
declare module '@redocly/openapi-language-server/server/bundle' {
|
|
@@ -226,7 +226,7 @@ declare module '@redocly/openapi-language-server/server/completion/yaml/paths' {
|
|
|
226
226
|
|
|
227
227
|
}
|
|
228
228
|
declare module '@redocly/openapi-language-server/server/context-core' {
|
|
229
|
-
import {
|
|
229
|
+
import { SpecVersion, SpecMajorVersion } from '@redocly/openapi-core';
|
|
230
230
|
import * as yamlAst from '@redocly/yaml-language-server-parser';
|
|
231
231
|
import type { Position } from 'vscode-languageserver/browser';
|
|
232
232
|
import type { NormalizedNodeType } from '@redocly/openapi-language-server/server/types/oas';
|
|
@@ -242,8 +242,8 @@ declare module '@redocly/openapi-language-server/server/context-core' {
|
|
|
242
242
|
endPath: string | null;
|
|
243
243
|
};
|
|
244
244
|
export function getRootTypes(ast: yamlAst.YAMLNode, uri: string): NormalizedNodeType | null;
|
|
245
|
-
export function getOASVersion(ast: yamlAst.YAMLNode): OpenApiVersion<
|
|
246
|
-
export function getOASMajorVersion(ast: yamlAst.YAMLNode): OpenApiVersion<
|
|
245
|
+
export function getOASVersion(ast: yamlAst.YAMLNode): OpenApiVersion<SpecVersion>;
|
|
246
|
+
export function getOASMajorVersion(ast: yamlAst.YAMLNode): OpenApiVersion<SpecMajorVersion>;
|
|
247
247
|
export function getChildNodes(node?: yamlAst.YAMLNode | null): yamlAst.YAMLNode[];
|
|
248
248
|
export function getExistingValues(node: yamlAst.YAMLSequence, values?: ExistingValues, indent?: number): ExistingValues;
|
|
249
249
|
|
|
@@ -286,13 +286,21 @@ declare module '@redocly/openapi-language-server/server/hints' {
|
|
|
286
286
|
|
|
287
287
|
}
|
|
288
288
|
declare module '@redocly/openapi-language-server/server/openapi-config' {
|
|
289
|
-
import { Config as
|
|
289
|
+
import { Config as RedoclyConfig, CONFIG_FILE_NAMES } from '@redocly/openapi-core';
|
|
290
|
+
import type { Document } from '@redocly/openapi-core/lib/resolve';
|
|
291
|
+
import type { DocumentUri } from 'vscode-languageserver/node';
|
|
290
292
|
export { CONFIG_FILE_NAMES };
|
|
293
|
+
export function findConfig(uri?: string): Promise<string | undefined>;
|
|
294
|
+
export type ConfigData = {
|
|
295
|
+
config: RedoclyConfig;
|
|
296
|
+
configPath?: string;
|
|
297
|
+
rootConfigDocument?: Document;
|
|
298
|
+
};
|
|
299
|
+
export function loadOpenAPIConfig(uri?: string): Promise<RedoclyConfig>;
|
|
300
|
+
export function getConfigData(): Promise<ConfigData>;
|
|
301
|
+
export function updateOpenAPIConfigByURI(uri: DocumentUri): Promise<RedoclyConfig>;
|
|
291
302
|
export function isConfigFile(uri: string): boolean;
|
|
292
|
-
export function
|
|
293
|
-
cache?: boolean;
|
|
294
|
-
}): Promise<OpenAPIConfig>;
|
|
295
|
-
export function updateOpenApiConfig(): Promise<OpenAPIConfig>;
|
|
303
|
+
export function isRootConfigFile(uri: string): boolean;
|
|
296
304
|
|
|
297
305
|
}
|
|
298
306
|
declare module '@redocly/openapi-language-server/server/openapi-extensions' {
|
|
@@ -377,7 +385,9 @@ declare module '@redocly/openapi-language-server/server/openapi-extensions' {
|
|
|
377
385
|
declare module '@redocly/openapi-language-server/server/path' {
|
|
378
386
|
import { DocumentUri } from 'vscode-languageserver/browser';
|
|
379
387
|
import { URI } from 'vscode-uri';
|
|
388
|
+
export function arePathsEqual(path1: string, path2: string): boolean;
|
|
380
389
|
export function parseUri(path: string): URI;
|
|
390
|
+
export function uriToAbsFSPath(uri: DocumentUri): string;
|
|
381
391
|
export function isHttpPath(path: string): boolean;
|
|
382
392
|
export function uriBaseName(uri: DocumentUri): string;
|
|
383
393
|
export function getFileExtension(uri: DocumentUri): string;
|
|
@@ -502,10 +512,13 @@ declare module '@redocly/openapi-language-server/server/types/oas' {
|
|
|
502
512
|
declare module '@redocly/openapi-language-server/server/utils' {
|
|
503
513
|
import { YAMLNode } from '@redocly/yaml-language-server-parser';
|
|
504
514
|
import type { TextDocument } from 'vscode-languageserver-textdocument';
|
|
515
|
+
import type { ResolvedApi } from '@redocly/openapi-core';
|
|
505
516
|
type Func<T> = (textDocument: TextDocument) => T | Promise<T>;
|
|
506
517
|
export function debounceDocument<T>(func: Func<T>, wait?: number, immediate?: boolean): Func<Promise<T>>;
|
|
507
518
|
export function removeCirculars(object: any): any;
|
|
508
519
|
export function isRefField(field: string): boolean;
|
|
520
|
+
export function getRootFilePath(apiRoot: string): Promise<string>;
|
|
521
|
+
export function getCurrentApiAlias(apis: Record<string, ResolvedApi>, rootFilePath: string): Promise<string | undefined>;
|
|
509
522
|
export function isString<T>(value: T): boolean;
|
|
510
523
|
export function isFunction<T>(f: T): boolean;
|
|
511
524
|
export function isPromise<T>(value: T): boolean;
|
|
@@ -515,6 +528,7 @@ declare module '@redocly/openapi-language-server/server/utils' {
|
|
|
515
528
|
export function surroundByNodeQuotes(valueToSurround: string, options: Record<string, any> & {
|
|
516
529
|
singleQuoted?: boolean;
|
|
517
530
|
}): string;
|
|
531
|
+
export function isAbsoluteUrl(ref: string): boolean;
|
|
518
532
|
export {};
|
|
519
533
|
|
|
520
534
|
}
|