@namiml/web-sdk
Version:
Nami Web SDK makes subscriptions & in-app purchases easy, with powerful built-in paywalls and A/B testing
99 lines (98 loc) • 2.98 kB
TypeScript
import { AlignmentType, BorderLocationType, TBaseComponent, TComponent, TTestObject } from ".";
export type TImageComponent = TBaseComponent & {
component: "image";
url?: string | null;
aspectRatio?: number;
imageCropping?: "fill" | "fit";
alt?: string | null;
blur?: string | null;
};
export type TSegmentPicker = TBaseComponent & {
component: "segmentPicker";
components: TSegmentPickerItem[];
};
export type TSegmentPickerItem = TBaseComponent & {
component: "segmentPickerItem";
ref?: any;
text?: string;
alignment?: AlignmentType;
activeFillColor?: string;
activeBorderColor?: string;
activeBorderRadius?: number;
activeBorderWidth?: number;
activeRoundBorders?: Array<BorderLocationType>;
activeFontSize?: number;
activeFontColor?: string;
activeFontName?: string;
inactiveBorderRadius?: number;
inactiveBorderColor?: string;
inactiveBorderWidth?: number;
inactiveRoundBorders?: Array<BorderLocationType>;
inactiveFontSize?: number;
inactiveFontName?: string;
inactiveFontColor?: string;
leftPadding?: number;
rightPadding?: number;
topPadding?: number;
bottomPadding?: number;
};
export type TSpacerComponent = TBaseComponent & {
component: "spacer";
};
export type TSvgImageComponent = TBaseComponent & {
component: "svgImage";
url?: string | null;
fontColor?: string;
};
export type TSymbolComponent = Omit<TTextComponent, "component" | "textType" | "text"> & {
component: "symbol";
name: string;
};
export type TTextComponent = TBaseComponent & {
component: "text";
textType: "title" | "body" | "legal" | "text";
androidFontSize?: number;
fontSize?: number;
fontColor?: string;
fontName?: string;
text: string;
strikethrough?: boolean | string;
linkColor?: string;
dateTimeFormat?: string;
blur?: number | null;
capitalize?: boolean;
};
export type TTextLikeComponent = TTextComponent | TTextListComponent | TSymbolComponent;
export type TTextListComponent = Omit<TTextComponent, "component" | "text"> & {
component: "text-list";
texts: string[];
bulletComponent?: TSymbolComponent;
};
export type TVideoComponent = TBaseComponent & {
component: "videoUrl";
url?: string | null;
aspectRatio?: number;
imageCropping?: "fill" | "fit";
autoplayVideo?: boolean;
controlsType?: string;
fallbackImage?: string | null;
loopVideo?: boolean;
mute?: boolean;
screenreaderText?: string;
};
export type TConditionalComponent = TBaseComponent & {
component: "condition";
components?: TComponent[];
assertions?: TTestObject[];
orAssertions?: TTestObject[] | undefined;
};
export type TQRCodeComponent = TBaseComponent & {
component: "qrCode";
url: string;
height: number | string;
width: number | string;
color?: string;
fillColor?: string;
borderWidth?: number;
borderColor?: string;
};