PaletteAPI.js 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. "use strict";
  2. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  3. /**
  4. * Licensed Materials - Property of IBM
  5. * IBM Business Analytics (C) Copyright IBM Corp. 2020
  6. * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  7. */
  8. define([], function () {
  9. /**
  10. * @interface PaletteAPI
  11. * @classdesc API class that defines PaletteService interface
  12. */
  13. var PaletteAPI = function () {
  14. function PaletteAPI() {
  15. _classCallCheck(this, PaletteAPI);
  16. }
  17. /**
  18. * Gets a palette with the given id from content service
  19. * @param {string} id - the ID of the palette to retrieve
  20. * @return {Promise} Resolved with the palette or Rejected if the palette wasn't found example below
  21. * Resolved value eg:
  22. * {
  23. * "defaultName": "demoName",
  24. * "content": {
  25. * "label": "demoName",
  26. * "fillType": "simple",
  27. * "fills": ["#FFD191"]
  28. * },
  29. * "id": "4e40ce98c8a548409880bc459d88ca62",
  30. * "my": true
  31. * }
  32. */
  33. PaletteAPI.prototype.getPalette = function getPalette() {};
  34. /**
  35. * Returns all the palettes found in the content store
  36. * @param {String} [fillType] - Specify either 'simple' or 'continuous' palettes to filter the list of palette being returned. Default will return all the palettes
  37. * @return {Promise} Resolved with the all the palettes found example below
  38. * Resolved value eg:
  39. * {
  40. * my: [{
  41. * "defaultName": "demoName",
  42. * "content": {
  43. * "label": "demoName",
  44. * "fillType": "simple",
  45. * "fills": ["#FFD191"]
  46. * },
  47. * "id": "demoId",
  48. * "my": true
  49. * }]
  50. * public: [{
  51. * "defaultName": "demoName2",
  52. * "content": {
  53. * "label": "demoName2",
  54. * "fillType": "simple2",
  55. * "fills": ["#FFD192"]
  56. * },
  57. * "id": "demoId2",
  58. * "public": true,
  59. * }]
  60. */
  61. PaletteAPI.prototype.getPalettes = function getPalettes() {};
  62. /**
  63. * Register an event to the palette feature
  64. * @param {string} eventName - supported events: 'palette:deleted' & 'palette:updated'
  65. * @param {*} callbackFunction - takes an object containing paletteId as param
  66. * eg: callbackFunction( { paletteId } )
  67. */
  68. PaletteAPI.prototype.on = function on() {};
  69. /**
  70. * Deregister an event from the palette feature
  71. * @param {string} eventName - supported events: 'palette:deleted' & 'palette:updated'
  72. * @param {*} callbackFunction - takes an object containing paletteId as param
  73. * eg: callbackFunction( { paletteId } )
  74. */
  75. PaletteAPI.prototype.off = function off() {};
  76. return PaletteAPI;
  77. }();
  78. return PaletteAPI;
  79. });
  80. //# sourceMappingURL=PaletteAPI.js.map