# @types/preact-i18n

> TypeScript definitions for preact-i18n

Latest version **2.3.6** (published 2023-11-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install @types/preact-i18n
pnpm add @types/preact-i18n
yarn add @types/preact-i18n
bun add @types/preact-i18n
```

## Health

**Score 45/100 (D)** — status: abandoned.

Positive: has types; no vulnerabilities; high maintenance score; popular repo; extremely popular.

Warnings: low downloads; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 2.3.6 |
| Published | 2023-11-07 |
| First published | 2019-03-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 6.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51444 |
| Maintainers | types |

## Links

- npm: https://www.npmjs.com/package/@types/preact-i18n
- Repository: https://github.com/DefinitelyTyped/DefinitelyTyped
- Homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/preact-i18n
- npm.io page: https://npm.io/package/@types/preact-i18n

## Dependencies (1)

- [preact](https://npm.io/package/preact.md) ^10.0.0

## Recent versions

- 2.3.6 (latest) — 2023-11-07
- 2.3.4 (ts4.5) — 2023-09-24
- 2.3.3 (ts4.3) — 2023-08-22
- 2.3.2 (ts4.2) — 2022-12-30
- 2.3.1 (ts3.6) — 2021-07-08
- 2.3.0 (ts3.5) — 2020-12-08
- 1.2.0 (ts3.3) — 2019-03-13
- 2.3.5 — 2023-10-18

## README

# Installation
> `npm install --save @types/preact-i18n`

# Summary
This package contains type definitions for preact-i18n (https://github.com/synacor/preact-i18n).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/preact-i18n.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/preact-i18n/index.d.ts)
````ts
import { Component, ComponentChild, Context, h, JSX, VNode } from "preact";

interface IntlContext {
    intl: {
        definition: {};
        mark: boolean;
        scope: string;
    };
}

interface IntlProviderProps {
    children: JSX.Element | JSX.Element[];
    definition?: {} | undefined;
    mark?: boolean | undefined;
    scope?: string | undefined;
}

interface LocalizerProps {
    children: JSX.Element | JSX.Element[];
}
interface TextProps {
    children?: string | undefined;
    id: string;
    fields?: {} | undefined;
    plural?: number | undefined;
}

export const IntlContext: Context<IntlContext>;

export function IntlProvider(props: IntlProviderProps): JSX.Element;

export function Text(props: TextProps): JSX.Element;

export function MarkupText(props: TextProps): JSX.Element;

export function Localizer(props: LocalizerProps): JSX.Element;

export function translate(
    id: string,
    scope: string,
    dictionary: {},
    fields?: {},
    plural?: number,
    fallback?: string,
): string;

export function useText(
    mapping: { [key: string]: string | JSX.Element } | string | JSX.Element,
): { [key: string]: string };

// eslint-disable-next-line @definitelytyped/no-unnecessary-generics
export function withText<Props, Context = IntlContext>(mapping: {}): (
    Child: ComponentChild,
    // eslint-disable-next-line @definitelytyped/no-unnecessary-generics
) => new(props?: Props, context?: Context) => any;

export function intl(Child: Component, options?: { scope?: string | undefined; definition?: {} | undefined }): VNode;

declare enum Intl {
    intl,
    IntlContext,
    IntlProvider,
    Text,
    MarkupText,
    Localizer,
    withText,
    useText,
    translate,
}

export default Intl;

````

### Additional Details
 * Last updated: Tue, 07 Nov 2023 09:09:39 GMT
 * Dependencies: [preact](https://npmjs.com/package/preact)

# Credits
These definitions were written by [ Lukas Tetzlaff](https://github.com/ltetzlaff), and [Sascha Zarhuber](https://github.com/saschazar21).

---
_Source: https://npm.io/package/@types/preact-i18n · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
