npm install --save @types/enzyme-react-intl
This package contains type definitions for enzyme-react-intl (https://github.com/joetidee/enzyme-react-intl#readme).
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/enzyme-react-intl.
import { MountRendererProps, ReactWrapper, ShallowRendererProps, ShallowWrapper } from "enzyme";
import { Component, ReactElement } from "react";
import { IntlProvider } from "react-intl";
// shallow methods
// eslint-disable-next-line @definitelytyped/no-unnecessary-generics
export function shallowWithIntl<C extends Component, P = C["props"], S = C["state"]>(
node: ReactElement<P>,
options?: ShallowRendererProps,
): ShallowWrapper<P, S, C>;
export function shallowWithIntl<P>(node: ReactElement<P>, options?: ShallowRendererProps): ShallowWrapper<P, any>;
// eslint-disable-next-line @definitelytyped/no-unnecessary-generics
export function shallowWithIntl<P, S>(node: ReactElement<P>, options?: ShallowRendererProps): ShallowWrapper<P, S>;
// mount methods
// eslint-disable-next-line @definitelytyped/no-unnecessary-generics
export function mountWithIntl<C extends Component, P = C["props"], S = C["state"]>(
node: ReactElement<P>,
options?: MountRendererProps,
): ReactWrapper<P, S, C>;
export function mountWithIntl<P>(node: ReactElement<P>, options?: MountRendererProps): ReactWrapper<P, any>;
// eslint-disable-next-line @definitelytyped/no-unnecessary-generics
export function mountWithIntl<P, S>(node: ReactElement<P>, options?: MountRendererProps): ReactWrapper<P, S>;
// render method
// eslint-disable-next-line @definitelytyped/no-unnecessary-generics
export function renderWithIntl<P, S>(node: ReactElement<P>, options?: any): cheerio.Cheerio;
// other methods
export function getIntl(): IntlProvider;
export function getLocale(): string;
export function setLocale(locale: string): void;
export function loadTranslation(translationFilePath: string): any;
export function loadTranslationObject<T extends { [key: string]: string }>(translations: T): T;
- Last updated: Mon, 06 Nov 2023 22:41:05 GMT
- Dependencies: @types/enzyme, @types/react, react-intl
These definitions were written by Mateusz Meller.