Files
super-app/App/common/interface/widgets/widgetData/TitleWidgetData.ts
2025-02-12 16:08:48 +00:00

69 lines
1.6 KiB
TypeScript

import { ImageStyle, StyleProp, TextStyle, ViewStyle } from "react-native";
import { CtaData } from "../..";
import { GenericActionPayload } from "../../../actions/GenericAction";
import { GenericWidgetData } from "../Widget";
export interface TitleWidgetData extends GenericWidgetData {
title?: TextFieldData;
subtitle?: TextFieldData;
rightTitle?: TextFieldData;
cta?: CtaData;
actions?: GenericActionPayload;
}
export interface TextFieldData {
id?: string;
text: string;
ellipsizeMode?: "head" | "middle" | "tail" | "clip";
numberOfLines?: number;
textStyle?: TextStyle;
substringStyles?: SubstringStyle[];
textDrawableData?: TextDrawableData;
cta?: CtaData;
actions?: GenericActionPayload;
viewStyle?: ViewStyle;
}
export interface SubstringStyle {
substring: string;
textStyle?: TextStyle;
}
export interface TextDrawableData {
left?: ImageFieldData;
right?: ImageFieldData;
top?: ImageFieldData;
bottom?: ImageFieldData;
leftLottie?: LottieFieldData;
rightLottie?: LottieFieldData;
topLottie?: LottieFieldData;
bottomLottie?: LottieFieldData;
}
export interface ImageFieldData {
url: string;
imageStyle?: ImageStyle;
cta?: CtaData;
actions?: GenericActionPayload;
}
export interface LottieFieldData {
url: string;
loop?: boolean;
autoPlay?: boolean;
lottieStyle?: ImageStyle;
cta?: CtaData;
delayAnimationBy?: number;
actions?: GenericActionPayload;
}
export type LottieViewProps = {
style?: StyleProp<ViewStyle>;
animationName?: string;
url: string;
lottieStyle?: StyleProp<ViewStyle>;
autoPlay?: boolean;
loop?: boolean;
delayAnimation: number;
};