import type { ChannelType } from "@/store"; export interface UseVariablesResult { /** * All available variables from the editor configuration */ availableVariables: string[]; /** * Variables that are actually used in the channel's content */ usedVariables: string[]; /** * Current variable values (for preview/testing) */ variableValues: Record; /** * Update a variable's value */ addVariableValue: (key: string, value: string) => void; /** * Update multiple variable values in a single state update */ addVariableValues: (entries: Record) => void; /** * Clear all variable values (reset to empty object) */ clearAllVariableValues: () => void; } /** * Hook to access and manage variables for a specific channel. * * @param channelType - The channel to get variables for (e.g., 'email', 'sms', 'slack'). * Pass `"all"` to merge used variables across every channel element in the template. * Omit to default to the currently active channel. * @returns Object containing available variables, used variables, current values, and update function * * @example * ```tsx * const { usedVariables } = useVariables('all'); * // usedVariables merges variables from email, sms, push, etc. * * const { availableVariables, usedVariables, addVariableValue } = useVariables('email'); * addVariableValue('user.name', 'John Doe'); * ``` */ export declare const useVariables: (channelType?: ChannelType | "all") => UseVariablesResult;