interface Stringable { toString(): string; safeInHTML?: boolean; } export { Stringable }; export declare type EachIterator = (value: T, key: number) => Stringable; export declare type StringFunction = () => Stringable; /** * Turns HTML-sensitive characters into HTML entities * Escapes all of &><"'` */ export declare function escapeHTML(str: string): string; /** * An HTML snippet that's escaped by default. * Embedded instances of $html will not be extra-escaped. * Use $${"data"} to skip escaping of an input. */ export declare function $html(literalSections: any, ...substs: any[]): Stringable; /** * Executes the given string or function a given number of times. */ export declare function $times(count: number, method: Function | Stringable): Stringable; /** * Maps a list of values using the given function or string. */ export declare function $map(collection: T[], method: EachIterator | Stringable): Stringable[]; /** * Maps all values of the collection using $map, then joins the array. * Use `$map` to get an array. */ export declare function $each(collection: T[], method: EachIterator | Stringable): Stringable; /** * Joins together a list of values and attempts to preserve safeInHTML if all values are. */ export declare function $join(collection: T[]): Stringable; /** * Calls the given function with the given object as a parameter. * Useful for aliasing a value to a shorter name in a template. */ export declare function $alias(object: T, method: (v: T) => Stringable): Stringable; /** * Executes the function or string only if the condition given is truthy. */ export declare function $if(condition: any, method: StringFunction | Stringable, other?: StringFunction | Stringable): Stringable;