@needle-tools/needle-component-compiler 3.0.8 → 3.0.10
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/impl/csharp-compiler.js +10 -2
- package/package.json +1 -1
|
@@ -128,12 +128,20 @@ var CSharpWriter = /** @class */ (function (_super) {
|
|
|
128
128
|
return _this;
|
|
129
129
|
}
|
|
130
130
|
CSharpWriter.prototype.resolveCSharpTypeName = function (typescriptTypeName) {
|
|
131
|
-
var _a, _b, _c, _d, _e
|
|
131
|
+
var _a, _b, _c, _d, _e;
|
|
132
132
|
if (!typescriptTypeName)
|
|
133
133
|
return undefined;
|
|
134
134
|
// Strip THREE. prefix for lookup fallback
|
|
135
135
|
var stripped = typescriptTypeName.startsWith("THREE.") ? typescriptTypeName.substring(6) : typescriptTypeName;
|
|
136
|
-
|
|
136
|
+
// Check built-in TYPE_MAP first (TS→C# mapping)
|
|
137
|
+
var builtIn = (_a = TYPE_MAP[typescriptTypeName]) !== null && _a !== void 0 ? _a : TYPE_MAP[stripped];
|
|
138
|
+
if (builtIn)
|
|
139
|
+
return builtIn;
|
|
140
|
+
// If the name is already a known C# type (e.g. "float"), return it as-is
|
|
141
|
+
// to prevent external types from overriding it (e.g. "float" → "System.Single")
|
|
142
|
+
if (KNOWN_CSHARP_TYPES.has(typescriptTypeName))
|
|
143
|
+
return typescriptTypeName;
|
|
144
|
+
return (_e = (_c = (_b = this.externalTypes) === null || _b === void 0 ? void 0 : _b[typescriptTypeName]) !== null && _c !== void 0 ? _c : (_d = this.externalTypes) === null || _d === void 0 ? void 0 : _d[stripped]) !== null && _e !== void 0 ? _e : typescriptTypeName;
|
|
137
145
|
};
|
|
138
146
|
/** Tries to resolve a C# type name; returns undefined if the type is not known.
|
|
139
147
|
* Checks TYPE_MAP keys/values and the enum registry. */
|