@gooddata/typings
Advanced tools
Comparing version 2.24.4 to 2.24.5-alpha-khanh.le-kl-SD-889-2020-05-20T03-54-48-489Z
@@ -22,7 +22,7 @@ import { CommandFailed, IObjectMeta, IGdcMessageEvent, IGdcMessageEnvelope, CommandFailedData, GdcProductName, IDrillableItemsCommandBody } from './common'; | ||
*/ | ||
type IADMessageEvent<T, TBody> = IGdcMessageEvent<GdcProductName.ANALYTICAL_DESIGNER, T, TBody>; | ||
type IGdcAdMessageEvent<T, TBody> = IGdcMessageEvent<GdcProductName.ANALYTICAL_DESIGNER, T, TBody>; | ||
/** | ||
* Base type for AD event data | ||
*/ | ||
type IAdGdcMessageEnvelope<T, TBody> = IGdcMessageEnvelope<GdcProductName.ANALYTICAL_DESIGNER, T, TBody>; | ||
type IGdcAdMessageEnvelope<T, TBody> = IGdcMessageEnvelope<GdcProductName.ANALYTICAL_DESIGNER, T, TBody>; | ||
/** | ||
@@ -133,3 +133,3 @@ * All AD command Types | ||
*/ | ||
type DrillableItemsCommand = IADMessageEvent<GdcAdCommandType.DrillableItems, IDrillableItemsCommandBody>; | ||
type DrillableItemsCommand = IGdcAdMessageEvent<GdcAdCommandType.DrillableItems, IDrillableItemsCommandBody>; | ||
/** | ||
@@ -141,3 +141,3 @@ * Data type of drillable items command | ||
*/ | ||
type DrillableItemsCommandData = IAdGdcMessageEnvelope<GdcAdCommandType.DrillableItems, IDrillableItemsCommandBody>; | ||
type DrillableItemsCommandData = IGdcAdMessageEnvelope<GdcAdCommandType.DrillableItems, IDrillableItemsCommandBody>; | ||
/** | ||
@@ -205,3 +205,3 @@ * Type-guard checking whether an object is an instance of {@link DrillableItemsCommandData} | ||
*/ | ||
type OpenInsightCommand = IADMessageEvent<GdcAdCommandType.OpenInsight, IOpenInsightCommandBody>; | ||
type OpenInsightCommand = IGdcAdMessageEvent<GdcAdCommandType.OpenInsight, IOpenInsightCommandBody>; | ||
/** | ||
@@ -213,3 +213,3 @@ * Data type of open insight command | ||
*/ | ||
type OpenInsightCommandData = IAdGdcMessageEnvelope<GdcAdCommandType.OpenInsight, IOpenInsightCommandBody>; | ||
type OpenInsightCommandData = IGdcAdMessageEnvelope<GdcAdCommandType.OpenInsight, IOpenInsightCommandBody>; | ||
/** | ||
@@ -224,3 +224,3 @@ * Type-guard checking whether an object is an instance of {@link OpenInsightCommandData} | ||
*/ | ||
type ClearCommand = IADMessageEvent<GdcAdCommandType.Clear, undefined>; | ||
type ClearCommand = IGdcAdMessageEvent<GdcAdCommandType.Clear, undefined>; | ||
/** | ||
@@ -231,3 +231,3 @@ * Data type of clear command | ||
*/ | ||
type ClearCommandData = IAdGdcMessageEnvelope<GdcAdCommandType.Clear, undefined>; | ||
type ClearCommandData = IGdcAdMessageEnvelope<GdcAdCommandType.Clear, undefined>; | ||
/** | ||
@@ -264,3 +264,3 @@ * Type-guard checking whether an object is an instance of {@link ClearCommandData} | ||
*/ | ||
type SaveInsightCommand = IADMessageEvent<GdcAdCommandType.Save, ISaveCommandBody>; | ||
type SaveInsightCommand = IGdcAdMessageEvent<GdcAdCommandType.Save, ISaveCommandBody>; | ||
/** | ||
@@ -272,3 +272,3 @@ * Data type of save insight command | ||
*/ | ||
type SaveInsightCommandData = IAdGdcMessageEnvelope<GdcAdCommandType.Save, ISaveCommandBody>; | ||
type SaveInsightCommandData = IGdcAdMessageEnvelope<GdcAdCommandType.Save, ISaveCommandBody>; | ||
/** | ||
@@ -294,3 +294,3 @@ * Type-guard checking whether an object is an instance of {@link SaveInsightCommandData} | ||
*/ | ||
type SaveAsInsightCommand = IADMessageEvent<GdcAdCommandType.SaveAs, ISaveAsInsightCommandBody>; | ||
type SaveAsInsightCommand = IGdcAdMessageEvent<GdcAdCommandType.SaveAs, ISaveAsInsightCommandBody>; | ||
/** | ||
@@ -302,3 +302,3 @@ * Data type of save as insight command | ||
*/ | ||
type SaveAsInsightCommandData = IAdGdcMessageEnvelope<GdcAdCommandType.SaveAs, ISaveAsInsightCommandBody>; | ||
type SaveAsInsightCommandData = IGdcAdMessageEnvelope<GdcAdCommandType.SaveAs, ISaveAsInsightCommandBody>; | ||
/** | ||
@@ -335,3 +335,3 @@ * Type-guard checking whether an object is an instance of {@link SaveAsInsightCommandData} | ||
*/ | ||
type ExportInsightCommand = IADMessageEvent<GdcAdCommandType.Export, IExportInsightCommandBody>; | ||
type ExportInsightCommand = IGdcAdMessageEvent<GdcAdCommandType.Export, IExportInsightCommandBody>; | ||
/** | ||
@@ -343,3 +343,3 @@ * Data type of export insight command | ||
*/ | ||
type ExportInsightCommandData = IAdGdcMessageEnvelope<GdcAdCommandType.Export, IExportInsightCommandBody>; | ||
type ExportInsightCommandData = IGdcAdMessageEnvelope<GdcAdCommandType.Export, IExportInsightCommandBody>; | ||
/** | ||
@@ -361,3 +361,3 @@ * Type-guard checking whether an object is an instance of {@link ExportInsightCommandData} | ||
*/ | ||
type UndoCommand = IADMessageEvent<GdcAdCommandType.Undo, undefined>; | ||
type UndoCommand = IGdcAdMessageEvent<GdcAdCommandType.Undo, undefined>; | ||
/** | ||
@@ -368,3 +368,3 @@ * Data type of undo command | ||
*/ | ||
type UndoCommandData = IAdGdcMessageEnvelope<GdcAdCommandType.Undo, undefined>; | ||
type UndoCommandData = IGdcAdMessageEnvelope<GdcAdCommandType.Undo, undefined>; | ||
/** | ||
@@ -386,3 +386,3 @@ * Type-guard checking whether an object is an instance of {@link UndoCommandData} | ||
*/ | ||
type RedoCommand = IADMessageEvent<GdcAdCommandType.Redo, undefined>; | ||
type RedoCommand = IGdcAdMessageEvent<GdcAdCommandType.Redo, undefined>; | ||
/** | ||
@@ -393,3 +393,3 @@ * Data type of redo command | ||
*/ | ||
type RedoCommandData = IAdGdcMessageEnvelope<GdcAdCommandType.Redo, undefined>; | ||
type RedoCommandData = IGdcAdMessageEnvelope<GdcAdCommandType.Redo, undefined>; | ||
/** | ||
@@ -417,3 +417,3 @@ * Type-guard checking whether an object is an instance of {@link RedoCommandData} | ||
*/ | ||
type NewInsightInitialized = IADMessageEvent<GdcAdEventType.NewInsightInitialized, NewInsightInitializedBody>; | ||
type NewInsightInitialized = IGdcAdMessageEvent<GdcAdEventType.NewInsightInitialized, NewInsightInitializedBody>; | ||
/** | ||
@@ -424,3 +424,3 @@ * Data type of event that was emitted when the new insight initialized | ||
*/ | ||
type NewInsightInitializedData = IAdGdcMessageEnvelope<GdcAdEventType.NewInsightInitialized, undefined>; | ||
type NewInsightInitializedData = IGdcAdMessageEnvelope<GdcAdEventType.NewInsightInitialized, undefined>; | ||
/** | ||
@@ -445,3 +445,3 @@ * Type-guard checking whether an object is an instance of {@link NewInsightInitializedData} | ||
*/ | ||
type InsightOpened = IADMessageEvent<GdcAdEventType.InsightOpened, InsightOpenedBody>; | ||
type InsightOpened = IGdcAdMessageEvent<GdcAdEventType.InsightOpened, InsightOpenedBody>; | ||
/** | ||
@@ -453,3 +453,3 @@ * Data type of event that was emitted when an insight is opened | ||
*/ | ||
type InsightOpenedData = IAdGdcMessageEnvelope<GdcAdEventType.InsightOpened, InsightOpenedBody>; | ||
type InsightOpenedData = IGdcAdMessageEnvelope<GdcAdEventType.InsightOpened, InsightOpenedBody>; | ||
/** | ||
@@ -464,3 +464,3 @@ * Type-guard checking whether an object is an instance of {@link InsightOpenedData} | ||
*/ | ||
type ClearFinished = IADMessageEvent<GdcAdEventType.ClearFinished, IAvailableCommands>; | ||
type ClearFinished = IGdcAdMessageEvent<GdcAdEventType.ClearFinished, IAvailableCommands>; | ||
/** | ||
@@ -472,3 +472,3 @@ * Data type of event that was emitted after finish clear action | ||
*/ | ||
type ClearFinishedData = IAdGdcMessageEnvelope<GdcAdEventType.ClearFinished, IAvailableCommands>; | ||
type ClearFinishedData = IGdcAdMessageEnvelope<GdcAdEventType.ClearFinished, IAvailableCommands>; | ||
/** | ||
@@ -494,3 +494,3 @@ * Type-guard checking whether an object is an instance of {@link ClearFinishedData} | ||
*/ | ||
type InsightSaved = IADMessageEvent<GdcAdEventType.InsightSaved, InsightSavedBody>; | ||
type InsightSaved = IGdcAdMessageEvent<GdcAdEventType.InsightSaved, InsightSavedBody>; | ||
/** | ||
@@ -502,3 +502,3 @@ * Data type of event that was emitted when an insight is saved | ||
*/ | ||
type InsightSavedData = IAdGdcMessageEnvelope<GdcAdEventType.InsightSaved, InsightSavedBody>; | ||
type InsightSavedData = IGdcAdMessageEnvelope<GdcAdEventType.InsightSaved, InsightSavedBody>; | ||
/** | ||
@@ -522,3 +522,3 @@ * Type-guard checking whether an object is an instance of {@link InsightSavedData} | ||
*/ | ||
type ExportFinished = IADMessageEvent<GdcAdEventType.ExportFinished, ExportFinishedBody>; | ||
type ExportFinished = IGdcAdMessageEvent<GdcAdEventType.ExportFinished, ExportFinishedBody>; | ||
/** | ||
@@ -530,3 +530,3 @@ * Data type of event that was emitted after an insight was exported | ||
*/ | ||
type ExportFinishedData = IAdGdcMessageEnvelope<GdcAdEventType.ExportFinished, ExportFinishedBody>; | ||
type ExportFinishedData = IGdcAdMessageEnvelope<GdcAdEventType.ExportFinished, ExportFinishedBody>; | ||
/** | ||
@@ -545,3 +545,3 @@ * Type-guard checking whether an object is an instance of {@link ExportFinishedData} | ||
*/ | ||
type UndoFinished = IADMessageEvent<GdcAdEventType.UndoFinished, UndoFinishedBody>; | ||
type UndoFinished = IGdcAdMessageEvent<GdcAdEventType.UndoFinished, UndoFinishedBody>; | ||
/** | ||
@@ -553,3 +553,3 @@ * Data type of event that was emitted after finish undo action | ||
*/ | ||
type UndoFinishedData = IAdGdcMessageEnvelope<GdcAdEventType.UndoFinished, UndoFinishedBody>; | ||
type UndoFinishedData = IGdcAdMessageEnvelope<GdcAdEventType.UndoFinished, UndoFinishedBody>; | ||
/** | ||
@@ -568,3 +568,3 @@ * Type-guard checking whether an object is an instance of {@link UndoFinishedData} | ||
*/ | ||
type RedoFinished = IADMessageEvent<GdcAdEventType.RedoFinished, RedoFinishedBody>; | ||
type RedoFinished = IGdcAdMessageEvent<GdcAdEventType.RedoFinished, RedoFinishedBody>; | ||
/** | ||
@@ -576,3 +576,3 @@ * Data type of event that was emitted after finish redo action | ||
*/ | ||
type RedoFinishedData = IAdGdcMessageEnvelope<GdcAdEventType.RedoFinished, RedoFinishedBody>; | ||
type RedoFinishedData = IGdcAdMessageEnvelope<GdcAdEventType.RedoFinished, RedoFinishedBody>; | ||
/** | ||
@@ -579,0 +579,0 @@ * Type-guard checking whether an object is an instance of {@link RedoFinishedData} |
@@ -6,7 +6,7 @@ import { IGdcMessageEvent, GdcProductName, IGdcMessageEnvelope, IDrillableItemsCommandBody } from './common'; | ||
*/ | ||
type IKdGdcMessageEvent<T, TBody> = IGdcMessageEvent<GdcProductName.KPI_DASHBOARD, T, TBody>; | ||
type IGdcKdMessageEvent<T, TBody> = IGdcMessageEvent<GdcProductName.KPI_DASHBOARD, T, TBody>; | ||
/** | ||
* Base type for KD event data. | ||
*/ | ||
type IKdGdcMessageEnvelope<T, TBody> = IGdcMessageEnvelope<GdcProductName.KPI_DASHBOARD, T, TBody>; | ||
type IGdcKdMessageEnvelope<T, TBody> = IGdcMessageEnvelope<GdcProductName.KPI_DASHBOARD, T, TBody>; | ||
/** | ||
@@ -41,5 +41,13 @@ * All KD command Types. | ||
/** | ||
* The command drill performed | ||
* The command add widget to dashboard. | ||
*/ | ||
Drill = "drill" | ||
AddWidget = "addWidget", | ||
/** | ||
* The command add filter to dashboard. | ||
*/ | ||
AddFilter = "addFilter", | ||
/** | ||
* The command export a dashboard. | ||
*/ | ||
ExportToPDF = "exportToPDF" | ||
} | ||
@@ -104,3 +112,21 @@ /** | ||
*/ | ||
Platform = "platform" | ||
Platform = "platform", | ||
/** | ||
* Type represent that the widget is added to dashboard. | ||
* | ||
*/ | ||
WidgetAdded = "widgetAdded", | ||
/** | ||
* Type represent that the filter is added to dashboard. | ||
* | ||
*/ | ||
FilterAdded = "filterAdded", | ||
/** | ||
* Type represent that the export action is finished. | ||
*/ | ||
ExportedToPDF = "exportedToPDF", | ||
/** | ||
* Type represent that the drill performed | ||
*/ | ||
Drill = "drill" | ||
} | ||
@@ -143,4 +169,4 @@ /** | ||
*/ | ||
type SaveDashboardCommand = IKdGdcMessageEvent<GdcKdCommandType.Save, IKdSaveCommandBody>; | ||
type SaveDashboardCommandData = IKdGdcMessageEnvelope<GdcKdCommandType.Save, IKdSaveCommandBody>; | ||
type SaveDashboardCommand = IGdcKdMessageEvent<GdcKdCommandType.Save, IKdSaveCommandBody>; | ||
type SaveDashboardCommandData = IGdcKdMessageEnvelope<GdcKdCommandType.Save, IKdSaveCommandBody>; | ||
/** | ||
@@ -164,4 +190,4 @@ * Type-guard checking whether object is an instance of {@link SaveDashboardCommandData}. | ||
*/ | ||
type CancelEditCommand = IKdGdcMessageEvent<GdcKdCommandType.CancelEdit, null>; | ||
type CancelEditCommandData = IKdGdcMessageEnvelope<GdcKdCommandType.CancelEdit, null>; | ||
type CancelEditCommand = IGdcKdMessageEvent<GdcKdCommandType.CancelEdit, null>; | ||
type CancelEditCommandData = IGdcKdMessageEnvelope<GdcKdCommandType.CancelEdit, null>; | ||
/** | ||
@@ -186,4 +212,4 @@ * Type-guard checking whether object is an instance of {@link CancelEditData}. | ||
*/ | ||
type DeleteDashboardCommand = IKdGdcMessageEvent<GdcKdCommandType.Delete, null>; | ||
type DeleteDashboardCommandData = IKdGdcMessageEnvelope<GdcKdCommandType.Delete, null>; | ||
type DeleteDashboardCommand = IGdcKdMessageEvent<GdcKdCommandType.Delete, null>; | ||
type DeleteDashboardCommandData = IGdcKdMessageEnvelope<GdcKdCommandType.Delete, null>; | ||
/** | ||
@@ -202,4 +228,4 @@ * Switches current dashboard to edit mode. | ||
*/ | ||
type SwitchToEditCommand = IKdGdcMessageEvent<GdcKdCommandType.SwitchToEdit, null>; | ||
type SwitchToEditCommandData = IKdGdcMessageEnvelope<GdcKdCommandType.SwitchToEdit, null>; | ||
type SwitchToEditCommand = IGdcKdMessageEvent<GdcKdCommandType.SwitchToEdit, null>; | ||
type SwitchToEditCommandData = IGdcKdMessageEnvelope<GdcKdCommandType.SwitchToEdit, null>; | ||
/** | ||
@@ -218,3 +244,3 @@ * Type-guard checking whether object is an instance of {@link SwitchToEditCommandData}. | ||
*/ | ||
type DrillableItemsCommand = IKdGdcMessageEvent<GdcKdCommandType.DrillableItems, IDrillableItemsCommandBody>; | ||
type DrillableItemsCommand = IGdcKdMessageEvent<GdcKdCommandType.DrillableItems, IDrillableItemsCommandBody>; | ||
/** | ||
@@ -226,3 +252,3 @@ * Data type of drillable items command | ||
*/ | ||
type DrillableItemsCommandData = IKdGdcMessageEnvelope<GdcKdCommandType.DrillableItems, IDrillableItemsCommandBody>; | ||
type DrillableItemsCommandData = IGdcKdMessageEnvelope<GdcKdCommandType.DrillableItems, IDrillableItemsCommandBody>; | ||
/** | ||
@@ -240,4 +266,4 @@ * Type-guard checking whether object is an instance of {@link DrillableItemsCommandData}. | ||
} | ||
type SetSizeCommand = IKdGdcMessageEvent<GdcKdCommandType.SetSize, ISetSizeCommandBody>; | ||
type SetSizeCommandData = IKdGdcMessageEnvelope<GdcKdCommandType.SetSize, ISetSizeCommandBody>; | ||
type SetSizeCommand = IGdcKdMessageEvent<GdcKdCommandType.SetSize, ISetSizeCommandBody>; | ||
type SetSizeCommandData = IGdcKdMessageEnvelope<GdcKdCommandType.SetSize, ISetSizeCommandBody>; | ||
/** | ||
@@ -249,2 +275,87 @@ * Type-guard checking whether object is an instance of {@link SetSizeCommandData}. | ||
function isSetSizeCommandData(obj: any): obj is SetSizeCommandData; | ||
interface IKpiWidget { | ||
type: 'kpi'; | ||
} | ||
type InsightRef = { | ||
identifier: string; | ||
} | { | ||
uri: string; | ||
}; | ||
interface IInsightWidget { | ||
type: 'insight'; | ||
ref: InsightRef; | ||
} | ||
interface IAddWidgetBody { | ||
widget: IKpiWidget | IInsightWidget; | ||
} | ||
/** | ||
* Adds new widget onto dashboard. New row will be created on top of the dashboard, the widget | ||
* will be placed into its first column. | ||
* | ||
* It is currently possible to add either a KPI or an Insight. When adding either of these, KD will | ||
* scroll to top so that the newly added widget is visible. | ||
* | ||
* For KPI, the KD will start the KPI customization flow right after the KPI is placed. | ||
* Insights are placed without need for further customization | ||
* | ||
* Contract: | ||
* | ||
* - if KD is currently editing a dashboard, then depending on widget type: | ||
* - KPI is added to dashboard, customization flow is started, WidgetAdded will be posted | ||
* - Insight is added to dashboard, WidgetAdded will be posted | ||
* | ||
* - if insight reference included in command payload does not refer to a valid insight, KdCommandFailed | ||
* will be posted | ||
* | ||
* - if KD is in view mode or not showing any dashboard, then KdCommandFailed will be posted | ||
* | ||
* @remarks use {@link AddWidgetCommand} to create instances of AddWidget | ||
*/ | ||
type AddWidgetCommand = IGdcKdMessageEvent<GdcKdCommandType.AddWidget, IAddWidgetBody>; | ||
type AddWidgetCommandData = IGdcKdMessageEnvelope<GdcKdCommandType.AddWidget, IAddWidgetBody>; | ||
/** | ||
* Type-guard checking whether object is an instance of {@link isAddWidgetCommandData}. | ||
* | ||
* @param obj - object to test | ||
*/ | ||
function isAddWidgetCommandData(obj: any): obj is AddWidgetCommandData; | ||
/** | ||
* Adds new attribute filter to filter bar and starts the filter customization flow. | ||
* | ||
* Contract: | ||
* | ||
* - if KD is currently editing a dashboard, adds new attribute filter, starts customization flow; FilterAdded | ||
* will be posted right after customization starts | ||
* | ||
* - if KD is currently in view mode or does not show any dashboard, will post KdCommandFailed | ||
* | ||
* @remarks use {@link AddFilterCommand} factory function to instantiate | ||
*/ | ||
type AddFilterCommand = IGdcKdMessageEvent<GdcKdCommandType.AddFilter, null>; | ||
type AddFilterCommandData = IGdcKdMessageEnvelope<GdcKdCommandType.AddFilter, null>; | ||
/** | ||
* Type-guard checking whether object is an instance of {@link isAddFilterCommandData}. | ||
* | ||
* @param obj - object to test | ||
*/ | ||
function isAddFilterCommandData(obj: any): obj is AddFilterCommandData; | ||
/** | ||
* Exports dashboard to PDF. | ||
* | ||
* Contract: | ||
* | ||
* - if KD shows dashboard in view mode, will export dashboard to PDF and post ExportFinished once ready for | ||
* exporting | ||
* - if KD shwows dashboard in edit mode or not not showing any dashboard, KdCommandFailed will | ||
* be posted | ||
* @remarks use {@link ExportToPDFCommand} factory function to instantiate | ||
*/ | ||
type ExportToPDFCommand = IGdcKdMessageEvent<GdcKdCommandType.ExportToPDF, null>; | ||
type ExportToPDFCommandData = IGdcKdMessageEnvelope<GdcKdCommandType.ExportToPDF, null>; | ||
/** | ||
* Type-guard checking whether object is an instance of {@link isExportCommandData}. | ||
* | ||
* @param obj - object to test | ||
*/ | ||
function isExportToPDFCommandData(obj: any): obj is ExportToPDFCommandData; | ||
interface INoPermissionsBody { | ||
@@ -259,3 +370,3 @@ /** | ||
*/ | ||
type NoPermissionsEventData = IKdGdcMessageEnvelope<GdcKdEventType.NoPermissions, INoPermissionsBody>; | ||
type NoPermissionsEventData = IGdcKdMessageEnvelope<GdcKdEventType.NoPermissions, INoPermissionsBody>; | ||
interface IResizedBody { | ||
@@ -267,3 +378,3 @@ height: number; | ||
*/ | ||
type ResizedEventData = IKdGdcMessageEnvelope<GdcKdEventType.Resized, IResizedBody>; | ||
type ResizedEventData = IGdcKdMessageEnvelope<GdcKdEventType.Resized, IResizedBody>; | ||
interface IDashboardObjectMeta { | ||
@@ -297,3 +408,3 @@ /** | ||
*/ | ||
type IDashboardCreatedData = IKdGdcMessageEnvelope<GdcKdEventType.DashboardCreated, IDashboardBody>; | ||
type IDashboardCreatedData = IGdcKdMessageEnvelope<GdcKdEventType.DashboardCreated, IDashboardBody>; | ||
/** | ||
@@ -303,23 +414,23 @@ * Data type of event that was emited when the content is fully loaded, | ||
*/ | ||
type IDashboardLoadedData = IKdGdcMessageEnvelope<GdcKdEventType.DashboardLoaded, IDashboardBody>; | ||
type IDashboardLoadedData = IGdcKdMessageEnvelope<GdcKdEventType.DashboardLoaded, IDashboardBody>; | ||
/** | ||
* Data type of event that was emited when the existing dashboard has been updated. | ||
*/ | ||
type IDashboardUpdatedData = IKdGdcMessageEnvelope<GdcKdEventType.DashboardUpdated, IDashboardBody>; | ||
type IDashboardUpdatedData = IGdcKdMessageEnvelope<GdcKdEventType.DashboardUpdated, IDashboardBody>; | ||
/** | ||
* Data type of event that was emited when the dashboard has been saved. | ||
*/ | ||
type IDashboardSavedData = IKdGdcMessageEnvelope<GdcKdEventType.DashboardSaved, IDashboardBody>; | ||
type IDashboardSavedData = IGdcKdMessageEnvelope<GdcKdEventType.DashboardSaved, IDashboardBody>; | ||
/** | ||
* Data type of event that was emited when the dashboard has been deleted. | ||
*/ | ||
type IDashboardDeletedData = IKdGdcMessageEnvelope<GdcKdEventType.DashboardDeleted, IDashboardBody>; | ||
type IDashboardDeletedData = IGdcKdMessageEnvelope<GdcKdEventType.DashboardDeleted, IDashboardBody>; | ||
/** | ||
* This event is emitted after KD switched a dashboard from view mode to edit mode. | ||
*/ | ||
type SwitchedToEditData = IKdGdcMessageEnvelope<GdcKdEventType.SwitchedToEdit, IDashboardBody>; | ||
type SwitchedToEditData = IGdcKdMessageEnvelope<GdcKdEventType.SwitchedToEdit, IDashboardBody>; | ||
/** | ||
* This event is emitted after KD switched a dashboard from edit mode to view mode. | ||
*/ | ||
type SwitchedToViewData = IKdGdcMessageEnvelope<GdcKdEventType.SwitchedToView, IDashboardBody>; | ||
type SwitchedToViewData = IGdcKdMessageEnvelope<GdcKdEventType.SwitchedToView, IDashboardBody>; | ||
interface IPlaformBody { | ||
@@ -330,3 +441,40 @@ status?: string; | ||
} | ||
type PlaformData = IKdGdcMessageEnvelope<GdcKdEventType.Platform, IPlaformBody>; | ||
type PlaformData = IGdcKdMessageEnvelope<GdcKdEventType.Platform, IPlaformBody>; | ||
interface IInsightWidgetBody { | ||
widgetCategory: "kpi" | "visualization"; | ||
identifier?: string; | ||
uri?: string; | ||
title?: string; | ||
} | ||
interface IWidgetAddedBody { | ||
insight?: IInsightWidgetBody; | ||
} | ||
/** | ||
* This event is emitted after KD added a new widget to a dashboard. If the widget is | ||
* an insight, then meta information about the insight will be returned. | ||
* | ||
* Note: when this event is added for a KPI widget, it means the customization flow for the KPI has | ||
* started. The user may still 'just' click somewhere outside of the KPI configuration and the KPI will | ||
* be discarded. | ||
*/ | ||
type WidgetAddedData = IGdcKdMessageEnvelope<GdcKdEventType.WidgetAdded, IWidgetAddedBody>; | ||
type FilterAddedBody = IKdAvailableCommands; | ||
/** | ||
* This event is emitted after KD added a new filter to dashboard's filter bar and started its | ||
* customization flow. | ||
* | ||
* Note: users can still cancel the filter customization flow meaning no new attribute filter | ||
* will end on the filter bar. | ||
*/ | ||
type FilterAddedData = IGdcKdMessageEnvelope<GdcKdEventType.FilterAdded, FilterAddedBody>; | ||
type ExportToPDFFinishedBody = IKdAvailableCommands & { | ||
/** | ||
* Link to the file containing exported data. | ||
*/ | ||
link: string; | ||
}; | ||
/** | ||
* This event is emitted after dashboard has been exported to PDF | ||
*/ | ||
type ExportToPDFFinishedData = IGdcKdMessageEnvelope<GdcKdEventType.ExportedToPDF, ExportToPDFFinishedBody>; | ||
} |
@@ -37,5 +37,13 @@ "use strict"; | ||
/** | ||
* The command drill performed | ||
* The command add widget to dashboard. | ||
*/ | ||
GdcKdCommandType["Drill"] = "drill"; | ||
GdcKdCommandType["AddWidget"] = "addWidget"; | ||
/** | ||
* The command add filter to dashboard. | ||
*/ | ||
GdcKdCommandType["AddFilter"] = "addFilter"; | ||
/** | ||
* The command export a dashboard. | ||
*/ | ||
GdcKdCommandType["ExportToPDF"] = "exportToPDF"; | ||
})(GdcKdCommandType = EmbeddedKpiDashboard.GdcKdCommandType || (EmbeddedKpiDashboard.GdcKdCommandType = {})); | ||
@@ -102,2 +110,20 @@ /** | ||
GdcKdEventType["Platform"] = "platform"; | ||
/** | ||
* Type represent that the widget is added to dashboard. | ||
* | ||
*/ | ||
GdcKdEventType["WidgetAdded"] = "widgetAdded"; | ||
/** | ||
* Type represent that the filter is added to dashboard. | ||
* | ||
*/ | ||
GdcKdEventType["FilterAdded"] = "filterAdded"; | ||
/** | ||
* Type represent that the export action is finished. | ||
*/ | ||
GdcKdEventType["ExportedToPDF"] = "exportedToPDF"; | ||
/** | ||
* Type represent that the drill performed | ||
*/ | ||
GdcKdEventType["Drill"] = "drill"; | ||
})(GdcKdEventType = EmbeddedKpiDashboard.GdcKdEventType || (EmbeddedKpiDashboard.GdcKdEventType = {})); | ||
@@ -149,3 +175,30 @@ /** | ||
EmbeddedKpiDashboard.isSetSizeCommandData = isSetSizeCommandData; | ||
/** | ||
* Type-guard checking whether object is an instance of {@link isAddWidgetCommandData}. | ||
* | ||
* @param obj - object to test | ||
*/ | ||
function isAddWidgetCommandData(obj) { | ||
return common_1.getEventType(obj) === GdcKdCommandType.AddWidget; | ||
} | ||
EmbeddedKpiDashboard.isAddWidgetCommandData = isAddWidgetCommandData; | ||
/** | ||
* Type-guard checking whether object is an instance of {@link isAddFilterCommandData}. | ||
* | ||
* @param obj - object to test | ||
*/ | ||
function isAddFilterCommandData(obj) { | ||
return common_1.getEventType(obj) === GdcKdCommandType.AddFilter; | ||
} | ||
EmbeddedKpiDashboard.isAddFilterCommandData = isAddFilterCommandData; | ||
/** | ||
* Type-guard checking whether object is an instance of {@link isExportCommandData}. | ||
* | ||
* @param obj - object to test | ||
*/ | ||
function isExportToPDFCommandData(obj) { | ||
return common_1.getEventType(obj) === GdcKdCommandType.ExportToPDF; | ||
} | ||
EmbeddedKpiDashboard.isExportToPDFCommandData = isExportToPDFCommandData; | ||
})(EmbeddedKpiDashboard = exports.EmbeddedKpiDashboard || (exports.EmbeddedKpiDashboard = {})); | ||
//# sourceMappingURL=kd.js.map |
{ | ||
"name": "@gooddata/typings", | ||
"version": "2.24.4", | ||
"version": "2.24.5-alpha-khanh.le-kl-SD-889-2020-05-20T03-54-48-489Z", | ||
"description": "TypeScript definition files for GoodData platform", | ||
@@ -5,0 +5,0 @@ "typings": "dist/index.d.ts", |
Sorry, the diff of this file is not supported yet
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
336023
5735
1