@hhgtech/hhg-components
Version:
Hello Health Group common components
58 lines (57 loc) • 2.09 kB
TypeScript
import { SubotNodeItem, SubotMessage, SubotBotItem, SubotFormSubmitMeta } from "../../interfaces/types";
export declare const getPreviousStateFromStorage: (botId: string | number, { getParams }: {
getParams: () => SubotMessage;
}) => {
listNodes: SubotNodeItem[];
activeId: string;
params: {
account_id: any;
cookie_id: any;
mode?: string;
bot_id?: string | number;
node_id?: string;
window_id?: string;
url?: string;
title_url?: string;
action_id?: string;
action_value?: string;
gtm_id?: string;
ga_client_id?: string;
device_id?: number;
categories?: string[];
current_keys?: string[];
current_score?: string | number;
current_selected?: string[];
current_polls?: {
[key: string]: string[];
};
is_new?: boolean;
selected_actions?: {
[key: string]: string;
};
form_submit_meta?: SubotFormSubmitMeta[];
};
};
export declare const getSubotInlineLogs: (botItem?: SubotBotItem) => Promise<{
nodes: any[];
activeId: any;
params: any;
}>;
export declare const extractUnifiedAnswers: (nodes: SubotNodeItem[]) => Record<string, string | string[]>[];
export declare const extractVoucherAnswers: (nodes: SubotNodeItem[], botItem: SubotBotItem) => {
email: string;
voucherName: string;
voucher_product: string;
voucher_location: string;
voucher_size: string;
voucher_color: string;
phone: string;
};
export declare const saveSubotInlineLogs: ({ nodes, activeId, params, accountIdFromLogs, }: {
nodes: SubotNodeItem[];
activeId: string;
params: SubotMessage;
accountIdFromLogs: null | number;
}) => Promise<void>;
export declare const getColorWithOpacity: (color: string, opacity: number) => string;
export declare const detectToSkipNodeStart: (botItem: SubotBotItem, currentActiveId: string, currentListNodes: SubotNodeItem[]) => [string, SubotNodeItem[]];