import { PlainObject } from "../models.mjs"; //#region src/string/template.d.ts /** * Renderer for a string template with variables * * @param variables Variables to use * @param options Templating options * @returns Templated string */ type Renderer = (variables?: PlainObject, options?: Partial) => string; /** * Options for templating strings */ type TemplateOptions = { /** * Ignore case when searching for variables? */ ignoreCase?: boolean; /** * Custom pattern for outputting variables */ pattern?: RegExp; }; type Templater = { /** * Render a string from a template with variables * * @returns Templated string */ (strings: TemplateStringsArray, ...values: unknown[]): TemplaterRenderer; /** * Render a string from a template with variables * * @param value Template string * @param variables Variables to use * @returns Templated string */ (value: string, variables?: PlainObject): string; }; /** * Render a template string with variables */ type TemplaterRenderer = (variables?: PlainObject) => string; /** * Create a _Templater_ with predefined options * * _Available as `initializeTemplater` and `template.initialize`_ * * @param options Templating options * @returns _Templater_ function */ declare function initializeTemplater(options?: Partial): Templater; /** * Get a _Renderer_ for a string template * * @returns _Renderer_ function */ declare function template(strings: TemplateStringsArray, ...values: unknown[]): Renderer; /** * Render a string from a template with variables * * @param value Template string * @param variables Variables to use * @param options Templating options * @returns Templated string */ declare function template(value: string, variables?: PlainObject, options?: Partial): string; declare namespace template { var initialize: typeof initializeTemplater; } //#endregion export { TemplateOptions, initializeTemplater, template };