//#region src/dedent.d.ts /** Configuration options for the dedent function behavior */ interface DedentOptions { /** * Whether to process escape sequences like \n, `, $, and { When true, allows * using escaped characters in template literals * * @default true for template literals, false for plain strings */ escapeSpecialCharacters?: boolean; /** * Whether to trim leading and trailing whitespace from the final result * * @default true */ trimWhitespace?: boolean; /** * Whether to preserve relative indentation of interpolated multi-line values * When true, multi-line interpolations are re-indented to match the * surrounding context * * @default true */ identInterpolations?: boolean; /** * Whether to display nullish or false values (false, null, undefined) in * interpolations When false, nullish or false values are skipped entirely * * @default false */ showNullishOrFalseValues?: boolean; } type InterpolationValue = string | number | boolean | null | undefined; /** * Dedent function interface that can be used both as a template tag and a * regular function */ interface Dedent { /** Process a plain string to remove common indentation */ (literals: string): string; /** * Process a template literal to remove common indentation while handling * interpolations */ (strings: TemplateStringsArray, ...values: InterpolationValue[]): string; /** Create a new dedent function with custom options */ withOptions: CreateDedent; } /** Factory function type for creating dedent functions with custom options */ type CreateDedent = (options: DedentOptions) => Dedent; /** * Remove common leading indentation from multi-line strings while preserving * relative indentation. Can be used as a tagged template literal or called with * a plain string. * * By default, it will dedent interpolated multi-line strings to match the * surrounding context. And it will not show falsy values. * * @example * ```typescript * const text = dedent`; * function hello() { * console.log('world'); * } * `; * // Result: * "function hello() { * console.log('world'); * }" * ```; */ declare const dedent: Dedent; //#endregion export { CreateDedent, Dedent, DedentOptions, dedent };