Grabbed dndbeyond's source code
``` ~/go/bin/sourcemapper -output ddb -jsurl https://media.dndbeyond.com/character-app/static/js/main.90aa78c5.js ```
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
export const DATA_SET = "appEnv.DATA_SET";
|
||||
export const MOBILE_SET = "appEnv.MOBILE_SET";
|
||||
export const DIMENSIONS_SET = "appEnv.DIMENSIONS_SET";
|
||||
@@ -0,0 +1,47 @@
|
||||
import { AppEnvDimensionsState } from "../../stores/typings";
|
||||
import * as actionTypes from "./actionTypes";
|
||||
import {
|
||||
DataSetAction,
|
||||
DataSetPayload,
|
||||
DimensionsSetAction,
|
||||
MobileSetAction,
|
||||
} from "./typings";
|
||||
|
||||
/**
|
||||
*
|
||||
* @param payload
|
||||
*/
|
||||
export function dataSet(payload: DataSetPayload): DataSetAction {
|
||||
return {
|
||||
type: actionTypes.DATA_SET,
|
||||
payload,
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param isMobile
|
||||
*/
|
||||
export function mobileSet(isMobile: boolean): MobileSetAction {
|
||||
return {
|
||||
type: actionTypes.MOBILE_SET,
|
||||
payload: {
|
||||
isMobile,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param dimensions
|
||||
*/
|
||||
export function dimensionsSet(
|
||||
dimensions: Omit<AppEnvDimensionsState, "styleSizeType">
|
||||
): DimensionsSetAction {
|
||||
return {
|
||||
type: actionTypes.DIMENSIONS_SET,
|
||||
payload: {
|
||||
dimensions,
|
||||
},
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
import * as actionTypes from "./actionTypes";
|
||||
import * as actions from "./actions";
|
||||
import * as typings from "./typings";
|
||||
|
||||
export const appEnvActionTypes = actionTypes;
|
||||
export const appEnvActions = actions;
|
||||
export const appEnvTypings = typings;
|
||||
@@ -0,0 +1 @@
|
||||
export const ERROR_SET = "appInfo.ERROR_SET";
|
||||
@@ -0,0 +1,21 @@
|
||||
import AppErrorTypeEnum from "../../constants/AppErrorTypeEnum";
|
||||
import * as types from "./actionTypes";
|
||||
import { ErrorSetAction } from "./typings";
|
||||
|
||||
/**
|
||||
*
|
||||
* @param appErrorType
|
||||
* @param errorId
|
||||
*/
|
||||
export function errorSet(
|
||||
appErrorType: AppErrorTypeEnum,
|
||||
errorId: string | null = null
|
||||
): ErrorSetAction {
|
||||
return {
|
||||
type: types.ERROR_SET,
|
||||
payload: {
|
||||
appErrorType: appErrorType,
|
||||
errorId,
|
||||
},
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
import * as actionTypes from "./actionTypes";
|
||||
import * as actions from "./actions";
|
||||
import * as typings from "./typings";
|
||||
|
||||
export const appInfoActionTypes = actionTypes;
|
||||
export const appInfoActions = actions;
|
||||
export const appInfoTypings = typings;
|
||||
@@ -0,0 +1,51 @@
|
||||
export const ROLL_RESULT_GROUPS_LOAD = "rollResult.ROLL_RESULT_GROUPS_LOAD";
|
||||
export const ROLL_RESULT_GROUP_CREATE = "rollResult.ROLL_RESULT_GROUP_CREATE";
|
||||
export const ROLL_RESULT_GROUP_DESTROY = "rollResult.ROLL_RESULT_GROUP_DESTROY";
|
||||
|
||||
export const ROLL_RESULT_COMPONENT_GROUPS_SET =
|
||||
"rollResult.ROLL_RESULT_COMPONENT_GROUPS_SET";
|
||||
export const ROLL_RESULT_COMPONENT_GROUPS_SET_COMMIT =
|
||||
"rollResult.ROLL_RESULT_COMPONENT_GROUPS_SET_COMMIT";
|
||||
|
||||
export const ROLL_RESULT_GROUP_ADD = "rollResult.ROLL_RESULT_GROUP_ADD";
|
||||
export const ROLL_RESULT_GROUP_ADD_COMMIT =
|
||||
"rollResult.ROLL_RESULT_GROUP_ADD_COMMIT";
|
||||
|
||||
export const ROLL_RESULT_GROUP_REMOVE = "rollResult.ROLL_RESULT_GROUP_REMOVE";
|
||||
export const ROLL_RESULT_GROUP_REMOVE_COMMIT =
|
||||
"rollResult.ROLL_RESULT_GROUP_REMOVE_COMMIT";
|
||||
|
||||
export const ROLL_RESULT_GROUP_DICE_ROLLS_SET =
|
||||
"rollResult.ROLL_RESULT_GROUP_DICE_ROLLS_SET";
|
||||
export const ROLL_RESULT_GROUP_DICE_ROLLS_SET_COMMIT =
|
||||
"rollResult.ROLL_RESULT_GROUP_DICE_ROLLS_SET_COMMIT";
|
||||
|
||||
export const ROLL_RESULT_GROUP_ORDER_SET =
|
||||
"rollResult.ROLL_RESULT_GROUP_ORDER_SET";
|
||||
export const ROLL_RESULT_GROUP_ORDER_SET_COMMIT =
|
||||
"rollResult.ROLL_RESULT_GROUP_ORDER_SET_COMMIT";
|
||||
|
||||
export const ROLL_RESULT_GROUP_RESET = "rollResult.ROLL_RESULT_GROUP_RESET";
|
||||
export const ROLL_RESULT_GROUP_RESET_COMMIT =
|
||||
"rollResult.ROLL_RESULT_GROUP_RESET_COMMIT";
|
||||
|
||||
export const ROLL_RESULT_DICE_ROLL_SET = "rollResult.ROLL_RESULT_DICE_ROLL_SET";
|
||||
export const ROLL_RESULT_DICE_ROLL_SET_COMMIT =
|
||||
"rollResult.ROLL_RESULT_DICE_ROLL_SET_COMMIT";
|
||||
|
||||
export const ROLL_RESULT_DICE_ROLL_STATUS_SET =
|
||||
"rollResult.ROLL_RESULT_DICE_ROLL_STATUS_SET";
|
||||
|
||||
export const ROLL_RESULT_COMPONENT_GROUP_PERSIST =
|
||||
"rollResult.ROLL_RESULT_COMPONENT_GROUP_PERSIST";
|
||||
export const ROLL_RESULT_COMPONENT_PERSIST =
|
||||
"rollResult.ROLL_RESULT_COMPONENT_PERSIST";
|
||||
|
||||
export const ROLL_RESULT_COMPONENT_SIMULATED_GROUPS_SET =
|
||||
"rollResult.ROLL_RESULT_COMPONENT_SIMULATED_GROUPS_SET";
|
||||
export const ROLL_RESULT_COMPONENT_SIMULATED_GROUPS_REMOVE =
|
||||
"rollResult.ROLL_RESULT_COMPONENT_SIMULATED_GROUPS_REMOVE";
|
||||
export const ROLL_RESULT_COMPONENT_SIMULATED_GROUPS_PERSIST =
|
||||
"rollResult.ROLL_RESULT_COMPONENT_SIMULATED_GROUPS_PERSIST";
|
||||
export const ROLL_RESULT_COMPONENT_SIMULATED_DICE_ROLL_SET =
|
||||
"rollResult.ROLL_RESULT_COMPONENT_SIMULATED_DICE_ROLL_SET";
|
||||
@@ -0,0 +1,488 @@
|
||||
import {
|
||||
RollGroupContract,
|
||||
RollResultContract,
|
||||
} from "@dndbeyond/character-rules-engine/es";
|
||||
|
||||
import * as types from "./actionTypes";
|
||||
import {
|
||||
RollResultGroupAddAction,
|
||||
RollResultGroupsLoadAction,
|
||||
RollResultGroupRemoveAction,
|
||||
RollResultGroupDiceRollsSetAction,
|
||||
RollResultComponentGroupsSetAction,
|
||||
RollResultGroupOrderSetAction,
|
||||
RollResultGroupCreateAction,
|
||||
RollResultGroupDestroyAction,
|
||||
RollResultComponentGroupsSetCommitAction,
|
||||
RollResultGroupAddCommitAction,
|
||||
RollResultGroupRemoveCommitAction,
|
||||
RollResultGroupDiceRollsSetCommitAction,
|
||||
RollResultGroupOrderSetCommitAction,
|
||||
RollResultGroupResetAction,
|
||||
RollResultGroupResetCommitAction,
|
||||
RollResultDiceRollSetAction,
|
||||
RollResultDiceRollSetCommitAction,
|
||||
RollResultDiceRollStatusSetAction,
|
||||
RollResultComponentSimulatedGroupsSetAction,
|
||||
RollResultComponentSimulatedGroupsPersistAction,
|
||||
RollResultComponentSimulatedDiceRollSetAction,
|
||||
RollResultComponentGroupPersistAction,
|
||||
RollResultComponentPersistAction,
|
||||
} from "./typings";
|
||||
|
||||
/**
|
||||
*
|
||||
* @param componentKey
|
||||
* @param simulatedGroupCount
|
||||
* @param simulatedRollResultCount
|
||||
*/
|
||||
export function rollResultGroupsLoad(
|
||||
componentKey: string,
|
||||
simulatedGroupCount: number | null,
|
||||
simulatedRollResultCount?: number
|
||||
): RollResultGroupsLoadAction {
|
||||
return {
|
||||
type: types.ROLL_RESULT_GROUPS_LOAD,
|
||||
payload: {
|
||||
componentKey,
|
||||
simulatedGroupCount,
|
||||
simulatedRollResultCount,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param componentKey
|
||||
* @param simulatedRollResultCount
|
||||
*/
|
||||
export function rollResultGroupCreate(
|
||||
componentKey: string,
|
||||
simulatedRollResultCount?: number
|
||||
): RollResultGroupCreateAction {
|
||||
return {
|
||||
type: types.ROLL_RESULT_GROUP_CREATE,
|
||||
payload: {
|
||||
componentKey,
|
||||
simulatedRollResultCount,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param componentKey
|
||||
* @param groupKey
|
||||
* @param nextGroupKey
|
||||
*/
|
||||
export function rollResultGroupDestroy(
|
||||
componentKey: string,
|
||||
groupKey: string,
|
||||
nextGroupKey: string | null
|
||||
): RollResultGroupDestroyAction {
|
||||
return {
|
||||
type: types.ROLL_RESULT_GROUP_DESTROY,
|
||||
payload: {
|
||||
componentKey,
|
||||
groupKey,
|
||||
nextGroupKey,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param componentKey
|
||||
* @param groups
|
||||
*/
|
||||
export function rollResultComponentGroupsSet(
|
||||
componentKey: string,
|
||||
groups: Array<RollGroupContract>
|
||||
): RollResultComponentGroupsSetAction {
|
||||
return {
|
||||
type: types.ROLL_RESULT_COMPONENT_GROUPS_SET,
|
||||
payload: {
|
||||
componentKey,
|
||||
groups,
|
||||
},
|
||||
};
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param componentKey
|
||||
* @param groups
|
||||
*/
|
||||
export function rollResultComponentGroupsSetCommit(
|
||||
componentKey: string,
|
||||
groups: Array<RollGroupContract>
|
||||
): RollResultComponentGroupsSetCommitAction {
|
||||
return {
|
||||
type: types.ROLL_RESULT_COMPONENT_GROUPS_SET_COMMIT,
|
||||
payload: {
|
||||
componentKey,
|
||||
groups,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param group
|
||||
*/
|
||||
export function rollResultGroupAdd(
|
||||
group: RollGroupContract
|
||||
): RollResultGroupAddAction {
|
||||
return {
|
||||
type: types.ROLL_RESULT_GROUP_ADD,
|
||||
payload: {
|
||||
group,
|
||||
componentKey: group.componentKey,
|
||||
},
|
||||
};
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param group
|
||||
*/
|
||||
export function rollResultGroupAddCommit(
|
||||
group: RollGroupContract
|
||||
): RollResultGroupAddCommitAction {
|
||||
return {
|
||||
type: types.ROLL_RESULT_GROUP_ADD_COMMIT,
|
||||
payload: {
|
||||
group,
|
||||
componentKey: group.componentKey,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param componentKey
|
||||
* @param groupKey
|
||||
*/
|
||||
export function rollResultGroupRemove(
|
||||
componentKey: string,
|
||||
groupKey: string
|
||||
): RollResultGroupRemoveAction {
|
||||
return {
|
||||
type: types.ROLL_RESULT_GROUP_REMOVE,
|
||||
payload: {
|
||||
componentKey,
|
||||
groupKey,
|
||||
},
|
||||
};
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param componentKey
|
||||
* @param groupKey
|
||||
*/
|
||||
export function rollResultGroupRemoveCommit(
|
||||
componentKey: string,
|
||||
groupKey: string
|
||||
): RollResultGroupRemoveCommitAction {
|
||||
return {
|
||||
type: types.ROLL_RESULT_GROUP_REMOVE_COMMIT,
|
||||
payload: {
|
||||
componentKey,
|
||||
groupKey,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param componentKey
|
||||
* @param groupKey
|
||||
* @param rollResults
|
||||
*/
|
||||
export function rollResultGroupDiceRollsSet(
|
||||
componentKey: string,
|
||||
groupKey: string,
|
||||
rollResults: Array<RollResultContract>
|
||||
): RollResultGroupDiceRollsSetAction {
|
||||
return {
|
||||
type: types.ROLL_RESULT_GROUP_DICE_ROLLS_SET,
|
||||
payload: {
|
||||
componentKey,
|
||||
groupKey,
|
||||
rollResults,
|
||||
},
|
||||
};
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param componentKey
|
||||
* @param groupKey
|
||||
* @param rollResults
|
||||
*/
|
||||
export function rollResultGroupDiceRollsSetCommit(
|
||||
componentKey: string,
|
||||
groupKey: string,
|
||||
rollResults: Array<RollResultContract>
|
||||
): RollResultGroupDiceRollsSetCommitAction {
|
||||
return {
|
||||
type: types.ROLL_RESULT_GROUP_DICE_ROLLS_SET_COMMIT,
|
||||
payload: {
|
||||
componentKey,
|
||||
groupKey,
|
||||
rollResults,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param componentKey
|
||||
* @param groupKey
|
||||
* @param nextGroupKey
|
||||
*/
|
||||
export function rollResultGroupOrderSet(
|
||||
componentKey: string,
|
||||
groupKey: string,
|
||||
nextGroupKey: string | null
|
||||
): RollResultGroupOrderSetAction {
|
||||
return {
|
||||
type: types.ROLL_RESULT_GROUP_ORDER_SET,
|
||||
payload: {
|
||||
componentKey,
|
||||
groupKey,
|
||||
nextGroupKey,
|
||||
},
|
||||
};
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param componentKey
|
||||
* @param groupKey
|
||||
* @param nextGroupKey
|
||||
*/
|
||||
export function rollResultGroupOrderSetCommit(
|
||||
componentKey: string,
|
||||
groupKey: string,
|
||||
nextGroupKey: string | null
|
||||
): RollResultGroupOrderSetCommitAction {
|
||||
return {
|
||||
type: types.ROLL_RESULT_GROUP_ORDER_SET_COMMIT,
|
||||
payload: {
|
||||
componentKey,
|
||||
groupKey,
|
||||
nextGroupKey,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param componentKey
|
||||
* @param groupKey
|
||||
*/
|
||||
export function rollResultGroupReset(
|
||||
componentKey: string,
|
||||
groupKey: string,
|
||||
rollResults: Array<RollResultContract>
|
||||
): RollResultGroupResetAction {
|
||||
return {
|
||||
type: types.ROLL_RESULT_GROUP_RESET,
|
||||
payload: {
|
||||
componentKey,
|
||||
groupKey,
|
||||
rollResults,
|
||||
},
|
||||
};
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param componentKey
|
||||
* @param groupKey
|
||||
*/
|
||||
export function rollResultGroupResetCommit(
|
||||
componentKey: string,
|
||||
groupKey: string,
|
||||
rollResults: Array<RollResultContract>
|
||||
): RollResultGroupResetCommitAction {
|
||||
return {
|
||||
type: types.ROLL_RESULT_GROUP_RESET_COMMIT,
|
||||
payload: {
|
||||
componentKey,
|
||||
groupKey,
|
||||
rollResults,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param rollKey
|
||||
* @param properties
|
||||
* @param nextRollKey
|
||||
*/
|
||||
export function rollResultDiceRollSet(
|
||||
rollKey: string,
|
||||
properties: Omit<Partial<RollResultContract>, "rollKey">,
|
||||
nextRollKey: string | null
|
||||
): RollResultDiceRollSetAction {
|
||||
return {
|
||||
type: types.ROLL_RESULT_DICE_ROLL_SET,
|
||||
payload: {
|
||||
rollKey,
|
||||
properties,
|
||||
nextRollKey,
|
||||
},
|
||||
};
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param componentKey
|
||||
* @param groupKey
|
||||
* @param rollKey
|
||||
* @param properties
|
||||
*/
|
||||
export function rollResultDiceRollSetCommit(
|
||||
componentKey: string,
|
||||
groupKey: string,
|
||||
rollKey: string,
|
||||
properties: Omit<Partial<RollResultContract>, "rollKey">,
|
||||
nextRollKey: string | null
|
||||
): RollResultDiceRollSetCommitAction {
|
||||
return {
|
||||
type: types.ROLL_RESULT_DICE_ROLL_SET_COMMIT,
|
||||
payload: {
|
||||
componentKey,
|
||||
groupKey,
|
||||
rollKey,
|
||||
properties,
|
||||
nextRollKey,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param rollKey
|
||||
* @param loadingStatus
|
||||
*/
|
||||
export function rollResultDiceRollStatusSet(
|
||||
rollKey,
|
||||
loadingStatus
|
||||
): RollResultDiceRollStatusSetAction {
|
||||
return {
|
||||
type: types.ROLL_RESULT_DICE_ROLL_STATUS_SET,
|
||||
payload: {
|
||||
rollKey,
|
||||
loadingStatus,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param componentKey
|
||||
* @param groupKey
|
||||
* @param rollResults
|
||||
*/
|
||||
export function rollResultComponentGroupPersist(
|
||||
componentKey: string,
|
||||
groupKey: string,
|
||||
rollResults: Array<RollResultContract>
|
||||
): RollResultComponentGroupPersistAction {
|
||||
return {
|
||||
type: types.ROLL_RESULT_COMPONENT_GROUP_PERSIST,
|
||||
payload: {
|
||||
componentKey,
|
||||
groupKey,
|
||||
rollResults,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param componentKey
|
||||
* @param groupKey
|
||||
* @param rollKey
|
||||
* @param properties
|
||||
* @param nextRollKey
|
||||
*/
|
||||
export function rollResultComponentPersist(
|
||||
componentKey: string,
|
||||
groupKey: string,
|
||||
rollKey: string,
|
||||
properties: Partial<RollResultContract>,
|
||||
nextRollKey: string | null
|
||||
): RollResultComponentPersistAction {
|
||||
return {
|
||||
type: types.ROLL_RESULT_COMPONENT_PERSIST,
|
||||
payload: {
|
||||
componentKey,
|
||||
groupKey,
|
||||
rollKey,
|
||||
properties,
|
||||
nextRollKey,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param componentKey
|
||||
* @param groups
|
||||
*/
|
||||
export function rollResultComponentSimulatedGroupsSet(
|
||||
componentKey: string,
|
||||
groups: Array<RollGroupContract>
|
||||
): RollResultComponentSimulatedGroupsSetAction {
|
||||
return {
|
||||
type: types.ROLL_RESULT_COMPONENT_SIMULATED_GROUPS_SET,
|
||||
payload: {
|
||||
componentKey,
|
||||
groups,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param componentKey
|
||||
*/
|
||||
export function rollResultComponentSimulatedGroupsPersist(
|
||||
componentKey: string,
|
||||
groupKey?: string,
|
||||
rollKey?: string,
|
||||
properties?: Partial<RollResultContract>
|
||||
): RollResultComponentSimulatedGroupsPersistAction {
|
||||
return {
|
||||
type: types.ROLL_RESULT_COMPONENT_SIMULATED_GROUPS_PERSIST,
|
||||
payload: {
|
||||
componentKey,
|
||||
groupKey,
|
||||
rollKey,
|
||||
properties,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param componentKey
|
||||
* @param groupKey
|
||||
* @param rollKey
|
||||
* @param properties
|
||||
*/
|
||||
export function rollResultComponentSimulatedDiceRollSet(
|
||||
componentKey: string,
|
||||
groupKey: string,
|
||||
rollKey: string,
|
||||
properties: Omit<Partial<RollResultContract>, "rollKey">
|
||||
): RollResultComponentSimulatedDiceRollSetAction {
|
||||
return {
|
||||
type: types.ROLL_RESULT_COMPONENT_SIMULATED_DICE_ROLL_SET,
|
||||
payload: {
|
||||
componentKey,
|
||||
groupKey,
|
||||
rollKey,
|
||||
properties,
|
||||
},
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
import * as actionTypes from "./actionTypes";
|
||||
import * as actions from "./actions";
|
||||
import * as typings from "./typings";
|
||||
|
||||
export const rollResultActionTypes = actionTypes;
|
||||
export const rollResultActions = actions;
|
||||
export const rollResultTypings = typings;
|
||||
@@ -0,0 +1,3 @@
|
||||
export const ADD_MESSAGE = "toastMessages.ADD_MESSAGE";
|
||||
export const REMOVE_MESSAGE = "toastMessages.REMOVE_MESSAGE";
|
||||
export const CLEAR_MESSAGES = "toastMessages.CLEAR_MESSAGES";
|
||||
@@ -0,0 +1,72 @@
|
||||
import { ToastMessageMeta } from "../../stores/typings";
|
||||
import * as actionTypes from "./actionTypes";
|
||||
import {
|
||||
ToastErrorAction,
|
||||
ToastRemoveAction,
|
||||
ToastSuccessAction,
|
||||
} from "./typings";
|
||||
|
||||
/**
|
||||
*
|
||||
* @param title
|
||||
* @param message
|
||||
* @param meta
|
||||
*/
|
||||
export function toastSuccess(
|
||||
title: string,
|
||||
message: string,
|
||||
meta?: ToastMessageMeta
|
||||
): ToastSuccessAction {
|
||||
return {
|
||||
type: actionTypes.ADD_MESSAGE,
|
||||
payload: {
|
||||
toast: {
|
||||
title,
|
||||
message,
|
||||
},
|
||||
meta: {
|
||||
level: "success",
|
||||
...meta,
|
||||
},
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param title
|
||||
* @param message
|
||||
* @param meta
|
||||
*/
|
||||
export function toastError(
|
||||
title: string,
|
||||
message: string,
|
||||
meta?: ToastMessageMeta
|
||||
): ToastErrorAction {
|
||||
return {
|
||||
type: actionTypes.ADD_MESSAGE,
|
||||
payload: {
|
||||
toast: {
|
||||
title,
|
||||
message,
|
||||
},
|
||||
meta: {
|
||||
level: "error",
|
||||
...meta,
|
||||
},
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param id
|
||||
*/
|
||||
export function removeToast(id: number | string): ToastRemoveAction {
|
||||
return {
|
||||
type: actionTypes.REMOVE_MESSAGE,
|
||||
payload: {
|
||||
id,
|
||||
},
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
import * as actionTypes from "./actionTypes";
|
||||
import * as actions from "./actions";
|
||||
import * as typings from "./typings";
|
||||
|
||||
export const toastMessageTypes = actionTypes;
|
||||
export const toastMessageActions = actions;
|
||||
export const toastMessageTypings = typings;
|
||||
Reference in New Issue
Block a user