Adding some Readme stuff
This commit is contained in:
parent
aa983c9960
commit
99563959c6
@ -29,6 +29,10 @@ type Test {
|
||||
}
|
||||
|
||||
service TestService {
|
||||
@Description("This Function adds two number")
|
||||
@Param("v1", "The first Number")
|
||||
@Param("v2", "The second Number")
|
||||
@Returns("The added values of the two numbers")
|
||||
AddNumbers(v1: number, v2: number): number;
|
||||
|
||||
|
||||
|
@ -28,6 +28,7 @@ type AddValueResponse {
|
||||
service TestService {
|
||||
@Description("Add two numbers")
|
||||
@Param("request", "Parameter containing the two numbers")
|
||||
@Returns("")
|
||||
AddValuesSingleParam(request: AddValueRequest): AddValueResponse;
|
||||
|
||||
@Description("Add two numbers")
|
||||
|
@ -308,10 +308,15 @@ export class TypescriptTarget extends CompileTarget {
|
||||
(e) => `${e.name}: ${toJSType(e.type) + (e.array ? "[]" : "")}`
|
||||
)
|
||||
.join(", ");
|
||||
|
||||
//TODO: Prio 1 : Verify and strip input parameters
|
||||
//TODO: Prio 2 : Add optional parameters to this and the declaration file
|
||||
// const verifyInputs = () => {
|
||||
|
||||
// }
|
||||
|
||||
if (!fnc.return) {
|
||||
a(1, `${fnc.name}(${params}): void {`);
|
||||
a(1, `${fnc.name}(${params}): void {`);1
|
||||
a(2, `this._provider.sendMessage({`);
|
||||
a(3, `jsonrpc: "2.0",`);
|
||||
a(3, `method: "${def.name}.${fnc.name}",`);
|
||||
@ -334,11 +339,11 @@ export class TypescriptTarget extends CompileTarget {
|
||||
a(3, `});`);
|
||||
a(2, `}).then(result => {`);
|
||||
if (fnc.return.array) {
|
||||
a(2, `for(const elm of result) {`);
|
||||
a(3, `apply_${fnc.return.type}(elm);`);
|
||||
a(2, `}`);
|
||||
a(3, `for(let i = 0; i < result.length; i++) {`);
|
||||
a(4, `result[i] = apply_${fnc.return.type}(result[i]);`);
|
||||
a(3, `}`);
|
||||
} else {
|
||||
a(3, `apply_${fnc.return.type}(result);`);
|
||||
a(3, `result = apply_${fnc.return.type}(result);`);
|
||||
}
|
||||
a(3, `return result;`);
|
||||
a(2, `});`);
|
||||
|
Loading…
Reference in New Issue
Block a user