上传插件,不包含上传的前端实现,只提供后端接口等,其他地方接入插件上传。包括上传进度、断点续传等

index.d.ts 1.1KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. // Type definitions for spark-md5 3.0
  2. // Project: https://github.com/satazor/js-spark-md5#readme
  3. // Definitions by: Bastien Moulia <https://github.com/bastienmoulia>
  4. // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
  5. // TypeScript Version: 2.3
  6. interface State {
  7. buff: Uint8Array;
  8. length: number;
  9. hash: number[];
  10. }
  11. // copy of ArrayBuffer because of a conflict with the class SparkMD5.ArrayBuffer
  12. interface ArrayBufferCopy extends ArrayBuffer {}
  13. declare class SparkMD5 {
  14. constructor();
  15. append(str: string): SparkMD5;
  16. appendBinary(contents: string): SparkMD5;
  17. end(raw?: boolean): string;
  18. reset(): SparkMD5;
  19. getState(): State;
  20. setState(state: State): State;
  21. destroy(): void;
  22. static hash(str: string, raw?: boolean): string;
  23. static hashBinary(content: string, raw?: boolean): string;
  24. }
  25. declare namespace SparkMD5 {
  26. class ArrayBuffer {
  27. constructor();
  28. append(str: ArrayBufferCopy): ArrayBuffer;
  29. end(raw?: boolean): string;
  30. reset(): ArrayBuffer;
  31. getState(): State;
  32. setState(state: State): State;
  33. destroy(): void;
  34. static hash(arr: ArrayBufferCopy, raw?: boolean): string;
  35. }
  36. }
  37. export = SparkMD5;