/** * @module API Reference/Liquid */ import { Agency, AgencyEmployee, Branch, Property } from '../models'; import { Context } from 'liquidjs'; import { Search } from '../search'; import { GlobalConfig } from '../state'; /** * Renders a Liquid template with custom handling for undefined variables. * * This function should be used instead of calling `liquid.parseAndRender` directly, * as the LiquidJS engine does not provide a built-in way to customize behavior * for undefined variables. It uses `injectDefaultFilter` to append a fallback * value for each variable where necessary. * * @param template - The Liquid template string to render. * @param context - The context object supplying variable values. * @returns The rendered output string. */ export declare function renderLiquid(template: string, context: Context): Promise; /** * Ensures that each Liquid variable in the template string includes a `default` filter. * If a variable already has a `default` filter, it is left unchanged. * Otherwise, it appends a `default` filter with a placeholder message indicating * the missing variable name. * * @example * ```ts * const template = '{{ brand_name }}'; * const output = injectDefaultFilter(template); * // output: '{{ brand_name | default: "[missing variable: brand_name]" }}' * ``` * * Regex match details: * - `match`: The full Liquid tag including any filters, e.g. `{{ brand_name | upcase }}` * - `expression`: The inner expression inside the tag, e.g. `brand_name | upcase` * * @param template - The Liquid template string to process. * @param defaultText - The default message prefix to use for missing variables. * @returns The updated template string with `default` filters injected where needed. */ export declare function injectDefaultFilter(template: string, defaultText?: string): string; /** * Generates a serializable Liquid `Context` object that provides the necessary * data models for various pages and includes custom variables from `globalConfig`, * if configured in the admin. * * This function abstracts the serialization of complex structures—such as V4 * model instances and the `customVariables` Map—to ensure compatibility with Liquid. */ export declare function buildLiquidContext(context: { agency?: Agency; property?: Property; branch?: Branch; staffMember?: AgencyEmployee; search?: Search; }, globalConfig: GlobalConfig): Context; //# sourceMappingURL=index.d.ts.map