@corsa-bind/napi 0.7.0 → 0.7.1
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 +3 -1
- package/dist/index.mjs +5 -1
- package/dist/index.mjs.map +1 -1
- package/index.d.ts +1 -0
- package/index.js +2 -1
- package/package.json +9 -9
package/dist/index.d.mts
CHANGED
|
@@ -16,6 +16,7 @@ declare function isBigIntLikeTypeTexts(typeTexts: readonly string[]): boolean;
|
|
|
16
16
|
declare function isAnyLikeTypeTexts(typeTexts: readonly string[]): boolean;
|
|
17
17
|
declare function isUnknownLikeTypeTexts(typeTexts: readonly string[]): boolean;
|
|
18
18
|
declare function isArrayLikeTypeTexts(typeTexts: readonly string[]): boolean;
|
|
19
|
+
declare function isStringArrayLikeTypeTexts(typeTexts: readonly string[]): boolean;
|
|
19
20
|
declare function isPromiseLikeTypeTexts(typeTexts: readonly string[], propertyNames?: readonly string[]): boolean;
|
|
20
21
|
declare function isErrorLikeTypeTexts(typeTexts: readonly string[], propertyNames?: readonly string[]): boolean;
|
|
21
22
|
declare const Utils: Readonly<{
|
|
@@ -28,6 +29,7 @@ declare const Utils: Readonly<{
|
|
|
28
29
|
isAnyLikeTypeTexts: typeof isAnyLikeTypeTexts;
|
|
29
30
|
isUnknownLikeTypeTexts: typeof isUnknownLikeTypeTexts;
|
|
30
31
|
isArrayLikeTypeTexts: typeof isArrayLikeTypeTexts;
|
|
32
|
+
isStringArrayLikeTypeTexts: typeof isStringArrayLikeTypeTexts;
|
|
31
33
|
isPromiseLikeTypeTexts: typeof isPromiseLikeTypeTexts;
|
|
32
34
|
isErrorLikeTypeTexts: typeof isErrorLikeTypeTexts;
|
|
33
35
|
}>;
|
|
@@ -79,5 +81,5 @@ declare class CorsaDistributedOrchestrator {
|
|
|
79
81
|
}
|
|
80
82
|
declare const version: typeof ___index_js0.version;
|
|
81
83
|
//#endregion
|
|
82
|
-
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, isStringLikeTypeTexts, isUnknownLikeTypeTexts, isUnsafeAssignment, isUnsafeReturn, nativeLintRuleMetas, runNativeLintRule, splitTopLevelTypeText, splitTypeText, version };
|
|
84
|
+
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 };
|
|
83
85
|
//# sourceMappingURL=index.d.mts.map
|
package/dist/index.mjs
CHANGED
|
@@ -46,6 +46,9 @@ function isUnknownLikeTypeTexts(typeTexts) {
|
|
|
46
46
|
function isArrayLikeTypeTexts(typeTexts) {
|
|
47
47
|
return binding.isArrayLikeTypeTexts([...typeTexts]);
|
|
48
48
|
}
|
|
49
|
+
function isStringArrayLikeTypeTexts(typeTexts) {
|
|
50
|
+
return binding.isStringArrayLikeTypeTexts([...typeTexts]);
|
|
51
|
+
}
|
|
49
52
|
function isPromiseLikeTypeTexts(typeTexts, propertyNames = []) {
|
|
50
53
|
return binding.isPromiseLikeTypeTexts([...typeTexts], [...propertyNames]);
|
|
51
54
|
}
|
|
@@ -62,6 +65,7 @@ const Utils = Object.freeze({
|
|
|
62
65
|
isAnyLikeTypeTexts,
|
|
63
66
|
isUnknownLikeTypeTexts,
|
|
64
67
|
isArrayLikeTypeTexts,
|
|
68
|
+
isStringArrayLikeTypeTexts,
|
|
65
69
|
isPromiseLikeTypeTexts,
|
|
66
70
|
isErrorLikeTypeTexts
|
|
67
71
|
});
|
|
@@ -192,6 +196,6 @@ var CorsaDistributedOrchestrator = class {
|
|
|
192
196
|
};
|
|
193
197
|
const version = binding.version;
|
|
194
198
|
//#endregion
|
|
195
|
-
export { CorsaApiClient, CorsaApiClient as TsgoApiClient, CorsaDistributedOrchestrator, CorsaDistributedOrchestrator as TsgoDistributedOrchestrator, CorsaVirtualDocument, CorsaVirtualDocument as TsgoVirtualDocument, Utils, classifyTypeText, binding as default, isAnyLikeTypeTexts, isArrayLikeTypeTexts, isBigIntLikeTypeTexts, isErrorLikeTypeTexts, isNumberLikeTypeTexts, isPromiseLikeTypeTexts, isStringLikeTypeTexts, isUnknownLikeTypeTexts, isUnsafeAssignment, isUnsafeReturn, nativeLintRuleMetas, runNativeLintRule, splitTopLevelTypeText, splitTypeText, version };
|
|
199
|
+
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 };
|
|
196
200
|
|
|
197
201
|
//# sourceMappingURL=index.mjs.map
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":["#inner"],"sources":["../ts/index.ts"],"sourcesContent":["import * as nativeModule from \"../index.js\";\n\nimport type {\n ApiClientOptions,\n ConfigResponse,\n InitializeResponse,\n NativeLintDiagnostic,\n NativeLintNode,\n NativeLintRuleMeta,\n SymbolResponse,\n TypeTextKind,\n TypeResponse,\n UnsafeTypeFlowInput,\n UpdateSnapshotParams,\n UpdateSnapshotResponse,\n VirtualChange,\n VirtualDocumentState,\n} from \"./types\";\n\nconst binding = (\n \"default\" in nativeModule ? nativeModule.default : nativeModule\n) as typeof import(\"../index.js\");\n\ntype NativeApiClient = InstanceType<typeof binding.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 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 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 initialize(): InitializeResponse {\n return fromJson(this.#inner.initializeJson());\n }\n\n parseConfigFile(file: string): ConfigResponse {\n return fromJson(this.#inner.parseConfigFileJson(file));\n }\n\n updateSnapshot(params?: UpdateSnapshotParams): UpdateSnapshotResponse {\n return fromJson(this.#inner.updateSnapshotJson(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 getStringType(snapshot: string, project: string): TypeResponse {\n return fromJson(this.#inner.getStringTypeJson(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 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 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 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 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 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 callJson<T>(method: string, params?: unknown): T {\n return fromJson(this.#inner.callJson(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 releaseHandle(handle: string): void {\n this.#inner.releaseHandle(handle);\n }\n\n close(): void {\n this.#inner.close();\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;AACrC,QAAO,KAAK,MAAM,MAAM;;AAG1B,SAAS,OAAO,OAAwB;AACtC,QAAO,KAAK,UAAU,SAAS,KAAK;;AAGtC,SAAgB,mBAA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;CAGhE,SAAS,QAAwB;AAC/B,SAAO,MAAA,MAAY,SAAS,OAAO;;CAGrC,WAA+B;AAC7B,SAAO,MAAA,MAAY,UAAU,IAAI,KAAA;;CAGnC,QAA0B;EACxB,MAAM,QAAQ,MAAA,MAAY,WAAW;AACrC,SAAO,QAAQ,SAAY,MAAM,GAAG,KAAA;;CAGtC,UAAa,QAA+B;EAC1C,MAAM,QAAQ,MAAA,MAAY,cAAc,OAAO;AAC/C,SAAO,QAAQ,SAAY,MAAM,GAAG,KAAA;;CAGtC,SAAS,QAAgB,KAA+C;EACtE,MAAM,QAAQ,MAAA,MAAY,aAAa,QAAQ,IAAI;AACnD,SAAO,QAAQ,SAA+B,MAAM,GAAG,KAAA;;CAGzD,oBAAoB,UAAsD;AACxE,SAAO,SAAS,MAAA,MAAY,wBAAwB,KAAK,eAAe,EAAE,OAAO,SAAS,CAAC,CAAC;;CAG9F,sBAAsB,KAAa,SAAgD;AACjF,SAAO,SACL,MAAA,MAAY,0BAA0B,KAAK,eAAe,EAAE,KAAK,OAAO,QAAQ,CAAC,CAClF;;CAGH,qBAAqB,KAAmB;AACtC,QAAA,MAAY,qBAAqB,KAAK,eAAe,EAAE,IAAI;;CAG7D,gBAAgC;EAC9B,MAAM,WAAW,KAAK,UAAU;AAChC,MAAI,CAAC,SACH,OAAM,IAAI,MAAM,mCAAmC;AAErD,SAAO;;;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.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 initialize(): InitializeResponse {\n return fromJson(this.#inner.initializeJson());\n }\n\n parseConfigFile(file: string): ConfigResponse {\n return fromJson(this.#inner.parseConfigFileJson(file));\n }\n\n updateSnapshot(params?: UpdateSnapshotParams): UpdateSnapshotResponse {\n return fromJson(this.#inner.updateSnapshotJson(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 getStringType(snapshot: string, project: string): TypeResponse {\n return fromJson(this.#inner.getStringTypeJson(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 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 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 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 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 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 callJson<T>(method: string, params?: unknown): T {\n return fromJson(this.#inner.callJson(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 releaseHandle(handle: string): void {\n this.#inner.releaseHandle(handle);\n }\n\n close(): void {\n this.#inner.close();\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;AACrC,QAAO,KAAK,MAAM,MAAM;;AAG1B,SAAS,OAAO,OAAwB;AACtC,QAAO,KAAK,UAAU,SAAS,KAAK;;AAGtC,SAAgB,mBAAmB,OAAqC;AACtE,QAAO,QAAQ,mBAAmB,OAAO,MAAM,CAAC;;AAGlD,SAAgB,eAAe,OAAqC;AAClE,QAAO,QAAQ,eAAe,OAAO,MAAM,CAAC;;AAG9C,SAAgB,kBAAkB,UAAkB,MAA8C;AAChG,QAAO,SAAS,QAAQ,kBAAkB,UAAU,OAAO,KAAK,CAAC,CAAC;;AAGpE,SAAgB,sBAA4C;AAC1D,QAAO,SAAS,QAAQ,yBAAyB,CAAC;;AAGpD,SAAgB,iBAAiB,MAA6B;AAC5D,QAAO,QAAQ,iBAAiB,KAAK;;AAGvC,SAAgB,sBAAsB,MAAc,WAA6B;AAC/E,QAAO,QAAQ,sBAAsB,MAAM,UAAU;;AAGvD,SAAgB,cAAc,MAAwB;AACpD,QAAO,QAAQ,cAAc,KAAK;;AAGpC,SAAgB,sBAAsB,WAAuC;AAC3E,QAAO,QAAQ,sBAAsB,CAAC,GAAG,UAAU,CAAC;;AAGtD,SAAgB,sBAAsB,WAAuC;AAC3E,QAAO,QAAQ,sBAAsB,CAAC,GAAG,UAAU,CAAC;;AAGtD,SAAgB,sBAAsB,WAAuC;AAC3E,QAAO,QAAQ,sBAAsB,CAAC,GAAG,UAAU,CAAC;;AAGtD,SAAgB,mBAAmB,WAAuC;AACxE,QAAO,QAAQ,mBAAmB,CAAC,GAAG,UAAU,CAAC;;AAGnD,SAAgB,uBAAuB,WAAuC;AAC5E,QAAO,QAAQ,uBAAuB,CAAC,GAAG,UAAU,CAAC;;AAGv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C;AAErD,SAAO;;;AAWX,MAAa,UAAU,QAAQ"}
|
package/index.d.ts
CHANGED
|
@@ -16,6 +16,7 @@ export declare function isBigIntLikeTypeTexts(typeTexts: Array<string>): boolean
|
|
|
16
16
|
export declare function isAnyLikeTypeTexts(typeTexts: Array<string>): boolean
|
|
17
17
|
export declare function isUnknownLikeTypeTexts(typeTexts: Array<string>): boolean
|
|
18
18
|
export declare function isArrayLikeTypeTexts(typeTexts: Array<string>): boolean
|
|
19
|
+
export declare function isStringArrayLikeTypeTexts(typeTexts: Array<string>): boolean
|
|
19
20
|
export declare function isPromiseLikeTypeTexts(typeTexts: Array<string>, propertyNames?: Array<string> | undefined | null): boolean
|
|
20
21
|
export declare function isErrorLikeTypeTexts(typeTexts: Array<string>, propertyNames?: Array<string> | undefined | null): boolean
|
|
21
22
|
/**
|
package/index.js
CHANGED
|
@@ -310,7 +310,7 @@ if (!nativeBinding) {
|
|
|
310
310
|
throw new Error(`Failed to load native binding`)
|
|
311
311
|
}
|
|
312
312
|
|
|
313
|
-
const { TsgoApiClient, TsgoVirtualDocument, runNativeLintRule, nativeLintRuleMetasJson, TsgoDistributedOrchestrator, isUnsafeAssignment, isUnsafeReturn, classifyTypeText, splitTopLevelTypeText, splitTypeText, isStringLikeTypeTexts, isNumberLikeTypeTexts, isBigIntLikeTypeTexts, isAnyLikeTypeTexts, isUnknownLikeTypeTexts, isArrayLikeTypeTexts, isPromiseLikeTypeTexts, isErrorLikeTypeTexts, version } = nativeBinding
|
|
313
|
+
const { TsgoApiClient, TsgoVirtualDocument, runNativeLintRule, nativeLintRuleMetasJson, TsgoDistributedOrchestrator, isUnsafeAssignment, isUnsafeReturn, classifyTypeText, splitTopLevelTypeText, splitTypeText, isStringLikeTypeTexts, isNumberLikeTypeTexts, isBigIntLikeTypeTexts, isAnyLikeTypeTexts, isUnknownLikeTypeTexts, isArrayLikeTypeTexts, isStringArrayLikeTypeTexts, isPromiseLikeTypeTexts, isErrorLikeTypeTexts, version } = nativeBinding
|
|
314
314
|
|
|
315
315
|
module.exports.TsgoApiClient = TsgoApiClient
|
|
316
316
|
module.exports.TsgoVirtualDocument = TsgoVirtualDocument
|
|
@@ -328,6 +328,7 @@ module.exports.isBigIntLikeTypeTexts = isBigIntLikeTypeTexts
|
|
|
328
328
|
module.exports.isAnyLikeTypeTexts = isAnyLikeTypeTexts
|
|
329
329
|
module.exports.isUnknownLikeTypeTexts = isUnknownLikeTypeTexts
|
|
330
330
|
module.exports.isArrayLikeTypeTexts = isArrayLikeTypeTexts
|
|
331
|
+
module.exports.isStringArrayLikeTypeTexts = isStringArrayLikeTypeTexts
|
|
331
332
|
module.exports.isPromiseLikeTypeTexts = isPromiseLikeTypeTexts
|
|
332
333
|
module.exports.isErrorLikeTypeTexts = isErrorLikeTypeTexts
|
|
333
334
|
module.exports.version = version
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@corsa-bind/napi",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.1",
|
|
4
4
|
"description": "Native Node.js bindings for corsa and typescript-go stdio workflows",
|
|
5
5
|
"homepage": "https://github.com/ubugeeei/corsa-bind/tree/main/src/bindings/nodejs/corsa_node",
|
|
6
6
|
"bugs": {
|
|
@@ -46,13 +46,13 @@
|
|
|
46
46
|
"node": ">=22"
|
|
47
47
|
},
|
|
48
48
|
"optionalDependencies": {
|
|
49
|
-
"@corsa-bind/napi-win32-x64-msvc": "0.7.
|
|
50
|
-
"@corsa-bind/napi-darwin-x64": "0.7.
|
|
51
|
-
"@corsa-bind/napi-linux-x64-gnu": "0.7.
|
|
52
|
-
"@corsa-bind/napi-darwin-arm64": "0.7.
|
|
53
|
-
"@corsa-bind/napi-win32-arm64-msvc": "0.7.
|
|
54
|
-
"@corsa-bind/napi-linux-x64-musl": "0.7.
|
|
55
|
-
"@corsa-bind/napi-linux-arm64-gnu": "0.7.
|
|
56
|
-
"@corsa-bind/napi-linux-arm64-musl": "0.7.
|
|
49
|
+
"@corsa-bind/napi-win32-x64-msvc": "0.7.1",
|
|
50
|
+
"@corsa-bind/napi-darwin-x64": "0.7.1",
|
|
51
|
+
"@corsa-bind/napi-linux-x64-gnu": "0.7.1",
|
|
52
|
+
"@corsa-bind/napi-darwin-arm64": "0.7.1",
|
|
53
|
+
"@corsa-bind/napi-win32-arm64-msvc": "0.7.1",
|
|
54
|
+
"@corsa-bind/napi-linux-x64-musl": "0.7.1",
|
|
55
|
+
"@corsa-bind/napi-linux-arm64-gnu": "0.7.1",
|
|
56
|
+
"@corsa-bind/napi-linux-arm64-musl": "0.7.1"
|
|
57
57
|
}
|
|
58
58
|
}
|