"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, 2021 * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. */ /** * @interface SlotsAPI * @classdesc API class that is used to control slots. * @example visualization.getSlots() */ define([], function () { var SlotsAPI = function () { function SlotsAPI() { _classCallCheck(this, SlotsAPI); } /** * @function SlotsAPI#createDataItems * @description Creates data items that are not mapped to any slot. * @public * * @param {object[]} dataitems Array of a dataItem spec. The spec contains a columnsId and an optional ID. * @param {Object} transactionToken */ SlotsAPI.prototype.createDataItems = function createDataItems() {}; /** * @function SlotsAPI#deleteDataItems * @description Deletes data items that correspond to the given dataItem IDs. * @public * * @param {String[]} idList List of data items IDs to delete. This will not remove slot mappings to the deleted dataItem IDs. * To delete and remove the mappings, use {@link SlotAPI#removeDataItems} instead. * @param {Object} transactionToken */ SlotsAPI.prototype.deleteDataItems = function deleteDataItems() {}; /** * @function SlotsAPI#setDataItems * @description Changes the data items assigned to an existing slot. Supports reordering and deletion of existing items. * @public * * @param {string[]} dataItemtIds - Ordered array of dataItem IDs to assign to this slot. * @param {string} slotId * @param {Object} transactionToken * @return {DataItemAPI[]} Array of removed data items */ SlotsAPI.prototype.setDataItems = function setDataItems() {}; /** * @function SlotsAPI#swapSlots * @description Swaps data items between the two slots that are identified by their IDs. * The operation should be performed as one transaction. * @public * * @param {string} sourceSlotId ID of the source slot * @param {string} targetSlotId ID of the target slot * @param {Object} transactionToken */ SlotsAPI.prototype.swapSlots = function swapSlots() {}; /** * @function SlotsAPI#getSlot * @description Gets the slot with the given ID * @public * * @param {string} slotId * @return {SlotAPI} Slot */ SlotsAPI.prototype.getSlot = function getSlot() {}; /** * @function SlotsAPI#getSlotList * @description Returns the list of all slots. * @public * * @return {SlotAPI[]} */ SlotsAPI.prototype.getSlotList = function getSlotList() {}; /** * @function SlotsAPI#getMappedSlotList * @description Returns the list of the mapped slots. * @public * * @return {SlotAPI[]} */ SlotsAPI.prototype.getMappedSlotList = function getMappedSlotList() {}; /** * @function SlotsAPI#getDataItem * @description Returns the data item with the given ID. * @public * * @param {String} dataItemId Unique dataItem ID * * @returns {dataItemAPI} Associated data item (or null) */ SlotsAPI.prototype.getDataItem = function getDataItem() {}; /** * @function SlotsAPI#getDataItemList * @description Returns a list of all dataItems in this visualization including ones which are not mapped to any slot. * @public * * @return {DataItem[]} dataItemList */ SlotsAPI.prototype.getDataItemList = function getDataItemList() {}; /** * @function SlotsAPI#getMappingInfo * @description Returns the data item location in the slots for the supplied dataItemUniqueId. * @public * * @param {string} dataItemId - dataItemUniqueId to find in the set of slots. * @return {MappingInfo} dataItem slot location information (dataItemAPI, slotAPI, indexInSlot). * Returns null if the data item is not mapped. */ SlotsAPI.prototype.getMappingInfo = function getMappingInfo() /* dataItemId */{}; /** * @function SlotsAPI#getMappingInfoList * @description Returns an array of all the data item mapping information for all the slots. * @public * * @return {MappingInfo[]} Array of data item mapping information */ SlotsAPI.prototype.getMappingInfoList = function getMappingInfoList() {}; /** * @function SlotsAPI#isMappingComplete * @description Returns true if all of the required slots for the specified layer are mapped and this visualization can be rendered. * If no layer is specified, then returns true if at least one layer has all required slots mapped. * @public * * @param {string} layerId (optional) * @return {boolean} isMappingComplete */ SlotsAPI.prototype.isMappingComplete = function isMappingComplete() {}; /** * @function SlotsAPI#clearAllSlots * @description Clears all slots content * @public * * @param {SetOptions} options */ SlotsAPI.prototype.clearAllSlots = function clearAllSlots() /* options */{}; /** * handlers can be registered for api's that support them (eg createDataItems, deleteDataItems) * @param {String} eventName - the name of the event eg change:dataitems:create * @param {function} handler - the handler */ SlotsAPI.prototype.on = function on() {}; /** * External code (eg navigate) can register a handler that will be called at the beginning of the deleteDataItemsAPI. * Similar to an event handler for delete but allows for 2 things * 1) It is called before items are deleted rather than after * 2) It can contribute to a transaction involving data item deletion. * @param {function} handler - the handler to call. */ SlotsAPI.prototype.registerDeleteDataItemsHandler = function registerDeleteDataItemsHandler() {}; return SlotsAPI; }(); return SlotsAPI; }); //# sourceMappingURL=SlotsAPI.js.map