简体   繁体   English

对象的打字稿定义,用作数组

[英]Typescript definition for object, that used as array

I'm trying to extend jszip.d.ts , since it misses description of files object. 我正在尝试扩展jszip.d.ts ,因为它缺少 files对象的描述。 And this object seems to be really tricky to describe. 这个对象似乎很难描述。

It's generic object that actually used as an array. 它实际上是用作数组的通用对象。 It has property per file found in archive, and every property value has JSZipObject type. 它具有在存档中找到的每个文件的属性,并且每个属性值都有JSZipObject类型。

The question is how to describe object that has no defined set of properties? 问题是如何描述没有定义的属性集的对象?

Can somebody advise the approach to solve this? 有人可以建议解决此问题的方法吗? Or maybe example definition file where such issue was successfully resolved (apart from using any type). 或者可能是成功解决了此问题的示例定义文件(除使用any类型外)。

这可能是您要寻找的:

declare var files: { [fileName: string]: JSZipObject };

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM