Search code examples
javascripttypescriptjszip

Typescript definition for object, that used as array


I'm trying to extend jszip.d.ts, since it misses description of files object. 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.

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).


Solution

  • This might be what you are looking for:

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