Bez popisu

File.js 574B

1234567891011121314151617181920212223242526
  1. // Copyright 2016 wkh237@github. All rights reserved.
  2. // Use of this source code is governed by a MIT-style license that can be
  3. // found in the LICENSE file.
  4. import fs from '../fs.js'
  5. import Blob from './Blob.js'
  6. export default class File extends Blob {
  7. name : string = '';
  8. static build(name:string, data:any, cType:string):Promise<File> {
  9. return new Promise((resolve, reject) => {
  10. new File(data, cType).onCreated((f) => {
  11. f.name = name
  12. resolve(f)
  13. })
  14. })
  15. }
  16. constructor(data:any , cType:string) {
  17. super(data, cType)
  18. }
  19. }