@hhgtech/hhg-components
Version:
Hello Health Group common components
68 lines (67 loc) • 2.43 kB
TypeScript
import React, { PropsWithChildren } from 'react';
import { LOCALE } from "../../interfaces/types/Locale";
import { LeadGenProps } from "../LeadGen.type";
export type SubmitValue = {};
export type SubmitSubscriptionBoxValue = {
url: string;
site_domain: string;
cookie_id: string;
ga_client_id: string;
name: string;
area_code: string;
phone_number: string;
sso_user_id: string;
sso_uuid: string;
sso_verified_profile: 1 | 0;
subscription_title: string;
article_id: number;
article_title: string;
category_id: number;
category_name: string;
campaign_id: number;
};
export type ImpressionValue = {
code: string;
action: string;
url: string;
cookie_id: string | null;
ga_client_id: string | null;
title_article: string;
extra?: Record<string, string | number>;
referrer?: string;
};
export type LeadGenContextProps = LeadGenProps & {
submit: (value?: SubmitValue) => Promise<any>;
submitSubscriptionBox: (value?: Partial<SubmitSubscriptionBoxValue>) => Promise<any>;
impression: (value?: ImpressionValue) => Promise<any>;
/** For Subscription Box */
subscriptionIcon: string;
subscriptionTitle: string;
};
export declare const LeadGenContext: React.Context<LeadGenContextProps>;
export declare const LeadGenContextProvider: (props: PropsWithChildren<LeadGenProps>) => React.JSX.Element;
export declare const useLeadGenContext: () => {
apiLeadUrl: string;
apiSubotUrl: string;
campaign_code?: string;
forceCampaign?: any;
apiSsoUrl?: string;
locale?: LOCALE;
siteId?: string;
siteDomain?: string;
extraValues?: import("../LeadGen.type").LeadGenFormValue;
extraPayloadValues?: import("../LeadGen.type").LeadGenExtraPayload[];
userInfo?: import("../../types").UserInfo;
onFinish?: (value: import("../LeadGen.type").LeadGenFormValue, metaValue?: {
blocks?: import("../LeadGenForm").LeadGenBlock[];
isUpdateSso?: boolean;
}) => void;
articleId?: number;
categoryId?: number;
submit: (value?: SubmitValue) => Promise<any>;
submitSubscriptionBox: (value?: Partial<SubmitSubscriptionBoxValue>) => Promise<any>;
impression: (value?: ImpressionValue) => Promise<any>;
/** For Subscription Box */
subscriptionIcon: string;
subscriptionTitle: string;
};