/** Value accepted for a placeholder; `null` / `undefined` mean "omit". */
export type TemplateValue = string | number | boolean | null | undefined;
/** Placeholder values keyed by tag name. */
export type TemplateValues = Record<string, TemplateValue>;
/**
 * Template engine used for the XML samlify builds.
 *
 * - `legacy` — string substitution (`replaceTagsByValue`); the default until v3.
 * - `strict` — {@link renderTemplate}: placeholders are only accepted in
 *   attribute values and text, and every value is escaped for its position.
 */
export type TemplateRenderer = 'legacy' | 'strict';
/**
 * XML-escape text for an attribute value or character data, also encoding
 * `{` and `}` as character references. XML parsers and canonicalization read
 * them as the same characters; encoding them guarantees that inserted text
 * never reads as a placeholder in a later rendering step.
 *
 * @param text raw text
 * @returns escaped text
 */
export declare function escapeXmlValue(text: string): string;
/**
 * Encode a tag name the way it must appear in a template so that it reads
 * as one placeholder. For plain names (letters, digits, `.`, `-`, `_`) this
 * is the name itself.
 *
 * @param name tag name
 * @returns placeholder text without the surrounding braces
 */
export declare function placeholderName(name: string): string;
/**
 * Render a SAML XML template, replacing `{Tag}` placeholders with values.
 *
 * Every placeholder is classified by its position in the markup, and the
 * template is rendered in a single pass:
 *
 * - A placeholder is only accepted inside an attribute value or in text.
 *   One in an element or attribute name, an end tag, a comment, a CDATA
 *   section or a processing instruction throws
 *   `ERR_TEMPLATE_PLACEHOLDER_POSITION`.
 * - Values are XML-escaped and inserted as data; inserted text is never
 *   scanned for further placeholders, so a value cannot add markup or fill
 *   in another tag.
 * - A `null` / `undefined` value omits the attribute when the placeholder is
 *   the attribute's whole value, omits the element when the placeholder is
 *   its only content, and is empty otherwise.
 * - Placeholders without a value are left in place.
 *
 * For valid templates the output is identical to `replaceTagsByValue`.
 * `{` and `}` in values are written as character references.
 *
 * @param template XML template (a document or a fragment)
 * @param values placeholder values keyed by tag name
 * @returns rendered XML
 */
export declare function renderTemplate(template: string, values: TemplateValues): string;
