@corsa-bind/napi 0.16.0 → 0.18.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/binding.mjs DELETED
@@ -1,14 +0,0 @@
1
- import * as nativeModule from "../index.js";
2
- //#region binding.ts
3
- /**
4
- * Resolved native module shape.
5
- *
6
- * `napi-rs` output can be loaded either as the namespace object itself or under
7
- * a default export depending on the runtime bridge. This value normalizes both
8
- * shapes so wrapper modules can call native methods without repeating the check.
9
- */
10
- const binding = "default" in nativeModule ? nativeModule.default : nativeModule;
11
- //#endregion
12
- export { binding };
13
-
14
- //# sourceMappingURL=binding.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"binding.mjs","names":[],"sources":["../ts/binding.ts"],"sourcesContent":["import * as nativeModule from \"../index.js\";\n\n/**\n * Resolved native module shape.\n *\n * `napi-rs` output can be loaded either as the namespace object itself or under\n * a default export depending on the runtime bridge. This value normalizes both\n * shapes so wrapper modules can call native methods without repeating the check.\n */\nexport const binding = (\n \"default\" in nativeModule ? nativeModule.default : nativeModule\n) as typeof import(\"../index.js\");\n\n/** Native synchronous/asynchronous Corsa API client instance. */\nexport type NativeApiClient = InstanceType<typeof binding.CorsaApiClient>;\n\n/** Native replicated orchestration wrapper instance. */\nexport type NativeDistributedOrchestrator = InstanceType<\n typeof binding.CorsaDistributedOrchestrator\n>;\n\n/** Native virtual document wrapper instance. */\nexport type NativeVirtualDocument = InstanceType<typeof binding.CorsaVirtualDocument>;\n"],"mappings":";;;;;;;;;AASA,MAAa,UACX,aAAa,eAAe,aAAa,UAAU"}
@@ -1,29 +0,0 @@
1
- import { VirtualChange, VirtualDocumentState } from "./types.mjs";
2
-
3
- //#region distributed_orchestrator.d.ts
4
- /** Experimental replicated orchestrator wrapper for multi-node document state. */
5
- declare class CorsaDistributedOrchestrator {
6
- #private;
7
- /** Creates an orchestrator with the supplied logical node identifiers. */
8
- constructor(nodeIds: string[]);
9
- /** Starts or advances an election campaign for a node and returns the term. */
10
- campaign(nodeId: string): number;
11
- /** Returns the current leader id, or `undefined` before election completes. */
12
- leaderId(): string | undefined;
13
- /** Returns the replicated cluster state as caller-selected JSON shape. */
14
- state<T>(): T | undefined;
15
- /** Returns one node's state as caller-selected JSON shape. */
16
- nodeState<T>(nodeId: string): T | undefined;
17
- /** Returns one virtual document from a node, if the document is open there. */
18
- document(nodeId: string, uri: string): VirtualDocumentState | undefined;
19
- /** Opens a virtual document through the elected leader. */
20
- openVirtualDocument(document: VirtualDocumentState): VirtualDocumentState;
21
- /** Applies virtual-document changes through the elected leader. */
22
- changeVirtualDocument(uri: string, changes: VirtualChange[]): VirtualDocumentState;
23
- /** Closes a virtual document through the elected leader. */
24
- closeVirtualDocument(uri: string): void;
25
- private requireLeader;
26
- }
27
- //#endregion
28
- export { CorsaDistributedOrchestrator };
29
- //# sourceMappingURL=distributed_orchestrator.d.mts.map
@@ -1,55 +0,0 @@
1
- import { binding } from "./binding.mjs";
2
- import { fromJson, toJson } from "./json.mjs";
3
- //#region distributed_orchestrator.ts
4
- /** Experimental replicated orchestrator wrapper for multi-node document state. */
5
- var CorsaDistributedOrchestrator = class {
6
- #inner;
7
- /** Creates an orchestrator with the supplied logical node identifiers. */
8
- constructor(nodeIds) {
9
- this.#inner = new binding.CorsaDistributedOrchestrator(nodeIds);
10
- }
11
- /** Starts or advances an election campaign for a node and returns the term. */
12
- campaign(nodeId) {
13
- return this.#inner.campaign(nodeId);
14
- }
15
- /** Returns the current leader id, or `undefined` before election completes. */
16
- leaderId() {
17
- return this.#inner.leaderId() ?? void 0;
18
- }
19
- /** Returns the replicated cluster state as caller-selected JSON shape. */
20
- state() {
21
- const value = this.#inner.stateJson();
22
- return value ? fromJson(value) : void 0;
23
- }
24
- /** Returns one node's state as caller-selected JSON shape. */
25
- nodeState(nodeId) {
26
- const value = this.#inner.nodeStateJson(nodeId);
27
- return value ? fromJson(value) : void 0;
28
- }
29
- /** Returns one virtual document from a node, if the document is open there. */
30
- document(nodeId, uri) {
31
- const value = this.#inner.documentJson(nodeId, uri);
32
- return value ? fromJson(value) : void 0;
33
- }
34
- /** Opens a virtual document through the elected leader. */
35
- openVirtualDocument(document) {
36
- return fromJson(this.#inner.openVirtualDocumentJson(this.requireLeader(), toJson(document)));
37
- }
38
- /** Applies virtual-document changes through the elected leader. */
39
- changeVirtualDocument(uri, changes) {
40
- return fromJson(this.#inner.changeVirtualDocumentJson(this.requireLeader(), uri, toJson(changes)));
41
- }
42
- /** Closes a virtual document through the elected leader. */
43
- closeVirtualDocument(uri) {
44
- this.#inner.closeVirtualDocument(this.requireLeader(), uri);
45
- }
46
- requireLeader() {
47
- const leaderId = this.leaderId();
48
- if (!leaderId) throw new Error("raft leader has not been elected");
49
- return leaderId;
50
- }
51
- };
52
- //#endregion
53
- export { CorsaDistributedOrchestrator };
54
-
55
- //# sourceMappingURL=distributed_orchestrator.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"distributed_orchestrator.mjs","names":["#inner"],"sources":["../ts/distributed_orchestrator.ts"],"sourcesContent":["import { binding } from \"./binding\";\nimport { fromJson, toJson } from \"./json\";\n\nimport type { NativeDistributedOrchestrator } from \"./binding\";\nimport type { VirtualChange, VirtualDocumentState } from \"./types\";\n\n/** Experimental replicated orchestrator wrapper for multi-node document state. */\nexport class CorsaDistributedOrchestrator {\n readonly #inner: NativeDistributedOrchestrator;\n\n /** Creates an orchestrator with the supplied logical node identifiers. */\n constructor(nodeIds: string[]) {\n this.#inner = new binding.CorsaDistributedOrchestrator(nodeIds);\n }\n\n /** Starts or advances an election campaign for a node and returns the term. */\n campaign(nodeId: string): number {\n return this.#inner.campaign(nodeId);\n }\n\n /** Returns the current leader id, or `undefined` before election completes. */\n leaderId(): string | undefined {\n return this.#inner.leaderId() ?? undefined;\n }\n\n /** Returns the replicated cluster state as caller-selected JSON shape. */\n state<T>(): T | undefined {\n const value = this.#inner.stateJson();\n return value ? fromJson<T>(value) : undefined;\n }\n\n /** Returns one node's state as caller-selected JSON shape. */\n nodeState<T>(nodeId: string): T | undefined {\n const value = this.#inner.nodeStateJson(nodeId);\n return value ? fromJson<T>(value) : undefined;\n }\n\n /** Returns one virtual document from a node, if the document is open there. */\n document(nodeId: string, uri: string): VirtualDocumentState | undefined {\n const value = this.#inner.documentJson(nodeId, uri);\n return value ? fromJson<VirtualDocumentState>(value) : undefined;\n }\n\n /** Opens a virtual document through the elected leader. */\n openVirtualDocument(document: VirtualDocumentState): VirtualDocumentState {\n return fromJson(this.#inner.openVirtualDocumentJson(this.requireLeader(), toJson(document)));\n }\n\n /** Applies virtual-document changes through the elected leader. */\n changeVirtualDocument(uri: string, changes: VirtualChange[]): VirtualDocumentState {\n return fromJson(\n this.#inner.changeVirtualDocumentJson(this.requireLeader(), uri, toJson(changes)),\n );\n }\n\n /** Closes a virtual document through the elected leader. */\n closeVirtualDocument(uri: string): void {\n this.#inner.closeVirtualDocument(this.requireLeader(), uri);\n }\n\n private requireLeader(): string {\n const leaderId = this.leaderId();\n if (!leaderId) {\n throw new Error(\"raft leader has not been elected\");\n }\n return leaderId;\n }\n}\n"],"mappings":";;;;AAOA,IAAa,+BAAb,MAA0C;CACxC;;CAGA,YAAY,SAAmB;EAC7B,KAAKA,SAAS,IAAI,QAAQ,6BAA6B,QAAQ;;;CAIjE,SAAS,QAAwB;EAC/B,OAAO,KAAKA,OAAO,SAAS,OAAO;;;CAIrC,WAA+B;EAC7B,OAAO,KAAKA,OAAO,UAAU,IAAI,KAAA;;;CAInC,QAA0B;EACxB,MAAM,QAAQ,KAAKA,OAAO,WAAW;EACrC,OAAO,QAAQ,SAAY,MAAM,GAAG,KAAA;;;CAItC,UAAa,QAA+B;EAC1C,MAAM,QAAQ,KAAKA,OAAO,cAAc,OAAO;EAC/C,OAAO,QAAQ,SAAY,MAAM,GAAG,KAAA;;;CAItC,SAAS,QAAgB,KAA+C;EACtE,MAAM,QAAQ,KAAKA,OAAO,aAAa,QAAQ,IAAI;EACnD,OAAO,QAAQ,SAA+B,MAAM,GAAG,KAAA;;;CAIzD,oBAAoB,UAAsD;EACxE,OAAO,SAAS,KAAKA,OAAO,wBAAwB,KAAK,eAAe,EAAE,OAAO,SAAS,CAAC,CAAC;;;CAI9F,sBAAsB,KAAa,SAAgD;EACjF,OAAO,SACL,KAAKA,OAAO,0BAA0B,KAAK,eAAe,EAAE,KAAK,OAAO,QAAQ,CAAC,CAClF;;;CAIH,qBAAqB,KAAmB;EACtC,KAAKA,OAAO,qBAAqB,KAAK,eAAe,EAAE,IAAI;;CAG7D,gBAAgC;EAC9B,MAAM,WAAW,KAAK,UAAU;EAChC,IAAI,CAAC,UACH,MAAM,IAAI,MAAM,mCAAmC;EAErD,OAAO"}
package/dist/index2.d.mts DELETED
@@ -1,14 +0,0 @@
1
- import { version as version$1 } from "./index.mjs";
2
- import { binding } from "./binding.mjs";
3
- import { ApiClientOptions, ApiMode, CapabilitiesResponse, ConfigResponse, DiagnosticsCapabilities, DocumentIdentifier, EditorCapabilities, FileChangeSummary, FileChanges, FileDiagnosticsResponse, InitializeResponse, NativeLintDiagnostic, NativeLintFix, NativeLintNode, NativeLintRange, NativeLintRuleMeta, NativeLintSuggestion, OverlayCapabilities, OverlayChanges, OverlayUpdate, ProjectDiagnosticsResponse, ProjectResponse, RuntimeCapabilities, SnapshotDiagnosticsResponse, SymbolResponse, TypeResponse, TypeTextKind, UnsafeTypeFlowInput, UpdateSnapshotParams, UpdateSnapshotResponse, VirtualChange, VirtualDocumentState } from "./types.mjs";
4
- import { CorsaApiClient } from "./api_client.mjs";
5
- import { CorsaDistributedOrchestrator } from "./distributed_orchestrator.mjs";
6
- import { Utils, classifyTypeText, isAnyLikeTypeTexts, isArrayLikeTypeTexts, isBigIntLikeTypeTexts, isErrorLikeTypeTexts, isNumberLikeTypeTexts, isPromiseLikeTypeTexts, isStringArrayLikeTypeTexts, isStringLikeTypeTexts, isUnknownLikeTypeTexts, isUnsafeAssignment, isUnsafeReturn, nativeLintRuleMetas, runNativeLintRule, splitTopLevelTypeText, splitTypeText } from "./native_utils.mjs";
7
- import { CorsaVirtualDocument } from "./virtual_document.mjs";
8
-
9
- //#region index.d.ts
10
- /** Native binding version reported by the compiled napi module. */
11
- declare const version: typeof version$1;
12
- //#endregion
13
- 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 };
14
- //# sourceMappingURL=index2.d.mts.map
package/dist/json.mjs DELETED
@@ -1,18 +0,0 @@
1
- //#region json.ts
2
- /** Parses a JSON payload returned by the native binding into a typed value. */
3
- function fromJson(value) {
4
- return JSON.parse(value);
5
- }
6
- /**
7
- * Serializes optional request parameters for native methods.
8
- *
9
- * Native endpoints expect a JSON string even for omitted payloads, so `undefined`
10
- * is normalized to JSON `null` before crossing the napi boundary.
11
- */
12
- function toJson(value) {
13
- return JSON.stringify(value ?? null);
14
- }
15
- //#endregion
16
- export { fromJson, toJson };
17
-
18
- //# sourceMappingURL=json.mjs.map
package/dist/json.mjs.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"json.mjs","names":[],"sources":["../ts/json.ts"],"sourcesContent":["/** Parses a JSON payload returned by the native binding into a typed value. */\nexport function fromJson<T>(value: string): T {\n return JSON.parse(value) as T;\n}\n\n/**\n * Serializes optional request parameters for native methods.\n *\n * Native endpoints expect a JSON string even for omitted payloads, so `undefined`\n * is normalized to JSON `null` before crossing the napi boundary.\n */\nexport function toJson(value: unknown): string {\n return JSON.stringify(value ?? null);\n}\n"],"mappings":";;AACA,SAAgB,SAAY,OAAkB;CAC5C,OAAO,KAAK,MAAM,MAAM;;;;;;;;AAS1B,SAAgB,OAAO,OAAwB;CAC7C,OAAO,KAAK,UAAU,SAAS,KAAK"}
@@ -1,53 +0,0 @@
1
- import { NativeLintDiagnostic, NativeLintNode, NativeLintRuleMeta, TypeTextKind, UnsafeTypeFlowInput } from "./types.mjs";
2
-
3
- //#region native_utils.d.ts
4
- /** Runs the Rust unsafe-assignment classifier against serialized type-flow data. */
5
- declare function isUnsafeAssignment(input: UnsafeTypeFlowInput): boolean;
6
- /** Runs the Rust unsafe-return classifier against serialized type-flow data. */
7
- declare function isUnsafeReturn(input: UnsafeTypeFlowInput): boolean;
8
- /** Executes a native lint rule implementation and returns normalized diagnostics. */
9
- declare function runNativeLintRule(ruleName: string, node: NativeLintNode): NativeLintDiagnostic[];
10
- /** Lists rule metadata exposed by the Rust-backed native rule registry. */
11
- declare function nativeLintRuleMetas(): NativeLintRuleMeta[];
12
- /** Classifies a TypeScript type string into the Rust fast-path type categories. */
13
- declare function classifyTypeText(text?: string): TypeTextKind;
14
- /** Splits a type string by a top-level delimiter while respecting nested syntax. */
15
- declare function splitTopLevelTypeText(text: string, delimiter: string): string[];
16
- /** Splits a union/intersection-like type string into top-level constituents. */
17
- declare function splitTypeText(text: string): string[];
18
- /** Returns whether any supplied type text is string-like. */
19
- declare function isStringLikeTypeTexts(typeTexts: readonly string[]): boolean;
20
- /** Returns whether any supplied type text is number-like. */
21
- declare function isNumberLikeTypeTexts(typeTexts: readonly string[]): boolean;
22
- /** Returns whether any supplied type text is bigint-like. */
23
- declare function isBigIntLikeTypeTexts(typeTexts: readonly string[]): boolean;
24
- /** Returns whether any supplied type text is `any`-like. */
25
- declare function isAnyLikeTypeTexts(typeTexts: readonly string[]): boolean;
26
- /** Returns whether any supplied type text is `unknown`-like. */
27
- declare function isUnknownLikeTypeTexts(typeTexts: readonly string[]): boolean;
28
- /** Returns whether any supplied type text represents an array-like value. */
29
- declare function isArrayLikeTypeTexts(typeTexts: readonly string[]): boolean;
30
- /** Returns whether any supplied type text represents an array of strings. */
31
- declare function isStringArrayLikeTypeTexts(typeTexts: readonly string[]): boolean;
32
- /** Returns whether type text plus property names looks Promise-like. */
33
- declare function isPromiseLikeTypeTexts(typeTexts: readonly string[], propertyNames?: readonly string[]): boolean;
34
- /** Returns whether type text plus property names looks Error-like. */
35
- declare function isErrorLikeTypeTexts(typeTexts: readonly string[], propertyNames?: readonly string[]): boolean;
36
- /** Namespaced utility export matching the previous public API shape. */
37
- declare const Utils: Readonly<{
38
- classifyTypeText: typeof classifyTypeText;
39
- splitTopLevelTypeText: typeof splitTopLevelTypeText;
40
- splitTypeText: typeof splitTypeText;
41
- isStringLikeTypeTexts: typeof isStringLikeTypeTexts;
42
- isNumberLikeTypeTexts: typeof isNumberLikeTypeTexts;
43
- isBigIntLikeTypeTexts: typeof isBigIntLikeTypeTexts;
44
- isAnyLikeTypeTexts: typeof isAnyLikeTypeTexts;
45
- isUnknownLikeTypeTexts: typeof isUnknownLikeTypeTexts;
46
- isArrayLikeTypeTexts: typeof isArrayLikeTypeTexts;
47
- isStringArrayLikeTypeTexts: typeof isStringArrayLikeTypeTexts;
48
- isPromiseLikeTypeTexts: typeof isPromiseLikeTypeTexts;
49
- isErrorLikeTypeTexts: typeof isErrorLikeTypeTexts;
50
- }>;
51
- //#endregion
52
- export { Utils, classifyTypeText, isAnyLikeTypeTexts, isArrayLikeTypeTexts, isBigIntLikeTypeTexts, isErrorLikeTypeTexts, isNumberLikeTypeTexts, isPromiseLikeTypeTexts, isStringArrayLikeTypeTexts, isStringLikeTypeTexts, isUnknownLikeTypeTexts, isUnsafeAssignment, isUnsafeReturn, nativeLintRuleMetas, runNativeLintRule, splitTopLevelTypeText, splitTypeText };
53
- //# sourceMappingURL=native_utils.d.mts.map
@@ -1,86 +0,0 @@
1
- import { binding } from "./binding.mjs";
2
- import { fromJson, toJson } from "./json.mjs";
3
- //#region native_utils.ts
4
- /** Runs the Rust unsafe-assignment classifier against serialized type-flow data. */
5
- function isUnsafeAssignment(input) {
6
- return binding.isUnsafeAssignment(toJson(input));
7
- }
8
- /** Runs the Rust unsafe-return classifier against serialized type-flow data. */
9
- function isUnsafeReturn(input) {
10
- return binding.isUnsafeReturn(toJson(input));
11
- }
12
- /** Executes a native lint rule implementation and returns normalized diagnostics. */
13
- function runNativeLintRule(ruleName, node) {
14
- return fromJson(binding.runNativeLintRule(ruleName, toJson(node)));
15
- }
16
- /** Lists rule metadata exposed by the Rust-backed native rule registry. */
17
- function nativeLintRuleMetas() {
18
- return fromJson(binding.nativeLintRuleMetasJson());
19
- }
20
- /** Classifies a TypeScript type string into the Rust fast-path type categories. */
21
- function classifyTypeText(text) {
22
- return binding.classifyTypeText(text);
23
- }
24
- /** Splits a type string by a top-level delimiter while respecting nested syntax. */
25
- function splitTopLevelTypeText(text, delimiter) {
26
- return binding.splitTopLevelTypeText(text, delimiter);
27
- }
28
- /** Splits a union/intersection-like type string into top-level constituents. */
29
- function splitTypeText(text) {
30
- return binding.splitTypeText(text);
31
- }
32
- /** Returns whether any supplied type text is string-like. */
33
- function isStringLikeTypeTexts(typeTexts) {
34
- return binding.isStringLikeTypeTexts([...typeTexts]);
35
- }
36
- /** Returns whether any supplied type text is number-like. */
37
- function isNumberLikeTypeTexts(typeTexts) {
38
- return binding.isNumberLikeTypeTexts([...typeTexts]);
39
- }
40
- /** Returns whether any supplied type text is bigint-like. */
41
- function isBigIntLikeTypeTexts(typeTexts) {
42
- return binding.isBigIntLikeTypeTexts([...typeTexts]);
43
- }
44
- /** Returns whether any supplied type text is `any`-like. */
45
- function isAnyLikeTypeTexts(typeTexts) {
46
- return binding.isAnyLikeTypeTexts([...typeTexts]);
47
- }
48
- /** Returns whether any supplied type text is `unknown`-like. */
49
- function isUnknownLikeTypeTexts(typeTexts) {
50
- return binding.isUnknownLikeTypeTexts([...typeTexts]);
51
- }
52
- /** Returns whether any supplied type text represents an array-like value. */
53
- function isArrayLikeTypeTexts(typeTexts) {
54
- return binding.isArrayLikeTypeTexts([...typeTexts]);
55
- }
56
- /** Returns whether any supplied type text represents an array of strings. */
57
- function isStringArrayLikeTypeTexts(typeTexts) {
58
- return binding.isStringArrayLikeTypeTexts([...typeTexts]);
59
- }
60
- /** Returns whether type text plus property names looks Promise-like. */
61
- function isPromiseLikeTypeTexts(typeTexts, propertyNames = []) {
62
- return binding.isPromiseLikeTypeTexts([...typeTexts], [...propertyNames]);
63
- }
64
- /** Returns whether type text plus property names looks Error-like. */
65
- function isErrorLikeTypeTexts(typeTexts, propertyNames = []) {
66
- return binding.isErrorLikeTypeTexts([...typeTexts], [...propertyNames]);
67
- }
68
- /** Namespaced utility export matching the previous public API shape. */
69
- const Utils = Object.freeze({
70
- classifyTypeText,
71
- splitTopLevelTypeText,
72
- splitTypeText,
73
- isStringLikeTypeTexts,
74
- isNumberLikeTypeTexts,
75
- isBigIntLikeTypeTexts,
76
- isAnyLikeTypeTexts,
77
- isUnknownLikeTypeTexts,
78
- isArrayLikeTypeTexts,
79
- isStringArrayLikeTypeTexts,
80
- isPromiseLikeTypeTexts,
81
- isErrorLikeTypeTexts
82
- });
83
- //#endregion
84
- export { Utils, classifyTypeText, isAnyLikeTypeTexts, isArrayLikeTypeTexts, isBigIntLikeTypeTexts, isErrorLikeTypeTexts, isNumberLikeTypeTexts, isPromiseLikeTypeTexts, isStringArrayLikeTypeTexts, isStringLikeTypeTexts, isUnknownLikeTypeTexts, isUnsafeAssignment, isUnsafeReturn, nativeLintRuleMetas, runNativeLintRule, splitTopLevelTypeText, splitTypeText };
85
-
86
- //# sourceMappingURL=native_utils.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"native_utils.mjs","names":[],"sources":["../ts/native_utils.ts"],"sourcesContent":["import { binding } from \"./binding\";\nimport { fromJson, toJson } from \"./json\";\n\nimport type {\n NativeLintDiagnostic,\n NativeLintNode,\n NativeLintRuleMeta,\n TypeTextKind,\n UnsafeTypeFlowInput,\n} from \"./types\";\n\n/** Runs the Rust unsafe-assignment classifier against serialized type-flow data. */\nexport function isUnsafeAssignment(input: UnsafeTypeFlowInput): boolean {\n return binding.isUnsafeAssignment(toJson(input));\n}\n\n/** Runs the Rust unsafe-return classifier against serialized type-flow data. */\nexport function isUnsafeReturn(input: UnsafeTypeFlowInput): boolean {\n return binding.isUnsafeReturn(toJson(input));\n}\n\n/** Executes a native lint rule implementation and returns normalized diagnostics. */\nexport function runNativeLintRule(ruleName: string, node: NativeLintNode): NativeLintDiagnostic[] {\n return fromJson(binding.runNativeLintRule(ruleName, toJson(node)));\n}\n\n/** Lists rule metadata exposed by the Rust-backed native rule registry. */\nexport function nativeLintRuleMetas(): NativeLintRuleMeta[] {\n return fromJson(binding.nativeLintRuleMetasJson());\n}\n\n/** Classifies a TypeScript type string into the Rust fast-path type categories. */\nexport function classifyTypeText(text?: string): TypeTextKind {\n return binding.classifyTypeText(text) as TypeTextKind;\n}\n\n/** Splits a type string by a top-level delimiter while respecting nested syntax. */\nexport function splitTopLevelTypeText(text: string, delimiter: string): string[] {\n return binding.splitTopLevelTypeText(text, delimiter);\n}\n\n/** Splits a union/intersection-like type string into top-level constituents. */\nexport function splitTypeText(text: string): string[] {\n return binding.splitTypeText(text);\n}\n\n/** Returns whether any supplied type text is string-like. */\nexport function isStringLikeTypeTexts(typeTexts: readonly string[]): boolean {\n return binding.isStringLikeTypeTexts([...typeTexts]);\n}\n\n/** Returns whether any supplied type text is number-like. */\nexport function isNumberLikeTypeTexts(typeTexts: readonly string[]): boolean {\n return binding.isNumberLikeTypeTexts([...typeTexts]);\n}\n\n/** Returns whether any supplied type text is bigint-like. */\nexport function isBigIntLikeTypeTexts(typeTexts: readonly string[]): boolean {\n return binding.isBigIntLikeTypeTexts([...typeTexts]);\n}\n\n/** Returns whether any supplied type text is `any`-like. */\nexport function isAnyLikeTypeTexts(typeTexts: readonly string[]): boolean {\n return binding.isAnyLikeTypeTexts([...typeTexts]);\n}\n\n/** Returns whether any supplied type text is `unknown`-like. */\nexport function isUnknownLikeTypeTexts(typeTexts: readonly string[]): boolean {\n return binding.isUnknownLikeTypeTexts([...typeTexts]);\n}\n\n/** Returns whether any supplied type text represents an array-like value. */\nexport function isArrayLikeTypeTexts(typeTexts: readonly string[]): boolean {\n return binding.isArrayLikeTypeTexts([...typeTexts]);\n}\n\n/** Returns whether any supplied type text represents an array of strings. */\nexport function isStringArrayLikeTypeTexts(typeTexts: readonly string[]): boolean {\n return binding.isStringArrayLikeTypeTexts([...typeTexts]);\n}\n\n/** Returns whether type text plus property names looks Promise-like. */\nexport function isPromiseLikeTypeTexts(\n typeTexts: readonly string[],\n propertyNames: readonly string[] = [],\n): boolean {\n return binding.isPromiseLikeTypeTexts([...typeTexts], [...propertyNames]);\n}\n\n/** Returns whether type text plus property names looks Error-like. */\nexport function isErrorLikeTypeTexts(\n typeTexts: readonly string[],\n propertyNames: readonly string[] = [],\n): boolean {\n return binding.isErrorLikeTypeTexts([...typeTexts], [...propertyNames]);\n}\n\n/** Namespaced utility export matching the previous public API shape. */\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"],"mappings":";;;;AAYA,SAAgB,mBAAmB,OAAqC;CACtE,OAAO,QAAQ,mBAAmB,OAAO,MAAM,CAAC;;;AAIlD,SAAgB,eAAe,OAAqC;CAClE,OAAO,QAAQ,eAAe,OAAO,MAAM,CAAC;;;AAI9C,SAAgB,kBAAkB,UAAkB,MAA8C;CAChG,OAAO,SAAS,QAAQ,kBAAkB,UAAU,OAAO,KAAK,CAAC,CAAC;;;AAIpE,SAAgB,sBAA4C;CAC1D,OAAO,SAAS,QAAQ,yBAAyB,CAAC;;;AAIpD,SAAgB,iBAAiB,MAA6B;CAC5D,OAAO,QAAQ,iBAAiB,KAAK;;;AAIvC,SAAgB,sBAAsB,MAAc,WAA6B;CAC/E,OAAO,QAAQ,sBAAsB,MAAM,UAAU;;;AAIvD,SAAgB,cAAc,MAAwB;CACpD,OAAO,QAAQ,cAAc,KAAK;;;AAIpC,SAAgB,sBAAsB,WAAuC;CAC3E,OAAO,QAAQ,sBAAsB,CAAC,GAAG,UAAU,CAAC;;;AAItD,SAAgB,sBAAsB,WAAuC;CAC3E,OAAO,QAAQ,sBAAsB,CAAC,GAAG,UAAU,CAAC;;;AAItD,SAAgB,sBAAsB,WAAuC;CAC3E,OAAO,QAAQ,sBAAsB,CAAC,GAAG,UAAU,CAAC;;;AAItD,SAAgB,mBAAmB,WAAuC;CACxE,OAAO,QAAQ,mBAAmB,CAAC,GAAG,UAAU,CAAC;;;AAInD,SAAgB,uBAAuB,WAAuC;CAC5E,OAAO,QAAQ,uBAAuB,CAAC,GAAG,UAAU,CAAC;;;AAIvD,SAAgB,qBAAqB,WAAuC;CAC1E,OAAO,QAAQ,qBAAqB,CAAC,GAAG,UAAU,CAAC;;;AAIrD,SAAgB,2BAA2B,WAAuC;CAChF,OAAO,QAAQ,2BAA2B,CAAC,GAAG,UAAU,CAAC;;;AAI3D,SAAgB,uBACd,WACA,gBAAmC,EAAE,EAC5B;CACT,OAAO,QAAQ,uBAAuB,CAAC,GAAG,UAAU,EAAE,CAAC,GAAG,cAAc,CAAC;;;AAI3E,SAAgB,qBACd,WACA,gBAAmC,EAAE,EAC5B;CACT,OAAO,QAAQ,qBAAqB,CAAC,GAAG,UAAU,EAAE,CAAC,GAAG,cAAc,CAAC;;;AAIzE,MAAa,QAAQ,OAAO,OAAO;CACjC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD,CAAC"}
@@ -1,29 +0,0 @@
1
- import { VirtualChange, VirtualDocumentState } from "./types.mjs";
2
-
3
- //#region virtual_document.d.ts
4
- /** Mutable in-memory document used to drive LSP overlays without touching disk. */
5
- declare class CorsaVirtualDocument {
6
- #private;
7
- private constructor();
8
- /** Creates an untitled virtual document with an editor-like URI. */
9
- static untitled(path: string, languageId: string, text: string): CorsaVirtualDocument;
10
- /** Creates an in-memory virtual document under the supplied URI authority. */
11
- static inMemory(authority: string, path: string, languageId: string, text: string): CorsaVirtualDocument;
12
- /** Canonical document URI consumed by LSP overlay APIs. */
13
- get uri(): string;
14
- /** LSP language id associated with the virtual document. */
15
- get languageId(): string;
16
- /** Monotonic version incremented whenever text changes. */
17
- get version(): number;
18
- /** Current full document text. */
19
- get text(): string;
20
- /** Returns the serializable document state for orchestrator or LSP APIs. */
21
- state(): VirtualDocumentState;
22
- /** Replaces the entire virtual document text. */
23
- replace(text: string): void;
24
- /** Applies LSP-style incremental changes and returns generated change events. */
25
- applyChanges(changes: VirtualChange[]): unknown[];
26
- }
27
- //#endregion
28
- export { CorsaVirtualDocument };
29
- //# sourceMappingURL=virtual_document.d.mts.map
@@ -1,50 +0,0 @@
1
- import { binding } from "./binding.mjs";
2
- import { fromJson, toJson } from "./json.mjs";
3
- //#region virtual_document.ts
4
- /** Mutable in-memory document used to drive LSP overlays without touching disk. */
5
- var CorsaVirtualDocument = class CorsaVirtualDocument {
6
- #inner;
7
- constructor(inner) {
8
- this.#inner = inner;
9
- }
10
- /** Creates an untitled virtual document with an editor-like URI. */
11
- static untitled(path, languageId, text) {
12
- return new CorsaVirtualDocument(binding.CorsaVirtualDocument.untitled(path, languageId, text));
13
- }
14
- /** Creates an in-memory virtual document under the supplied URI authority. */
15
- static inMemory(authority, path, languageId, text) {
16
- return new CorsaVirtualDocument(binding.CorsaVirtualDocument.inMemory(authority, path, languageId, text));
17
- }
18
- /** Canonical document URI consumed by LSP overlay APIs. */
19
- get uri() {
20
- return this.#inner.uri;
21
- }
22
- /** LSP language id associated with the virtual document. */
23
- get languageId() {
24
- return this.#inner.languageId;
25
- }
26
- /** Monotonic version incremented whenever text changes. */
27
- get version() {
28
- return this.#inner.version;
29
- }
30
- /** Current full document text. */
31
- get text() {
32
- return this.#inner.text;
33
- }
34
- /** Returns the serializable document state for orchestrator or LSP APIs. */
35
- state() {
36
- return fromJson(this.#inner.stateJson());
37
- }
38
- /** Replaces the entire virtual document text. */
39
- replace(text) {
40
- this.#inner.replace(text);
41
- }
42
- /** Applies LSP-style incremental changes and returns generated change events. */
43
- applyChanges(changes) {
44
- return fromJson(this.#inner.applyChangesJson(toJson(changes)));
45
- }
46
- };
47
- //#endregion
48
- export { CorsaVirtualDocument };
49
-
50
- //# sourceMappingURL=virtual_document.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"virtual_document.mjs","names":["#inner"],"sources":["../ts/virtual_document.ts"],"sourcesContent":["import { binding } from \"./binding\";\nimport { fromJson, toJson } from \"./json\";\n\nimport type { NativeVirtualDocument } from \"./binding\";\nimport type { VirtualChange, VirtualDocumentState } from \"./types\";\n\n/** Mutable in-memory document used to drive LSP overlays without touching disk. */\nexport class CorsaVirtualDocument {\n readonly #inner: NativeVirtualDocument;\n\n private constructor(inner: NativeVirtualDocument) {\n this.#inner = inner;\n }\n\n /** Creates an untitled virtual document with an editor-like URI. */\n static untitled(path: string, languageId: string, text: string): CorsaVirtualDocument {\n return new CorsaVirtualDocument(binding.CorsaVirtualDocument.untitled(path, languageId, text));\n }\n\n /** Creates an in-memory virtual document under the supplied URI authority. */\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 /** Canonical document URI consumed by LSP overlay APIs. */\n get uri(): string {\n return this.#inner.uri;\n }\n\n /** LSP language id associated with the virtual document. */\n get languageId(): string {\n return this.#inner.languageId;\n }\n\n /** Monotonic version incremented whenever text changes. */\n get version(): number {\n return this.#inner.version;\n }\n\n /** Current full document text. */\n get text(): string {\n return this.#inner.text;\n }\n\n /** Returns the serializable document state for orchestrator or LSP APIs. */\n state(): VirtualDocumentState {\n return fromJson(this.#inner.stateJson());\n }\n\n /** Replaces the entire virtual document text. */\n replace(text: string): void {\n this.#inner.replace(text);\n }\n\n /** Applies LSP-style incremental changes and returns generated change events. */\n applyChanges(changes: VirtualChange[]): unknown[] {\n return fromJson(this.#inner.applyChangesJson(toJson(changes)));\n }\n}\n"],"mappings":";;;;AAOA,IAAa,uBAAb,MAAa,qBAAqB;CAChC;CAEA,YAAoB,OAA8B;EAChD,KAAKA,SAAS;;;CAIhB,OAAO,SAAS,MAAc,YAAoB,MAAoC;EACpF,OAAO,IAAI,qBAAqB,QAAQ,qBAAqB,SAAS,MAAM,YAAY,KAAK,CAAC;;;CAIhG,OAAO,SACL,WACA,MACA,YACA,MACsB;EACtB,OAAO,IAAI,qBACT,QAAQ,qBAAqB,SAAS,WAAW,MAAM,YAAY,KAAK,CACzE;;;CAIH,IAAI,MAAc;EAChB,OAAO,KAAKA,OAAO;;;CAIrB,IAAI,aAAqB;EACvB,OAAO,KAAKA,OAAO;;;CAIrB,IAAI,UAAkB;EACpB,OAAO,KAAKA,OAAO;;;CAIrB,IAAI,OAAe;EACjB,OAAO,KAAKA,OAAO;;;CAIrB,QAA8B;EAC5B,OAAO,SAAS,KAAKA,OAAO,WAAW,CAAC;;;CAI1C,QAAQ,MAAoB;EAC1B,KAAKA,OAAO,QAAQ,KAAK;;;CAI3B,aAAa,SAAqC;EAChD,OAAO,SAAS,KAAKA,OAAO,iBAAiB,OAAO,QAAQ,CAAC,CAAC"}