版博士V2.0程序
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

54 lines
1.2 KiB

  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. /**
  4. * Plugin.
  5. */
  6. class Plugin {
  7. /**
  8. * Constructor.
  9. *
  10. * @param mimeTypes Mime types.
  11. * @param description Description.
  12. * @param filename Filename.
  13. * @param name Name.
  14. */
  15. constructor(mimeTypes, description, filename, name) {
  16. this.length = 0;
  17. this.description = description;
  18. this.filename = filename;
  19. this.name = name;
  20. for (let i = 0, max = mimeTypes.length; i < max; i++) {
  21. this[i] = mimeTypes[i];
  22. this[mimeTypes[i].type] = mimeTypes[i];
  23. }
  24. this.length = mimeTypes.length;
  25. }
  26. /**
  27. * Item.
  28. *
  29. * @param index Number.
  30. * @returns IMimeType.
  31. */
  32. item(index) {
  33. return this[index] || null;
  34. }
  35. /**
  36. * NamedItem.
  37. *
  38. * @param name String.
  39. * @returns IMimeType.
  40. */
  41. namedItem(name) {
  42. return this[name] || null;
  43. }
  44. /**
  45. * Returns the object as a string.
  46. *
  47. * @returns String.
  48. */
  49. toString() {
  50. return '[object Plugin]';
  51. }
  52. }
  53. exports.default = Plugin;
  54. //# sourceMappingURL=Plugin.js.map