Files
coopgo/node_modules/react-polyglot/src/translate.d.ts
sgauthier 6e64e138e2
All checks were successful
Publish To Prod / deploy_and_publish (push) Successful in 35s
planning
2024-10-14 09:15:30 +02:00

25 lines
669 B
TypeScript

// Type definitions for react-polyglot v0.4.0
// Typescript version: 2.8
import { InterpolationOptions } from 'node-polyglot'
import { ComponentType } from 'react'
export type t = (
/** The key of the phrase to translate. */
phrase: string,
/** The options accepted by `polyglot.t`. */
options?: number | InterpolationOptions
) => string
export interface TranslateProps {
/** Function to get translated phrase. */
t: t
}
/** Wrap your components with `translate` to get a prop `t` passed in. */
declare const translate = () => <T extends object>(
Component: ComponentType<T>
) => ComponentType<T & TranslateProps>(Component)
export default translate