import type { MarkdownRef } from "./forms/FormDefinition"; export interface TokenInstance { end: number; start: number; token: string; } export interface TokenValues { [token: string]: string; } export declare function findTokenInstances(formatString: string | undefined): TokenInstance[]; /** * Gets a string representation of the supplied value. * @param token The name of the token being replaced. * @param value The value to replace the token. */ export declare function getTokenValueString(token: string, value: any): string; export declare function replacePlaceholders(formatString: string, tokenInstances: TokenInstance[], tokenValues: TokenValues): MarkdownRef; /** * Returns the value itself, or an empty string if the value is `null` or `undefined`. * * Care must be taken to handle two cases correctly: * 1) A "falsey" value such as zero should be preserved as it is still a legitimate value. * 2) Values of `undefined` and `null` must not be mistakenly interpreted to mean * "the field name was invalid". * @param value A value to inspect. * @returns The value itself, or an empty string if the value is `null` or `undefined`. */ export declare function valueOrEmptyString(value: any): any;