@enable-tech/shared-types
Version:
This package represents the single source of truth of the Types being used in the codebase (front-end and back-end) of enable.tech, It is an organization-scoped package. So, all the development teams belonging to it can participate to enhance it.
74 lines • 2.72 kB
TypeScript
import { ReactNode } from 'react';
import { E_AppNavigation, E_SettingsAndUpdatesDecisions } from '../enums';
import { I_Discount, T_LabelledDiscount } from 'src/modules/loyaltyProgram/common/backend/responses/schemas';
import { I_CustomerEarnedBenefit } from 'src/modules/benefit/backend/responses/schemas';
export type T_ProviderProps = {
children: ReactNode;
};
export type T_FalsyValue<T> = T | null | undefined;
export type T_FalsyObject<T> = {
[K in keyof T]: T[K] | null | undefined;
};
export type T_Months = 'January' | 'February' | 'March' | 'April' | 'May' | 'June' | 'July' | 'August' | 'September' | 'October' | 'November' | 'December';
export type T_RootParamList = {
[E_AppNavigation.LOGIN]: undefined;
[E_AppNavigation.LANDING_PAGE]: undefined;
[E_AppNavigation.SCAN_QR_CODE]: undefined;
[E_AppNavigation.WRONG_QR_CODE]: undefined;
[E_AppNavigation.CUSTOMER_PROFILE]: undefined;
[E_AppNavigation.LOYALTY_ORDER_CAPTURING]: undefined;
[E_AppNavigation.SUCCESS_PAGE]: undefined;
[E_AppNavigation.SETTINGS_AND_UPDATES_DECISIONS]: undefined;
[E_AppNavigation.SETTINGS_AND_UPDATES_DECISIONS_CAMERA]: undefined;
[E_AppNavigation.SETTINGS_AND_UPDATES_DECISIONS_FORCE_UPDATE]: undefined;
[E_AppNavigation.SETTINGS_AND_UPDATES_DECISIONS_NETWORK_ERROR]: {
previousRoute: string;
};
};
export type T_AppNavigationProps = {
initialRoute: keyof T_RootParamList;
};
export type M_T_ImageSource = number | {
uri: string;
} | {
uri: string;
width: number;
height: number;
} | {
uri: string;
headers?: {
[key: string]: string;
};
} | {
uri: string;
cache?: 'default' | 'reload' | 'force-cache' | 'only-if-cached';
} | Array<M_T_ImageSource>;
export type T_SettingsAndUpdatesDecisionsProps = {
iconSrc: M_T_ImageSource;
textColor?: string;
backgroundColor?: string;
mainText: string;
subText: string;
buttonTitle: string;
isCloseButtonHidden?: boolean;
origin: E_SettingsAndUpdatesDecisions;
secondaryButtonTitle?: string;
onSecondaryButtonPress?: () => void;
};
export type T_QueryStatus = 'idle' | 'loading' | 'error' | 'success';
export interface I_CalculateDiscountRowParams {
invoicedAmount: number;
deliveryAmount: number;
discount: T_FalsyValue<I_Discount>;
}
export interface I_CommonInvoiceLabelProps {
invoicedAmount: number;
deliveryAmount: number;
}
export interface I_BenefitLabelProps extends I_CommonInvoiceLabelProps {
benefits: T_FalsyValue<I_CustomerEarnedBenefit[]>;
}
export interface I_DiscountLabelProps extends I_CommonInvoiceLabelProps {
discounts: T_FalsyValue<T_LabelledDiscount[]>;
}
//# sourceMappingURL=index.d.ts.map