feat: add filepicker package

This commit is contained in:
Karol Sójko
2022-07-05 19:28:22 +02:00
parent 577da2ca84
commit d4188a3fa2
45 changed files with 5848 additions and 25 deletions

View File

@@ -0,0 +1,23 @@
import { saveFile } from '../utils'
export class ClassicFileSaver {
public loggingEnabled = false
private log(...args: any[]): void {
if (!this.loggingEnabled) {
return
}
// eslint-disable-next-line no-console
console.log(args)
}
static maximumFileSize(): number {
return 50 * 1_000_000
}
saveFile(name: string, bytes: Uint8Array): void {
this.log('Saving file to disk...')
saveFile(name, bytes)
this.log('Closing write stream')
}
}