@iterable/react-native-sdk
Version:
Iterable SDK for React Native.
47 lines (42 loc) • 1.34 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.IterableAction = void 0;
/**
* IterableAction represents an action defined as a response to user events.
*
* It is currently used in push notification actions (open push & action buttons).
*/
class IterableAction {
/** The type of iterable action. */
/**
* Determines the action. EG: "open_url", "open_in_app", "deep_link", "join" etc.
*/
/**
* Additional info related to the action.
*/
/**
* Creates an instance of IterableAction.
*
* @param type - The type of the action.
* @param data - Optional data associated with the action.
* @param userInput - Optional user input related to the action.
*/
constructor(type, data, userInput) {
this.type = type;
this.data = data;
this.userInput = userInput;
}
/**
* Creates an instance of `IterableAction` from a dictionary object.
*
* @param dict - The dictionary object containing the properties to initialize the `IterableAction` instance.
* @returns A new instance of `IterableAction` initialized with the provided dictionary properties.
*/
static fromDict(dict) {
return new IterableAction(dict.type, dict.data, dict.userInput);
}
}
exports.IterableAction = IterableAction;
//# sourceMappingURL=IterableAction.js.map