CanvasAPI.js 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  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. 2019, 2020
  6. * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  7. */
  8. /**
  9. * @class CanvasAPI
  10. * @hideconstructor
  11. * @classdesc API class that is used to control a dashboard canvas behaviour.
  12. */
  13. define([], function () {
  14. var CanvasAPI = function () {
  15. function CanvasAPI() {
  16. _classCallCheck(this, CanvasAPI);
  17. }
  18. /**
  19. * @function CanvasAPI#getLayout
  20. * @description Get the layout API
  21. * @return {@link LayoutAPI Layout API}
  22. *
  23. * @deprecated use {@link CanvasAPI#getContent} instead
  24. */
  25. CanvasAPI.prototype.getLayout = function getLayout() {};
  26. /**
  27. * @function CanvasAPI#addWidget
  28. * @description Add a widget to canvas
  29. * @param {object} options content that describes the widget to add
  30. * @param {object} options.model model json for object being added
  31. * @param {string} [options.parentId] location identifier in layout associated with object being added
  32. * @param {object[]} [options.layoutProperties] layout properties
  33. *
  34. * @deprecated use {@link CanvasAPI#addContent} instead
  35. */
  36. CanvasAPI.prototype.addWidget = function addWidget() {};
  37. /**
  38. * @function CanvasAPI#replaceWidget
  39. * @description Replaces a existing widget on the canvas
  40. * @param {string} widgetId unique identifier of the widget to be replaced
  41. * @param {object} options
  42. * @param {object} options.model JSON model of the widget being added
  43. * @param {string} [options.parentId] location identifier in layout associated with object being added
  44. * @param {object[]} [options.layoutProperties] layout properties
  45. * @param sender - sender identifier, optional
  46. * @return {string} - new widget id
  47. *
  48. * @deprecated use {@link CanvasAPI#addContent} instead
  49. */
  50. CanvasAPI.prototype.replaceWidget = function replaceWidget() {};
  51. /**
  52. * @function CanvasAPI#removeWidget
  53. * @description Removes a widget from the canvas
  54. * @param {string} unique identifier of widget to be removed
  55. * @param {string} [sender] sender identifier
  56. *
  57. * @deprecated use {@link CanvasAPI#removeContent} instead
  58. */
  59. CanvasAPI.prototype.removeWidget = function removeWidget() {};
  60. /**
  61. * @function CanvasAPI#getWidgetWhenReady
  62. * @description Wait for the widget with the given id is loaded and rendered.<br>
  63. * If the widget is already loaded, an alternative synchronous way to get a widget is {@link CanvasAPI#getWidget getWidget}
  64. * @param {String} id unique widget identifier
  65. * @return {Promise<WidgetAPI>}
  66. *
  67. * @deprecated use {@link CanvasAPI#getContent} instead
  68. */
  69. CanvasAPI.prototype.getWidgetWhenReady = function getWidgetWhenReady() {};
  70. /**
  71. * @function CanvasAPI#getWidgetsWhenRenderComplete
  72. * @description Wait for the given widgets to be rendered<br>
  73. * Replaces {@link DashboardAPI#waitTillWidgetsRendered DashboardAPI.waitTillWidgetsRendered}
  74. *
  75. * @deprecated use {@link CanvasAPI#getContent} instead
  76. */
  77. CanvasAPI.prototype.getWidgetsWhenRendered = function getWidgetsWhenRendered() {};
  78. /**
  79. * @function CanvasAPI#selectWidget
  80. * @description Select a widget
  81. * @param {string} widgetId unique widget identifier
  82. * @param {object} options selection options
  83. * @param {boolean} [options.isTouch] Indicate if it is a touch gesture so that we can render touch friendly handles
  84. * @return {Promise<WidgetAPI>}
  85. *
  86. * @deprecated use {@link CanvasAPI#selectContent} instead
  87. */
  88. CanvasAPI.prototype.selectWidget = function selectWidget() {};
  89. /**
  90. * @function CanvasAPI#selectWidgets
  91. * @description Select multiple widgets
  92. * @param {string[]} widgetId array of unique widget identifiers
  93. * @param {object} options selection options
  94. * @param {boolean} [options.isTouch] Indicate if it is a touch gesture so that we can render touch friendly handles
  95. * @return {Promise<WidgetAPI[]>}
  96. *
  97. * @deprecated use {@link CanvasAPI#selectContent} instead
  98. */
  99. CanvasAPI.prototype.selectWidgets = function selectWidgets() {};
  100. /**
  101. * @function CanvasAPI#getSelectedWidgets
  102. * @description Get an array of currently selected widget APIs
  103. * @return {Promise<WidgetAPI[]>}
  104. *
  105. * @deprecated use {@link CanvasAPI#getSelectedContentList} instead
  106. */
  107. CanvasAPI.prototype.getSelectedWidgets = function getSelectedWidgets() {};
  108. /**
  109. * @function CanvasAPI#deselectAllWidgets
  110. * @description Deselect all widgets that are currently selected
  111. *
  112. * @deprecated use {@link CanvasAPI#deselectContent} instead
  113. */
  114. CanvasAPI.prototype.deselectAllWidgets = function deselectAllWidgets() {};
  115. /**
  116. * @function CanvasAPI#getWidget
  117. * @description Return a widget Api object. If the widget hasn't loaded yet, this will return null
  118. * An alternative way to get a widget that is not loaded yet is {@link CanvasAPI#getWidgetWhenReady getWidgetWhenReady}
  119. * @param {string} id unique widget identifier
  120. * @return {WidgetAPI} Widget Api object
  121. *
  122. * @deprecated use {@link CanvasAPI#getContent} instead
  123. */
  124. CanvasAPI.prototype.getWidget = function getWidget() {};
  125. /**
  126. * @function CanvasAPI#getWidgets
  127. * @description Get an array of all loaded widget APIs
  128. * @return {WidgetAPI[]} - Array of widget API objects
  129. *
  130. * @deprecated use {@link CanvasAPI#findContent} instead
  131. */
  132. CanvasAPI.prototype.getWidgets = function getWidgets() {};
  133. /**
  134. * @function CanvasAPI#hasMaximizedWidget
  135. * @description Indicate whether the canvas contains a maximized widget
  136. * @return {boolean} true if the canvas contains a maximized widget, otherwise false
  137. *
  138. * @deprecated
  139. */
  140. CanvasAPI.prototype.hasMaximizedWidget = function hasMaximizedWidget() {};
  141. /**
  142. * @function CanvasAPI#getFeature
  143. * @deprecated Replaced by {@link DashboardAPI#getFeature DashboardAPI.getFeature}
  144. */
  145. CanvasAPI.prototype.getFeature = function getFeature() {};
  146. /**
  147. * @deprecated
  148. */
  149. CanvasAPI.prototype.registerFeature = function registerFeature() {};
  150. /**
  151. * @deprecated
  152. * @function CanvasAPI#addFragment
  153. * @description Add a fragment containing widgets and layout spec
  154. * @param {object} fragment containing widgets and layout spec
  155. *
  156. * @deprecated Use {@link CanvasAPI#addContent}
  157. */
  158. CanvasAPI.prototype.addFragment = function addFragment() {};
  159. /**
  160. * @deprecated Use Filters feature
  161. */
  162. CanvasAPI.prototype.getFilters = function getFilters() {};
  163. return CanvasAPI;
  164. }();
  165. return CanvasAPI;
  166. });
  167. //# sourceMappingURL=CanvasAPI.js.map