Skip to content

Commit

Permalink
records
Browse files Browse the repository at this point in the history
  • Loading branch information
azahnen committed Jan 2, 2025
1 parent 4d906ca commit fd83a2a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion libxtracfg/js/types/generate-java-classes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand Down Expand Up @@ -129,7 +130,7 @@ public abstract class Handler<T extends Handler.Context, U extends Handler.Conte
return notConnected();
}
${result} result = handle(new ${initCommand}(command.options()), false, ignore -> {});
${result} result = handle(new ${initCommand}((${baseOptions})command.options()), false, ignore -> {});
if (result instanceof ${failure}) {
return result;
Expand Down
4 changes: 2 additions & 2 deletions libxtracfg/js/types/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit fd83a2a

Please sign in to comment.