@corsa-bind/napi 0.14.0 → 0.16.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.
@@ -0,0 +1,43 @@
1
+ import { ApiClientOptions, SymbolResponse, TypeResponse } from "./types.mjs";
2
+ import { CorsaApiClientBase } from "./api_client_base.mjs";
3
+
4
+ //#region api_client.d.ts
5
+ /** High-level JavaScript wrapper over the native Corsa stdio API client. */
6
+ declare class CorsaApiClient extends CorsaApiClientBase {
7
+ private constructor();
8
+ /** Spawns a Corsa API process and returns a synchronous wrapper. */
9
+ static spawn(options: ApiClientOptions): CorsaApiClient;
10
+ /** Spawns a Corsa API process without blocking the JavaScript thread. */
11
+ static spawnAsync(options: ApiClientOptions): Promise<CorsaApiClient>;
12
+ /** Returns the built-in string type for a project snapshot. */
13
+ getStringType(snapshot: string, project: string): TypeResponse;
14
+ /** Returns the built-in string type asynchronously. */
15
+ getStringTypeAsync(snapshot: string, project: string): Promise<TypeResponse>;
16
+ /** Returns type information for the source position, if Corsa can resolve it. */
17
+ getTypeAtPosition(snapshot: string, project: string, file: string, position: number): TypeResponse | undefined;
18
+ /** Returns type information for the source position asynchronously. */
19
+ getTypeAtPositionAsync(snapshot: string, project: string, file: string, position: number): Promise<TypeResponse | undefined>;
20
+ /** Returns symbol information for the source position, if one exists. */
21
+ getSymbolAtPosition(snapshot: string, project: string, file: string, position: number): SymbolResponse | undefined;
22
+ /** Returns symbol information for the source position asynchronously. */
23
+ getSymbolAtPositionAsync(snapshot: string, project: string, file: string, position: number): Promise<SymbolResponse | undefined>;
24
+ /** Returns type arguments for a generic object or alias type handle. */
25
+ getTypeArguments(snapshot: string, project: string, typeHandle: string, objectFlags?: number): TypeResponse[];
26
+ /** Returns type arguments asynchronously. */
27
+ getTypeArgumentsAsync(snapshot: string, project: string, typeHandle: string, objectFlags?: number): Promise<TypeResponse[]>;
28
+ /** Returns the apparent type of a symbol handle, if Corsa can resolve it. */
29
+ getTypeOfSymbol(snapshot: string, project: string, symbol: string): TypeResponse | undefined;
30
+ /** Returns the apparent type of a symbol handle asynchronously. */
31
+ getTypeOfSymbolAsync(snapshot: string, project: string, symbol: string): Promise<TypeResponse | undefined>;
32
+ /** Returns the declared type of a symbol handle, if Corsa can resolve it. */
33
+ getDeclaredTypeOfSymbol(snapshot: string, project: string, symbol: string): TypeResponse | undefined;
34
+ /** Returns the declared type of a symbol handle asynchronously. */
35
+ getDeclaredTypeOfSymbolAsync(snapshot: string, project: string, symbol: string): Promise<TypeResponse | undefined>;
36
+ /** Formats a native type handle as TypeScript source text. */
37
+ typeToString(snapshot: string, project: string, typeHandle: string, location?: string, flags?: number): string;
38
+ /** Formats a native type handle as TypeScript source text asynchronously. */
39
+ typeToStringAsync(snapshot: string, project: string, typeHandle: string, location?: string, flags?: number): Promise<string>;
40
+ }
41
+ //#endregion
42
+ export { CorsaApiClient };
43
+ //# sourceMappingURL=api_client.d.mts.map
@@ -0,0 +1,78 @@
1
+ import { binding } from "./binding.mjs";
2
+ import { fromJson, toJson } from "./json.mjs";
3
+ import { CorsaApiClientBase } from "./api_client_base.mjs";
4
+ //#region api_client.ts
5
+ /** High-level JavaScript wrapper over the native Corsa stdio API client. */
6
+ var CorsaApiClient = class CorsaApiClient extends CorsaApiClientBase {
7
+ constructor(inner) {
8
+ super(inner);
9
+ }
10
+ /** Spawns a Corsa API process and returns a synchronous wrapper. */
11
+ static spawn(options) {
12
+ return new CorsaApiClient(binding.CorsaApiClient.spawn(toJson(options)));
13
+ }
14
+ /** Spawns a Corsa API process without blocking the JavaScript thread. */
15
+ static async spawnAsync(options) {
16
+ return new CorsaApiClient(await binding.spawnCorsaApiClientAsync(toJson(options)));
17
+ }
18
+ /** Returns the built-in string type for a project snapshot. */
19
+ getStringType(snapshot, project) {
20
+ return fromJson(this.inner.getStringTypeJson(snapshot, project));
21
+ }
22
+ /** Returns the built-in string type asynchronously. */
23
+ async getStringTypeAsync(snapshot, project) {
24
+ return fromJson(await this.inner.getStringTypeJsonAsync(snapshot, project));
25
+ }
26
+ /** Returns type information for the source position, if Corsa can resolve it. */
27
+ getTypeAtPosition(snapshot, project, file, position) {
28
+ return fromJson(this.inner.getTypeAtPositionJson(snapshot, project, file, position)) ?? void 0;
29
+ }
30
+ /** Returns type information for the source position asynchronously. */
31
+ async getTypeAtPositionAsync(snapshot, project, file, position) {
32
+ return fromJson(await this.inner.getTypeAtPositionJsonAsync(snapshot, project, file, position)) ?? void 0;
33
+ }
34
+ /** Returns symbol information for the source position, if one exists. */
35
+ getSymbolAtPosition(snapshot, project, file, position) {
36
+ return fromJson(this.inner.getSymbolAtPositionJson(snapshot, project, file, position)) ?? void 0;
37
+ }
38
+ /** Returns symbol information for the source position asynchronously. */
39
+ async getSymbolAtPositionAsync(snapshot, project, file, position) {
40
+ return fromJson(await this.inner.getSymbolAtPositionJsonAsync(snapshot, project, file, position)) ?? void 0;
41
+ }
42
+ /** Returns type arguments for a generic object or alias type handle. */
43
+ getTypeArguments(snapshot, project, typeHandle, objectFlags) {
44
+ return fromJson(this.inner.getTypeArgumentsJson(snapshot, project, typeHandle, objectFlags));
45
+ }
46
+ /** Returns type arguments asynchronously. */
47
+ async getTypeArgumentsAsync(snapshot, project, typeHandle, objectFlags) {
48
+ return fromJson(await this.inner.getTypeArgumentsJsonAsync(snapshot, project, typeHandle, objectFlags));
49
+ }
50
+ /** Returns the apparent type of a symbol handle, if Corsa can resolve it. */
51
+ getTypeOfSymbol(snapshot, project, symbol) {
52
+ return fromJson(this.inner.getTypeOfSymbolJson(snapshot, project, symbol)) ?? void 0;
53
+ }
54
+ /** Returns the apparent type of a symbol handle asynchronously. */
55
+ async getTypeOfSymbolAsync(snapshot, project, symbol) {
56
+ return fromJson(await this.inner.getTypeOfSymbolJsonAsync(snapshot, project, symbol)) ?? void 0;
57
+ }
58
+ /** Returns the declared type of a symbol handle, if Corsa can resolve it. */
59
+ getDeclaredTypeOfSymbol(snapshot, project, symbol) {
60
+ return fromJson(this.inner.getDeclaredTypeOfSymbolJson(snapshot, project, symbol)) ?? void 0;
61
+ }
62
+ /** Returns the declared type of a symbol handle asynchronously. */
63
+ async getDeclaredTypeOfSymbolAsync(snapshot, project, symbol) {
64
+ return fromJson(await this.inner.getDeclaredTypeOfSymbolJsonAsync(snapshot, project, symbol)) ?? void 0;
65
+ }
66
+ /** Formats a native type handle as TypeScript source text. */
67
+ typeToString(snapshot, project, typeHandle, location, flags) {
68
+ return this.inner.typeToString(snapshot, project, typeHandle, location, flags);
69
+ }
70
+ /** Formats a native type handle as TypeScript source text asynchronously. */
71
+ async typeToStringAsync(snapshot, project, typeHandle, location, flags) {
72
+ return this.inner.typeToStringAsync(snapshot, project, typeHandle, location, flags);
73
+ }
74
+ };
75
+ //#endregion
76
+ export { CorsaApiClient };
77
+
78
+ //# sourceMappingURL=api_client.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api_client.mjs","names":[],"sources":["../ts/api_client.ts"],"sourcesContent":["import { CorsaApiClientBase } from \"./api_client_base\";\nimport { binding } from \"./binding\";\nimport { fromJson, toJson } from \"./json\";\n\nimport type { NativeApiClient } from \"./binding\";\nimport type { ApiClientOptions, SymbolResponse, TypeResponse } from \"./types\";\n\n/** High-level JavaScript wrapper over the native Corsa stdio API client. */\nexport class CorsaApiClient extends CorsaApiClientBase {\n private constructor(inner: NativeApiClient) {\n super(inner);\n }\n\n /** Spawns a Corsa API process and returns a synchronous wrapper. */\n static spawn(options: ApiClientOptions): CorsaApiClient {\n return new CorsaApiClient(binding.CorsaApiClient.spawn(toJson(options)));\n }\n\n /** Spawns a Corsa API process without blocking the JavaScript thread. */\n static async spawnAsync(options: ApiClientOptions): Promise<CorsaApiClient> {\n return new CorsaApiClient(await binding.spawnCorsaApiClientAsync(toJson(options)));\n }\n\n /** Returns the built-in string type for a project snapshot. */\n getStringType(snapshot: string, project: string): TypeResponse {\n return fromJson(this.inner.getStringTypeJson(snapshot, project));\n }\n\n /** Returns the built-in string type asynchronously. */\n async getStringTypeAsync(snapshot: string, project: string): Promise<TypeResponse> {\n return fromJson(await this.inner.getStringTypeJsonAsync(snapshot, project));\n }\n\n /** Returns type information for the source position, if Corsa can resolve it. */\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 /** Returns type information for the source position asynchronously. */\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 /** Returns symbol information for the source position, if one exists. */\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 /** Returns symbol information for the source position asynchronously. */\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 /** Returns type arguments for a generic object or alias type handle. */\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 /** Returns type arguments asynchronously. */\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 /** Returns the apparent type of a symbol handle, if Corsa can resolve it. */\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 /** Returns the apparent type of a symbol handle asynchronously. */\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 /** Returns the declared type of a symbol handle, if Corsa can resolve it. */\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 /** Returns the declared type of a symbol handle asynchronously. */\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 /** Formats a native type handle as TypeScript source text. */\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 /** Formats a native type handle as TypeScript source text asynchronously. */\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"],"mappings":";;;;;AAQA,IAAa,iBAAb,MAAa,uBAAuB,mBAAmB;CACrD,YAAoB,OAAwB;EAC1C,MAAM,MAAM;;;CAId,OAAO,MAAM,SAA2C;EACtD,OAAO,IAAI,eAAe,QAAQ,eAAe,MAAM,OAAO,QAAQ,CAAC,CAAC;;;CAI1E,aAAa,WAAW,SAAoD;EAC1E,OAAO,IAAI,eAAe,MAAM,QAAQ,yBAAyB,OAAO,QAAQ,CAAC,CAAC;;;CAIpF,cAAc,UAAkB,SAA+B;EAC7D,OAAO,SAAS,KAAK,MAAM,kBAAkB,UAAU,QAAQ,CAAC;;;CAIlE,MAAM,mBAAmB,UAAkB,SAAwC;EACjF,OAAO,SAAS,MAAM,KAAK,MAAM,uBAAuB,UAAU,QAAQ,CAAC;;;CAI7E,kBACE,UACA,SACA,MACA,UAC0B;EAC1B,OACE,SACE,KAAK,MAAM,sBAAsB,UAAU,SAAS,MAAM,SAAS,CACpE,IAAI,KAAA;;;CAKT,MAAM,uBACJ,UACA,SACA,MACA,UACmC;EACnC,OACE,SACE,MAAM,KAAK,MAAM,2BAA2B,UAAU,SAAS,MAAM,SAAS,CAC/E,IAAI,KAAA;;;CAKT,oBACE,UACA,SACA,MACA,UAC4B;EAC5B,OACE,SACE,KAAK,MAAM,wBAAwB,UAAU,SAAS,MAAM,SAAS,CACtE,IAAI,KAAA;;;CAKT,MAAM,yBACJ,UACA,SACA,MACA,UACqC;EACrC,OACE,SACE,MAAM,KAAK,MAAM,6BAA6B,UAAU,SAAS,MAAM,SAAS,CACjF,IAAI,KAAA;;;CAKT,iBACE,UACA,SACA,YACA,aACgB;EAChB,OAAO,SAAS,KAAK,MAAM,qBAAqB,UAAU,SAAS,YAAY,YAAY,CAAC;;;CAI9F,MAAM,sBACJ,UACA,SACA,YACA,aACyB;EACzB,OAAO,SACL,MAAM,KAAK,MAAM,0BAA0B,UAAU,SAAS,YAAY,YAAY,CACvF;;;CAIH,gBAAgB,UAAkB,SAAiB,QAA0C;EAC3F,OACE,SAA8B,KAAK,MAAM,oBAAoB,UAAU,SAAS,OAAO,CAAC,IACxF,KAAA;;;CAKJ,MAAM,qBACJ,UACA,SACA,QACmC;EACnC,OACE,SACE,MAAM,KAAK,MAAM,yBAAyB,UAAU,SAAS,OAAO,CACrE,IAAI,KAAA;;;CAKT,wBACE,UACA,SACA,QAC0B;EAC1B,OACE,SACE,KAAK,MAAM,4BAA4B,UAAU,SAAS,OAAO,CAClE,IAAI,KAAA;;;CAKT,MAAM,6BACJ,UACA,SACA,QACmC;EACnC,OACE,SACE,MAAM,KAAK,MAAM,iCAAiC,UAAU,SAAS,OAAO,CAC7E,IAAI,KAAA;;;CAKT,aACE,UACA,SACA,YACA,UACA,OACQ;EACR,OAAO,KAAK,MAAM,aAAa,UAAU,SAAS,YAAY,UAAU,MAAM;;;CAIhF,MAAM,kBACJ,UACA,SACA,YACA,UACA,OACiB;EACjB,OAAO,KAAK,MAAM,kBAAkB,UAAU,SAAS,YAAY,UAAU,MAAM"}
@@ -0,0 +1,45 @@
1
+ import { NativeApiClient } from "./binding.mjs";
2
+ import { ConfigResponse, InitializeResponse, UpdateSnapshotParams, UpdateSnapshotResponse } from "./types.mjs";
3
+
4
+ //#region api_client_base.d.ts
5
+ /** Shared lifecycle and transport operations for the public Corsa API client. */
6
+ declare abstract class CorsaApiClientBase {
7
+ protected readonly inner: NativeApiClient;
8
+ /** Wraps a native client handle. Construction is restricted to subclasses. */
9
+ protected constructor(inner: NativeApiClient);
10
+ /** Performs the synchronous Corsa API initialize handshake. */
11
+ initialize(): InitializeResponse;
12
+ /** Performs the asynchronous Corsa API initialize handshake. */
13
+ initializeAsync(): Promise<InitializeResponse>;
14
+ /** Parses a Corsa config file and returns the native config response. */
15
+ parseConfigFile(file: string): ConfigResponse;
16
+ /** Parses a Corsa config file without blocking the JavaScript thread. */
17
+ parseConfigFileAsync(file: string): Promise<ConfigResponse>;
18
+ /** Updates the upstream Corsa project snapshot with optional changed files. */
19
+ updateSnapshot(params?: UpdateSnapshotParams): UpdateSnapshotResponse;
20
+ /** Updates the upstream Corsa project snapshot asynchronously. */
21
+ updateSnapshotAsync(params?: UpdateSnapshotParams): Promise<UpdateSnapshotResponse>;
22
+ /** Reads a source file from a snapshot as bytes, or `null` if it is unavailable. */
23
+ getSourceFile(snapshot: string, project: string, file: string): Uint8Array | null;
24
+ /** Reads a source file from a snapshot asynchronously. */
25
+ getSourceFileAsync(snapshot: string, project: string, file: string): Promise<Uint8Array | null>;
26
+ /** Calls an arbitrary JSON-RPC method and parses the JSON response. */
27
+ callJson<T>(method: string, params?: unknown): T;
28
+ /** Calls an arbitrary JSON-RPC method asynchronously and parses the response. */
29
+ callJsonAsync<T>(method: string, params?: unknown): Promise<T>;
30
+ /** Calls a binary endpoint and returns raw bytes, or `null` for empty responses. */
31
+ callBinary(method: string, params?: unknown): Uint8Array | null;
32
+ /** Calls a binary endpoint asynchronously. */
33
+ callBinaryAsync(method: string, params?: unknown): Promise<Uint8Array | null>;
34
+ /** Releases a native type, symbol, or snapshot handle when callers are done with it. */
35
+ releaseHandle(handle: string): void;
36
+ /** Releases a native handle asynchronously. */
37
+ releaseHandleAsync(handle: string): Promise<void>;
38
+ /** Closes the underlying Corsa process and transport. */
39
+ close(): void;
40
+ /** Closes the underlying Corsa process asynchronously. */
41
+ closeAsync(): Promise<void>;
42
+ }
43
+ //#endregion
44
+ export { CorsaApiClientBase };
45
+ //# sourceMappingURL=api_client_base.d.mts.map
@@ -0,0 +1,78 @@
1
+ import { fromJson, toJson } from "./json.mjs";
2
+ //#region api_client_base.ts
3
+ /** Shared lifecycle and transport operations for the public Corsa API client. */
4
+ var CorsaApiClientBase = class {
5
+ inner;
6
+ /** Wraps a native client handle. Construction is restricted to subclasses. */
7
+ constructor(inner) {
8
+ this.inner = inner;
9
+ }
10
+ /** Performs the synchronous Corsa API initialize handshake. */
11
+ initialize() {
12
+ return fromJson(this.inner.initializeJson());
13
+ }
14
+ /** Performs the asynchronous Corsa API initialize handshake. */
15
+ async initializeAsync() {
16
+ return fromJson(await this.inner.initializeJsonAsync());
17
+ }
18
+ /** Parses a Corsa config file and returns the native config response. */
19
+ parseConfigFile(file) {
20
+ return fromJson(this.inner.parseConfigFileJson(file));
21
+ }
22
+ /** Parses a Corsa config file without blocking the JavaScript thread. */
23
+ async parseConfigFileAsync(file) {
24
+ return fromJson(await this.inner.parseConfigFileJsonAsync(file));
25
+ }
26
+ /** Updates the upstream Corsa project snapshot with optional changed files. */
27
+ updateSnapshot(params) {
28
+ return fromJson(this.inner.updateSnapshotJson(params ? toJson(params) : void 0));
29
+ }
30
+ /** Updates the upstream Corsa project snapshot asynchronously. */
31
+ async updateSnapshotAsync(params) {
32
+ return fromJson(await this.inner.updateSnapshotJsonAsync(params ? toJson(params) : void 0));
33
+ }
34
+ /** Reads a source file from a snapshot as bytes, or `null` if it is unavailable. */
35
+ getSourceFile(snapshot, project, file) {
36
+ return this.inner.getSourceFile(snapshot, project, file) ?? null;
37
+ }
38
+ /** Reads a source file from a snapshot asynchronously. */
39
+ async getSourceFileAsync(snapshot, project, file) {
40
+ return await this.inner.getSourceFileAsync(snapshot, project, file) ?? null;
41
+ }
42
+ /** Calls an arbitrary JSON-RPC method and parses the JSON response. */
43
+ callJson(method, params) {
44
+ return fromJson(this.inner.callJson(method, params ? toJson(params) : void 0));
45
+ }
46
+ /** Calls an arbitrary JSON-RPC method asynchronously and parses the response. */
47
+ async callJsonAsync(method, params) {
48
+ return fromJson(await this.inner.callJsonAsync(method, params ? toJson(params) : void 0));
49
+ }
50
+ /** Calls a binary endpoint and returns raw bytes, or `null` for empty responses. */
51
+ callBinary(method, params) {
52
+ return this.inner.callBinary(method, params ? toJson(params) : void 0) ?? null;
53
+ }
54
+ /** Calls a binary endpoint asynchronously. */
55
+ async callBinaryAsync(method, params) {
56
+ return await this.inner.callBinaryAsync(method, params ? toJson(params) : void 0) ?? null;
57
+ }
58
+ /** Releases a native type, symbol, or snapshot handle when callers are done with it. */
59
+ releaseHandle(handle) {
60
+ this.inner.releaseHandle(handle);
61
+ }
62
+ /** Releases a native handle asynchronously. */
63
+ async releaseHandleAsync(handle) {
64
+ await this.inner.releaseHandleAsync(handle);
65
+ }
66
+ /** Closes the underlying Corsa process and transport. */
67
+ close() {
68
+ this.inner.close();
69
+ }
70
+ /** Closes the underlying Corsa process asynchronously. */
71
+ async closeAsync() {
72
+ await this.inner.closeAsync();
73
+ }
74
+ };
75
+ //#endregion
76
+ export { CorsaApiClientBase };
77
+
78
+ //# sourceMappingURL=api_client_base.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api_client_base.mjs","names":[],"sources":["../ts/api_client_base.ts"],"sourcesContent":["import { fromJson, toJson } from \"./json\";\n\nimport type { NativeApiClient } from \"./binding\";\nimport type {\n ConfigResponse,\n InitializeResponse,\n UpdateSnapshotParams,\n UpdateSnapshotResponse,\n} from \"./types\";\n\n/** Shared lifecycle and transport operations for the public Corsa API client. */\nexport abstract class CorsaApiClientBase {\n protected readonly inner: NativeApiClient;\n\n /** Wraps a native client handle. Construction is restricted to subclasses. */\n protected constructor(inner: NativeApiClient) {\n this.inner = inner;\n }\n\n /** Performs the synchronous Corsa API initialize handshake. */\n initialize(): InitializeResponse {\n return fromJson(this.inner.initializeJson());\n }\n\n /** Performs the asynchronous Corsa API initialize handshake. */\n async initializeAsync(): Promise<InitializeResponse> {\n return fromJson(await this.inner.initializeJsonAsync());\n }\n\n /** Parses a Corsa config file and returns the native config response. */\n parseConfigFile(file: string): ConfigResponse {\n return fromJson(this.inner.parseConfigFileJson(file));\n }\n\n /** Parses a Corsa config file without blocking the JavaScript thread. */\n async parseConfigFileAsync(file: string): Promise<ConfigResponse> {\n return fromJson(await this.inner.parseConfigFileJsonAsync(file));\n }\n\n /** Updates the upstream Corsa project snapshot with optional changed files. */\n updateSnapshot(params?: UpdateSnapshotParams): UpdateSnapshotResponse {\n return fromJson(this.inner.updateSnapshotJson(params ? toJson(params) : undefined));\n }\n\n /** Updates the upstream Corsa project snapshot asynchronously. */\n async updateSnapshotAsync(params?: UpdateSnapshotParams): Promise<UpdateSnapshotResponse> {\n return fromJson(await this.inner.updateSnapshotJsonAsync(params ? toJson(params) : undefined));\n }\n\n /** Reads a source file from a snapshot as bytes, or `null` if it is unavailable. */\n getSourceFile(snapshot: string, project: string, file: string): Uint8Array | null {\n return this.inner.getSourceFile(snapshot, project, file) ?? null;\n }\n\n /** Reads a source file from a snapshot asynchronously. */\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 /** Calls an arbitrary JSON-RPC method and parses the JSON response. */\n callJson<T>(method: string, params?: unknown): T {\n return fromJson(this.inner.callJson(method, params ? toJson(params) : undefined));\n }\n\n /** Calls an arbitrary JSON-RPC method asynchronously and parses the response. */\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 /** Calls a binary endpoint and returns raw bytes, or `null` for empty responses. */\n callBinary(method: string, params?: unknown): Uint8Array | null {\n return this.inner.callBinary(method, params ? toJson(params) : undefined) ?? null;\n }\n\n /** Calls a binary endpoint asynchronously. */\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 /** Releases a native type, symbol, or snapshot handle when callers are done with it. */\n releaseHandle(handle: string): void {\n this.inner.releaseHandle(handle);\n }\n\n /** Releases a native handle asynchronously. */\n async releaseHandleAsync(handle: string): Promise<void> {\n await this.inner.releaseHandleAsync(handle);\n }\n\n /** Closes the underlying Corsa process and transport. */\n close(): void {\n this.inner.close();\n }\n\n /** Closes the underlying Corsa process asynchronously. */\n async closeAsync(): Promise<void> {\n await this.inner.closeAsync();\n }\n}\n"],"mappings":";;;AAWA,IAAsB,qBAAtB,MAAyC;CACvC;;CAGA,YAAsB,OAAwB;EAC5C,KAAK,QAAQ;;;CAIf,aAAiC;EAC/B,OAAO,SAAS,KAAK,MAAM,gBAAgB,CAAC;;;CAI9C,MAAM,kBAA+C;EACnD,OAAO,SAAS,MAAM,KAAK,MAAM,qBAAqB,CAAC;;;CAIzD,gBAAgB,MAA8B;EAC5C,OAAO,SAAS,KAAK,MAAM,oBAAoB,KAAK,CAAC;;;CAIvD,MAAM,qBAAqB,MAAuC;EAChE,OAAO,SAAS,MAAM,KAAK,MAAM,yBAAyB,KAAK,CAAC;;;CAIlE,eAAe,QAAuD;EACpE,OAAO,SAAS,KAAK,MAAM,mBAAmB,SAAS,OAAO,OAAO,GAAG,KAAA,EAAU,CAAC;;;CAIrF,MAAM,oBAAoB,QAAgE;EACxF,OAAO,SAAS,MAAM,KAAK,MAAM,wBAAwB,SAAS,OAAO,OAAO,GAAG,KAAA,EAAU,CAAC;;;CAIhG,cAAc,UAAkB,SAAiB,MAAiC;EAChF,OAAO,KAAK,MAAM,cAAc,UAAU,SAAS,KAAK,IAAI;;;CAI9D,MAAM,mBACJ,UACA,SACA,MAC4B;EAC5B,OAAQ,MAAM,KAAK,MAAM,mBAAmB,UAAU,SAAS,KAAK,IAAK;;;CAI3E,SAAY,QAAgB,QAAqB;EAC/C,OAAO,SAAS,KAAK,MAAM,SAAS,QAAQ,SAAS,OAAO,OAAO,GAAG,KAAA,EAAU,CAAC;;;CAInF,MAAM,cAAiB,QAAgB,QAA8B;EACnE,OAAO,SAAS,MAAM,KAAK,MAAM,cAAc,QAAQ,SAAS,OAAO,OAAO,GAAG,KAAA,EAAU,CAAC;;;CAI9F,WAAW,QAAgB,QAAqC;EAC9D,OAAO,KAAK,MAAM,WAAW,QAAQ,SAAS,OAAO,OAAO,GAAG,KAAA,EAAU,IAAI;;;CAI/E,MAAM,gBAAgB,QAAgB,QAA8C;EAClF,OAAQ,MAAM,KAAK,MAAM,gBAAgB,QAAQ,SAAS,OAAO,OAAO,GAAG,KAAA,EAAU,IAAK;;;CAI5F,cAAc,QAAsB;EAClC,KAAK,MAAM,cAAc,OAAO;;;CAIlC,MAAM,mBAAmB,QAA+B;EACtD,MAAM,KAAK,MAAM,mBAAmB,OAAO;;;CAI7C,QAAc;EACZ,KAAK,MAAM,OAAO;;;CAIpB,MAAM,aAA4B;EAChC,MAAM,KAAK,MAAM,YAAY"}
@@ -0,0 +1,16 @@
1
+ import * as _$___index_js0 from "../index.js";
2
+
3
+ //#region binding.d.ts
4
+ /**
5
+ * Resolved native module shape.
6
+ *
7
+ * `napi-rs` output can be loaded either as the namespace object itself or under
8
+ * a default export depending on the runtime bridge. This value normalizes both
9
+ * shapes so wrapper modules can call native methods without repeating the check.
10
+ */
11
+ declare const binding: typeof _$___index_js0;
12
+ /** Native synchronous/asynchronous Corsa API client instance. */
13
+ type NativeApiClient = InstanceType<typeof binding.CorsaApiClient>;
14
+ //#endregion
15
+ export { NativeApiClient, binding };
16
+ //# sourceMappingURL=binding.d.mts.map
@@ -0,0 +1,14 @@
1
+ import * as nativeModule from "../index.js";
2
+ //#region binding.ts
3
+ /**
4
+ * Resolved native module shape.
5
+ *
6
+ * `napi-rs` output can be loaded either as the namespace object itself or under
7
+ * a default export depending on the runtime bridge. This value normalizes both
8
+ * shapes so wrapper modules can call native methods without repeating the check.
9
+ */
10
+ const binding = "default" in nativeModule ? nativeModule.default : nativeModule;
11
+ //#endregion
12
+ export { binding };
13
+
14
+ //# sourceMappingURL=binding.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"binding.mjs","names":[],"sources":["../ts/binding.ts"],"sourcesContent":["import * as nativeModule from \"../index.js\";\n\n/**\n * Resolved native module shape.\n *\n * `napi-rs` output can be loaded either as the namespace object itself or under\n * a default export depending on the runtime bridge. This value normalizes both\n * shapes so wrapper modules can call native methods without repeating the check.\n */\nexport const binding = (\n \"default\" in nativeModule ? nativeModule.default : nativeModule\n) as typeof import(\"../index.js\");\n\n/** Native synchronous/asynchronous Corsa API client instance. */\nexport type NativeApiClient = InstanceType<typeof binding.CorsaApiClient>;\n\n/** Native replicated orchestration wrapper instance. */\nexport type NativeDistributedOrchestrator = InstanceType<\n typeof binding.CorsaDistributedOrchestrator\n>;\n\n/** Native virtual document wrapper instance. */\nexport type NativeVirtualDocument = InstanceType<typeof binding.CorsaVirtualDocument>;\n"],"mappings":";;;;;;;;;AASA,MAAa,UACX,aAAa,eAAe,aAAa,UAAU"}
@@ -0,0 +1,29 @@
1
+ import { VirtualChange, VirtualDocumentState } from "./types.mjs";
2
+
3
+ //#region distributed_orchestrator.d.ts
4
+ /** Experimental replicated orchestrator wrapper for multi-node document state. */
5
+ declare class CorsaDistributedOrchestrator {
6
+ #private;
7
+ /** Creates an orchestrator with the supplied logical node identifiers. */
8
+ constructor(nodeIds: string[]);
9
+ /** Starts or advances an election campaign for a node and returns the term. */
10
+ campaign(nodeId: string): number;
11
+ /** Returns the current leader id, or `undefined` before election completes. */
12
+ leaderId(): string | undefined;
13
+ /** Returns the replicated cluster state as caller-selected JSON shape. */
14
+ state<T>(): T | undefined;
15
+ /** Returns one node's state as caller-selected JSON shape. */
16
+ nodeState<T>(nodeId: string): T | undefined;
17
+ /** Returns one virtual document from a node, if the document is open there. */
18
+ document(nodeId: string, uri: string): VirtualDocumentState | undefined;
19
+ /** Opens a virtual document through the elected leader. */
20
+ openVirtualDocument(document: VirtualDocumentState): VirtualDocumentState;
21
+ /** Applies virtual-document changes through the elected leader. */
22
+ changeVirtualDocument(uri: string, changes: VirtualChange[]): VirtualDocumentState;
23
+ /** Closes a virtual document through the elected leader. */
24
+ closeVirtualDocument(uri: string): void;
25
+ private requireLeader;
26
+ }
27
+ //#endregion
28
+ export { CorsaDistributedOrchestrator };
29
+ //# sourceMappingURL=distributed_orchestrator.d.mts.map
@@ -0,0 +1,55 @@
1
+ import { binding } from "./binding.mjs";
2
+ import { fromJson, toJson } from "./json.mjs";
3
+ //#region distributed_orchestrator.ts
4
+ /** Experimental replicated orchestrator wrapper for multi-node document state. */
5
+ var CorsaDistributedOrchestrator = class {
6
+ #inner;
7
+ /** Creates an orchestrator with the supplied logical node identifiers. */
8
+ constructor(nodeIds) {
9
+ this.#inner = new binding.CorsaDistributedOrchestrator(nodeIds);
10
+ }
11
+ /** Starts or advances an election campaign for a node and returns the term. */
12
+ campaign(nodeId) {
13
+ return this.#inner.campaign(nodeId);
14
+ }
15
+ /** Returns the current leader id, or `undefined` before election completes. */
16
+ leaderId() {
17
+ return this.#inner.leaderId() ?? void 0;
18
+ }
19
+ /** Returns the replicated cluster state as caller-selected JSON shape. */
20
+ state() {
21
+ const value = this.#inner.stateJson();
22
+ return value ? fromJson(value) : void 0;
23
+ }
24
+ /** Returns one node's state as caller-selected JSON shape. */
25
+ nodeState(nodeId) {
26
+ const value = this.#inner.nodeStateJson(nodeId);
27
+ return value ? fromJson(value) : void 0;
28
+ }
29
+ /** Returns one virtual document from a node, if the document is open there. */
30
+ document(nodeId, uri) {
31
+ const value = this.#inner.documentJson(nodeId, uri);
32
+ return value ? fromJson(value) : void 0;
33
+ }
34
+ /** Opens a virtual document through the elected leader. */
35
+ openVirtualDocument(document) {
36
+ return fromJson(this.#inner.openVirtualDocumentJson(this.requireLeader(), toJson(document)));
37
+ }
38
+ /** Applies virtual-document changes through the elected leader. */
39
+ changeVirtualDocument(uri, changes) {
40
+ return fromJson(this.#inner.changeVirtualDocumentJson(this.requireLeader(), uri, toJson(changes)));
41
+ }
42
+ /** Closes a virtual document through the elected leader. */
43
+ closeVirtualDocument(uri) {
44
+ this.#inner.closeVirtualDocument(this.requireLeader(), uri);
45
+ }
46
+ requireLeader() {
47
+ const leaderId = this.leaderId();
48
+ if (!leaderId) throw new Error("raft leader has not been elected");
49
+ return leaderId;
50
+ }
51
+ };
52
+ //#endregion
53
+ export { CorsaDistributedOrchestrator };
54
+
55
+ //# sourceMappingURL=distributed_orchestrator.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"distributed_orchestrator.mjs","names":["#inner"],"sources":["../ts/distributed_orchestrator.ts"],"sourcesContent":["import { binding } from \"./binding\";\nimport { fromJson, toJson } from \"./json\";\n\nimport type { NativeDistributedOrchestrator } from \"./binding\";\nimport type { VirtualChange, VirtualDocumentState } from \"./types\";\n\n/** Experimental replicated orchestrator wrapper for multi-node document state. */\nexport class CorsaDistributedOrchestrator {\n readonly #inner: NativeDistributedOrchestrator;\n\n /** Creates an orchestrator with the supplied logical node identifiers. */\n constructor(nodeIds: string[]) {\n this.#inner = new binding.CorsaDistributedOrchestrator(nodeIds);\n }\n\n /** Starts or advances an election campaign for a node and returns the term. */\n campaign(nodeId: string): number {\n return this.#inner.campaign(nodeId);\n }\n\n /** Returns the current leader id, or `undefined` before election completes. */\n leaderId(): string | undefined {\n return this.#inner.leaderId() ?? undefined;\n }\n\n /** Returns the replicated cluster state as caller-selected JSON shape. */\n state<T>(): T | undefined {\n const value = this.#inner.stateJson();\n return value ? fromJson<T>(value) : undefined;\n }\n\n /** Returns one node's state as caller-selected JSON shape. */\n nodeState<T>(nodeId: string): T | undefined {\n const value = this.#inner.nodeStateJson(nodeId);\n return value ? fromJson<T>(value) : undefined;\n }\n\n /** Returns one virtual document from a node, if the document is open there. */\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 /** Opens a virtual document through the elected leader. */\n openVirtualDocument(document: VirtualDocumentState): VirtualDocumentState {\n return fromJson(this.#inner.openVirtualDocumentJson(this.requireLeader(), toJson(document)));\n }\n\n /** Applies virtual-document changes through the elected leader. */\n changeVirtualDocument(uri: string, changes: VirtualChange[]): VirtualDocumentState {\n return fromJson(\n this.#inner.changeVirtualDocumentJson(this.requireLeader(), uri, toJson(changes)),\n );\n }\n\n /** Closes a virtual document through the elected leader. */\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"],"mappings":";;;;AAOA,IAAa,+BAAb,MAA0C;CACxC;;CAGA,YAAY,SAAmB;EAC7B,KAAKA,SAAS,IAAI,QAAQ,6BAA6B,QAAQ;;;CAIjE,SAAS,QAAwB;EAC/B,OAAO,KAAKA,OAAO,SAAS,OAAO;;;CAIrC,WAA+B;EAC7B,OAAO,KAAKA,OAAO,UAAU,IAAI,KAAA;;;CAInC,QAA0B;EACxB,MAAM,QAAQ,KAAKA,OAAO,WAAW;EACrC,OAAO,QAAQ,SAAY,MAAM,GAAG,KAAA;;;CAItC,UAAa,QAA+B;EAC1C,MAAM,QAAQ,KAAKA,OAAO,cAAc,OAAO;EAC/C,OAAO,QAAQ,SAAY,MAAM,GAAG,KAAA;;;CAItC,SAAS,QAAgB,KAA+C;EACtE,MAAM,QAAQ,KAAKA,OAAO,aAAa,QAAQ,IAAI;EACnD,OAAO,QAAQ,SAA+B,MAAM,GAAG,KAAA;;;CAIzD,oBAAoB,UAAsD;EACxE,OAAO,SAAS,KAAKA,OAAO,wBAAwB,KAAK,eAAe,EAAE,OAAO,SAAS,CAAC,CAAC;;;CAI9F,sBAAsB,KAAa,SAAgD;EACjF,OAAO,SACL,KAAKA,OAAO,0BAA0B,KAAK,eAAe,EAAE,KAAK,OAAO,QAAQ,CAAC,CAClF;;;CAIH,qBAAqB,KAAmB;EACtC,KAAKA,OAAO,qBAAqB,KAAK,eAAe,EAAE,IAAI;;CAG7D,gBAAgC;EAC9B,MAAM,WAAW,KAAK,UAAU;EAChC,IAAI,CAAC,UACH,MAAM,IAAI,MAAM,mCAAmC;EAErD,OAAO"}
package/dist/index.d.mts CHANGED
@@ -1,101 +1,14 @@
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
- declare function isUnsafeAssignment(input: UnsafeTypeFlowInput): boolean;
7
- declare function isUnsafeReturn(input: UnsafeTypeFlowInput): boolean;
8
- declare function runNativeLintRule(ruleName: string, node: NativeLintNode): NativeLintDiagnostic[];
9
- declare function nativeLintRuleMetas(): NativeLintRuleMeta[];
10
- declare function classifyTypeText(text?: string): TypeTextKind;
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>;
41
- initialize(): InitializeResponse;
42
- initializeAsync(): Promise<InitializeResponse>;
43
- parseConfigFile(file: string): ConfigResponse;
44
- parseConfigFileAsync(file: string): Promise<ConfigResponse>;
45
- updateSnapshot(params?: UpdateSnapshotParams): UpdateSnapshotResponse;
46
- updateSnapshotAsync(params?: UpdateSnapshotParams): Promise<UpdateSnapshotResponse>;
47
- getSourceFile(snapshot: string, project: string, file: string): Uint8Array | null;
48
- getSourceFileAsync(snapshot: string, project: string, file: string): Promise<Uint8Array | null>;
49
- getStringType(snapshot: string, project: string): TypeResponse;
50
- getStringTypeAsync(snapshot: string, project: string): Promise<TypeResponse>;
51
- getTypeAtPosition(snapshot: string, project: string, file: string, position: number): TypeResponse | undefined;
52
- getTypeAtPositionAsync(snapshot: string, project: string, file: string, position: number): Promise<TypeResponse | undefined>;
53
- getSymbolAtPosition(snapshot: string, project: string, file: string, position: number): SymbolResponse | undefined;
54
- getSymbolAtPositionAsync(snapshot: string, project: string, file: string, position: number): Promise<SymbolResponse | undefined>;
55
- getTypeArguments(snapshot: string, project: string, typeHandle: string, objectFlags?: number): TypeResponse[];
56
- getTypeArgumentsAsync(snapshot: string, project: string, typeHandle: string, objectFlags?: number): Promise<TypeResponse[]>;
57
- getTypeOfSymbol(snapshot: string, project: string, symbol: string): TypeResponse | undefined;
58
- getTypeOfSymbolAsync(snapshot: string, project: string, symbol: string): Promise<TypeResponse | undefined>;
59
- getDeclaredTypeOfSymbol(snapshot: string, project: string, symbol: string): TypeResponse | undefined;
60
- getDeclaredTypeOfSymbolAsync(snapshot: string, project: string, symbol: string): Promise<TypeResponse | undefined>;
61
- typeToString(snapshot: string, project: string, typeHandle: string, location?: string, flags?: number): string;
62
- typeToStringAsync(snapshot: string, project: string, typeHandle: string, location?: string, flags?: number): Promise<string>;
63
- callJson<T>(method: string, params?: unknown): T;
64
- callJsonAsync<T>(method: string, params?: unknown): Promise<T>;
65
- callBinary(method: string, params?: unknown): Uint8Array | null;
66
- callBinaryAsync(method: string, params?: unknown): Promise<Uint8Array | null>;
67
- releaseHandle(handle: string): void;
68
- releaseHandleAsync(handle: string): Promise<void>;
69
- close(): void;
70
- closeAsync(): Promise<void>;
71
- }
72
- declare class CorsaVirtualDocument {
73
- #private;
74
- private constructor();
75
- static untitled(path: string, languageId: string, text: string): CorsaVirtualDocument;
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[]);
88
- campaign(nodeId: string): number;
89
- leaderId(): string | undefined;
90
- state<T>(): T | undefined;
91
- nodeState<T>(nodeId: string): T | undefined;
92
- document(nodeId: string, uri: string): VirtualDocumentState | undefined;
93
- openVirtualDocument(document: VirtualDocumentState): VirtualDocumentState;
94
- changeVirtualDocument(uri: string, changes: VirtualChange[]): VirtualDocumentState;
95
- closeVirtualDocument(uri: string): void;
96
- private requireLeader;
97
- }
98
- declare const version: typeof _$___index_js0.version;
1
+ //#region ../index.d.ts
2
+ /**
3
+ * Returns the package version exposed by the native addon.
4
+ *
5
+ * # Examples
6
+ *
7
+ * ```
8
+ * assert_eq!(corsa_node::version(), env!("CARGO_PKG_VERSION"));
9
+ * ```
10
+ */
11
+ declare function version(): string;
99
12
  //#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 };
13
+ export { version };
101
14
  //# sourceMappingURL=index.d.mts.map