0.0.16 • Published 6 months ago

@types/react-redux-i18n v0.0.16

Weekly downloads
2,700
License
MIT
Repository
github
Last release
6 months ago

Installation

npm install --save @types/react-redux-i18n

Summary

This package contains type definitions for react-redux-i18n (https://github.com/zoover/react-redux-i18n).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-redux-i18n.

index.d.ts

// Type definitions for react-redux-i18n
// Project: https://github.com/zoover/react-redux-i18n
// Definitions by: Clément Devos <https://github.com/clementdevos>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.8

declare module 'react-redux-i18n' {
  import * as react from "react"
  import * as redux from "redux"

  /**
   * Helper methods
   */
  interface I18n {
    t(code: string, options?: any): string;
    l(timestamp: number, options?: any): string;
  }
  export var I18n : I18n;

  type SubTranslationObject = string | { [key: string]: SubTranslationObject };

  type TranslationObjects = { [lang: string]: SubTranslationObject };

  type DispatchCallback<S extends redux.Action> = {
    (dispatch?: redux.Dispatch<S>, getState?: () => S): any;
  }

  type I18nState = {
    translations: TranslationObjects;
    locale: string;
  }

  type TranslateProps = {
    className?: string | undefined;
    dangerousHTML?: boolean | undefined;
    style?: React.CSSProperties | undefined;
    tag?: React.ElementType | undefined;
    value: string;
    [prop: string]: any;
  }

  type LocalizeProps = {
    className?: string | undefined;
    dangerousHTML?: boolean | undefined;
    dateFormat?: string | undefined;
    options?: Object | undefined;
    style?: React.CSSProperties | undefined;
    tag?: React.ElementType | undefined;
    value: string | number | object;
  }

  /**
   * React components
   */
  export class Translate extends react.Component<TranslateProps>{ }
  export class Localize extends react.Component<LocalizeProps>{ }

  /**
   * Reducer
   */
  export function i18nReducer(state?: any, options?: any): redux.Reducer<I18nState>;

  /**
   * Reducer init
   */
  export function syncTranslationWithStore(store: redux.Store<any>): void;

  /**
   *  Redux Actions
   */
  export function loadTranslations(translationsObject: TranslationObjects): DispatchCallback<any>;

  export function setLocale(locale: string): DispatchCallback<any>;

}

Additional Details

Credits

These definitions were written by Clément Devos.

0.0.14

7 months ago

0.0.15

7 months ago

0.0.16

6 months ago

0.0.13

3 years ago

0.0.12

3 years ago

0.0.11

6 years ago

0.0.10

6 years ago

0.0.9

6 years ago

0.0.8

6 years ago

0.0.7

7 years ago

0.0.6

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago

0.0.0

7 years ago