UNPKG

@hhgtech/hhg-components

Version:
86 lines (85 loc) 3.47 kB
/// <reference types="react" /> import { UserRole } from "../../interfaces/types"; import { basePath, CARE_BASE_PATH, COMMUNITY_BASE_PATH, HEALTH_TOOLs_BASE_PATH, SSO_USER_BASE_PATH } from "./constants"; export type LocaleType = 'vi-VN' | 'id-ID' | 'ms-MY' | 'km-KH' | 'en-PH' | 'th-TH' | 'my-MM' | 'zh-TW' | 'hi-IN'; export type PushNotificationPayloadType = { message: string; type: 'success' | 'danger' | 'info' | 'warning'; title?: string; }; export type LogoType = 'hellobacsi' | 'hellosehat' | 'hellohealth' | 'hellotogether' | 'hellocare' | 'logomark' | 'hellodoctor' | 'hellokrupet' | 'hellswasthya' | 'hellokhunmor' | 'hellodoktor'; export type CategoriesLayout = 'short' | 'long'; export type CountryInitial = 'VN' | 'ID' | 'TH' | 'KH' | 'MY' | 'MM' | 'PH' | 'IN' | 'TW'; export type Flag = { country: CountryInitial; link: string; }; export type Role = UserRole | ('branch' | 'facility' | 'doctor'); export type UserInfo = { name?: string; phone?: string; username?: string; avatar?: string; email?: string; role?: Role; phone_verified_at?: string; birthday?: string; gender?: number; id?: number; bookmarks?: Array<string | number>; coralToken?: { token?: string; isTemp?: boolean; }; total_bookmark?: number; first_time_bookmark?: boolean; phone_verified?: boolean; provider?: string; verify_phone_code?: string; city_id?: string; type_of_pass?: string; is_new?: 0 | 1; communities_interacted?: 0 | 1; }; export declare enum GenderLabel { MALE = "gender.male", FEMALE = "gender.female", OTHER = "gender.other" } export type DesktopMenuPopup = 'categories' | 'tools' | 'care' | 'communities' | 'profile' | 'none'; export type MobileMenuPopup = 'categories' | 'profile' | 'none'; export type HealthTool = { title: string; subtitle: string; icon: string; link: string; }; export type UrlSourceType = 'first_login' | 'welcome_back' | 'comment' | 'care_phone' | 'care_onboarding' | 'new_admin' | 'ecom'; export type UrlPostActionType = 'call' | 'redirect'; export type UrlQueryType = 'source' | 'post_action' | 'params'; export type Coordinate = { lat: number; lng: number; }; /** * default props types */ export type ElementDataProps = 'data-event-action' | 'data-event-label'; export type ExtendingDataProps<K> = { [key in K extends string ? K | ElementDataProps : ElementDataProps]?: string | number | boolean | ((e: React.MouseEvent<HTMLDivElement, MouseEvent>) => void) | React.CSSProperties; } & { style?: React.CSSProperties; }; /** * localised slugs */ export type LocalisedSlugsType = 'PRODUCT' | 'CATEGORY' | 'BRAND' | 'SEARCH' | 'BRANDS' | 'PROFILE' | 'PROFILE_MANAGE_ORDERS' | 'PROFILE_MANAGE_ADDRESS' | 'PROFILE_VOUCHER' | 'PROFILE_MEMBER_CARD' | 'CART' | 'CART_CHECKOUT' | 'PROMOTION' | 'PROMOTION_DETAIL' | 'ORDER_CONFIRMATION'; /** * base path type */ export type BasePathType = typeof basePath | typeof SSO_USER_BASE_PATH | typeof CARE_BASE_PATH | typeof COMMUNITY_BASE_PATH | typeof HEALTH_TOOLs_BASE_PATH; export type SortType = 'price' | 'updated_at'; export type SortOrder = 'asc' | 'desc'; export type OrderStatus = 'pending' | 'processing' | 'delivering' | 'complete' | 'canceled'; export declare const DATE_FORMAT_API = "yyyy-MM-dd"; export declare const DATE_FORMAT = "dd-MM-yyyy";