window.getScreenWidth = () => {
    return window.innerWidth;
};

window.registerResizeCallback = (dotNetHelper) => {
    window.onresize = () => {
        dotNetHelper.invokeMethodAsync('UpdateScreenWidth', window.innerWidth);
    };
};

window.downloadFileFromText = (filename, contentType, content) => {
    const blob = new Blob([content], { type: contentType });
    const url = URL.createObjectURL(blob);
    const anchor = document.createElement('a');
    anchor.href = url;
    anchor.download = filename;
    anchor.click();
    URL.revokeObjectURL(url);
}