// @formatter:off
import { Direction } from "@minecraft/server";
import { UIBuilder } from "./util/uiBuilder";
import { translate } from "./util/miscUtils";
export const ConfigsComponent = {
    onUse(event) {
        const player = event.source;
        configUI.configBook.open(player);
    }
};
class Configs {
    constructor() {
        // Initialize the configBook property with the BookBuilder instance and use the wallLanternsEnabled
        const builder = UIBuilder.create('configs')
            .configPage();
        this.wallLanternsEnabled = builder.defineBool("wall_lanterns", true);
        this.placeableBooksEnabled = builder.defineBool("placeable_books", true);
        this.rakedGravelEnabled = builder.defineBool("raked_gravel", true);
        this.clockAndCompassEnabled = builder.defineBool("clock_and_compass", true);
        this.configsInBook = builder.defineBool("configs_in_book", true);
        builder.defineEnum("enum_config", Direction, Direction.North);
        builder.defineNum("num_config", 0, 20, 10);
        builder.defineStr("str_config", "test");
        builder.onSubmit((b, p) => {
            p.onScreenDisplay.setActionBar(translate("message", "configs"));
        });
        this.configBook = builder.build();
    }
}
export const configUI = new Configs();
