Files
super-app/App/common/interface/index.ts
Kshitij Pramod Ghongadi f95cdfe35d NTP-15148 | GI | Self Serve Plan Migration Flow (#14226)
Co-authored-by: Prajjaval Verma <prajjaval.verma@navi.com>
Co-authored-by: Balrambhai Sharma <sharma.balrambhai@navi.com>
2024-12-24 11:00:57 +00:00

74 lines
1.7 KiB
TypeScript

import { ImageName } from "../constants";
import { ScreenData } from "./widgets/screenData/ScreenData";
export type CtaData = {
url: string;
type?: string;
parameters?: Array<LineItem>;
additionalParameters?: Array<LineItem>;
data?: any;
finish?: boolean;
screenKey?: string;
title?: string;
analyticsEventProperties?: AnalyticsEvent;
screenStructure?: ScreenData;
};
export type AnalyticsEvent = {
name: string;
properties?: Record<string, string>;
};
type LineItem = {
key?: string;
value?: string | null;
data?: any | null;
};
export interface BaseNavigator {
navigate(navigationRef: any, ctaData: CtaData): any;
goBack(navigationRef: any, ctaData: CtaData): any;
push(navigationRef: any, ctaData: CtaData): any;
}
export enum NavigationType {
NAVIGATE = "navigate",
GO_BACK = "goBack",
PUSH = "push",
}
export interface CtaParameter {
key: string;
value: string | undefined | null;
}
export interface StaticHeaderProperties {
leftIcon?: keyof typeof ImageName;
rightIcon?: keyof typeof ImageName;
leftIconCta?: CtaData | null;
rightIconCta?: CtaData | null;
}
export enum ParameterType {
PRE_QUOTE_ID = "preQuoteId",
QUOTE_ID = "quoteId",
NAVIGATOR_TYPE = "RnNavigatorType",
PLAN_ID = "planId",
BENEFIT_TYPE = "benefitType",
SOURCE_SCREEN = "sourceScreen",
APPLICATION_ID = "applicationId",
SOURCE = "source",
PREVIOUS_PLAN_ID = "previousPlanId",
PLAN_TYPE = "planType",
}
export enum CtaType {
DEEP_LINK = "DEEP_LINK",
DISMISS_MODAL = "DISMISS_MODAL",
USE_ROOT_DEEPLINK_NAVIGATOR = "USE_ROOT_DEEPLINK_NAVIGATOR",
RN_NAVIGATOR = "RN_NAVIGATOR",
RN_PUSH = "RN_PUSH",
RN_NAVIGATE = "RN_NAVIGATE",
GO_BACK = "GO_BACK",
}