Closed tlrobinson closed 7 months ago
This documentation
The biggest difference between jt and t is that t concatenates translations and expressions all together into a single string, while jt returns an array of the translated strings and expressions that can be used in jsx.
and this TypeScript type
https://github.com/ttag-org/ttag/blob/master/types/index.d.ts#L22
aren't quite right. jt returns an array of strings and any template variables.
jt
I think this is a better type:
export function jt<T>(strings: TemplateStringsArray, ...expr: T[]): string | (string | T)[];
A workaround is to redeclare the type in some TypesScript file in your project:
import "ttag"; declare module "ttag" { function jt<T>(strings: TemplateStringsArray, ...expr: T[]): string | (string | T)[]; }
good point, this needs to be fixed
done in 1.8.6 :heavy_check_mark:
1.8.6
This documentation
and this TypeScript type
https://github.com/ttag-org/ttag/blob/master/types/index.d.ts#L22
aren't quite right.
jt
returns an array of strings and any template variables.I think this is a better type:
A workaround is to redeclare the type in some TypesScript file in your project: