@corsa-bind/napi 0.15.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 +74 -70
- package/dist/index.mjs +22 -229
- 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/index.d.mts
CHANGED
|
@@ -3,99 +3,103 @@ import * as _$___index_js0 from "../index.js";
|
|
|
3
3
|
|
|
4
4
|
//#region index.d.ts
|
|
5
5
|
declare const binding: typeof _$___index_js0;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
declare function splitTopLevelTypeText(text: string, delimiter: string): string[];
|
|
12
|
-
declare function splitTypeText(text: string): string[];
|
|
13
|
-
declare function isStringLikeTypeTexts(typeTexts: readonly string[]): boolean;
|
|
14
|
-
declare function isNumberLikeTypeTexts(typeTexts: readonly string[]): boolean;
|
|
15
|
-
declare function isBigIntLikeTypeTexts(typeTexts: readonly string[]): boolean;
|
|
16
|
-
declare function isAnyLikeTypeTexts(typeTexts: readonly string[]): boolean;
|
|
17
|
-
declare function isUnknownLikeTypeTexts(typeTexts: readonly string[]): boolean;
|
|
18
|
-
declare function isArrayLikeTypeTexts(typeTexts: readonly string[]): boolean;
|
|
19
|
-
declare function isStringArrayLikeTypeTexts(typeTexts: readonly string[]): boolean;
|
|
20
|
-
declare function isPromiseLikeTypeTexts(typeTexts: readonly string[], propertyNames?: readonly string[]): boolean;
|
|
21
|
-
declare function isErrorLikeTypeTexts(typeTexts: readonly string[], propertyNames?: readonly string[]): boolean;
|
|
22
|
-
declare const Utils: Readonly<{
|
|
23
|
-
classifyTypeText: typeof classifyTypeText;
|
|
24
|
-
splitTopLevelTypeText: typeof splitTopLevelTypeText;
|
|
25
|
-
splitTypeText: typeof splitTypeText;
|
|
26
|
-
isStringLikeTypeTexts: typeof isStringLikeTypeTexts;
|
|
27
|
-
isNumberLikeTypeTexts: typeof isNumberLikeTypeTexts;
|
|
28
|
-
isBigIntLikeTypeTexts: typeof isBigIntLikeTypeTexts;
|
|
29
|
-
isAnyLikeTypeTexts: typeof isAnyLikeTypeTexts;
|
|
30
|
-
isUnknownLikeTypeTexts: typeof isUnknownLikeTypeTexts;
|
|
31
|
-
isArrayLikeTypeTexts: typeof isArrayLikeTypeTexts;
|
|
32
|
-
isStringArrayLikeTypeTexts: typeof isStringArrayLikeTypeTexts;
|
|
33
|
-
isPromiseLikeTypeTexts: typeof isPromiseLikeTypeTexts;
|
|
34
|
-
isErrorLikeTypeTexts: typeof isErrorLikeTypeTexts;
|
|
35
|
-
}>;
|
|
36
|
-
declare class CorsaApiClient {
|
|
37
|
-
#private;
|
|
38
|
-
private constructor();
|
|
39
|
-
static spawn(options: ApiClientOptions): CorsaApiClient;
|
|
40
|
-
static spawnAsync(options: ApiClientOptions): Promise<CorsaApiClient>;
|
|
6
|
+
type CorsaApiClientConstructor = {
|
|
7
|
+
spawn(options: ApiClientOptions): CorsaApiClient;
|
|
8
|
+
spawnAsync(options: ApiClientOptions): Promise<CorsaApiClient>;
|
|
9
|
+
};
|
|
10
|
+
interface CorsaApiClient {
|
|
41
11
|
initialize(): InitializeResponse;
|
|
42
12
|
initializeAsync(): Promise<InitializeResponse>;
|
|
43
13
|
parseConfigFile(file: string): ConfigResponse;
|
|
44
14
|
parseConfigFileAsync(file: string): Promise<ConfigResponse>;
|
|
45
15
|
updateSnapshot(params?: UpdateSnapshotParams): UpdateSnapshotResponse;
|
|
46
16
|
updateSnapshotAsync(params?: UpdateSnapshotParams): Promise<UpdateSnapshotResponse>;
|
|
47
|
-
getSourceFile(snapshot: string, project: string, file: string):
|
|
48
|
-
getSourceFileAsync(snapshot: string, project: string, file: string): Promise<
|
|
17
|
+
getSourceFile(snapshot: string, project: string, file: string): Buffer | null;
|
|
18
|
+
getSourceFileAsync(snapshot: string, project: string, file: string): Promise<Buffer | null>;
|
|
49
19
|
getStringType(snapshot: string, project: string): TypeResponse;
|
|
50
20
|
getStringTypeAsync(snapshot: string, project: string): Promise<TypeResponse>;
|
|
51
|
-
getTypeAtPosition(snapshot: string, project: string, file: string, position: number): TypeResponse |
|
|
52
|
-
getTypeAtPositionAsync(snapshot: string, project: string, file: string, position: number): Promise<TypeResponse |
|
|
53
|
-
getSymbolAtPosition(snapshot: string, project: string, file: string, position: number): SymbolResponse |
|
|
54
|
-
getSymbolAtPositionAsync(snapshot: string, project: string, file: string, position: number): Promise<SymbolResponse |
|
|
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>;
|
|
55
25
|
getTypeArguments(snapshot: string, project: string, typeHandle: string, objectFlags?: number): TypeResponse[];
|
|
56
26
|
getTypeArgumentsAsync(snapshot: string, project: string, typeHandle: string, objectFlags?: number): Promise<TypeResponse[]>;
|
|
57
|
-
getTypeOfSymbol(snapshot: string, project: string, symbol: string): TypeResponse |
|
|
58
|
-
getTypeOfSymbolAsync(snapshot: string, project: string, symbol: string): Promise<TypeResponse |
|
|
59
|
-
getDeclaredTypeOfSymbol(snapshot: string, project: string, symbol: string): TypeResponse |
|
|
60
|
-
getDeclaredTypeOfSymbolAsync(snapshot: string, project: string, symbol: string): 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>;
|
|
61
31
|
typeToString(snapshot: string, project: string, typeHandle: string, location?: string, flags?: number): string;
|
|
62
32
|
typeToStringAsync(snapshot: string, project: string, typeHandle: string, location?: string, flags?: number): Promise<string>;
|
|
63
33
|
callJson<T>(method: string, params?: unknown): T;
|
|
64
34
|
callJsonAsync<T>(method: string, params?: unknown): Promise<T>;
|
|
65
|
-
callBinary(method: string, params?: unknown):
|
|
66
|
-
callBinaryAsync(method: string, params?: unknown): Promise<
|
|
35
|
+
callBinary(method: string, params?: unknown): Buffer | null;
|
|
36
|
+
callBinaryAsync(method: string, params?: unknown): Promise<Buffer | null>;
|
|
67
37
|
releaseHandle(handle: string): void;
|
|
68
38
|
releaseHandleAsync(handle: string): Promise<void>;
|
|
69
39
|
close(): void;
|
|
70
40
|
closeAsync(): Promise<void>;
|
|
71
41
|
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
static inMemory(authority: string, path: string, languageId: string, text: string): CorsaVirtualDocument;
|
|
77
|
-
get uri(): string;
|
|
78
|
-
get languageId(): string;
|
|
79
|
-
get version(): number;
|
|
80
|
-
get text(): string;
|
|
81
|
-
state(): VirtualDocumentState;
|
|
82
|
-
replace(text: string): void;
|
|
83
|
-
applyChanges(changes: VirtualChange[]): unknown[];
|
|
84
|
-
}
|
|
85
|
-
declare class CorsaDistributedOrchestrator {
|
|
86
|
-
#private;
|
|
87
|
-
constructor(nodeIds: string[]);
|
|
42
|
+
type CorsaDistributedOrchestratorConstructor = {
|
|
43
|
+
new (nodeIds: string[]): CorsaDistributedOrchestrator;
|
|
44
|
+
};
|
|
45
|
+
interface CorsaDistributedOrchestrator {
|
|
88
46
|
campaign(nodeId: string): number;
|
|
89
|
-
leaderId(): string |
|
|
90
|
-
state<T>(): T |
|
|
91
|
-
nodeState<T>(nodeId: string): T |
|
|
92
|
-
document(nodeId: string, uri: string): VirtualDocumentState |
|
|
47
|
+
leaderId(): string | null;
|
|
48
|
+
state<T>(): T | null;
|
|
49
|
+
nodeState<T>(nodeId: string): T | null;
|
|
50
|
+
document(nodeId: string, uri: string): VirtualDocumentState | null;
|
|
93
51
|
openVirtualDocument(document: VirtualDocumentState): VirtualDocumentState;
|
|
94
52
|
changeVirtualDocument(uri: string, changes: VirtualChange[]): VirtualDocumentState;
|
|
95
53
|
closeVirtualDocument(uri: string): void;
|
|
96
|
-
private requireLeader;
|
|
97
54
|
}
|
|
98
|
-
|
|
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
|
+
}>;
|
|
99
103
|
//#endregion
|
|
100
|
-
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, splitTopLevelTypeText, splitTypeText, 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 };
|
|
101
105
|
//# sourceMappingURL=index.d.mts.map
|
package/dist/index.mjs
CHANGED
|
@@ -1,60 +1,27 @@
|
|
|
1
1
|
import * as nativeModule from "../index.js";
|
|
2
2
|
//#region index.ts
|
|
3
3
|
const binding = "default" in nativeModule ? nativeModule.default : nativeModule;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
function splitTopLevelTypeText(text, delimiter) {
|
|
26
|
-
return binding.splitTopLevelTypeText(text, delimiter);
|
|
27
|
-
}
|
|
28
|
-
function splitTypeText(text) {
|
|
29
|
-
return binding.splitTypeText(text);
|
|
30
|
-
}
|
|
31
|
-
function isStringLikeTypeTexts(typeTexts) {
|
|
32
|
-
return binding.isStringLikeTypeTexts([...typeTexts]);
|
|
33
|
-
}
|
|
34
|
-
function isNumberLikeTypeTexts(typeTexts) {
|
|
35
|
-
return binding.isNumberLikeTypeTexts([...typeTexts]);
|
|
36
|
-
}
|
|
37
|
-
function isBigIntLikeTypeTexts(typeTexts) {
|
|
38
|
-
return binding.isBigIntLikeTypeTexts([...typeTexts]);
|
|
39
|
-
}
|
|
40
|
-
function isAnyLikeTypeTexts(typeTexts) {
|
|
41
|
-
return binding.isAnyLikeTypeTexts([...typeTexts]);
|
|
42
|
-
}
|
|
43
|
-
function isUnknownLikeTypeTexts(typeTexts) {
|
|
44
|
-
return binding.isUnknownLikeTypeTexts([...typeTexts]);
|
|
45
|
-
}
|
|
46
|
-
function isArrayLikeTypeTexts(typeTexts) {
|
|
47
|
-
return binding.isArrayLikeTypeTexts([...typeTexts]);
|
|
48
|
-
}
|
|
49
|
-
function isStringArrayLikeTypeTexts(typeTexts) {
|
|
50
|
-
return binding.isStringArrayLikeTypeTexts([...typeTexts]);
|
|
51
|
-
}
|
|
52
|
-
function isPromiseLikeTypeTexts(typeTexts, propertyNames = []) {
|
|
53
|
-
return binding.isPromiseLikeTypeTexts([...typeTexts], [...propertyNames]);
|
|
54
|
-
}
|
|
55
|
-
function isErrorLikeTypeTexts(typeTexts, propertyNames = []) {
|
|
56
|
-
return binding.isErrorLikeTypeTexts([...typeTexts], [...propertyNames]);
|
|
57
|
-
}
|
|
4
|
+
const CorsaApiClient = binding.CorsaApiClient;
|
|
5
|
+
const CorsaDistributedOrchestrator = binding.CorsaDistributedOrchestrator;
|
|
6
|
+
const CorsaVirtualDocument = binding.CorsaVirtualDocument;
|
|
7
|
+
const version = binding.version;
|
|
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;
|
|
58
25
|
const Utils = Object.freeze({
|
|
59
26
|
classifyTypeText,
|
|
60
27
|
splitTopLevelTypeText,
|
|
@@ -69,181 +36,7 @@ const Utils = Object.freeze({
|
|
|
69
36
|
isPromiseLikeTypeTexts,
|
|
70
37
|
isErrorLikeTypeTexts
|
|
71
38
|
});
|
|
72
|
-
var CorsaApiClient = class CorsaApiClient {
|
|
73
|
-
#inner;
|
|
74
|
-
constructor(inner) {
|
|
75
|
-
this.#inner = inner;
|
|
76
|
-
}
|
|
77
|
-
static spawn(options) {
|
|
78
|
-
return new CorsaApiClient(binding.CorsaApiClient.spawn(toJson(options)));
|
|
79
|
-
}
|
|
80
|
-
static async spawnAsync(options) {
|
|
81
|
-
return new CorsaApiClient(await binding.spawnCorsaApiClientAsync(toJson(options)));
|
|
82
|
-
}
|
|
83
|
-
initialize() {
|
|
84
|
-
return fromJson(this.#inner.initializeJson());
|
|
85
|
-
}
|
|
86
|
-
async initializeAsync() {
|
|
87
|
-
return fromJson(await this.#inner.initializeJsonAsync());
|
|
88
|
-
}
|
|
89
|
-
parseConfigFile(file) {
|
|
90
|
-
return fromJson(this.#inner.parseConfigFileJson(file));
|
|
91
|
-
}
|
|
92
|
-
async parseConfigFileAsync(file) {
|
|
93
|
-
return fromJson(await this.#inner.parseConfigFileJsonAsync(file));
|
|
94
|
-
}
|
|
95
|
-
updateSnapshot(params) {
|
|
96
|
-
return fromJson(this.#inner.updateSnapshotJson(params ? toJson(params) : void 0));
|
|
97
|
-
}
|
|
98
|
-
async updateSnapshotAsync(params) {
|
|
99
|
-
return fromJson(await this.#inner.updateSnapshotJsonAsync(params ? toJson(params) : void 0));
|
|
100
|
-
}
|
|
101
|
-
getSourceFile(snapshot, project, file) {
|
|
102
|
-
return this.#inner.getSourceFile(snapshot, project, file) ?? null;
|
|
103
|
-
}
|
|
104
|
-
async getSourceFileAsync(snapshot, project, file) {
|
|
105
|
-
return await this.#inner.getSourceFileAsync(snapshot, project, file) ?? null;
|
|
106
|
-
}
|
|
107
|
-
getStringType(snapshot, project) {
|
|
108
|
-
return fromJson(this.#inner.getStringTypeJson(snapshot, project));
|
|
109
|
-
}
|
|
110
|
-
async getStringTypeAsync(snapshot, project) {
|
|
111
|
-
return fromJson(await this.#inner.getStringTypeJsonAsync(snapshot, project));
|
|
112
|
-
}
|
|
113
|
-
getTypeAtPosition(snapshot, project, file, position) {
|
|
114
|
-
return fromJson(this.#inner.getTypeAtPositionJson(snapshot, project, file, position)) ?? void 0;
|
|
115
|
-
}
|
|
116
|
-
async getTypeAtPositionAsync(snapshot, project, file, position) {
|
|
117
|
-
return fromJson(await this.#inner.getTypeAtPositionJsonAsync(snapshot, project, file, position)) ?? void 0;
|
|
118
|
-
}
|
|
119
|
-
getSymbolAtPosition(snapshot, project, file, position) {
|
|
120
|
-
return fromJson(this.#inner.getSymbolAtPositionJson(snapshot, project, file, position)) ?? void 0;
|
|
121
|
-
}
|
|
122
|
-
async getSymbolAtPositionAsync(snapshot, project, file, position) {
|
|
123
|
-
return fromJson(await this.#inner.getSymbolAtPositionJsonAsync(snapshot, project, file, position)) ?? void 0;
|
|
124
|
-
}
|
|
125
|
-
getTypeArguments(snapshot, project, typeHandle, objectFlags) {
|
|
126
|
-
return fromJson(this.#inner.getTypeArgumentsJson(snapshot, project, typeHandle, objectFlags));
|
|
127
|
-
}
|
|
128
|
-
async getTypeArgumentsAsync(snapshot, project, typeHandle, objectFlags) {
|
|
129
|
-
return fromJson(await this.#inner.getTypeArgumentsJsonAsync(snapshot, project, typeHandle, objectFlags));
|
|
130
|
-
}
|
|
131
|
-
getTypeOfSymbol(snapshot, project, symbol) {
|
|
132
|
-
return fromJson(this.#inner.getTypeOfSymbolJson(snapshot, project, symbol)) ?? void 0;
|
|
133
|
-
}
|
|
134
|
-
async getTypeOfSymbolAsync(snapshot, project, symbol) {
|
|
135
|
-
return fromJson(await this.#inner.getTypeOfSymbolJsonAsync(snapshot, project, symbol)) ?? void 0;
|
|
136
|
-
}
|
|
137
|
-
getDeclaredTypeOfSymbol(snapshot, project, symbol) {
|
|
138
|
-
return fromJson(this.#inner.getDeclaredTypeOfSymbolJson(snapshot, project, symbol)) ?? void 0;
|
|
139
|
-
}
|
|
140
|
-
async getDeclaredTypeOfSymbolAsync(snapshot, project, symbol) {
|
|
141
|
-
return fromJson(await this.#inner.getDeclaredTypeOfSymbolJsonAsync(snapshot, project, symbol)) ?? void 0;
|
|
142
|
-
}
|
|
143
|
-
typeToString(snapshot, project, typeHandle, location, flags) {
|
|
144
|
-
return this.#inner.typeToString(snapshot, project, typeHandle, location, flags);
|
|
145
|
-
}
|
|
146
|
-
async typeToStringAsync(snapshot, project, typeHandle, location, flags) {
|
|
147
|
-
return this.#inner.typeToStringAsync(snapshot, project, typeHandle, location, flags);
|
|
148
|
-
}
|
|
149
|
-
callJson(method, params) {
|
|
150
|
-
return fromJson(this.#inner.callJson(method, params ? toJson(params) : void 0));
|
|
151
|
-
}
|
|
152
|
-
async callJsonAsync(method, params) {
|
|
153
|
-
return fromJson(await this.#inner.callJsonAsync(method, params ? toJson(params) : void 0));
|
|
154
|
-
}
|
|
155
|
-
callBinary(method, params) {
|
|
156
|
-
return this.#inner.callBinary(method, params ? toJson(params) : void 0) ?? null;
|
|
157
|
-
}
|
|
158
|
-
async callBinaryAsync(method, params) {
|
|
159
|
-
return await this.#inner.callBinaryAsync(method, params ? toJson(params) : void 0) ?? null;
|
|
160
|
-
}
|
|
161
|
-
releaseHandle(handle) {
|
|
162
|
-
this.#inner.releaseHandle(handle);
|
|
163
|
-
}
|
|
164
|
-
async releaseHandleAsync(handle) {
|
|
165
|
-
await this.#inner.releaseHandleAsync(handle);
|
|
166
|
-
}
|
|
167
|
-
close() {
|
|
168
|
-
this.#inner.close();
|
|
169
|
-
}
|
|
170
|
-
async closeAsync() {
|
|
171
|
-
await this.#inner.closeAsync();
|
|
172
|
-
}
|
|
173
|
-
};
|
|
174
|
-
var CorsaVirtualDocument = class CorsaVirtualDocument {
|
|
175
|
-
#inner;
|
|
176
|
-
constructor(inner) {
|
|
177
|
-
this.#inner = inner;
|
|
178
|
-
}
|
|
179
|
-
static untitled(path, languageId, text) {
|
|
180
|
-
return new CorsaVirtualDocument(binding.CorsaVirtualDocument.untitled(path, languageId, text));
|
|
181
|
-
}
|
|
182
|
-
static inMemory(authority, path, languageId, text) {
|
|
183
|
-
return new CorsaVirtualDocument(binding.CorsaVirtualDocument.inMemory(authority, path, languageId, text));
|
|
184
|
-
}
|
|
185
|
-
get uri() {
|
|
186
|
-
return this.#inner.uri;
|
|
187
|
-
}
|
|
188
|
-
get languageId() {
|
|
189
|
-
return this.#inner.languageId;
|
|
190
|
-
}
|
|
191
|
-
get version() {
|
|
192
|
-
return this.#inner.version;
|
|
193
|
-
}
|
|
194
|
-
get text() {
|
|
195
|
-
return this.#inner.text;
|
|
196
|
-
}
|
|
197
|
-
state() {
|
|
198
|
-
return fromJson(this.#inner.stateJson());
|
|
199
|
-
}
|
|
200
|
-
replace(text) {
|
|
201
|
-
this.#inner.replace(text);
|
|
202
|
-
}
|
|
203
|
-
applyChanges(changes) {
|
|
204
|
-
return fromJson(this.#inner.applyChangesJson(toJson(changes)));
|
|
205
|
-
}
|
|
206
|
-
};
|
|
207
|
-
var CorsaDistributedOrchestrator = class {
|
|
208
|
-
#inner;
|
|
209
|
-
constructor(nodeIds) {
|
|
210
|
-
this.#inner = new binding.CorsaDistributedOrchestrator(nodeIds);
|
|
211
|
-
}
|
|
212
|
-
campaign(nodeId) {
|
|
213
|
-
return this.#inner.campaign(nodeId);
|
|
214
|
-
}
|
|
215
|
-
leaderId() {
|
|
216
|
-
return this.#inner.leaderId() ?? void 0;
|
|
217
|
-
}
|
|
218
|
-
state() {
|
|
219
|
-
const value = this.#inner.stateJson();
|
|
220
|
-
return value ? fromJson(value) : void 0;
|
|
221
|
-
}
|
|
222
|
-
nodeState(nodeId) {
|
|
223
|
-
const value = this.#inner.nodeStateJson(nodeId);
|
|
224
|
-
return value ? fromJson(value) : void 0;
|
|
225
|
-
}
|
|
226
|
-
document(nodeId, uri) {
|
|
227
|
-
const value = this.#inner.documentJson(nodeId, uri);
|
|
228
|
-
return value ? fromJson(value) : void 0;
|
|
229
|
-
}
|
|
230
|
-
openVirtualDocument(document) {
|
|
231
|
-
return fromJson(this.#inner.openVirtualDocumentJson(this.requireLeader(), toJson(document)));
|
|
232
|
-
}
|
|
233
|
-
changeVirtualDocument(uri, changes) {
|
|
234
|
-
return fromJson(this.#inner.changeVirtualDocumentJson(this.requireLeader(), uri, toJson(changes)));
|
|
235
|
-
}
|
|
236
|
-
closeVirtualDocument(uri) {
|
|
237
|
-
this.#inner.closeVirtualDocument(this.requireLeader(), uri);
|
|
238
|
-
}
|
|
239
|
-
requireLeader() {
|
|
240
|
-
const leaderId = this.leaderId();
|
|
241
|
-
if (!leaderId) throw new Error("raft leader has not been elected");
|
|
242
|
-
return leaderId;
|
|
243
|
-
}
|
|
244
|
-
};
|
|
245
|
-
const version = binding.version;
|
|
246
39
|
//#endregion
|
|
247
|
-
export { CorsaApiClient, CorsaDistributedOrchestrator, CorsaVirtualDocument, Utils, classifyTypeText, binding as default, isAnyLikeTypeTexts, isArrayLikeTypeTexts, isBigIntLikeTypeTexts, isErrorLikeTypeTexts, isNumberLikeTypeTexts, isPromiseLikeTypeTexts, isStringArrayLikeTypeTexts, isStringLikeTypeTexts, isUnknownLikeTypeTexts, isUnsafeAssignment, isUnsafeReturn, nativeLintRuleMetas, runNativeLintRule, splitTopLevelTypeText, splitTypeText, version };
|
|
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 };
|
|
248
41
|
|
|
249
42
|
//# sourceMappingURL=index.mjs.map
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":["#inner"],"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 TypeTextKind,\n TypeResponse,\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 NativeApiClient = InstanceType<typeof binding.CorsaApiClient>;\ntype NativeDistributedOrchestrator = InstanceType<typeof binding.CorsaDistributedOrchestrator>;\ntype NativeVirtualDocument = InstanceType<typeof binding.CorsaVirtualDocument>;\n\nfunction fromJson<T>(value: string): T {\n return JSON.parse(value) as T;\n}\n\nfunction toJson(value: unknown): string {\n return JSON.stringify(value ?? null);\n}\n\nexport function isUnsafeAssignment(input: UnsafeTypeFlowInput): boolean {\n return binding.isUnsafeAssignment(toJson(input));\n}\n\nexport function isUnsafeReturn(input: UnsafeTypeFlowInput): boolean {\n return binding.isUnsafeReturn(toJson(input));\n}\n\nexport function runNativeLintRule(ruleName: string, node: NativeLintNode): NativeLintDiagnostic[] {\n return fromJson(binding.runNativeLintRule(ruleName, toJson(node)));\n}\n\nexport function nativeLintRuleMetas(): NativeLintRuleMeta[] {\n return fromJson(binding.nativeLintRuleMetasJson());\n}\n\nexport function classifyTypeText(text?: string): TypeTextKind {\n return binding.classifyTypeText(text) as TypeTextKind;\n}\n\nexport function splitTopLevelTypeText(text: string, delimiter: string): string[] {\n return binding.splitTopLevelTypeText(text, delimiter);\n}\n\nexport function splitTypeText(text: string): string[] {\n return binding.splitTypeText(text);\n}\n\nexport function isStringLikeTypeTexts(typeTexts: readonly string[]): boolean {\n return binding.isStringLikeTypeTexts([...typeTexts]);\n}\n\nexport function isNumberLikeTypeTexts(typeTexts: readonly string[]): boolean {\n return binding.isNumberLikeTypeTexts([...typeTexts]);\n}\n\nexport function isBigIntLikeTypeTexts(typeTexts: readonly string[]): boolean {\n return binding.isBigIntLikeTypeTexts([...typeTexts]);\n}\n\nexport function isAnyLikeTypeTexts(typeTexts: readonly string[]): boolean {\n return binding.isAnyLikeTypeTexts([...typeTexts]);\n}\n\nexport function isUnknownLikeTypeTexts(typeTexts: readonly string[]): boolean {\n return binding.isUnknownLikeTypeTexts([...typeTexts]);\n}\n\nexport function isArrayLikeTypeTexts(typeTexts: readonly string[]): boolean {\n return binding.isArrayLikeTypeTexts([...typeTexts]);\n}\n\nexport function isStringArrayLikeTypeTexts(typeTexts: readonly string[]): boolean {\n return binding.isStringArrayLikeTypeTexts([...typeTexts]);\n}\n\nexport function isPromiseLikeTypeTexts(\n typeTexts: readonly string[],\n propertyNames: readonly string[] = [],\n): boolean {\n return binding.isPromiseLikeTypeTexts([...typeTexts], [...propertyNames]);\n}\n\nexport function isErrorLikeTypeTexts(\n typeTexts: readonly string[],\n propertyNames: readonly string[] = [],\n): boolean {\n return binding.isErrorLikeTypeTexts([...typeTexts], [...propertyNames]);\n}\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 class CorsaApiClient {\n readonly #inner: NativeApiClient;\n\n private constructor(inner: NativeApiClient) {\n this.#inner = inner;\n }\n\n static spawn(options: ApiClientOptions): CorsaApiClient {\n return new CorsaApiClient(binding.CorsaApiClient.spawn(toJson(options)));\n }\n\n static async spawnAsync(options: ApiClientOptions): Promise<CorsaApiClient> {\n return new CorsaApiClient(await binding.spawnCorsaApiClientAsync(toJson(options)));\n }\n\n initialize(): InitializeResponse {\n return fromJson(this.#inner.initializeJson());\n }\n\n async initializeAsync(): Promise<InitializeResponse> {\n return fromJson(await this.#inner.initializeJsonAsync());\n }\n\n parseConfigFile(file: string): ConfigResponse {\n return fromJson(this.#inner.parseConfigFileJson(file));\n }\n\n async parseConfigFileAsync(file: string): Promise<ConfigResponse> {\n return fromJson(await this.#inner.parseConfigFileJsonAsync(file));\n }\n\n updateSnapshot(params?: UpdateSnapshotParams): UpdateSnapshotResponse {\n return fromJson(this.#inner.updateSnapshotJson(params ? toJson(params) : undefined));\n }\n\n async updateSnapshotAsync(params?: UpdateSnapshotParams): Promise<UpdateSnapshotResponse> {\n return fromJson(await this.#inner.updateSnapshotJsonAsync(params ? toJson(params) : undefined));\n }\n\n getSourceFile(snapshot: string, project: string, file: string): Uint8Array | null {\n return this.#inner.getSourceFile(snapshot, project, file) ?? null;\n }\n\n async getSourceFileAsync(\n snapshot: string,\n project: string,\n file: string,\n ): Promise<Uint8Array | null> {\n return (await this.#inner.getSourceFileAsync(snapshot, project, file)) ?? null;\n }\n\n getStringType(snapshot: string, project: string): TypeResponse {\n return fromJson(this.#inner.getStringTypeJson(snapshot, project));\n }\n\n async getStringTypeAsync(snapshot: string, project: string): Promise<TypeResponse> {\n return fromJson(await this.#inner.getStringTypeJsonAsync(snapshot, project));\n }\n\n getTypeAtPosition(\n snapshot: string,\n project: string,\n file: string,\n position: number,\n ): TypeResponse | undefined {\n return (\n fromJson<TypeResponse | null>(\n this.#inner.getTypeAtPositionJson(snapshot, project, file, position),\n ) ?? undefined\n );\n }\n\n async getTypeAtPositionAsync(\n snapshot: string,\n project: string,\n file: string,\n position: number,\n ): Promise<TypeResponse | undefined> {\n return (\n fromJson<TypeResponse | null>(\n await this.#inner.getTypeAtPositionJsonAsync(snapshot, project, file, position),\n ) ?? undefined\n );\n }\n\n getSymbolAtPosition(\n snapshot: string,\n project: string,\n file: string,\n position: number,\n ): SymbolResponse | undefined {\n return (\n fromJson<SymbolResponse | null>(\n this.#inner.getSymbolAtPositionJson(snapshot, project, file, position),\n ) ?? undefined\n );\n }\n\n async getSymbolAtPositionAsync(\n snapshot: string,\n project: string,\n file: string,\n position: number,\n ): Promise<SymbolResponse | undefined> {\n return (\n fromJson<SymbolResponse | null>(\n await this.#inner.getSymbolAtPositionJsonAsync(snapshot, project, file, position),\n ) ?? undefined\n );\n }\n\n getTypeArguments(\n snapshot: string,\n project: string,\n typeHandle: string,\n objectFlags?: number,\n ): TypeResponse[] {\n return fromJson(this.#inner.getTypeArgumentsJson(snapshot, project, typeHandle, objectFlags));\n }\n\n async getTypeArgumentsAsync(\n snapshot: string,\n project: string,\n typeHandle: string,\n objectFlags?: number,\n ): Promise<TypeResponse[]> {\n return fromJson(\n await this.#inner.getTypeArgumentsJsonAsync(snapshot, project, typeHandle, objectFlags),\n );\n }\n\n getTypeOfSymbol(snapshot: string, project: string, symbol: string): TypeResponse | undefined {\n return (\n fromJson<TypeResponse | null>(this.#inner.getTypeOfSymbolJson(snapshot, project, symbol)) ??\n undefined\n );\n }\n\n async getTypeOfSymbolAsync(\n snapshot: string,\n project: string,\n symbol: string,\n ): Promise<TypeResponse | undefined> {\n return (\n fromJson<TypeResponse | null>(\n await this.#inner.getTypeOfSymbolJsonAsync(snapshot, project, symbol),\n ) ?? undefined\n );\n }\n\n getDeclaredTypeOfSymbol(\n snapshot: string,\n project: string,\n symbol: string,\n ): TypeResponse | undefined {\n return (\n fromJson<TypeResponse | null>(\n this.#inner.getDeclaredTypeOfSymbolJson(snapshot, project, symbol),\n ) ?? undefined\n );\n }\n\n async getDeclaredTypeOfSymbolAsync(\n snapshot: string,\n project: string,\n symbol: string,\n ): Promise<TypeResponse | undefined> {\n return (\n fromJson<TypeResponse | null>(\n await this.#inner.getDeclaredTypeOfSymbolJsonAsync(snapshot, project, symbol),\n ) ?? undefined\n );\n }\n\n typeToString(\n snapshot: string,\n project: string,\n typeHandle: string,\n location?: string,\n flags?: number,\n ): string {\n return this.#inner.typeToString(snapshot, project, typeHandle, location, flags);\n }\n\n async typeToStringAsync(\n snapshot: string,\n project: string,\n typeHandle: string,\n location?: string,\n flags?: number,\n ): Promise<string> {\n return this.#inner.typeToStringAsync(snapshot, project, typeHandle, location, flags);\n }\n\n callJson<T>(method: string, params?: unknown): T {\n return fromJson(this.#inner.callJson(method, params ? toJson(params) : undefined));\n }\n\n async callJsonAsync<T>(method: string, params?: unknown): Promise<T> {\n return fromJson(await this.#inner.callJsonAsync(method, params ? toJson(params) : undefined));\n }\n\n callBinary(method: string, params?: unknown): Uint8Array | null {\n return this.#inner.callBinary(method, params ? toJson(params) : undefined) ?? null;\n }\n\n async callBinaryAsync(method: string, params?: unknown): Promise<Uint8Array | null> {\n return (await this.#inner.callBinaryAsync(method, params ? toJson(params) : undefined)) ?? null;\n }\n\n releaseHandle(handle: string): void {\n this.#inner.releaseHandle(handle);\n }\n\n async releaseHandleAsync(handle: string): Promise<void> {\n await this.#inner.releaseHandleAsync(handle);\n }\n\n close(): void {\n this.#inner.close();\n }\n\n async closeAsync(): Promise<void> {\n await this.#inner.closeAsync();\n }\n}\n\nexport class CorsaVirtualDocument {\n readonly #inner: NativeVirtualDocument;\n\n private constructor(inner: NativeVirtualDocument) {\n this.#inner = inner;\n }\n\n static untitled(path: string, languageId: string, text: string): CorsaVirtualDocument {\n return new CorsaVirtualDocument(binding.CorsaVirtualDocument.untitled(path, languageId, text));\n }\n\n static inMemory(\n authority: string,\n path: string,\n languageId: string,\n text: string,\n ): CorsaVirtualDocument {\n return new CorsaVirtualDocument(\n binding.CorsaVirtualDocument.inMemory(authority, path, languageId, text),\n );\n }\n\n get uri(): string {\n return this.#inner.uri;\n }\n\n get languageId(): string {\n return this.#inner.languageId;\n }\n\n get version(): number {\n return this.#inner.version;\n }\n\n get text(): string {\n return this.#inner.text;\n }\n\n state(): VirtualDocumentState {\n return fromJson(this.#inner.stateJson());\n }\n\n replace(text: string): void {\n this.#inner.replace(text);\n }\n\n applyChanges(changes: VirtualChange[]): unknown[] {\n return fromJson(this.#inner.applyChangesJson(toJson(changes)));\n }\n}\n\nexport class CorsaDistributedOrchestrator {\n readonly #inner: NativeDistributedOrchestrator;\n\n constructor(nodeIds: string[]) {\n this.#inner = new binding.CorsaDistributedOrchestrator(nodeIds);\n }\n\n campaign(nodeId: string): number {\n return this.#inner.campaign(nodeId);\n }\n\n leaderId(): string | undefined {\n return this.#inner.leaderId() ?? undefined;\n }\n\n state<T>(): T | undefined {\n const value = this.#inner.stateJson();\n return value ? fromJson<T>(value) : undefined;\n }\n\n nodeState<T>(nodeId: string): T | undefined {\n const value = this.#inner.nodeStateJson(nodeId);\n return value ? fromJson<T>(value) : undefined;\n }\n\n document(nodeId: string, uri: string): VirtualDocumentState | undefined {\n const value = this.#inner.documentJson(nodeId, uri);\n return value ? fromJson<VirtualDocumentState>(value) : undefined;\n }\n\n openVirtualDocument(document: VirtualDocumentState): VirtualDocumentState {\n return fromJson(this.#inner.openVirtualDocumentJson(this.requireLeader(), toJson(document)));\n }\n\n changeVirtualDocument(uri: string, changes: VirtualChange[]): VirtualDocumentState {\n return fromJson(\n this.#inner.changeVirtualDocumentJson(this.requireLeader(), uri, toJson(changes)),\n );\n }\n\n closeVirtualDocument(uri: string): void {\n this.#inner.closeVirtualDocument(this.requireLeader(), uri);\n }\n\n private requireLeader(): string {\n const leaderId = this.leaderId();\n if (!leaderId) {\n throw new Error(\"raft leader has not been elected\");\n }\n return leaderId;\n }\n}\n\nexport default binding;\nexport const version = binding.version;\nexport type * from \"./types\";\n"],"mappings":"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"}
|
|
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
|
|
package/index.js
CHANGED
|
@@ -77,8 +77,8 @@ function requireNative() {
|
|
|
77
77
|
try {
|
|
78
78
|
const binding = require('@corsa-bind/napi-android-arm64')
|
|
79
79
|
const bindingPackageVersion = require('@corsa-bind/napi-android-arm64/package.json').version
|
|
80
|
-
if (bindingPackageVersion !== '0.
|
|
81
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
80
|
+
if (bindingPackageVersion !== '0.17.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
81
|
+
throw new Error(`Native binding package version mismatch, expected 0.17.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
82
82
|
}
|
|
83
83
|
return binding
|
|
84
84
|
} catch (e) {
|
|
@@ -93,8 +93,8 @@ function requireNative() {
|
|
|
93
93
|
try {
|
|
94
94
|
const binding = require('@corsa-bind/napi-android-arm-eabi')
|
|
95
95
|
const bindingPackageVersion = require('@corsa-bind/napi-android-arm-eabi/package.json').version
|
|
96
|
-
if (bindingPackageVersion !== '0.
|
|
97
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
96
|
+
if (bindingPackageVersion !== '0.17.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
97
|
+
throw new Error(`Native binding package version mismatch, expected 0.17.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
98
98
|
}
|
|
99
99
|
return binding
|
|
100
100
|
} catch (e) {
|
|
@@ -114,8 +114,8 @@ function requireNative() {
|
|
|
114
114
|
try {
|
|
115
115
|
const binding = require('@corsa-bind/napi-win32-x64-gnu')
|
|
116
116
|
const bindingPackageVersion = require('@corsa-bind/napi-win32-x64-gnu/package.json').version
|
|
117
|
-
if (bindingPackageVersion !== '0.
|
|
118
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
117
|
+
if (bindingPackageVersion !== '0.17.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
118
|
+
throw new Error(`Native binding package version mismatch, expected 0.17.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
119
119
|
}
|
|
120
120
|
return binding
|
|
121
121
|
} catch (e) {
|
|
@@ -130,8 +130,8 @@ function requireNative() {
|
|
|
130
130
|
try {
|
|
131
131
|
const binding = require('@corsa-bind/napi-win32-x64-msvc')
|
|
132
132
|
const bindingPackageVersion = require('@corsa-bind/napi-win32-x64-msvc/package.json').version
|
|
133
|
-
if (bindingPackageVersion !== '0.
|
|
134
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
133
|
+
if (bindingPackageVersion !== '0.17.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
134
|
+
throw new Error(`Native binding package version mismatch, expected 0.17.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
135
135
|
}
|
|
136
136
|
return binding
|
|
137
137
|
} catch (e) {
|
|
@@ -147,8 +147,8 @@ function requireNative() {
|
|
|
147
147
|
try {
|
|
148
148
|
const binding = require('@corsa-bind/napi-win32-ia32-msvc')
|
|
149
149
|
const bindingPackageVersion = require('@corsa-bind/napi-win32-ia32-msvc/package.json').version
|
|
150
|
-
if (bindingPackageVersion !== '0.
|
|
151
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
150
|
+
if (bindingPackageVersion !== '0.17.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
151
|
+
throw new Error(`Native binding package version mismatch, expected 0.17.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
152
152
|
}
|
|
153
153
|
return binding
|
|
154
154
|
} catch (e) {
|
|
@@ -163,8 +163,8 @@ function requireNative() {
|
|
|
163
163
|
try {
|
|
164
164
|
const binding = require('@corsa-bind/napi-win32-arm64-msvc')
|
|
165
165
|
const bindingPackageVersion = require('@corsa-bind/napi-win32-arm64-msvc/package.json').version
|
|
166
|
-
if (bindingPackageVersion !== '0.
|
|
167
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
166
|
+
if (bindingPackageVersion !== '0.17.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
167
|
+
throw new Error(`Native binding package version mismatch, expected 0.17.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
168
168
|
}
|
|
169
169
|
return binding
|
|
170
170
|
} catch (e) {
|
|
@@ -182,8 +182,8 @@ function requireNative() {
|
|
|
182
182
|
try {
|
|
183
183
|
const binding = require('@corsa-bind/napi-darwin-universal')
|
|
184
184
|
const bindingPackageVersion = require('@corsa-bind/napi-darwin-universal/package.json').version
|
|
185
|
-
if (bindingPackageVersion !== '0.
|
|
186
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
185
|
+
if (bindingPackageVersion !== '0.17.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
186
|
+
throw new Error(`Native binding package version mismatch, expected 0.17.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
187
187
|
}
|
|
188
188
|
return binding
|
|
189
189
|
} catch (e) {
|
|
@@ -198,8 +198,8 @@ function requireNative() {
|
|
|
198
198
|
try {
|
|
199
199
|
const binding = require('@corsa-bind/napi-darwin-x64')
|
|
200
200
|
const bindingPackageVersion = require('@corsa-bind/napi-darwin-x64/package.json').version
|
|
201
|
-
if (bindingPackageVersion !== '0.
|
|
202
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
201
|
+
if (bindingPackageVersion !== '0.17.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
202
|
+
throw new Error(`Native binding package version mismatch, expected 0.17.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
203
203
|
}
|
|
204
204
|
return binding
|
|
205
205
|
} catch (e) {
|
|
@@ -214,8 +214,8 @@ function requireNative() {
|
|
|
214
214
|
try {
|
|
215
215
|
const binding = require('@corsa-bind/napi-darwin-arm64')
|
|
216
216
|
const bindingPackageVersion = require('@corsa-bind/napi-darwin-arm64/package.json').version
|
|
217
|
-
if (bindingPackageVersion !== '0.
|
|
218
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
217
|
+
if (bindingPackageVersion !== '0.17.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
218
|
+
throw new Error(`Native binding package version mismatch, expected 0.17.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
219
219
|
}
|
|
220
220
|
return binding
|
|
221
221
|
} catch (e) {
|
|
@@ -234,8 +234,8 @@ function requireNative() {
|
|
|
234
234
|
try {
|
|
235
235
|
const binding = require('@corsa-bind/napi-freebsd-x64')
|
|
236
236
|
const bindingPackageVersion = require('@corsa-bind/napi-freebsd-x64/package.json').version
|
|
237
|
-
if (bindingPackageVersion !== '0.
|
|
238
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
237
|
+
if (bindingPackageVersion !== '0.17.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
238
|
+
throw new Error(`Native binding package version mismatch, expected 0.17.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
239
239
|
}
|
|
240
240
|
return binding
|
|
241
241
|
} catch (e) {
|
|
@@ -250,8 +250,8 @@ function requireNative() {
|
|
|
250
250
|
try {
|
|
251
251
|
const binding = require('@corsa-bind/napi-freebsd-arm64')
|
|
252
252
|
const bindingPackageVersion = require('@corsa-bind/napi-freebsd-arm64/package.json').version
|
|
253
|
-
if (bindingPackageVersion !== '0.
|
|
254
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
253
|
+
if (bindingPackageVersion !== '0.17.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
254
|
+
throw new Error(`Native binding package version mismatch, expected 0.17.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
255
255
|
}
|
|
256
256
|
return binding
|
|
257
257
|
} catch (e) {
|
|
@@ -271,8 +271,8 @@ function requireNative() {
|
|
|
271
271
|
try {
|
|
272
272
|
const binding = require('@corsa-bind/napi-linux-x64-musl')
|
|
273
273
|
const bindingPackageVersion = require('@corsa-bind/napi-linux-x64-musl/package.json').version
|
|
274
|
-
if (bindingPackageVersion !== '0.
|
|
275
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
274
|
+
if (bindingPackageVersion !== '0.17.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
275
|
+
throw new Error(`Native binding package version mismatch, expected 0.17.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
276
276
|
}
|
|
277
277
|
return binding
|
|
278
278
|
} catch (e) {
|
|
@@ -287,8 +287,8 @@ function requireNative() {
|
|
|
287
287
|
try {
|
|
288
288
|
const binding = require('@corsa-bind/napi-linux-x64-gnu')
|
|
289
289
|
const bindingPackageVersion = require('@corsa-bind/napi-linux-x64-gnu/package.json').version
|
|
290
|
-
if (bindingPackageVersion !== '0.
|
|
291
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
290
|
+
if (bindingPackageVersion !== '0.17.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
291
|
+
throw new Error(`Native binding package version mismatch, expected 0.17.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
292
292
|
}
|
|
293
293
|
return binding
|
|
294
294
|
} catch (e) {
|
|
@@ -305,8 +305,8 @@ function requireNative() {
|
|
|
305
305
|
try {
|
|
306
306
|
const binding = require('@corsa-bind/napi-linux-arm64-musl')
|
|
307
307
|
const bindingPackageVersion = require('@corsa-bind/napi-linux-arm64-musl/package.json').version
|
|
308
|
-
if (bindingPackageVersion !== '0.
|
|
309
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
308
|
+
if (bindingPackageVersion !== '0.17.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
309
|
+
throw new Error(`Native binding package version mismatch, expected 0.17.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
310
310
|
}
|
|
311
311
|
return binding
|
|
312
312
|
} catch (e) {
|
|
@@ -321,8 +321,8 @@ function requireNative() {
|
|
|
321
321
|
try {
|
|
322
322
|
const binding = require('@corsa-bind/napi-linux-arm64-gnu')
|
|
323
323
|
const bindingPackageVersion = require('@corsa-bind/napi-linux-arm64-gnu/package.json').version
|
|
324
|
-
if (bindingPackageVersion !== '0.
|
|
325
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
324
|
+
if (bindingPackageVersion !== '0.17.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
325
|
+
throw new Error(`Native binding package version mismatch, expected 0.17.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
326
326
|
}
|
|
327
327
|
return binding
|
|
328
328
|
} catch (e) {
|
|
@@ -339,8 +339,8 @@ function requireNative() {
|
|
|
339
339
|
try {
|
|
340
340
|
const binding = require('@corsa-bind/napi-linux-arm-musleabihf')
|
|
341
341
|
const bindingPackageVersion = require('@corsa-bind/napi-linux-arm-musleabihf/package.json').version
|
|
342
|
-
if (bindingPackageVersion !== '0.
|
|
343
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
342
|
+
if (bindingPackageVersion !== '0.17.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
343
|
+
throw new Error(`Native binding package version mismatch, expected 0.17.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
344
344
|
}
|
|
345
345
|
return binding
|
|
346
346
|
} catch (e) {
|
|
@@ -355,8 +355,8 @@ function requireNative() {
|
|
|
355
355
|
try {
|
|
356
356
|
const binding = require('@corsa-bind/napi-linux-arm-gnueabihf')
|
|
357
357
|
const bindingPackageVersion = require('@corsa-bind/napi-linux-arm-gnueabihf/package.json').version
|
|
358
|
-
if (bindingPackageVersion !== '0.
|
|
359
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
358
|
+
if (bindingPackageVersion !== '0.17.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
359
|
+
throw new Error(`Native binding package version mismatch, expected 0.17.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
360
360
|
}
|
|
361
361
|
return binding
|
|
362
362
|
} catch (e) {
|
|
@@ -373,8 +373,8 @@ function requireNative() {
|
|
|
373
373
|
try {
|
|
374
374
|
const binding = require('@corsa-bind/napi-linux-loong64-musl')
|
|
375
375
|
const bindingPackageVersion = require('@corsa-bind/napi-linux-loong64-musl/package.json').version
|
|
376
|
-
if (bindingPackageVersion !== '0.
|
|
377
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
376
|
+
if (bindingPackageVersion !== '0.17.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
377
|
+
throw new Error(`Native binding package version mismatch, expected 0.17.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
378
378
|
}
|
|
379
379
|
return binding
|
|
380
380
|
} catch (e) {
|
|
@@ -389,8 +389,8 @@ function requireNative() {
|
|
|
389
389
|
try {
|
|
390
390
|
const binding = require('@corsa-bind/napi-linux-loong64-gnu')
|
|
391
391
|
const bindingPackageVersion = require('@corsa-bind/napi-linux-loong64-gnu/package.json').version
|
|
392
|
-
if (bindingPackageVersion !== '0.
|
|
393
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
392
|
+
if (bindingPackageVersion !== '0.17.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
393
|
+
throw new Error(`Native binding package version mismatch, expected 0.17.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
394
394
|
}
|
|
395
395
|
return binding
|
|
396
396
|
} catch (e) {
|
|
@@ -407,8 +407,8 @@ function requireNative() {
|
|
|
407
407
|
try {
|
|
408
408
|
const binding = require('@corsa-bind/napi-linux-riscv64-musl')
|
|
409
409
|
const bindingPackageVersion = require('@corsa-bind/napi-linux-riscv64-musl/package.json').version
|
|
410
|
-
if (bindingPackageVersion !== '0.
|
|
411
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
410
|
+
if (bindingPackageVersion !== '0.17.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
411
|
+
throw new Error(`Native binding package version mismatch, expected 0.17.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
412
412
|
}
|
|
413
413
|
return binding
|
|
414
414
|
} catch (e) {
|
|
@@ -423,8 +423,8 @@ function requireNative() {
|
|
|
423
423
|
try {
|
|
424
424
|
const binding = require('@corsa-bind/napi-linux-riscv64-gnu')
|
|
425
425
|
const bindingPackageVersion = require('@corsa-bind/napi-linux-riscv64-gnu/package.json').version
|
|
426
|
-
if (bindingPackageVersion !== '0.
|
|
427
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
426
|
+
if (bindingPackageVersion !== '0.17.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
427
|
+
throw new Error(`Native binding package version mismatch, expected 0.17.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
428
428
|
}
|
|
429
429
|
return binding
|
|
430
430
|
} catch (e) {
|
|
@@ -440,8 +440,8 @@ function requireNative() {
|
|
|
440
440
|
try {
|
|
441
441
|
const binding = require('@corsa-bind/napi-linux-ppc64-gnu')
|
|
442
442
|
const bindingPackageVersion = require('@corsa-bind/napi-linux-ppc64-gnu/package.json').version
|
|
443
|
-
if (bindingPackageVersion !== '0.
|
|
444
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
443
|
+
if (bindingPackageVersion !== '0.17.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
444
|
+
throw new Error(`Native binding package version mismatch, expected 0.17.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
445
445
|
}
|
|
446
446
|
return binding
|
|
447
447
|
} catch (e) {
|
|
@@ -456,8 +456,8 @@ function requireNative() {
|
|
|
456
456
|
try {
|
|
457
457
|
const binding = require('@corsa-bind/napi-linux-s390x-gnu')
|
|
458
458
|
const bindingPackageVersion = require('@corsa-bind/napi-linux-s390x-gnu/package.json').version
|
|
459
|
-
if (bindingPackageVersion !== '0.
|
|
460
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
459
|
+
if (bindingPackageVersion !== '0.17.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
460
|
+
throw new Error(`Native binding package version mismatch, expected 0.17.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
461
461
|
}
|
|
462
462
|
return binding
|
|
463
463
|
} catch (e) {
|
|
@@ -476,8 +476,8 @@ function requireNative() {
|
|
|
476
476
|
try {
|
|
477
477
|
const binding = require('@corsa-bind/napi-openharmony-arm64')
|
|
478
478
|
const bindingPackageVersion = require('@corsa-bind/napi-openharmony-arm64/package.json').version
|
|
479
|
-
if (bindingPackageVersion !== '0.
|
|
480
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
479
|
+
if (bindingPackageVersion !== '0.17.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
480
|
+
throw new Error(`Native binding package version mismatch, expected 0.17.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
481
481
|
}
|
|
482
482
|
return binding
|
|
483
483
|
} catch (e) {
|
|
@@ -492,8 +492,8 @@ function requireNative() {
|
|
|
492
492
|
try {
|
|
493
493
|
const binding = require('@corsa-bind/napi-openharmony-x64')
|
|
494
494
|
const bindingPackageVersion = require('@corsa-bind/napi-openharmony-x64/package.json').version
|
|
495
|
-
if (bindingPackageVersion !== '0.
|
|
496
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
495
|
+
if (bindingPackageVersion !== '0.17.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
496
|
+
throw new Error(`Native binding package version mismatch, expected 0.17.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
497
497
|
}
|
|
498
498
|
return binding
|
|
499
499
|
} catch (e) {
|
|
@@ -508,8 +508,8 @@ function requireNative() {
|
|
|
508
508
|
try {
|
|
509
509
|
const binding = require('@corsa-bind/napi-openharmony-arm')
|
|
510
510
|
const bindingPackageVersion = require('@corsa-bind/napi-openharmony-arm/package.json').version
|
|
511
|
-
if (bindingPackageVersion !== '0.
|
|
512
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
511
|
+
if (bindingPackageVersion !== '0.17.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
512
|
+
throw new Error(`Native binding package version mismatch, expected 0.17.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
513
513
|
}
|
|
514
514
|
return binding
|
|
515
515
|
} catch (e) {
|
|
@@ -591,7 +591,7 @@ module.exports.isStringLikeTypeTexts = nativeBinding.isStringLikeTypeTexts
|
|
|
591
591
|
module.exports.isUnknownLikeTypeTexts = nativeBinding.isUnknownLikeTypeTexts
|
|
592
592
|
module.exports.isUnsafeAssignment = nativeBinding.isUnsafeAssignment
|
|
593
593
|
module.exports.isUnsafeReturn = nativeBinding.isUnsafeReturn
|
|
594
|
-
module.exports.
|
|
594
|
+
module.exports.nativeLintRuleMetas = nativeBinding.nativeLintRuleMetas
|
|
595
595
|
module.exports.runNativeLintRule = nativeBinding.runNativeLintRule
|
|
596
596
|
module.exports.spawnCorsaApiClientAsync = nativeBinding.spawnCorsaApiClientAsync
|
|
597
597
|
module.exports.splitTopLevelTypeText = nativeBinding.splitTopLevelTypeText
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@corsa-bind/napi",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.17.0",
|
|
4
4
|
"description": "Native JS runtime bindings for Corsa stdio workflows",
|
|
5
5
|
"homepage": "https://github.com/ubugeeei/corsa-bind/tree/main/src/bindings/nodejs/corsa_node",
|
|
6
6
|
"bugs": {
|
|
@@ -51,13 +51,13 @@
|
|
|
51
51
|
"node": ">=22"
|
|
52
52
|
},
|
|
53
53
|
"optionalDependencies": {
|
|
54
|
-
"@corsa-bind/napi-win32-x64-msvc": "0.
|
|
55
|
-
"@corsa-bind/napi-darwin-x64": "0.
|
|
56
|
-
"@corsa-bind/napi-linux-x64-gnu": "0.
|
|
57
|
-
"@corsa-bind/napi-darwin-arm64": "0.
|
|
58
|
-
"@corsa-bind/napi-win32-arm64-msvc": "0.
|
|
59
|
-
"@corsa-bind/napi-linux-x64-musl": "0.
|
|
60
|
-
"@corsa-bind/napi-linux-arm64-gnu": "0.
|
|
61
|
-
"@corsa-bind/napi-linux-arm64-musl": "0.
|
|
54
|
+
"@corsa-bind/napi-win32-x64-msvc": "0.17.0",
|
|
55
|
+
"@corsa-bind/napi-darwin-x64": "0.17.0",
|
|
56
|
+
"@corsa-bind/napi-linux-x64-gnu": "0.17.0",
|
|
57
|
+
"@corsa-bind/napi-darwin-arm64": "0.17.0",
|
|
58
|
+
"@corsa-bind/napi-win32-arm64-msvc": "0.17.0",
|
|
59
|
+
"@corsa-bind/napi-linux-x64-musl": "0.17.0",
|
|
60
|
+
"@corsa-bind/napi-linux-arm64-gnu": "0.17.0",
|
|
61
|
+
"@corsa-bind/napi-linux-arm64-musl": "0.17.0"
|
|
62
62
|
}
|
|
63
63
|
}
|