import { AppObjectUC, getSingletonComponent, } from "@vived/core";
import { dispatchStateChange } from "../../Dispatcher";
import { BaseAppState } from "../Entity";
export class UpdateContentSizeUC extends AppObjectUC {
}
UpdateContentSizeUC.type = "UpdateContentSizeUC";
UpdateContentSizeUC.get = (appObjects) => getSingletonComponent(UpdateContentSizeUC.type, appObjects);
export function makeUpdateContentSizeUC(appObject) {
    return new UpdateContentSizeUCImp(appObject);
}
class UpdateContentSizeUCImp extends UpdateContentSizeUC {
    get baseApp() {
        return this.getCachedSingleton(BaseAppState.type);
    }
    constructor(appObject) {
        super(appObject, UpdateContentSizeUC.type);
        this.updateContentSize = (size) => {
            if (!this.baseApp) {
                return;
            }
            const newHeight = Math.ceil(size);
            if (newHeight === this.baseApp.slideInfoContentHeight)
                return;
            this.baseApp.slideInfoContentHeight = newHeight;
            dispatchStateChange(this.appObjects);
        };
    }
}
//# sourceMappingURL=UpdateContentSizeUC.js.map