diff --git a/libxtracfg/js/types/generate-java-classes.ts b/libxtracfg/js/types/generate-java-classes.ts index d83fb95..f6f7675 100644 --- a/libxtracfg/js/types/generate-java-classes.ts +++ b/libxtracfg/js/types/generate-java-classes.ts @@ -6,6 +6,7 @@ import { generateClass, generateJava } from "./java/index.ts"; const dataNs = ["Command", "Options", "Result"]; const suffixNs = ["Command", "Options"]; const commandNs = "Command"; +const baseOptions = "BaseOptions"; const baseResult = "BaseResult"; const failureResult = "FailureResult"; @@ -129,7 +130,7 @@ public abstract class Handler {}); + ${result} result = handle(new ${initCommand}((${baseOptions})command.options()), false, ignore -> {}); if (result instanceof ${failure}) { return result; diff --git a/libxtracfg/js/types/src/index.ts b/libxtracfg/js/types/src/index.ts index 157e12e..2de852f 100644 --- a/libxtracfg/js/types/src/index.ts +++ b/libxtracfg/js/types/src/index.ts @@ -69,9 +69,9 @@ export namespace Command { //TODO: should be abstract so that it cannot be instantiated, but that breaks the JSON schema generation export class Base { readonly command: Enums.Main; - readonly options: Options.Base; + readonly options: Options.Options; - constructor(command: Enums.Main, options: Options.Base) { + constructor(command: Enums.Main, options: Options.Options) { this.command = command; this.options = options; }