//#region src/derive/decodeVars.d.ts /** * Given an encoded ICU string, interpolate only _gt_ variables that have been marked with declareVar() * @example * const encodedIcu = "Hi" + declareVar("Brian") + ", my name is {name}" * // 'Hi {_gt_, select, other {Brian}}, my name is {name}' * decodeVars(encodedIcu) * // 'Hi Brian, my name is {name}' */ declare function decodeVars(icuString: string): string; //#endregion //#region src/derive/declareVar.d.ts /** * Mark as a non-translatable string. Use within a derive() call to mark content as not derivable (e.g., not possible to statically analyze). * * @example * function nonDerivableFunction() { * return Math.random(); * } * * function derivableFunction() { * if (condition) { * return declareVar(nonDerivableFunction()) * } * return 'John Doe'; * } * * const gt = useGT(); * gt(`My name is ${derive(derivableFunction())}`); * * @param {string | number | boolean | null | undefined} variable - The variable to sanitize. * @param {Object} [options] - The options for the sanitization. * @param {string} [options.$name] - The name of the variable. * @returns {string} The sanitized value. */ declare function declareVar(variable: string | number | boolean | null | undefined, options?: { $name?: string; }): string; //#endregion //#region src/derive/derive.d.ts /** * Marks content as derivable by the GT compiler and CLI. * * Use `derive()` when a translation string or context needs content that is * computed from source code, but should still be discovered during extraction * instead of treated as a runtime interpolation variable. The CLI attempts to * resolve the derivable expression into every possible static value and * includes those values in the source content that gets translated. * * `derive()` returns its argument unchanged at runtime. * * Run `gt validate` after adding or changing `derive()` calls to verify that * each derivable expression can be resolved by the CLI before translating or * building. * * @example * ```jsx * function getSubject() { * return (Math.random() > 0.5) ? "Alice" : "Brian"; * } * ... * gt(`My name is ${derive(getSubject())}`); * ``` * * @param {T extends string | boolean | number | null | undefined} content - Content to derive for translation extraction. * @returns {T} The same content, unchanged at runtime. */ declare function derive(content: T): T; //#endregion export { declareVar as n, decodeVars as r, derive as t }; //# sourceMappingURL=derive-DBCCXTmL.d.cts.map