Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error TS2495: Type 'FileList' is not an array type or a string type #7181

Closed
Maks3w opened this issue Feb 22, 2016 · 2 comments
Closed

error TS2495: Type 'FileList' is not an array type or a string type #7181

Maks3w opened this issue Feb 22, 2016 · 2 comments
Labels
Duplicate An existing issue was already created

Comments

@Maks3w
Copy link

Maks3w commented Feb 22, 2016

TypeScript Version:

1.8.0-beta

Code

setFilesFromFileList(fileList: FileList) {
    for (let file of fileList) { }
}

Expected behavior:
No errors

Actual behavior:

error TS2495: Type 'FileList' is not an array type or a string type

@yortus
Copy link
Contributor

yortus commented Feb 22, 2016

Are you targeting ES5? If so it's probably the problem described in #4031

EDIT: Actually #3164 describes the problem, and #4031 is a response to that

@saschanaz
Copy link
Contributor

It seems FileList does not support iterator yet, so it won't work even on ES6 mode as of now.

[Exposed=Window,Worker] interface FileList {
  getter File? item(unsigned long index);
  readonly attribute unsigned long length;
};

@RyanCavanaugh RyanCavanaugh added the Duplicate An existing issue was already created label Feb 22, 2016
@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Duplicate An existing issue was already created
Projects
None yet
Development

No branches or pull requests

4 participants