2019-09-12 11:19:38 +00:00
|
|
|
import { AlertType, MessageIntent } from "../widgets/AlertWidget";
|
2019-02-10 13:06:05 +00:00
|
|
|
|
2019-09-12 11:19:38 +00:00
|
|
|
export type EventType =
|
|
|
|
|
| "ON_CLICK"
|
|
|
|
|
| "ON_HOVER"
|
|
|
|
|
| "ON_TOGGLE"
|
|
|
|
|
| "ON_LOAD"
|
|
|
|
|
| "ON_TEXT_CHANGE"
|
|
|
|
|
| "ON_SUBMIT"
|
|
|
|
|
| "ON_CHECK_CHANGE"
|
|
|
|
|
| "ON_SELECT"
|
|
|
|
|
| "ON_DATE_SELECTED"
|
|
|
|
|
| "ON_DATE_RANGE_SELECTED"
|
2019-03-30 12:30:42 +00:00
|
|
|
|
2019-09-12 11:19:38 +00:00
|
|
|
export type ActionType =
|
|
|
|
|
| "CALL_API"
|
|
|
|
|
| "EXECUTE_QUERY"
|
|
|
|
|
| "NAVIGATE_PAGE"
|
|
|
|
|
| "SHOW_ALERT"
|
|
|
|
|
| "EXECUTE_JS"
|
|
|
|
|
| "SET_VALUE"
|
|
|
|
|
| "DOWNLOAD_DATA"
|
|
|
|
|
|
|
|
|
|
export interface ActionPayload {
|
|
|
|
|
actionType: ActionType
|
|
|
|
|
contextParams: Record<string, string>
|
2019-02-10 13:06:05 +00:00
|
|
|
}
|
|
|
|
|
|
2019-09-12 11:19:38 +00:00
|
|
|
export interface APIActionPayload extends ActionPayload {
|
|
|
|
|
apiId: string
|
2019-02-10 13:06:05 +00:00
|
|
|
}
|
|
|
|
|
|
2019-09-12 11:19:38 +00:00
|
|
|
export interface QueryActionPayload extends ActionPayload {
|
|
|
|
|
queryId: string
|
2019-03-18 15:10:30 +00:00
|
|
|
}
|
|
|
|
|
|
2019-09-12 11:19:38 +00:00
|
|
|
export type NavigationType = "NEW_TAB" | "INLINE"
|
|
|
|
|
|
|
|
|
|
export interface NavigateActionPayload extends ActionPayload {
|
|
|
|
|
pageUrl: string
|
|
|
|
|
navigationType: NavigationType
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface ShowAlertActionPayload extends ActionPayload {
|
|
|
|
|
header: string
|
|
|
|
|
message: string
|
|
|
|
|
alertType: AlertType
|
|
|
|
|
intent: MessageIntent
|
2019-09-12 08:11:25 +00:00
|
|
|
}
|
|
|
|
|
|
2019-09-12 11:19:38 +00:00
|
|
|
export interface SetValueActionPayload extends ActionPayload {
|
|
|
|
|
header: string
|
|
|
|
|
message: string
|
|
|
|
|
alertType: AlertType
|
|
|
|
|
intent: MessageIntent
|
2019-03-21 17:42:23 +00:00
|
|
|
}
|
2019-08-20 13:19:19 +00:00
|
|
|
|
2019-09-12 11:19:38 +00:00
|
|
|
export interface ExecuteJSActionPayload extends ActionPayload {
|
|
|
|
|
jsFunctionId: string
|
2019-08-21 12:49:16 +00:00
|
|
|
}
|
2019-09-12 11:19:38 +00:00
|
|
|
|
|
|
|
|
export type DownloadFiletype = "CSV" | "XLS" | "JSON" | "TXT"
|
|
|
|
|
|
|
|
|
|
export interface DownloadDataActionPayload extends ActionPayload {
|
|
|
|
|
data: JSON
|
|
|
|
|
fileName: string
|
|
|
|
|
fileType: DownloadFiletype
|
|
|
|
|
}
|