我正在尝试在 Angular5 中使用 pdfmake 库,它在 node_modules/@types/pdfkit/index.d.ts:603:23 中给出错误 - 错误 TS1110:预期类型

问题描述 投票:0回答:1

我尝试使用以下导入语句:

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'.
node.js angular pdfmake vfs
1个回答
0
投票

你能解决这个问题吗?我也有同样的问题,我已经尝试了所有的解决方案,但还是无法解决。

© www.soinside.com 2019 - 2024. All rights reserved.