@types/enzyme-react-intl
TypeScript icon, indicating that this package has built-in type declarations

2.0.9 • Public • Published

Installation

npm install --save @types/enzyme-react-intl

Summary

This package contains type definitions for enzyme-react-intl (https://github.com/joetidee/enzyme-react-intl#readme).

Details

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;

Additional Details

Credits

These definitions were written by Mateusz Meller.

/@types/enzyme-react-intl/

    Package Sidebar

    Install

    npm i @types/enzyme-react-intl

    Weekly Downloads

    48

    Version

    2.0.9

    License

    MIT

    Unpacked Size

    6.47 kB

    Total Files

    5

    Last publish

    Collaborators

    • types