@corsa-bind/napi 0.16.0 → 0.17.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/dist/index.d.mts +103 -12
- package/dist/index.mjs +37 -8
- package/dist/index.mjs.map +1 -1
- package/index.d.ts +50 -48
- package/index.js +53 -53
- package/package.json +9 -9
- package/dist/api_client.d.mts +0 -43
- package/dist/api_client.mjs +0 -78
- package/dist/api_client.mjs.map +0 -1
- package/dist/api_client_base.d.mts +0 -45
- package/dist/api_client_base.mjs +0 -78
- package/dist/api_client_base.mjs.map +0 -1
- package/dist/binding.d.mts +0 -16
- package/dist/binding.mjs +0 -14
- package/dist/binding.mjs.map +0 -1
- package/dist/distributed_orchestrator.d.mts +0 -29
- package/dist/distributed_orchestrator.mjs +0 -55
- package/dist/distributed_orchestrator.mjs.map +0 -1
- package/dist/index2.d.mts +0 -14
- package/dist/json.mjs +0 -18
- package/dist/json.mjs.map +0 -1
- package/dist/native_utils.d.mts +0 -53
- package/dist/native_utils.mjs +0 -86
- package/dist/native_utils.mjs.map +0 -1
- package/dist/virtual_document.d.mts +0 -29
- package/dist/virtual_document.mjs +0 -50
- package/dist/virtual_document.mjs.map +0 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,14 +1,105 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import { ApiClientOptions, ApiMode, CapabilitiesResponse, ConfigResponse, DiagnosticsCapabilities, DocumentIdentifier, EditorCapabilities, FileChangeSummary, FileChanges, FileDiagnosticsResponse, InitializeResponse, NativeLintDiagnostic, NativeLintFix, NativeLintNode, NativeLintRange, NativeLintRuleMeta, NativeLintSuggestion, OverlayCapabilities, OverlayChanges, OverlayUpdate, ProjectDiagnosticsResponse, ProjectResponse, RuntimeCapabilities, SnapshotDiagnosticsResponse, SymbolResponse, TypeResponse, TypeTextKind, UnsafeTypeFlowInput, UpdateSnapshotParams, UpdateSnapshotResponse, VirtualChange, VirtualDocumentState } from "./types.mjs";
|
|
2
|
+
import * as _$___index_js0 from "../index.js";
|
|
3
|
+
|
|
4
|
+
//#region index.d.ts
|
|
5
|
+
declare const binding: typeof _$___index_js0;
|
|
6
|
+
type CorsaApiClientConstructor = {
|
|
7
|
+
spawn(options: ApiClientOptions): CorsaApiClient;
|
|
8
|
+
spawnAsync(options: ApiClientOptions): Promise<CorsaApiClient>;
|
|
9
|
+
};
|
|
10
|
+
interface CorsaApiClient {
|
|
11
|
+
initialize(): InitializeResponse;
|
|
12
|
+
initializeAsync(): Promise<InitializeResponse>;
|
|
13
|
+
parseConfigFile(file: string): ConfigResponse;
|
|
14
|
+
parseConfigFileAsync(file: string): Promise<ConfigResponse>;
|
|
15
|
+
updateSnapshot(params?: UpdateSnapshotParams): UpdateSnapshotResponse;
|
|
16
|
+
updateSnapshotAsync(params?: UpdateSnapshotParams): Promise<UpdateSnapshotResponse>;
|
|
17
|
+
getSourceFile(snapshot: string, project: string, file: string): Buffer | null;
|
|
18
|
+
getSourceFileAsync(snapshot: string, project: string, file: string): Promise<Buffer | null>;
|
|
19
|
+
getStringType(snapshot: string, project: string): TypeResponse;
|
|
20
|
+
getStringTypeAsync(snapshot: string, project: string): Promise<TypeResponse>;
|
|
21
|
+
getTypeAtPosition(snapshot: string, project: string, file: string, position: number): TypeResponse | null;
|
|
22
|
+
getTypeAtPositionAsync(snapshot: string, project: string, file: string, position: number): Promise<TypeResponse | null>;
|
|
23
|
+
getSymbolAtPosition(snapshot: string, project: string, file: string, position: number): SymbolResponse | null;
|
|
24
|
+
getSymbolAtPositionAsync(snapshot: string, project: string, file: string, position: number): Promise<SymbolResponse | null>;
|
|
25
|
+
getTypeArguments(snapshot: string, project: string, typeHandle: string, objectFlags?: number): TypeResponse[];
|
|
26
|
+
getTypeArgumentsAsync(snapshot: string, project: string, typeHandle: string, objectFlags?: number): Promise<TypeResponse[]>;
|
|
27
|
+
getTypeOfSymbol(snapshot: string, project: string, symbol: string): TypeResponse | null;
|
|
28
|
+
getTypeOfSymbolAsync(snapshot: string, project: string, symbol: string): Promise<TypeResponse | null>;
|
|
29
|
+
getDeclaredTypeOfSymbol(snapshot: string, project: string, symbol: string): TypeResponse | null;
|
|
30
|
+
getDeclaredTypeOfSymbolAsync(snapshot: string, project: string, symbol: string): Promise<TypeResponse | null>;
|
|
31
|
+
typeToString(snapshot: string, project: string, typeHandle: string, location?: string, flags?: number): string;
|
|
32
|
+
typeToStringAsync(snapshot: string, project: string, typeHandle: string, location?: string, flags?: number): Promise<string>;
|
|
33
|
+
callJson<T>(method: string, params?: unknown): T;
|
|
34
|
+
callJsonAsync<T>(method: string, params?: unknown): Promise<T>;
|
|
35
|
+
callBinary(method: string, params?: unknown): Buffer | null;
|
|
36
|
+
callBinaryAsync(method: string, params?: unknown): Promise<Buffer | null>;
|
|
37
|
+
releaseHandle(handle: string): void;
|
|
38
|
+
releaseHandleAsync(handle: string): Promise<void>;
|
|
39
|
+
close(): void;
|
|
40
|
+
closeAsync(): Promise<void>;
|
|
41
|
+
}
|
|
42
|
+
type CorsaDistributedOrchestratorConstructor = {
|
|
43
|
+
new (nodeIds: string[]): CorsaDistributedOrchestrator;
|
|
44
|
+
};
|
|
45
|
+
interface CorsaDistributedOrchestrator {
|
|
46
|
+
campaign(nodeId: string): number;
|
|
47
|
+
leaderId(): string | null;
|
|
48
|
+
state<T>(): T | null;
|
|
49
|
+
nodeState<T>(nodeId: string): T | null;
|
|
50
|
+
document(nodeId: string, uri: string): VirtualDocumentState | null;
|
|
51
|
+
openVirtualDocument(document: VirtualDocumentState): VirtualDocumentState;
|
|
52
|
+
changeVirtualDocument(uri: string, changes: VirtualChange[]): VirtualDocumentState;
|
|
53
|
+
closeVirtualDocument(uri: string): void;
|
|
54
|
+
}
|
|
55
|
+
type CorsaVirtualDocumentConstructor = {
|
|
56
|
+
untitled(path: string, languageId: string, text: string): CorsaVirtualDocument;
|
|
57
|
+
inMemory(authority: string, path: string, languageId: string, text: string): CorsaVirtualDocument;
|
|
58
|
+
};
|
|
59
|
+
interface CorsaVirtualDocument {
|
|
60
|
+
readonly uri: string;
|
|
61
|
+
readonly languageId: string;
|
|
62
|
+
readonly version: number;
|
|
63
|
+
readonly text: string;
|
|
64
|
+
state(): VirtualDocumentState;
|
|
65
|
+
replace(text: string): void;
|
|
66
|
+
applyChanges(changes: VirtualChange[]): unknown[];
|
|
67
|
+
}
|
|
68
|
+
declare const CorsaApiClient: CorsaApiClientConstructor;
|
|
69
|
+
declare const CorsaDistributedOrchestrator: CorsaDistributedOrchestratorConstructor;
|
|
70
|
+
declare const CorsaVirtualDocument: CorsaVirtualDocumentConstructor;
|
|
71
|
+
declare const version: () => string;
|
|
72
|
+
declare const spawnCorsaApiClientAsync: (options: ApiClientOptions) => Promise<CorsaApiClient>;
|
|
73
|
+
declare const isUnsafeAssignment: (input: UnsafeTypeFlowInput) => boolean;
|
|
74
|
+
declare const isUnsafeReturn: (input: UnsafeTypeFlowInput) => boolean;
|
|
75
|
+
declare const runNativeLintRule: (ruleName: string, node: NativeLintNode) => NativeLintDiagnostic[];
|
|
76
|
+
declare const nativeLintRuleMetas: () => NativeLintRuleMeta[];
|
|
77
|
+
declare const classifyTypeText: (text?: string) => TypeTextKind;
|
|
78
|
+
declare const splitTopLevelTypeText: (text: string, delimiter: string) => string[];
|
|
79
|
+
declare const splitTypeText: (text: string) => string[];
|
|
80
|
+
declare const isStringLikeTypeTexts: (typeTexts: readonly string[]) => boolean;
|
|
81
|
+
declare const isNumberLikeTypeTexts: (typeTexts: readonly string[]) => boolean;
|
|
82
|
+
declare const isBigIntLikeTypeTexts: (typeTexts: readonly string[]) => boolean;
|
|
83
|
+
declare const isAnyLikeTypeTexts: (typeTexts: readonly string[]) => boolean;
|
|
84
|
+
declare const isUnknownLikeTypeTexts: (typeTexts: readonly string[]) => boolean;
|
|
85
|
+
declare const isArrayLikeTypeTexts: (typeTexts: readonly string[]) => boolean;
|
|
86
|
+
declare const isStringArrayLikeTypeTexts: (typeTexts: readonly string[]) => boolean;
|
|
87
|
+
declare const isPromiseLikeTypeTexts: (typeTexts: readonly string[], propertyNames?: readonly string[]) => boolean;
|
|
88
|
+
declare const isErrorLikeTypeTexts: (typeTexts: readonly string[], propertyNames?: readonly string[]) => boolean;
|
|
89
|
+
declare const Utils: Readonly<{
|
|
90
|
+
classifyTypeText: (text?: string) => TypeTextKind;
|
|
91
|
+
splitTopLevelTypeText: (text: string, delimiter: string) => string[];
|
|
92
|
+
splitTypeText: (text: string) => string[];
|
|
93
|
+
isStringLikeTypeTexts: (typeTexts: readonly string[]) => boolean;
|
|
94
|
+
isNumberLikeTypeTexts: (typeTexts: readonly string[]) => boolean;
|
|
95
|
+
isBigIntLikeTypeTexts: (typeTexts: readonly string[]) => boolean;
|
|
96
|
+
isAnyLikeTypeTexts: (typeTexts: readonly string[]) => boolean;
|
|
97
|
+
isUnknownLikeTypeTexts: (typeTexts: readonly string[]) => boolean;
|
|
98
|
+
isArrayLikeTypeTexts: (typeTexts: readonly string[]) => boolean;
|
|
99
|
+
isStringArrayLikeTypeTexts: (typeTexts: readonly string[]) => boolean;
|
|
100
|
+
isPromiseLikeTypeTexts: (typeTexts: readonly string[], propertyNames?: readonly string[]) => boolean;
|
|
101
|
+
isErrorLikeTypeTexts: (typeTexts: readonly string[], propertyNames?: readonly string[]) => boolean;
|
|
102
|
+
}>;
|
|
12
103
|
//#endregion
|
|
13
|
-
export { version };
|
|
104
|
+
export { ApiClientOptions, ApiMode, CapabilitiesResponse, ConfigResponse, CorsaApiClient, CorsaDistributedOrchestrator, CorsaVirtualDocument, DiagnosticsCapabilities, DocumentIdentifier, EditorCapabilities, FileChangeSummary, FileChanges, FileDiagnosticsResponse, InitializeResponse, NativeLintDiagnostic, NativeLintFix, NativeLintNode, NativeLintRange, NativeLintRuleMeta, NativeLintSuggestion, OverlayCapabilities, OverlayChanges, OverlayUpdate, ProjectDiagnosticsResponse, ProjectResponse, RuntimeCapabilities, SnapshotDiagnosticsResponse, SymbolResponse, TypeResponse, TypeTextKind, UnsafeTypeFlowInput, UpdateSnapshotParams, UpdateSnapshotResponse, Utils, VirtualChange, VirtualDocumentState, classifyTypeText, binding as default, isAnyLikeTypeTexts, isArrayLikeTypeTexts, isBigIntLikeTypeTexts, isErrorLikeTypeTexts, isNumberLikeTypeTexts, isPromiseLikeTypeTexts, isStringArrayLikeTypeTexts, isStringLikeTypeTexts, isUnknownLikeTypeTexts, isUnsafeAssignment, isUnsafeReturn, nativeLintRuleMetas, runNativeLintRule, spawnCorsaApiClientAsync, splitTopLevelTypeText, splitTypeText, version };
|
|
14
105
|
//# sourceMappingURL=index.d.mts.map
|
package/dist/index.mjs
CHANGED
|
@@ -1,13 +1,42 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { CorsaApiClient } from "./api_client.mjs";
|
|
3
|
-
import { CorsaDistributedOrchestrator } from "./distributed_orchestrator.mjs";
|
|
4
|
-
import { Utils, classifyTypeText, isAnyLikeTypeTexts, isArrayLikeTypeTexts, isBigIntLikeTypeTexts, isErrorLikeTypeTexts, isNumberLikeTypeTexts, isPromiseLikeTypeTexts, isStringArrayLikeTypeTexts, isStringLikeTypeTexts, isUnknownLikeTypeTexts, isUnsafeAssignment, isUnsafeReturn, nativeLintRuleMetas, runNativeLintRule, splitTopLevelTypeText, splitTypeText } from "./native_utils.mjs";
|
|
5
|
-
import { CorsaVirtualDocument } from "./virtual_document.mjs";
|
|
1
|
+
import * as nativeModule from "../index.js";
|
|
6
2
|
//#region index.ts
|
|
7
|
-
|
|
3
|
+
const binding = "default" in nativeModule ? nativeModule.default : nativeModule;
|
|
4
|
+
const CorsaApiClient = binding.CorsaApiClient;
|
|
5
|
+
const CorsaDistributedOrchestrator = binding.CorsaDistributedOrchestrator;
|
|
6
|
+
const CorsaVirtualDocument = binding.CorsaVirtualDocument;
|
|
8
7
|
const version = binding.version;
|
|
9
|
-
|
|
8
|
+
const spawnCorsaApiClientAsync = binding.spawnCorsaApiClientAsync;
|
|
9
|
+
const isUnsafeAssignment = binding.isUnsafeAssignment;
|
|
10
|
+
const isUnsafeReturn = binding.isUnsafeReturn;
|
|
11
|
+
const runNativeLintRule = binding.runNativeLintRule;
|
|
12
|
+
const nativeLintRuleMetas = binding.nativeLintRuleMetas;
|
|
13
|
+
const classifyTypeText = binding.classifyTypeText;
|
|
14
|
+
const splitTopLevelTypeText = binding.splitTopLevelTypeText;
|
|
15
|
+
const splitTypeText = binding.splitTypeText;
|
|
16
|
+
const isStringLikeTypeTexts = binding.isStringLikeTypeTexts;
|
|
17
|
+
const isNumberLikeTypeTexts = binding.isNumberLikeTypeTexts;
|
|
18
|
+
const isBigIntLikeTypeTexts = binding.isBigIntLikeTypeTexts;
|
|
19
|
+
const isAnyLikeTypeTexts = binding.isAnyLikeTypeTexts;
|
|
20
|
+
const isUnknownLikeTypeTexts = binding.isUnknownLikeTypeTexts;
|
|
21
|
+
const isArrayLikeTypeTexts = binding.isArrayLikeTypeTexts;
|
|
22
|
+
const isStringArrayLikeTypeTexts = binding.isStringArrayLikeTypeTexts;
|
|
23
|
+
const isPromiseLikeTypeTexts = binding.isPromiseLikeTypeTexts;
|
|
24
|
+
const isErrorLikeTypeTexts = binding.isErrorLikeTypeTexts;
|
|
25
|
+
const Utils = Object.freeze({
|
|
26
|
+
classifyTypeText,
|
|
27
|
+
splitTopLevelTypeText,
|
|
28
|
+
splitTypeText,
|
|
29
|
+
isStringLikeTypeTexts,
|
|
30
|
+
isNumberLikeTypeTexts,
|
|
31
|
+
isBigIntLikeTypeTexts,
|
|
32
|
+
isAnyLikeTypeTexts,
|
|
33
|
+
isUnknownLikeTypeTexts,
|
|
34
|
+
isArrayLikeTypeTexts,
|
|
35
|
+
isStringArrayLikeTypeTexts,
|
|
36
|
+
isPromiseLikeTypeTexts,
|
|
37
|
+
isErrorLikeTypeTexts
|
|
38
|
+
});
|
|
10
39
|
//#endregion
|
|
11
|
-
export { CorsaApiClient, CorsaDistributedOrchestrator, CorsaVirtualDocument, Utils, classifyTypeText,
|
|
40
|
+
export { CorsaApiClient, CorsaDistributedOrchestrator, CorsaVirtualDocument, Utils, classifyTypeText, binding as default, isAnyLikeTypeTexts, isArrayLikeTypeTexts, isBigIntLikeTypeTexts, isErrorLikeTypeTexts, isNumberLikeTypeTexts, isPromiseLikeTypeTexts, isStringArrayLikeTypeTexts, isStringLikeTypeTexts, isUnknownLikeTypeTexts, isUnsafeAssignment, isUnsafeReturn, nativeLintRuleMetas, runNativeLintRule, spawnCorsaApiClientAsync, splitTopLevelTypeText, splitTypeText, version };
|
|
12
41
|
|
|
13
42
|
//# sourceMappingURL=index.mjs.map
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../ts/index.ts"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../ts/index.ts"],"sourcesContent":["import * as nativeModule from \"../index.js\";\n\nimport type {\n ApiClientOptions,\n ConfigResponse,\n InitializeResponse,\n NativeLintDiagnostic,\n NativeLintNode,\n NativeLintRuleMeta,\n SymbolResponse,\n TypeResponse,\n TypeTextKind,\n UnsafeTypeFlowInput,\n UpdateSnapshotParams,\n UpdateSnapshotResponse,\n VirtualChange,\n VirtualDocumentState,\n} from \"./types\";\n\nconst binding = (\n \"default\" in nativeModule ? nativeModule.default : nativeModule\n) as typeof import(\"../index.js\");\n\ntype CorsaApiClientConstructor = {\n spawn(options: ApiClientOptions): CorsaApiClient;\n spawnAsync(options: ApiClientOptions): Promise<CorsaApiClient>;\n};\n\nexport interface CorsaApiClient {\n initialize(): InitializeResponse;\n initializeAsync(): Promise<InitializeResponse>;\n parseConfigFile(file: string): ConfigResponse;\n parseConfigFileAsync(file: string): Promise<ConfigResponse>;\n updateSnapshot(params?: UpdateSnapshotParams): UpdateSnapshotResponse;\n updateSnapshotAsync(params?: UpdateSnapshotParams): Promise<UpdateSnapshotResponse>;\n getSourceFile(snapshot: string, project: string, file: string): Buffer | null;\n getSourceFileAsync(snapshot: string, project: string, file: string): Promise<Buffer | null>;\n getStringType(snapshot: string, project: string): TypeResponse;\n getStringTypeAsync(snapshot: string, project: string): Promise<TypeResponse>;\n getTypeAtPosition(\n snapshot: string,\n project: string,\n file: string,\n position: number,\n ): TypeResponse | null;\n getTypeAtPositionAsync(\n snapshot: string,\n project: string,\n file: string,\n position: number,\n ): Promise<TypeResponse | null>;\n getSymbolAtPosition(\n snapshot: string,\n project: string,\n file: string,\n position: number,\n ): SymbolResponse | null;\n getSymbolAtPositionAsync(\n snapshot: string,\n project: string,\n file: string,\n position: number,\n ): Promise<SymbolResponse | null>;\n getTypeArguments(\n snapshot: string,\n project: string,\n typeHandle: string,\n objectFlags?: number,\n ): TypeResponse[];\n getTypeArgumentsAsync(\n snapshot: string,\n project: string,\n typeHandle: string,\n objectFlags?: number,\n ): Promise<TypeResponse[]>;\n getTypeOfSymbol(snapshot: string, project: string, symbol: string): TypeResponse | null;\n getTypeOfSymbolAsync(\n snapshot: string,\n project: string,\n symbol: string,\n ): Promise<TypeResponse | null>;\n getDeclaredTypeOfSymbol(snapshot: string, project: string, symbol: string): TypeResponse | null;\n getDeclaredTypeOfSymbolAsync(\n snapshot: string,\n project: string,\n symbol: string,\n ): Promise<TypeResponse | null>;\n typeToString(\n snapshot: string,\n project: string,\n typeHandle: string,\n location?: string,\n flags?: number,\n ): string;\n typeToStringAsync(\n snapshot: string,\n project: string,\n typeHandle: string,\n location?: string,\n flags?: number,\n ): Promise<string>;\n callJson<T>(method: string, params?: unknown): T;\n callJsonAsync<T>(method: string, params?: unknown): Promise<T>;\n callBinary(method: string, params?: unknown): Buffer | null;\n callBinaryAsync(method: string, params?: unknown): Promise<Buffer | null>;\n releaseHandle(handle: string): void;\n releaseHandleAsync(handle: string): Promise<void>;\n close(): void;\n closeAsync(): Promise<void>;\n}\n\ntype CorsaDistributedOrchestratorConstructor = {\n new (nodeIds: string[]): CorsaDistributedOrchestrator;\n};\n\nexport interface CorsaDistributedOrchestrator {\n campaign(nodeId: string): number;\n leaderId(): string | null;\n state<T>(): T | null;\n nodeState<T>(nodeId: string): T | null;\n document(nodeId: string, uri: string): VirtualDocumentState | null;\n openVirtualDocument(document: VirtualDocumentState): VirtualDocumentState;\n changeVirtualDocument(uri: string, changes: VirtualChange[]): VirtualDocumentState;\n closeVirtualDocument(uri: string): void;\n}\n\ntype CorsaVirtualDocumentConstructor = {\n untitled(path: string, languageId: string, text: string): CorsaVirtualDocument;\n inMemory(authority: string, path: string, languageId: string, text: string): CorsaVirtualDocument;\n};\n\nexport interface CorsaVirtualDocument {\n readonly uri: string;\n readonly languageId: string;\n readonly version: number;\n readonly text: string;\n state(): VirtualDocumentState;\n replace(text: string): void;\n applyChanges(changes: VirtualChange[]): unknown[];\n}\n\nexport const CorsaApiClient = binding.CorsaApiClient as unknown as CorsaApiClientConstructor;\nexport const CorsaDistributedOrchestrator =\n binding.CorsaDistributedOrchestrator as unknown as CorsaDistributedOrchestratorConstructor;\nexport const CorsaVirtualDocument =\n binding.CorsaVirtualDocument as unknown as CorsaVirtualDocumentConstructor;\n\nexport const version = binding.version as () => string;\nexport const spawnCorsaApiClientAsync = binding.spawnCorsaApiClientAsync as (\n options: ApiClientOptions,\n) => Promise<CorsaApiClient>;\nexport const isUnsafeAssignment = binding.isUnsafeAssignment as (\n input: UnsafeTypeFlowInput,\n) => boolean;\nexport const isUnsafeReturn = binding.isUnsafeReturn as (input: UnsafeTypeFlowInput) => boolean;\nexport const runNativeLintRule = binding.runNativeLintRule as (\n ruleName: string,\n node: NativeLintNode,\n) => NativeLintDiagnostic[];\nexport const nativeLintRuleMetas = binding.nativeLintRuleMetas as () => NativeLintRuleMeta[];\nexport const classifyTypeText = binding.classifyTypeText as (text?: string) => TypeTextKind;\nexport const splitTopLevelTypeText = binding.splitTopLevelTypeText as (\n text: string,\n delimiter: string,\n) => string[];\nexport const splitTypeText = binding.splitTypeText as (text: string) => string[];\nexport const isStringLikeTypeTexts = binding.isStringLikeTypeTexts as (\n typeTexts: readonly string[],\n) => boolean;\nexport const isNumberLikeTypeTexts = binding.isNumberLikeTypeTexts as (\n typeTexts: readonly string[],\n) => boolean;\nexport const isBigIntLikeTypeTexts = binding.isBigIntLikeTypeTexts as (\n typeTexts: readonly string[],\n) => boolean;\nexport const isAnyLikeTypeTexts = binding.isAnyLikeTypeTexts as (\n typeTexts: readonly string[],\n) => boolean;\nexport const isUnknownLikeTypeTexts = binding.isUnknownLikeTypeTexts as (\n typeTexts: readonly string[],\n) => boolean;\nexport const isArrayLikeTypeTexts = binding.isArrayLikeTypeTexts as (\n typeTexts: readonly string[],\n) => boolean;\nexport const isStringArrayLikeTypeTexts = binding.isStringArrayLikeTypeTexts as (\n typeTexts: readonly string[],\n) => boolean;\nexport const isPromiseLikeTypeTexts = binding.isPromiseLikeTypeTexts as (\n typeTexts: readonly string[],\n propertyNames?: readonly string[],\n) => boolean;\nexport const isErrorLikeTypeTexts = binding.isErrorLikeTypeTexts as (\n typeTexts: readonly string[],\n propertyNames?: readonly string[],\n) => boolean;\n\nexport const Utils = Object.freeze({\n classifyTypeText,\n splitTopLevelTypeText,\n splitTypeText,\n isStringLikeTypeTexts,\n isNumberLikeTypeTexts,\n isBigIntLikeTypeTexts,\n isAnyLikeTypeTexts,\n isUnknownLikeTypeTexts,\n isArrayLikeTypeTexts,\n isStringArrayLikeTypeTexts,\n isPromiseLikeTypeTexts,\n isErrorLikeTypeTexts,\n});\n\nexport default binding;\nexport type * from \"./types\";\n"],"mappings":";;AAmBA,MAAM,UACJ,aAAa,eAAe,aAAa,UAAU;AAyHrD,MAAa,iBAAiB,QAAQ;AACtC,MAAa,+BACX,QAAQ;AACV,MAAa,uBACX,QAAQ;AAEV,MAAa,UAAU,QAAQ;AAC/B,MAAa,2BAA2B,QAAQ;AAGhD,MAAa,qBAAqB,QAAQ;AAG1C,MAAa,iBAAiB,QAAQ;AACtC,MAAa,oBAAoB,QAAQ;AAIzC,MAAa,sBAAsB,QAAQ;AAC3C,MAAa,mBAAmB,QAAQ;AACxC,MAAa,wBAAwB,QAAQ;AAI7C,MAAa,gBAAgB,QAAQ;AACrC,MAAa,wBAAwB,QAAQ;AAG7C,MAAa,wBAAwB,QAAQ;AAG7C,MAAa,wBAAwB,QAAQ;AAG7C,MAAa,qBAAqB,QAAQ;AAG1C,MAAa,yBAAyB,QAAQ;AAG9C,MAAa,uBAAuB,QAAQ;AAG5C,MAAa,6BAA6B,QAAQ;AAGlD,MAAa,yBAAyB,QAAQ;AAI9C,MAAa,uBAAuB,QAAQ;AAK5C,MAAa,QAAQ,OAAO,OAAO;CACjC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD,CAAC"}
|
package/index.d.ts
CHANGED
|
@@ -2,53 +2,55 @@
|
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
/** Thin synchronous wrapper around the Rust stdio API client. */
|
|
4
4
|
export declare class CorsaApiClient {
|
|
5
|
-
/** Spawns a new client from a
|
|
6
|
-
static spawn(
|
|
7
|
-
/**
|
|
8
|
-
|
|
5
|
+
/** Spawns a new client from a JavaScript spawn config. */
|
|
6
|
+
static spawn(options: any): CorsaApiClient
|
|
7
|
+
/** Spawns a new client without blocking the JavaScript event loop. */
|
|
8
|
+
static spawnAsync(options: any): Promise<CorsaApiClient>
|
|
9
|
+
/** Calls `initialize` and returns the response object. */
|
|
10
|
+
initialize(): any
|
|
9
11
|
/** Calls `initialize` without blocking the JavaScript event loop. */
|
|
10
|
-
|
|
11
|
-
/** Parses a `tsconfig` through corsa and returns the
|
|
12
|
-
|
|
12
|
+
initializeAsync(): Promise<unknown>
|
|
13
|
+
/** Parses a `tsconfig` through corsa and returns the response object. */
|
|
14
|
+
parseConfigFile(file: string): any
|
|
13
15
|
/** Parses a `tsconfig` on a libuv worker thread. */
|
|
14
|
-
|
|
15
|
-
/** Applies file changes and returns a
|
|
16
|
-
|
|
16
|
+
parseConfigFileAsync(file: string): Promise<unknown>
|
|
17
|
+
/** Applies file changes and returns a snapshot record. */
|
|
18
|
+
updateSnapshot(params?: any | undefined | null): any
|
|
17
19
|
/** Applies file changes on a libuv worker thread. */
|
|
18
|
-
|
|
20
|
+
updateSnapshotAsync(params?: any | undefined | null): Promise<unknown>
|
|
19
21
|
/** Fetches a source file through the binary endpoint. */
|
|
20
22
|
getSourceFile(snapshot: string, project: string, file: string): Buffer | null
|
|
21
23
|
/** Fetches a source file on a libuv worker thread. */
|
|
22
24
|
getSourceFileAsync(snapshot: string, project: string, file: string): Promise<Buffer | null>
|
|
23
25
|
/** Resolves the intrinsic string type for a project. */
|
|
24
|
-
|
|
25
|
-
|
|
26
|
+
getStringType(snapshot: string, project: string): any
|
|
27
|
+
getStringTypeAsync(snapshot: string, project: string): Promise<unknown>
|
|
26
28
|
/** Resolves the checker type visible at a file position. */
|
|
27
|
-
|
|
28
|
-
|
|
29
|
+
getTypeAtPosition(snapshot: string, project: string, file: string, position: number): any
|
|
30
|
+
getTypeAtPositionAsync(snapshot: string, project: string, file: string, position: number): Promise<unknown>
|
|
29
31
|
/** Resolves the checker symbol visible at a file position. */
|
|
30
|
-
|
|
31
|
-
|
|
32
|
+
getSymbolAtPosition(snapshot: string, project: string, file: string, position: number): any
|
|
33
|
+
getSymbolAtPositionAsync(snapshot: string, project: string, file: string, position: number): Promise<unknown>
|
|
32
34
|
/** Resolves type arguments for type-reference objects and returns [] otherwise. */
|
|
33
|
-
|
|
34
|
-
|
|
35
|
+
getTypeArguments(snapshot: string, project: string, typeHandle: string, objectFlags?: number | undefined | null): any
|
|
36
|
+
getTypeArgumentsAsync(snapshot: string, project: string, typeHandle: string, objectFlags?: number | undefined | null): Promise<unknown>
|
|
35
37
|
/** Resolves the apparent checker type of a symbol. */
|
|
36
|
-
|
|
37
|
-
|
|
38
|
+
getTypeOfSymbol(snapshot: string, project: string, symbol: string): any
|
|
39
|
+
getTypeOfSymbolAsync(snapshot: string, project: string, symbol: string): Promise<unknown>
|
|
38
40
|
/** Resolves the declared checker type of a symbol. */
|
|
39
|
-
|
|
40
|
-
|
|
41
|
+
getDeclaredTypeOfSymbol(snapshot: string, project: string, symbol: string): any
|
|
42
|
+
getDeclaredTypeOfSymbolAsync(snapshot: string, project: string, symbol: string): Promise<unknown>
|
|
41
43
|
/** Renders a type back to a string representation. */
|
|
42
44
|
typeToString(snapshot: string, project: string, typeHandle: string, location?: string | undefined | null, flags?: number | undefined | null): string
|
|
43
|
-
typeToStringAsync(snapshot: string, project: string, typeHandle: string, location?: string | undefined | null, flags?: number | undefined | null): Promise<
|
|
45
|
+
typeToStringAsync(snapshot: string, project: string, typeHandle: string, location?: string | undefined | null, flags?: number | undefined | null): Promise<unknown>
|
|
44
46
|
/** Sends an arbitrary JSON endpoint request. */
|
|
45
|
-
callJson(method: string,
|
|
47
|
+
callJson(method: string, params?: any | undefined | null): any
|
|
46
48
|
/** Sends an arbitrary JSON endpoint request on a libuv worker thread. */
|
|
47
|
-
callJsonAsync(method: string,
|
|
49
|
+
callJsonAsync(method: string, params?: any | undefined | null): Promise<unknown>
|
|
48
50
|
/** Sends an arbitrary binary endpoint request. */
|
|
49
|
-
callBinary(method: string,
|
|
51
|
+
callBinary(method: string, params?: any | undefined | null): Buffer | null
|
|
50
52
|
/** Sends an arbitrary binary endpoint request on a libuv worker thread. */
|
|
51
|
-
callBinaryAsync(method: string,
|
|
53
|
+
callBinaryAsync(method: string, params?: any | undefined | null): Promise<Buffer | null>
|
|
52
54
|
/** Releases a corsa handle explicitly. */
|
|
53
55
|
releaseHandle(handle: string): void
|
|
54
56
|
/** Releases a corsa handle on a libuv worker thread. */
|
|
@@ -67,18 +69,18 @@ export declare class CorsaDistributedOrchestrator {
|
|
|
67
69
|
campaign(nodeId: string): number
|
|
68
70
|
/** Returns the current leader identifier. */
|
|
69
71
|
leaderId(): string | null
|
|
70
|
-
/**
|
|
71
|
-
|
|
72
|
-
/**
|
|
73
|
-
|
|
74
|
-
/**
|
|
75
|
-
|
|
76
|
-
/** Replicates an opened document and returns the
|
|
77
|
-
|
|
78
|
-
/** Applies replicated incremental changes and returns the
|
|
79
|
-
|
|
72
|
+
/** Returns the leader state. */
|
|
73
|
+
state(): any | null
|
|
74
|
+
/** Returns the state for a single node. */
|
|
75
|
+
nodeState(nodeId: string): any | null
|
|
76
|
+
/** Returns a replicated document if it exists. */
|
|
77
|
+
document(nodeId: string, uri: string): any | null
|
|
78
|
+
/** Replicates an opened document and returns the state. */
|
|
79
|
+
openVirtualDocument(document: any): any
|
|
80
|
+
/** Applies replicated incremental changes and returns the state. */
|
|
81
|
+
changeVirtualDocument(uri: string, changes: any): any
|
|
80
82
|
/** Removes a replicated document. */
|
|
81
|
-
closeVirtualDocument(
|
|
83
|
+
closeVirtualDocument(uri: string): void
|
|
82
84
|
}
|
|
83
85
|
|
|
84
86
|
/** Mutable virtual document mirrored through the LSP overlay layer. */
|
|
@@ -95,12 +97,12 @@ export declare class CorsaVirtualDocument {
|
|
|
95
97
|
get version(): number
|
|
96
98
|
/** Returns the current full text. */
|
|
97
99
|
get text(): string
|
|
98
|
-
/**
|
|
99
|
-
|
|
100
|
+
/** Returns the full document state. */
|
|
101
|
+
state(): any
|
|
100
102
|
/** Replaces the entire document text. */
|
|
101
103
|
replace(text: string): void
|
|
102
|
-
/** Applies a batch of
|
|
103
|
-
|
|
104
|
+
/** Applies a batch of LSP changes. */
|
|
105
|
+
applyChanges(changes: any): any
|
|
104
106
|
}
|
|
105
107
|
|
|
106
108
|
export declare function classifyTypeText(text?: string | undefined | null): string
|
|
@@ -123,16 +125,16 @@ export declare function isStringLikeTypeTexts(typeTexts: Array<string>): boolean
|
|
|
123
125
|
|
|
124
126
|
export declare function isUnknownLikeTypeTexts(typeTexts: Array<string>): boolean
|
|
125
127
|
|
|
126
|
-
export declare function isUnsafeAssignment(
|
|
128
|
+
export declare function isUnsafeAssignment(input: any): boolean
|
|
127
129
|
|
|
128
|
-
export declare function isUnsafeReturn(
|
|
130
|
+
export declare function isUnsafeReturn(input: any): boolean
|
|
129
131
|
|
|
130
|
-
export declare function
|
|
132
|
+
export declare function nativeLintRuleMetas(): any
|
|
131
133
|
|
|
132
|
-
export declare function runNativeLintRule(ruleName: string,
|
|
134
|
+
export declare function runNativeLintRule(ruleName: string, node: any): any
|
|
133
135
|
|
|
134
136
|
/** Spawns a new client on a libuv worker thread. */
|
|
135
|
-
export declare function spawnCorsaApiClientAsync(
|
|
137
|
+
export declare function spawnCorsaApiClientAsync(options: any): Promise<CorsaApiClient>
|
|
136
138
|
|
|
137
139
|
export declare function splitTopLevelTypeText(text: string, delimiter: string): Array<string>
|
|
138
140
|
|