class CustomRenderController {
    hostConnected() {
        this.resetRenderState();
    }
    hostUpdated() {
        this.executeRenderFunction();
    }
    resetRenderState() {
        this.hasExecutedRenderFunction = false;
    }
    executeRenderFunction() {
        const renderingFunction = this.options.renderingFunction();
        const itemData = this.options.itemData();
        const rootElementRef = this.options.rootElementRef();
        if (!renderingFunction || !itemData || !rootElementRef || this.hasExecutedRenderFunction) return;
        const customRenderOutput = renderingFunction(itemData, rootElementRef, this.options.linkContainerRef());
        this.options.onRenderComplete(rootElementRef, customRenderOutput);
        this.hasExecutedRenderFunction = true;
    }
    constructor(host, options){
        this.hasExecutedRenderFunction = false;
        this.options = {
            linkContainerRef: ()=>void 0,
            onRenderComplete: ()=>{},
            ...options
        };
        host.addController(this);
    }
}
export { CustomRenderController };
