我尝试使用以下导入语句:
import * as pdfMake from 'pdfmake/build/pdfmake'; import * as pdfFonts from 'pdfmake/build/vfs_fonts'; (pdfMake as any).vfs = pdfFonts.pdfMake.vfs;
It gave follwoing errors :
Failed to compile.
ERROR in node_modules/@types/pdfkit/index.d.ts:603:23 - error TS1110: Type expected.
ERROR in node_modules/@types/pdfkit/index.d.ts(603,23): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type.
node_modules/@types/pdfkit/index.d.ts(603,33): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type.
node_modules/@types/pdfmake/interfaces.d.ts(868,13): error TS2456: Type alias 'Content' circularly references itself.
node_modules/@types/pdfmake/interfaces.d.ts(924,89): error TS2304: Cannot find name 'Omit'.
你能解决这个问题吗?我也有同样的问题,我已经尝试了所有的解决方案,但还是无法解决。