23 / resumable.js

A JavaScript library for providing multiple simultaneous, stable, fault-tolerant and resumable/restartable uploads via the HTML5 File API.
MIT License
4.66k stars 612 forks source link

Typescript for maxFileSize wrong message #618

Open darkopetreski opened 8 months ago

darkopetreski commented 8 months ago

When the component is used with typescript maxFileSize gives warning, since the field is defined as boolean. It should be number.

https://github.com/23/resumable.js/blob/b7580789f4d19bb180c08389538e0733f0f811d8/resumable.d.ts#L123

sadik-malik commented 2 months ago

@darkopetreski, there are already some PRs submitted for this dating back to 2020, but the maintainers still have not merged them. For now, you can override the type definition.

Create one global.d.ts file in your src folder and add the following to it.

declare module Resumable {
  export interface ConfigurationHash extends Resumable.ConfigurationHash {
    maxFileSize?: number
  }
}

declare module 'resumablejs' {
  export = Resumable.Resumable
}

Is someone still maintaining this library?