import { downloadPDF } from "@/shared/download-pdf"; import getDetailsPDFContent from "@/scripts/functionality/view-khatian/download-document-content"; declare function load(): void; document.addEventListener("DOMContentLoaded", () => { const proxiedPost = $.post; const submitButtonElement = document.querySelector("#khbutton") as HTMLButtonElement; const separatorElement = document.querySelector("#bodycover > div > form > hr:nth-child(2)") as HTMLElement; const formElement = document.querySelector("#bodycover > div > form") as HTMLElement; let downloadPDFButton: HTMLButtonElement | null = null; const submitButtonElementComputedStyles = window.getComputedStyle(submitButtonElement); const styles = Array.from(submitButtonElementComputedStyles) .reduce( (str, property) => `${str}${property}:${submitButtonElementComputedStyles.getPropertyValue(property)};`, "" ); const getValueOfSelectElement = (selector: string) => { const element = document.querySelector(selector) as HTMLSelectElement; return element.options[element.selectedIndex].text; }; let isPlotInformation: boolean | null = null; const downloadInformationPDF = () => { let contentElement = document.getElementById(isPlotInformation ? "plotdetails" : "khdetails"); const documentStringContent = getDetailsPDFContent(!!isPlotInformation, contentElement!.innerHTML, { district: getValueOfSelectElement("#lstDistrictCode1"), block: getValueOfSelectElement("#lstBlockCode1"), mouza: getValueOfSelectElement("#lstMouzaList") }); downloadPDF(`