/** * Tiny template renderer for linkAuth rewrite + header templates. * * Syntax (strict, no escapes, no nesting): * - `${name}` → context[name] * - `${transform(name)}` → applyTransform(transform, context[name]) * * Anything else inside `${...}` throws `TemplateSyntaxError`. Missing context * keys throw `TemplateMissingVarError`. Unknown transform names propagate * `UnknownTransformError` from the transforms allowlist. * * This is NOT the project's general-purpose Handlebars renderer * (`utils/template.ts`) — that one is `{{...}}` and consumed widely. linkAuth * needs different syntax and a closed transform set; the two coexist by * namespace (`link-auth/template.ts`). */ /** * Thrown when a template references a variable not present in the context. * Message names the missing variable and includes the full template for * caller-side debugging. */ export declare class TemplateMissingVarError extends Error { constructor(varName: string, template: string); } /** * Thrown when a template contains syntactically invalid content inside `${...}` * (empty expression, whitespace, unrecognized form) or an unterminated `${`. */ export declare class TemplateSyntaxError extends Error { constructor(detail: string, template: string); } /** * Render a template by substituting `${...}` expressions from a context map. * * @throws {TemplateMissingVarError} if a referenced variable is absent * @throws {TemplateSyntaxError} for invalid expressions or unterminated `${` * @throws {UnknownTransformError} from a `${transform(name)}` call */ export declare function renderTemplate(template: string, context: Record): string; //# sourceMappingURL=template.d.ts.map