amis-rpc-design/libs/amis/packages/office-viewer/__tests__/EmptyWord.ts
2023-10-07 19:42:30 +08:00

17 lines
399 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/**
* 构建一个空 word主要是很多传参依赖
*/
import Word from '../src/Word';
import fs from 'fs';
import path from 'path';
import XMLPackageParser from '../src/package/XMLPackageParser';
export function createWord() {
const xmlContent = fs.readFileSync(
path.join(__dirname, './docx/empty.xml'),
'utf-8'
);
return new Word(xmlContent, {}, new XMLPackageParser());
}