@corsa-bind/napi 0.13.0 → 0.14.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 CHANGED
@@ -97,5 +97,5 @@ declare class CorsaDistributedOrchestrator {
97
97
  }
98
98
  declare const version: typeof _$___index_js0.version;
99
99
  //#endregion
100
- export { ApiClientOptions, ApiMode, CapabilitiesResponse, ConfigResponse, CorsaApiClient, CorsaApiClient as TsgoApiClient, CorsaDistributedOrchestrator, CorsaDistributedOrchestrator as TsgoDistributedOrchestrator, CorsaVirtualDocument, CorsaVirtualDocument as TsgoVirtualDocument, 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 };
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 };
101
101
  //# sourceMappingURL=index.d.mts.map
package/dist/index.mjs CHANGED
@@ -75,10 +75,10 @@ var CorsaApiClient = class CorsaApiClient {
75
75
  this.#inner = inner;
76
76
  }
77
77
  static spawn(options) {
78
- return new CorsaApiClient(binding.TsgoApiClient.spawn(toJson(options)));
78
+ return new CorsaApiClient(binding.CorsaApiClient.spawn(toJson(options)));
79
79
  }
80
80
  static async spawnAsync(options) {
81
- return new CorsaApiClient(await binding.spawnTsgoApiClientAsync(toJson(options)));
81
+ return new CorsaApiClient(await binding.spawnCorsaApiClientAsync(toJson(options)));
82
82
  }
83
83
  initialize() {
84
84
  return fromJson(this.#inner.initializeJson());
@@ -177,10 +177,10 @@ var CorsaVirtualDocument = class CorsaVirtualDocument {
177
177
  this.#inner = inner;
178
178
  }
179
179
  static untitled(path, languageId, text) {
180
- return new CorsaVirtualDocument(binding.TsgoVirtualDocument.untitled(path, languageId, text));
180
+ return new CorsaVirtualDocument(binding.CorsaVirtualDocument.untitled(path, languageId, text));
181
181
  }
182
182
  static inMemory(authority, path, languageId, text) {
183
- return new CorsaVirtualDocument(binding.TsgoVirtualDocument.inMemory(authority, path, languageId, text));
183
+ return new CorsaVirtualDocument(binding.CorsaVirtualDocument.inMemory(authority, path, languageId, text));
184
184
  }
185
185
  get uri() {
186
186
  return this.#inner.uri;
@@ -207,7 +207,7 @@ var CorsaVirtualDocument = class CorsaVirtualDocument {
207
207
  var CorsaDistributedOrchestrator = class {
208
208
  #inner;
209
209
  constructor(nodeIds) {
210
- this.#inner = new binding.TsgoDistributedOrchestrator(nodeIds);
210
+ this.#inner = new binding.CorsaDistributedOrchestrator(nodeIds);
211
211
  }
212
212
  campaign(nodeId) {
213
213
  return this.#inner.campaign(nodeId);
@@ -244,6 +244,6 @@ var CorsaDistributedOrchestrator = class {
244
244
  };
245
245
  const version = binding.version;
246
246
  //#endregion
247
- export { CorsaApiClient, CorsaApiClient as TsgoApiClient, CorsaDistributedOrchestrator, CorsaDistributedOrchestrator as TsgoDistributedOrchestrator, CorsaVirtualDocument, CorsaVirtualDocument as TsgoVirtualDocument, Utils, classifyTypeText, binding as default, isAnyLikeTypeTexts, isArrayLikeTypeTexts, isBigIntLikeTypeTexts, isErrorLikeTypeTexts, isNumberLikeTypeTexts, isPromiseLikeTypeTexts, isStringArrayLikeTypeTexts, isStringLikeTypeTexts, isUnknownLikeTypeTexts, isUnsafeAssignment, isUnsafeReturn, nativeLintRuleMetas, runNativeLintRule, splitTopLevelTypeText, splitTypeText, version };
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 };
248
248
 
249
249
  //# sourceMappingURL=index.mjs.map
@@ -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.TsgoApiClient>;\ntype NativeDistributedOrchestrator = InstanceType<typeof binding.TsgoDistributedOrchestrator>;\ntype NativeVirtualDocument = InstanceType<typeof binding.TsgoVirtualDocument>;\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.TsgoApiClient.spawn(toJson(options)));\n }\n\n static async spawnAsync(options: ApiClientOptions): Promise<CorsaApiClient> {\n return new CorsaApiClient(await binding.spawnTsgoApiClientAsync(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.TsgoVirtualDocument.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.TsgoVirtualDocument.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.TsgoDistributedOrchestrator(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 {\n CorsaApiClient as TsgoApiClient,\n CorsaDistributedOrchestrator as TsgoDistributedOrchestrator,\n CorsaVirtualDocument as TsgoVirtualDocument,\n};\n\nexport default binding;\nexport const version = binding.version;\nexport type * from \"./types\";\n"],"mappings":";;AAmBA,MAAM,UACJ,aAAa,eAAe,aAAa,UAAU;AAOrD,SAAS,SAAY,OAAkB;CACrC,OAAO,KAAK,MAAM,MAAM;;AAG1B,SAAS,OAAO,OAAwB;CACtC,OAAO,KAAK,UAAU,SAAS,KAAK;;AAGtC,SAAgB,mBAAmB,OAAqC;CACtE,OAAO,QAAQ,mBAAmB,OAAO,MAAM,CAAC;;AAGlD,SAAgB,eAAe,OAAqC;CAClE,OAAO,QAAQ,eAAe,OAAO,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AW,KAAK,UAAU;EAChC,IAAI,CAAC,UACH,MAAM,IAAI,MAAM,mCAAmC;EAErD,OAAO;;;AAWX,MAAa,UAAU,QAAQ"}
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":";;AAmBA,MAAM,UACJ,aAAa,eAAe,aAAa,UAAU;AAOrD,SAAS,SAAY,OAAkB;CACrC,OAAO,KAAK,MAAM,MAAM;;AAG1B,SAAS,OAAO,OAAwB;CACtC,OAAO,KAAK,UAAU,SAAS,KAAK;;AAGtC,SAAgB,mBA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AAC,CAClF;;CAGH,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;;;AAKX,MAAa,UAAU,QAAQ"}
package/index.d.ts CHANGED
@@ -1,14 +1,14 @@
1
1
  /* auto-generated by NAPI-RS */
2
2
  /* eslint-disable */
3
3
  /** Thin synchronous wrapper around the Rust stdio API client. */
4
- export declare class TsgoApiClient {
4
+ export declare class CorsaApiClient {
5
5
  /** Spawns a new client from a JSON-encoded spawn config. */
6
- static spawn(optionsJson: string): TsgoApiClient
6
+ static spawn(optionsJson: string): CorsaApiClient
7
7
  /** Calls `initialize` and returns the raw JSON response. */
8
8
  initializeJson(): string
9
9
  /** Calls `initialize` without blocking the JavaScript event loop. */
10
10
  initializeJsonAsync(): Promise<string>
11
- /** Parses a `tsconfig` through tsgo and returns the JSON response. */
11
+ /** Parses a `tsconfig` through corsa and returns the JSON response. */
12
12
  parseConfigFileJson(file: string): string
13
13
  /** Parses a `tsconfig` on a libuv worker thread. */
14
14
  parseConfigFileJsonAsync(file: string): Promise<string>
@@ -49,9 +49,9 @@ export declare class TsgoApiClient {
49
49
  callBinary(method: string, paramsJson?: string | undefined | null): Buffer | null
50
50
  /** Sends an arbitrary binary endpoint request on a libuv worker thread. */
51
51
  callBinaryAsync(method: string, paramsJson?: string | undefined | null): Promise<Buffer | null>
52
- /** Releases a tsgo handle explicitly. */
52
+ /** Releases a corsa handle explicitly. */
53
53
  releaseHandle(handle: string): void
54
- /** Releases a tsgo handle on a libuv worker thread. */
54
+ /** Releases a corsa handle on a libuv worker thread. */
55
55
  releaseHandleAsync(handle: string): Promise<void>
56
56
  /** Closes the underlying worker process. */
57
57
  close(): void
@@ -60,7 +60,7 @@ export declare class TsgoApiClient {
60
60
  }
61
61
 
62
62
  /** N-API wrapper for the distributed orchestration layer. */
63
- export declare class TsgoDistributedOrchestrator {
63
+ export declare class CorsaDistributedOrchestrator {
64
64
  /** Creates a new in-process Raft cluster. */
65
65
  constructor(nodeIds: Array<string>)
66
66
  /** Starts a leader election and returns the resulting term. */
@@ -82,11 +82,11 @@ export declare class TsgoDistributedOrchestrator {
82
82
  }
83
83
 
84
84
  /** Mutable virtual document mirrored through the LSP overlay layer. */
85
- export declare class TsgoVirtualDocument {
85
+ export declare class CorsaVirtualDocument {
86
86
  /** Creates an `untitled:` document. */
87
- static untitled(path: string, languageId: string, text: string): TsgoVirtualDocument
87
+ static untitled(path: string, languageId: string, text: string): CorsaVirtualDocument
88
88
  /** Creates an in-memory `corsa://` document. */
89
- static inMemory(authority: string, path: string, languageId: string, text: string): TsgoVirtualDocument
89
+ static inMemory(authority: string, path: string, languageId: string, text: string): CorsaVirtualDocument
90
90
  /** Returns the document URI. */
91
91
  get uri(): string
92
92
  /** Returns the language identifier. */
@@ -132,7 +132,7 @@ export declare function nativeLintRuleMetasJson(): string
132
132
  export declare function runNativeLintRule(ruleName: string, nodeJson: string): string
133
133
 
134
134
  /** Spawns a new client on a libuv worker thread. */
135
- export declare function spawnTsgoApiClientAsync(optionsJson: string): Promise<TsgoApiClient>
135
+ export declare function spawnCorsaApiClientAsync(optionsJson: string): Promise<CorsaApiClient>
136
136
 
137
137
  export declare function splitTopLevelTypeText(text: string, delimiter: string): Array<string>
138
138
 
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.13.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.13.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
80
+ if (bindingPackageVersion !== '0.14.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.14.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.13.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.13.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
96
+ if (bindingPackageVersion !== '0.14.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.14.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.13.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.13.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
117
+ if (bindingPackageVersion !== '0.14.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.14.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.13.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.13.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
133
+ if (bindingPackageVersion !== '0.14.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.14.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.13.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.13.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
150
+ if (bindingPackageVersion !== '0.14.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.14.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.13.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.13.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
166
+ if (bindingPackageVersion !== '0.14.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.14.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.13.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.13.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
185
+ if (bindingPackageVersion !== '0.14.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.14.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.13.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.13.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
201
+ if (bindingPackageVersion !== '0.14.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.14.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.13.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.13.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
217
+ if (bindingPackageVersion !== '0.14.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.14.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.13.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.13.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
237
+ if (bindingPackageVersion !== '0.14.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.14.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.13.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.13.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
253
+ if (bindingPackageVersion !== '0.14.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.14.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.13.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.13.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
274
+ if (bindingPackageVersion !== '0.14.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.14.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.13.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.13.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
290
+ if (bindingPackageVersion !== '0.14.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.14.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.13.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.13.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
308
+ if (bindingPackageVersion !== '0.14.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.14.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.13.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.13.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
324
+ if (bindingPackageVersion !== '0.14.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.14.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.13.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.13.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
342
+ if (bindingPackageVersion !== '0.14.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.14.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.13.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.13.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
358
+ if (bindingPackageVersion !== '0.14.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.14.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.13.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.13.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
376
+ if (bindingPackageVersion !== '0.14.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.14.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.13.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.13.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
392
+ if (bindingPackageVersion !== '0.14.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.14.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.13.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.13.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
410
+ if (bindingPackageVersion !== '0.14.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.14.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.13.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.13.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
426
+ if (bindingPackageVersion !== '0.14.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.14.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.13.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.13.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
443
+ if (bindingPackageVersion !== '0.14.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.14.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.13.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.13.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
459
+ if (bindingPackageVersion !== '0.14.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.14.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.13.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.13.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
479
+ if (bindingPackageVersion !== '0.14.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.14.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.13.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.13.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
495
+ if (bindingPackageVersion !== '0.14.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.14.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.13.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.13.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
511
+ if (bindingPackageVersion !== '0.14.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.14.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
513
513
  }
514
514
  return binding
515
515
  } catch (e) {
@@ -576,9 +576,9 @@ if (!nativeBinding) {
576
576
  }
577
577
 
578
578
  module.exports = nativeBinding
579
- module.exports.TsgoApiClient = nativeBinding.TsgoApiClient
580
- module.exports.TsgoDistributedOrchestrator = nativeBinding.TsgoDistributedOrchestrator
581
- module.exports.TsgoVirtualDocument = nativeBinding.TsgoVirtualDocument
579
+ module.exports.CorsaApiClient = nativeBinding.CorsaApiClient
580
+ module.exports.CorsaDistributedOrchestrator = nativeBinding.CorsaDistributedOrchestrator
581
+ module.exports.CorsaVirtualDocument = nativeBinding.CorsaVirtualDocument
582
582
  module.exports.classifyTypeText = nativeBinding.classifyTypeText
583
583
  module.exports.isAnyLikeTypeTexts = nativeBinding.isAnyLikeTypeTexts
584
584
  module.exports.isArrayLikeTypeTexts = nativeBinding.isArrayLikeTypeTexts
@@ -593,7 +593,7 @@ module.exports.isUnsafeAssignment = nativeBinding.isUnsafeAssignment
593
593
  module.exports.isUnsafeReturn = nativeBinding.isUnsafeReturn
594
594
  module.exports.nativeLintRuleMetasJson = nativeBinding.nativeLintRuleMetasJson
595
595
  module.exports.runNativeLintRule = nativeBinding.runNativeLintRule
596
- module.exports.spawnTsgoApiClientAsync = nativeBinding.spawnTsgoApiClientAsync
596
+ module.exports.spawnCorsaApiClientAsync = nativeBinding.spawnCorsaApiClientAsync
597
597
  module.exports.splitTopLevelTypeText = nativeBinding.splitTopLevelTypeText
598
598
  module.exports.splitTypeText = nativeBinding.splitTypeText
599
599
  module.exports.version = nativeBinding.version
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@corsa-bind/napi",
3
- "version": "0.13.0",
3
+ "version": "0.14.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.13.0",
55
- "@corsa-bind/napi-darwin-x64": "0.13.0",
56
- "@corsa-bind/napi-linux-x64-gnu": "0.13.0",
57
- "@corsa-bind/napi-darwin-arm64": "0.13.0",
58
- "@corsa-bind/napi-win32-arm64-msvc": "0.13.0",
59
- "@corsa-bind/napi-linux-x64-musl": "0.13.0",
60
- "@corsa-bind/napi-linux-arm64-gnu": "0.13.0",
61
- "@corsa-bind/napi-linux-arm64-musl": "0.13.0"
54
+ "@corsa-bind/napi-win32-x64-msvc": "0.14.0",
55
+ "@corsa-bind/napi-darwin-x64": "0.14.0",
56
+ "@corsa-bind/napi-linux-x64-gnu": "0.14.0",
57
+ "@corsa-bind/napi-darwin-arm64": "0.14.0",
58
+ "@corsa-bind/napi-win32-arm64-msvc": "0.14.0",
59
+ "@corsa-bind/napi-linux-x64-musl": "0.14.0",
60
+ "@corsa-bind/napi-linux-arm64-gnu": "0.14.0",
61
+ "@corsa-bind/napi-linux-arm64-musl": "0.14.0"
62
62
  }
63
63
  }