StateAPI.js 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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. * @interface StateAPI
  10. * @hideconstructor
  11. * @classdesc API class that is used to control a state.
  12. * @example content.getFeature('state')
  13. */
  14. define([], function () {
  15. var StateAPI = function () {
  16. function StateAPI() {
  17. _classCallCheck(this, StateAPI);
  18. }
  19. /**
  20. * @function StateAPI#getStatus
  21. * @description Returns the status of the state.
  22. * @return {StateAPI#STATUS}
  23. */
  24. StateAPI.prototype.getStatus = function getStatus() {};
  25. /**
  26. * @async
  27. * @function StateAPI#whenStatusChanges
  28. * @description Resolves when the status changes to an expected status.
  29. * @param {StateAPI#STATUS} status
  30. * @returns {Promise<STATUS>}
  31. */
  32. StateAPI.prototype.whenStatusChanges = function whenStatusChanges() {};
  33. /**
  34. * @function StateAPI#getError
  35. * @description Returns the error associated with the state.
  36. * @return {Error} Type of the canvas content
  37. */
  38. StateAPI.prototype.getError = function getError() {};
  39. /**
  40. * @function StateAPI#onChangeError
  41. * @description Registers the callback method to call when setError is called.
  42. */
  43. StateAPI.prototype.onChangeError = function onChangeError() {};
  44. return StateAPI;
  45. }();
  46. /**
  47. * @readonly
  48. * @description Enumeration of status.
  49. * @static
  50. * @enum {String}
  51. * @memberof StateAPI
  52. */
  53. StateAPI.STATUS = {
  54. /** Created, means the content is created but before loading widget */
  55. CREATED: 'created',
  56. /** Initialized */
  57. INITIALIZED: 'init',
  58. /** Rendering */
  59. RENDERING: 'rendering',
  60. /** Rendered */
  61. RENDERED: 'rendered'
  62. };
  63. return StateAPI;
  64. });
  65. //# sourceMappingURL=StateAPI.js.map