tus-js-client
tus-js-client copied to clipboard
typescript: Replace file types with interfaces
Currently, the definitions reference browser-specific types, which do not exist in other environments, e.g. in Node.js: https://github.com/tus/tus-js-client/blob/239343a75da5aaedeefbc3bf2438062554b5db8d/lib/index.d.ts#L8
It would be better to replace them with interfaces, so we are independent of the environment (pseudo-code):
interface IBlob {
slice(start, end): IBlob;
}
interface IReader {
read(): Promise<IBlob>;
}
This could prevent issues like https://github.com/tus/tus-js-client/issues/252