@needle-tools/needle-component-compiler 3.0.0-alpha → 3.0.0-alpha.1.42c96bd
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/Changelog.md +133 -88
- package/Readme.md +93 -19
- package/dist/BaseWriter.d.ts +23 -23
- package/dist/BaseWriter.js +90 -90
- package/dist/Compiler.d.ts +22 -20
- package/dist/Compiler.js +447 -412
- package/dist/base-compiler.d.ts +54 -54
- package/dist/base-compiler.js +168 -168
- package/dist/commands.d.ts +3 -3
- package/dist/commands.js +15 -15
- package/dist/component-compiler.d.ts +3 -3
- package/dist/component-compiler.js +816 -704
- package/dist/impl/blender-compiler.d.ts +14 -14
- package/dist/impl/blender-compiler.js +185 -179
- package/dist/impl/csharp-compiler.d.ts +16 -16
- package/dist/impl/csharp-compiler.js +307 -306
- package/dist/impl/react-three-fiber-compiler.d.ts +20 -20
- package/dist/impl/react-three-fiber-compiler.js +36 -36
- package/dist/register-types.d.ts +8 -8
- package/dist/register-types.js +34 -34
- package/dist/watcher.d.ts +6 -6
- package/dist/watcher.js +79 -79
- package/package.json +60 -55
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { Visibility } from "../base-compiler";
|
|
2
|
-
import { BaseWriter } from "../BaseWriter";
|
|
3
|
-
export declare class BlenderWriter extends BaseWriter {
|
|
4
|
-
resolveCSharpTypeName(typeName: string, comments?: string[]): string | void;
|
|
5
|
-
startNewType(filePath: string | null, typeName: string, baseTypes: string[], comments?: string[]): void | boolean;
|
|
6
|
-
endNewType(filePath: string | null, typeName: string): void;
|
|
7
|
-
writeMember(visibility: Visibility, name: string, isArray: boolean, type: string, initialValue?: string, comments?: string[]): void;
|
|
8
|
-
writeMethod(visibility: Visibility, name: string, returnType: string | undefined, args: {
|
|
9
|
-
name: string;
|
|
10
|
-
type: string;
|
|
11
|
-
defaultValue?: string;
|
|
12
|
-
}[], comments?: string[]): void;
|
|
13
|
-
writeNewTypeExpression(typeName: string, args?: string[]): void;
|
|
14
|
-
}
|
|
1
|
+
import { Visibility } from "../base-compiler";
|
|
2
|
+
import { BaseWriter } from "../BaseWriter";
|
|
3
|
+
export declare class BlenderWriter extends BaseWriter {
|
|
4
|
+
resolveCSharpTypeName(typeName: string, comments?: string[]): string | void;
|
|
5
|
+
startNewType(filePath: string | null, typeName: string, baseTypes: string[], comments?: string[]): void | boolean;
|
|
6
|
+
endNewType(filePath: string | null, typeName: string): void;
|
|
7
|
+
writeMember(visibility: Visibility, name: string, isArray: boolean, type: string, initialValue?: string, comments?: string[]): void;
|
|
8
|
+
writeMethod(visibility: Visibility, name: string, returnType: string | undefined, args: {
|
|
9
|
+
name: string;
|
|
10
|
+
type: string;
|
|
11
|
+
defaultValue?: string;
|
|
12
|
+
}[], comments?: string[]): void;
|
|
13
|
+
writeNewTypeExpression(typeName: string, args?: string[]): void;
|
|
14
|
+
}
|
|
@@ -1,179 +1,185 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.BlenderWriter = void 0;
|
|
19
|
-
var base_compiler_1 = require("../base-compiler");
|
|
20
|
-
var BaseWriter_1 = require("../BaseWriter");
|
|
21
|
-
var supportedTypes = ["string", "float", "int", "bool", "col", "obj", "evt", "fn", "vec2", "vec3", "comp"];
|
|
22
|
-
var knownBaseTypes = ["Behaviour", "IComponent"];
|
|
23
|
-
var BlenderWriter = /** @class */ (function (_super) {
|
|
24
|
-
__extends(BlenderWriter, _super);
|
|
25
|
-
function BlenderWriter() {
|
|
26
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
27
|
-
}
|
|
28
|
-
BlenderWriter.prototype.resolveCSharpTypeName = function (typeName, comments) {
|
|
29
|
-
typeName = typeName.toLocaleLowerCase();
|
|
30
|
-
if (typeName.startsWith("three."))
|
|
31
|
-
typeName = typeName.substring("three.".length);
|
|
32
|
-
switch (typeName) {
|
|
33
|
-
case "number":
|
|
34
|
-
return "float";
|
|
35
|
-
case "int":
|
|
36
|
-
return "int";
|
|
37
|
-
case "boolean":
|
|
38
|
-
return "bool";
|
|
39
|
-
case "string":
|
|
40
|
-
return "string";
|
|
41
|
-
case "void":
|
|
42
|
-
return "void";
|
|
43
|
-
case "vector2":
|
|
44
|
-
return "vec2";
|
|
45
|
-
case "vector3":
|
|
46
|
-
return "vec3";
|
|
47
|
-
case "vector4":
|
|
48
|
-
return "vec4";
|
|
49
|
-
case "quaternion":
|
|
50
|
-
return "quat";
|
|
51
|
-
case "euler":
|
|
52
|
-
return "vec3";
|
|
53
|
-
case "color":
|
|
54
|
-
return "col";
|
|
55
|
-
case "eventlist":
|
|
56
|
-
return "evt";
|
|
57
|
-
case "behaviour":
|
|
58
|
-
case "animation": // Animation component ref
|
|
59
|
-
case "animator": // Animator component ref
|
|
60
|
-
case "camera":
|
|
61
|
-
case "light":
|
|
62
|
-
case "rigidbody":
|
|
63
|
-
case "renderer": // Renderer component ref
|
|
64
|
-
case "canvas": // Canvas component ref
|
|
65
|
-
case "charactercontroller": // CharacterController component ref
|
|
66
|
-
case "videoplayer": // VideoPlayer component ref
|
|
67
|
-
case "lookatconstraint": // LookAtConstraint component ref
|
|
68
|
-
return "comp";
|
|
69
|
-
case "texture":
|
|
70
|
-
return "tex";
|
|
71
|
-
case "image":
|
|
72
|
-
return "img";
|
|
73
|
-
case "object3d":
|
|
74
|
-
case "gameobject": // GameObject = scene object reference
|
|
75
|
-
return "obj";
|
|
76
|
-
case "vec2":
|
|
77
|
-
return "vec2";
|
|
78
|
-
case "material":
|
|
79
|
-
return "mat";
|
|
80
|
-
case "animationclip":
|
|
81
|
-
return "anim";
|
|
82
|
-
case "animatorcontroller":
|
|
83
|
-
return "animatorcontroller";
|
|
84
|
-
case "audioclip":
|
|
85
|
-
return "audioclip";
|
|
86
|
-
case "videoclip":
|
|
87
|
-
case "video":
|
|
88
|
-
return "videoclip";
|
|
89
|
-
case "assetreference":
|
|
90
|
-
case "asset":
|
|
91
|
-
return "assetreference";
|
|
92
|
-
case "mesh":
|
|
93
|
-
return "mesh";
|
|
94
|
-
case "timelineasset":
|
|
95
|
-
return "timeline";
|
|
96
|
-
}
|
|
97
|
-
return typeName;
|
|
98
|
-
};
|
|
99
|
-
BlenderWriter.prototype.startNewType = function (filePath, typeName, baseTypes, comments) {
|
|
100
|
-
var isSupportedType = false;
|
|
101
|
-
for (var i = 0; i < knownBaseTypes.length; i++) {
|
|
102
|
-
if (baseTypes.includes(knownBaseTypes[i])) {
|
|
103
|
-
isSupportedType = true;
|
|
104
|
-
break;
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
// console.log(baseTypes, knownBaseTypes, isSupportedType)
|
|
108
|
-
if (!isSupportedType)
|
|
109
|
-
return false;
|
|
110
|
-
this.writer.beginBlock("{");
|
|
111
|
-
if (comments)
|
|
112
|
-
console.log(comments);
|
|
113
|
-
this.writer.beginBlock("\"" + typeName + "\": {");
|
|
114
|
-
};
|
|
115
|
-
BlenderWriter.prototype.endNewType = function (filePath, typeName) {
|
|
116
|
-
this.writer.endBlock("},");
|
|
117
|
-
this.writer.endBlock("}");
|
|
118
|
-
this.writeScheme(filePath, typeName);
|
|
119
|
-
};
|
|
120
|
-
BlenderWriter.prototype.writeMember = function (visibility, name, isArray, type, initialValue, comments) {
|
|
121
|
-
if (visibility !== base_compiler_1.Visibility.Public)
|
|
122
|
-
return;
|
|
123
|
-
// Check if type is a registered TypeScript enum
|
|
124
|
-
var enumMembers = this._enumRegistry.get(type);
|
|
125
|
-
if (enumMembers && enumMembers.length > 0) {
|
|
126
|
-
this.writer.beginBlock("\"" + name + "\": {");
|
|
127
|
-
this.writer.writeLine("\"type\": \"enum\",");
|
|
128
|
-
// Resolve default value: try to match explicit initializer (e.g. "lighttype.spot")
|
|
129
|
-
var enumValue = enumMembers[0].value;
|
|
130
|
-
if (initialValue && initialValue.includes(".")) {
|
|
131
|
-
var memberKey_1 = initialValue.split(".").pop();
|
|
132
|
-
var found = enumMembers.find(function (m) { return m.name.toLowerCase() === memberKey_1; });
|
|
133
|
-
if (found !== undefined)
|
|
134
|
-
enumValue = found.value;
|
|
135
|
-
}
|
|
136
|
-
this.writer.writeLine("\"value\": " + JSON.stringify(enumValue) + ",");
|
|
137
|
-
var options = enumMembers.map(function (m) { return m.name; });
|
|
138
|
-
this.writer.writeLine("\"options\": " + JSON.stringify(options));
|
|
139
|
-
this.writer.endBlock("},");
|
|
140
|
-
return;
|
|
141
|
-
}
|
|
142
|
-
// if (!supportedTypes.includes(type)) {
|
|
143
|
-
// console.log("-- unsupported type:", type);
|
|
144
|
-
// return;
|
|
145
|
-
// }
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
case "
|
|
156
|
-
initialValue =
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
if (
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
this.writer.
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.BlenderWriter = void 0;
|
|
19
|
+
var base_compiler_1 = require("../base-compiler");
|
|
20
|
+
var BaseWriter_1 = require("../BaseWriter");
|
|
21
|
+
var supportedTypes = ["string", "float", "int", "bool", "col", "obj", "evt", "fn", "vec2", "vec3", "comp"];
|
|
22
|
+
var knownBaseTypes = ["Behaviour", "IComponent"];
|
|
23
|
+
var BlenderWriter = /** @class */ (function (_super) {
|
|
24
|
+
__extends(BlenderWriter, _super);
|
|
25
|
+
function BlenderWriter() {
|
|
26
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
27
|
+
}
|
|
28
|
+
BlenderWriter.prototype.resolveCSharpTypeName = function (typeName, comments) {
|
|
29
|
+
typeName = typeName.toLocaleLowerCase();
|
|
30
|
+
if (typeName.startsWith("three."))
|
|
31
|
+
typeName = typeName.substring("three.".length);
|
|
32
|
+
switch (typeName) {
|
|
33
|
+
case "number":
|
|
34
|
+
return "float";
|
|
35
|
+
case "int":
|
|
36
|
+
return "int";
|
|
37
|
+
case "boolean":
|
|
38
|
+
return "bool";
|
|
39
|
+
case "string":
|
|
40
|
+
return "string";
|
|
41
|
+
case "void":
|
|
42
|
+
return "void";
|
|
43
|
+
case "vector2":
|
|
44
|
+
return "vec2";
|
|
45
|
+
case "vector3":
|
|
46
|
+
return "vec3";
|
|
47
|
+
case "vector4":
|
|
48
|
+
return "vec4";
|
|
49
|
+
case "quaternion":
|
|
50
|
+
return "quat";
|
|
51
|
+
case "euler":
|
|
52
|
+
return "vec3";
|
|
53
|
+
case "color":
|
|
54
|
+
return "col";
|
|
55
|
+
case "eventlist":
|
|
56
|
+
return "evt";
|
|
57
|
+
case "behaviour":
|
|
58
|
+
case "animation": // Animation component ref
|
|
59
|
+
case "animator": // Animator component ref
|
|
60
|
+
case "camera":
|
|
61
|
+
case "light":
|
|
62
|
+
case "rigidbody":
|
|
63
|
+
case "renderer": // Renderer component ref
|
|
64
|
+
case "canvas": // Canvas component ref
|
|
65
|
+
case "charactercontroller": // CharacterController component ref
|
|
66
|
+
case "videoplayer": // VideoPlayer component ref
|
|
67
|
+
case "lookatconstraint": // LookAtConstraint component ref
|
|
68
|
+
return "comp";
|
|
69
|
+
case "texture":
|
|
70
|
+
return "tex";
|
|
71
|
+
case "image":
|
|
72
|
+
return "img";
|
|
73
|
+
case "object3d":
|
|
74
|
+
case "gameobject": // GameObject = scene object reference
|
|
75
|
+
return "obj";
|
|
76
|
+
case "vec2":
|
|
77
|
+
return "vec2";
|
|
78
|
+
case "material":
|
|
79
|
+
return "mat";
|
|
80
|
+
case "animationclip":
|
|
81
|
+
return "anim";
|
|
82
|
+
case "animatorcontroller":
|
|
83
|
+
return "animatorcontroller";
|
|
84
|
+
case "audioclip":
|
|
85
|
+
return "audioclip";
|
|
86
|
+
case "videoclip":
|
|
87
|
+
case "video":
|
|
88
|
+
return "videoclip";
|
|
89
|
+
case "assetreference":
|
|
90
|
+
case "asset":
|
|
91
|
+
return "assetreference";
|
|
92
|
+
case "mesh":
|
|
93
|
+
return "mesh";
|
|
94
|
+
case "timelineasset":
|
|
95
|
+
return "timeline";
|
|
96
|
+
}
|
|
97
|
+
return typeName;
|
|
98
|
+
};
|
|
99
|
+
BlenderWriter.prototype.startNewType = function (filePath, typeName, baseTypes, comments) {
|
|
100
|
+
var isSupportedType = false;
|
|
101
|
+
for (var i = 0; i < knownBaseTypes.length; i++) {
|
|
102
|
+
if (baseTypes.includes(knownBaseTypes[i])) {
|
|
103
|
+
isSupportedType = true;
|
|
104
|
+
break;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
// console.log(baseTypes, knownBaseTypes, isSupportedType)
|
|
108
|
+
if (!isSupportedType)
|
|
109
|
+
return false;
|
|
110
|
+
this.writer.beginBlock("{");
|
|
111
|
+
if (comments)
|
|
112
|
+
console.log(comments);
|
|
113
|
+
this.writer.beginBlock("\"" + typeName + "\": {");
|
|
114
|
+
};
|
|
115
|
+
BlenderWriter.prototype.endNewType = function (filePath, typeName) {
|
|
116
|
+
this.writer.endBlock("},");
|
|
117
|
+
this.writer.endBlock("}");
|
|
118
|
+
this.writeScheme(filePath, typeName);
|
|
119
|
+
};
|
|
120
|
+
BlenderWriter.prototype.writeMember = function (visibility, name, isArray, type, initialValue, comments) {
|
|
121
|
+
if (visibility !== base_compiler_1.Visibility.Public)
|
|
122
|
+
return;
|
|
123
|
+
// Check if type is a registered TypeScript enum
|
|
124
|
+
var enumMembers = this._enumRegistry.get(type);
|
|
125
|
+
if (enumMembers && enumMembers.length > 0) {
|
|
126
|
+
this.writer.beginBlock("\"" + name + "\": {");
|
|
127
|
+
this.writer.writeLine("\"type\": \"enum\",");
|
|
128
|
+
// Resolve default value: try to match explicit initializer (e.g. "lighttype.spot")
|
|
129
|
+
var enumValue = enumMembers[0].value;
|
|
130
|
+
if (initialValue && initialValue.includes(".")) {
|
|
131
|
+
var memberKey_1 = initialValue.split(".").pop();
|
|
132
|
+
var found = enumMembers.find(function (m) { return m.name.toLowerCase() === memberKey_1; });
|
|
133
|
+
if (found !== undefined)
|
|
134
|
+
enumValue = found.value;
|
|
135
|
+
}
|
|
136
|
+
this.writer.writeLine("\"value\": " + JSON.stringify(enumValue) + ",");
|
|
137
|
+
var options = enumMembers.map(function (m) { return m.name; });
|
|
138
|
+
this.writer.writeLine("\"options\": " + JSON.stringify(options));
|
|
139
|
+
this.writer.endBlock("},");
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
142
|
+
// if (!supportedTypes.includes(type)) {
|
|
143
|
+
// console.log("-- unsupported type:", type);
|
|
144
|
+
// return;
|
|
145
|
+
// }
|
|
146
|
+
// @tooltip → description
|
|
147
|
+
var tooltipComment = comments === null || comments === void 0 ? void 0 : comments.find(function (c) { return c.startsWith("@tooltip "); });
|
|
148
|
+
var tooltip = tooltipComment ? tooltipComment.substring("@tooltip ".length).trim() : null;
|
|
149
|
+
this.writer.beginBlock("\"" + name + "\": {");
|
|
150
|
+
this.writer.writeLine("\"type\": \"" + type + "\",");
|
|
151
|
+
if (initialValue && !isArray) {
|
|
152
|
+
if (initialValue.startsWith("new "))
|
|
153
|
+
initialValue = undefined;
|
|
154
|
+
switch (type) {
|
|
155
|
+
case "bool":
|
|
156
|
+
initialValue = initialValue.toLowerCase();
|
|
157
|
+
break;
|
|
158
|
+
case "string":
|
|
159
|
+
initialValue = "\"" + initialValue + "\"";
|
|
160
|
+
}
|
|
161
|
+
if (initialValue)
|
|
162
|
+
this.writer.writeLine("\"value\": " + initialValue + ",");
|
|
163
|
+
}
|
|
164
|
+
if (isArray) {
|
|
165
|
+
this.writer.writeLine("\"value\": [],");
|
|
166
|
+
}
|
|
167
|
+
if (tooltip) {
|
|
168
|
+
this.writer.writeLine("\"description\": \"" + tooltip.replace(/"/g, "'") + "\"");
|
|
169
|
+
}
|
|
170
|
+
this.writer.endBlock("},");
|
|
171
|
+
};
|
|
172
|
+
BlenderWriter.prototype.writeMethod = function (visibility, name, returnType, args, comments) {
|
|
173
|
+
if (visibility !== base_compiler_1.Visibility.Public)
|
|
174
|
+
return;
|
|
175
|
+
this.writer.beginBlock("\"" + name + "\": {");
|
|
176
|
+
this.writer.writeLine("\"type\": \"fn\",");
|
|
177
|
+
this.writer.endBlock("},");
|
|
178
|
+
};
|
|
179
|
+
BlenderWriter.prototype.writeNewTypeExpression = function (typeName, args) {
|
|
180
|
+
console.log("new type:", typeName);
|
|
181
|
+
};
|
|
182
|
+
return BlenderWriter;
|
|
183
|
+
}(BaseWriter_1.BaseWriter));
|
|
184
|
+
exports.BlenderWriter = BlenderWriter;
|
|
185
|
+
// runFromFile(new BlenderWriter("dist"), "src\\test.ts");
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { Argument, Visibility } from "../base-compiler";
|
|
2
|
-
import { BaseWriter } from "../BaseWriter";
|
|
3
|
-
export declare class CSharpWriter extends BaseWriter {
|
|
4
|
-
resolveCSharpTypeName(typescriptTypeName: string): string | void;
|
|
5
|
-
startNewType(filePath: string, typeName: string, baseTypes: string[], comments?: string[]): boolean | void;
|
|
6
|
-
endNewType(filePath: string, typeName: string): void;
|
|
7
|
-
writeMember(visibility: Visibility, name: string, isArray: boolean, type: string, initialValue?: string, comments?: string[]): void;
|
|
8
|
-
writeMethod(visibility: Visibility, name: string, returnType: string, args: Argument[], comments: string[]): void;
|
|
9
|
-
writeNewTypeExpression(typeName: string, args?: string[]): void;
|
|
10
|
-
/** Converts camelCase to PascalCase for method names */
|
|
11
|
-
private toPascalCase;
|
|
12
|
-
/** Resolve a "new Type(args)" expression: map TS types to C# qualified types */
|
|
13
|
-
private resolveNewExpression;
|
|
14
|
-
/** Override writeScheme to use .cs extension instead of .component.json */
|
|
15
|
-
protected writeCSharpScheme(processingFilePath: string | null, component: string): void;
|
|
16
|
-
}
|
|
1
|
+
import { Argument, Visibility } from "../base-compiler";
|
|
2
|
+
import { BaseWriter } from "../BaseWriter";
|
|
3
|
+
export declare class CSharpWriter extends BaseWriter {
|
|
4
|
+
resolveCSharpTypeName(typescriptTypeName: string): string | void;
|
|
5
|
+
startNewType(filePath: string, typeName: string, baseTypes: string[], comments?: string[]): boolean | void;
|
|
6
|
+
endNewType(filePath: string, typeName: string): void;
|
|
7
|
+
writeMember(visibility: Visibility, name: string, isArray: boolean, type: string, initialValue?: string, comments?: string[]): void;
|
|
8
|
+
writeMethod(visibility: Visibility, name: string, returnType: string, args: Argument[], comments: string[]): void;
|
|
9
|
+
writeNewTypeExpression(typeName: string, args?: string[]): void;
|
|
10
|
+
/** Converts camelCase to PascalCase for method names */
|
|
11
|
+
private toPascalCase;
|
|
12
|
+
/** Resolve a "new Type(args)" expression: map TS types to C# qualified types */
|
|
13
|
+
private resolveNewExpression;
|
|
14
|
+
/** Override writeScheme to use .cs extension instead of .component.json */
|
|
15
|
+
protected writeCSharpScheme(processingFilePath: string | null, component: string): void;
|
|
16
|
+
}
|