hwobs.service.d.ts 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /// <reference path="typings/esdk-obs-browser.d.ts" />
  2. import ObsClient from "esdk-obs-browserjs";
  3. import Parse from "parse";
  4. import * as i0 from "@angular/core";
  5. /**
  6. * HwobsDir 华为OBS目录接口
  7. * @public
  8. */
  9. export interface HwobsDir {
  10. Prefix: string;
  11. }
  12. /**
  13. * HwobsDir 华为OBS文件接口
  14. * @public
  15. */
  16. export interface HwobsFile {
  17. ETag: "\"f0ec968fe51ab48348307e06476122eb\"";
  18. Key: string;
  19. LastModified: string;
  20. Owner: object;
  21. Size: string;
  22. StorageClass: string;
  23. }
  24. /**
  25. * HwobsService 华为OBS文件服务
  26. * @public
  27. */
  28. export declare class HwobsService {
  29. obsClient: ObsClient;
  30. bucketName: string;
  31. host: string;
  32. constructor();
  33. /**
  34. * 目录及检索相关函数
  35. */
  36. listDir(prefix: any): Promise<{
  37. dirs: Array<HwobsDir>;
  38. files: Array<HwobsFile>;
  39. }>;
  40. /**
  41. * 文件上传相关函数
  42. * @param file
  43. * @param key
  44. * @returns
  45. */
  46. uploadFile(file: File, key: string): Promise<Parse.Object>;
  47. Attachment: any;
  48. checkFileExists(file: any): Promise<Parse.Object>;
  49. saveAttachment(file: File, key: string): Promise<Parse.Object<Parse.Attributes>>;
  50. getFileHash(file: File): Promise<unknown>;
  51. static ɵfac: i0.ɵɵFactoryDeclaration<HwobsService, never>;
  52. static ɵprov: i0.ɵɵInjectableDeclaration<HwobsService>;
  53. }