Archived
1
0
This repository has been archived on 2025-04-26. You can view files and clone it, but cannot push or open issues or pull requests.
pdf2img/cssjs/js/docx.esm.js

19 lines
746 B
JavaScript
Raw Normal View History

// 等待 docx.min.js 加载完成
const waitForDocx = new Promise((resolve) => {
const checkDocx = () => {
if (window.docx && window.docx.Document) {
resolve();
} else {
setTimeout(checkDocx, 100);
}
};
checkDocx();
});
// 导出 docx 库的所有必要组件
export const Document = waitForDocx.then(() => window.docx.Document);
export const Paragraph = waitForDocx.then(() => window.docx.Paragraph);
export const ImageRun = waitForDocx.then(() => window.docx.ImageRun);
export const HeadingLevel = waitForDocx.then(() => window.docx.HeadingLevel);
export const AlignmentType = waitForDocx.then(() => window.docx.AlignmentType);
export const Packer = waitForDocx.then(() => window.docx.Packer);