"use strict";
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
/**
* Licensed Materials - Property of IBM
* IBM Business Analytics (C) Copyright IBM Corp. 2018, 2019
* US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
*/
/**
* @class WidgetAPI
* @hideconstructor
* @classdesc API class that is used to control a widget behaviour.
*/
define([], function () {
var WidgetAPI = function () {
function WidgetAPI() {
_classCallCheck(this, WidgetAPI);
}
/**
* @function WidgetAPI#getId
* @description Get the internal ID of the widget
* @return {String} Internal ID of the widget
*/
WidgetAPI.prototype.getId = function getId() {};
/**
* @function WidgetAPI#getEventGroupId
* @description Get the ID for the event group this widget is a part of
* @return {String} Group ID this widget belongs to. Undefined if the widget is not part of a group
*/
WidgetAPI.prototype.getEventGroupId = function getEventGroupId() {};
/**
* @function WidgetAPI#getScope
* @description Get the container page ID for which the widget belongs to
* @return {String} ccontainer page ID for which the widget belongs to
*/
WidgetAPI.prototype.getScope = function getScope() {};
/**
* @function WidgetAPI#getLayoutAPI
* @deprecated APIs should not know about their parent
*/
WidgetAPI.prototype.getLayoutAPI = function getLayoutAPI() {};
/**
* @function WidgetAPI#getType
* @description Get the type of the widget
* @return {String} The type of the widget
*/
WidgetAPI.prototype.getType = function getType() {};
/**
* @deprecated
* @function WidgetAPI#getProperties
* @description Get all the properties for the widget
* @returns {PropertiesAPI}
*/
WidgetAPI.prototype.getProperties = function getProperties() {};
/**
* @deprecated
* @function WidgetAPI#getProperty
* @param {String} propertyName name of the property
* @descrpition Get the property for the widget
* @return {Object} property object
*/
WidgetAPI.prototype.getProperty = function getProperty() /* propertyName */{};
/**
* @function WidgetAPI#getPropertyLayoutList
* @descrpition Returns a list of layout list
* @return {Object[]} Array of layout list
*/
WidgetAPI.prototype.getPropertyLayoutList = function getPropertyLayoutList() {};
/**
* @function WidgetAPI#getPropertyList
* @descrpition Returns a list of properties list
* @return {Object[]} Array of properties
*/
WidgetAPI.prototype.getPropertyList = function getPropertyList() {};
/**
* @function WidgetAPI#getFeature
* @description Get a widget level feature. Features are extensions to the widget
* @param {String} featureId - The ID of the feature to get
* @return {Promise} Promise resolved with the feature or with undefined if feature does not exist
*/
WidgetAPI.prototype.getFeature = function getFeature() {};
/**
* @function WidgetAPI#getContextToolbarItems
* @description Get the toolbar actions for the widget
* @return {WidgetAction[]} An array of {@link WidgetAction} objects
*/
WidgetAPI.prototype.getContextToolbarItems = function getContextToolbarItems() {};
/**
* @function WidgetAPI#getError
* @deprecated use {@link WidgetAPI#getErrorDetails}
*/
WidgetAPI.prototype.getError = function getError() {};
/**
* @function WidgetAPI#getErrorDetails
* @description Get error information for the widget
* @return {WidgetErrorDetails} Returns the error details for the widget. Returns null if the widget isn't in an error state
*/
WidgetAPI.prototype.getErrorDetails = function getErrorDetails() {};
/**
* @function WidgetAPI#hasError
* @description Used to check if the widget is currently in an error state
* @return {Boolean} - Returns true if the widget is currently in an error state
*/
WidgetAPI.prototype.hasError = function hasError() {};
/**
* @function WidgetAPI#hasWarning
* @description Used to check if the widget is currently in an warning state
* @return {Boolean} - Returns true if the widget is currently in an warning state
*/
WidgetAPI.prototype.hasWarning = function hasWarning() {};
/**
* @function WidgetAPI#clearError
* @deprecated Clearing of the error should be handled by a render call and the render sequence
*/
WidgetAPI.prototype.clearError = function clearError() {};
/**
* @function WidgetAPI#on
* @description Register an event handler for the widget
* @param {String} eventName Name of the event
* @param {function} handler Event handler to be called when the event occurrs.
* @param {object} context Context of the event
* Multiple handlers can be registered with the same eventName.
* Each handlers needs to be registered and unregistered individually.
*/
WidgetAPI.prototype.on = function on() {};
/**
* @function WidgetAPI#off
* @description Unregister an event handler that was registered with {@link WidgetAPI#on}
* @param {String} eventName Name of the dashboard event
* @param {function} handler Event handler to be called when the event occurrs
* @param {object} context Context of the event
*/
WidgetAPI.prototype.off = function off() {};
/**
* @function WidgetAPI#isWidgetMaximized
* @description Used to know if the widget is in maximized mode
* @return {Boolean} true if the widget is currently maximize
*/
WidgetAPI.prototype.isWidgetMaximized = function isWidgetMaximized() {};
/**
* @function WidgetAPI#isContextualGridEnabled
* @description Check if contextual grid is supported for this widget
* @return {Promise} promise resolves with true if enabled
*/
WidgetAPI.prototype.isContextualGridEnabled = function isContextualGridEnabled() {};
/**
* @function WidgetAPI#setFeatureEnabled
* @description Allows for a widget level feature to be enabled or disabled at runtime
* @param {String} featureId - The ID of the feature to update
* @param {Boolean} isEnabled - Is the feature enabled or not
*/
WidgetAPI.prototype.setFeatureEnabled = function setFeatureEnabled() {};
return WidgetAPI;
}();
return WidgetAPI;
});
//# sourceMappingURL=WidgetAPI.js.map