PromucFlow_constructor/app/client/src/constants/ActionConstants.tsx

68 lines
1.4 KiB
TypeScript
Raw Normal View History

import { AlertType, MessageIntent } from "../widgets/AlertWidget";
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"
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>
}
export interface APIActionPayload extends ActionPayload {
apiId: string
}
export interface QueryActionPayload extends ActionPayload {
queryId: string
}
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
}
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
export interface ExecuteJSActionPayload extends ActionPayload {
jsFunctionId: string
2019-08-21 12:49:16 +00:00
}
export type DownloadFiletype = "CSV" | "XLS" | "JSON" | "TXT"
export interface DownloadDataActionPayload extends ActionPayload {
data: JSON
fileName: string
fileType: DownloadFiletype
}