版博士V2.0程序
Não pode escolher mais do que 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

DataTransferItem.js 785 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. /**
  4. *
  5. */
  6. class DataTransferItem {
  7. /**
  8. * Constructor.
  9. *
  10. * @param item Item.
  11. */
  12. constructor(item) {
  13. this.kind = '';
  14. this.type = '';
  15. this._item = null;
  16. this.kind = typeof item === 'string' ? 'string' : 'file';
  17. this._item = item;
  18. }
  19. /**
  20. * Returns file.
  21. */
  22. getAsFile() {
  23. if (this.kind === 'string') {
  24. return null;
  25. }
  26. return this._item;
  27. }
  28. /**
  29. * Returns string.
  30. */
  31. getAsString() {
  32. if (this.kind === 'file') {
  33. return null;
  34. }
  35. return this._item;
  36. }
  37. }
  38. exports.default = DataTransferItem;
  39. //# sourceMappingURL=DataTransferItem.js.map