SyncCompleteData
/**
* Data on API sync complete.
*/
class SyncCompleteData {
/**
* Indicating if there were any updates in the cards post sync. true if there are any new
* updates present else false. This value is true even if card(s) are deleted.
*/
hasUpdates: boolean;
/**
* Condition under which sync was triggered. Refer to {@link SyncType}
*/
syncType: SyncType;
}
CardInfo
/**
* All data for cards.
*/
class CardInfo {
/**
* True if showing ALL tabs is enabled else false.
*/
shouldShowAllTab: boolean;
/**
* All configured categories for cards.
*/
categories: Array<string>;
/**
* All cards which are eligible for display currently.
*/
cards: Array<Card>;
}
Card
/**
* Card data
*/
class Card {
/**
* Internal SDK identifier.
*/
id: number;
/**
* Unique identifier for the campaign
*/
cardId: string;
/**
* Category to which the campaign belongs.
*/
category: string;
/**
* Template payload for the campaign.
*/
template: Template;
/**
* Meta data related to the campaign like status, delivery control etc.
*/
metaData: MetaData;
}
Template
/**
* Card Template data
*/
class Template {
/**
* Type of Template.
*/
templateType: TemplateType;
/**
* Containers in the template.
*/
containers: Array<Container>;
/**
* Additional data associated to the template
*/
kvPairs: { [k: string]: any };
}
TemplateType
/**
* Supported template types.
*/
enum TemplateType {
/**
* Basic Template
*/
BASIC,
/**
* Illustration Template
*/
ILLUSTRATION
}
Container
/**
* Container to hold UI widget
*/
class Container {
/**
* Unique identifier for a template
*/
id: number;
/**
* Type of container.
*/
templateType: TemplateType;
/**
* Style associated to the Container
*/
style: ContainerStyle | undefined;
/**
* Widget list associated to the Container
*/
widgets: Array<Widget>;
/**
* Actions to be performed on widget click
*/
actionList: Array<Action>;
}
Widget
/**
* UI element in a card.
*/
class Widget {
/**
* Identifier for the widget.
*/
id: number;
/**
* Type of widget
*/
widgetType: WidgetType;
/**
* Content to be loaded in the widget.
*/
content: string;
/**
* Style associated with the widget
*/
style: WidgetStyle | undefined;
/**
* Actions to be performed on widget click
*/
actionList: Array<Action>;
}
WidgetType
/**
* Types of UI widgets supported.
*/
enum WidgetType {
/**
* Widget that loads an image or gif
*/
IMAGE,
/**
* Widget that loads text content.
*/
TEXT,
/**
* Widget that loads button content.
*/
BUTTON
}
MetaData
/**
* Meta data related to a campaign.
*/
class MetaData {
/**
* True if the campaign should be pinned to the top else false.
*/
isPinned: boolean;
/**
* True if the campaign hasn't been delivered to the inbox, else false.
*/
isNewCard: boolean;
/**
* Current state of the campaign.
*/
campaignState: CampaignState;
/**
* Time at which the campaign would be deleted from local store
*/
deletionTime: number;
/**
* Delivery Controls defined during campaign creation.
*/
displayControl: DisplayControl;
/**
* Additional meta data regarding campaign used for tracking purposes.
*/
metaData: { [k: string]: any };
/**
* Creation time for the campaign.
* Notes: Available in iOS, default value is -1
*/
createdAt: number;
/**
* Last time the campaign was updated.
*/
updatedTime: number;
/**
* Complete Campaign payload.
*/
campaignPayload: { [k: string]: any };
}
CardsData
/**
* Data for cards
*/
class CardsData {
/**
* Category for the cards
*/
category: string;
/**
* [List] of [Card]
*/
cards: Array<Card>;
}
SyncType
/**
* Condition/Situation when sync
*/
enum SyncType {
/**
* Sync when application comes to foreground
*/
APP_OPEN,
/**
* Sync when inbox screen opened.
*/
INBOX_OPEN,
/**
* Sync when SwipeToRefresh widget is pulled.
*/
PULL_TO_REFRESH
/**
* Sync when user logs in
* @since 5.0.0
*/
IMMEDIATE
}