# @types/text-encoding

> TypeScript definitions for text-encoding

Latest version **0.0.40** (published 2024-11-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install @types/text-encoding
pnpm add @types/text-encoding
yarn add @types/text-encoding
bun add @types/text-encoding
```

## Health

**Score 55/100 (C)** — status: stable.

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

Warnings: low downloads; no esm support; pre 1.0.

Negative: stale.

## Facts

| | |
|---|---|
| Version | 0.0.40 |
| Published | 2024-11-25 |
| First published | 2016-05-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 5.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51436 |
| Maintainers | types |

## Links

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

## Recent versions

- 0.0.40 (latest) — 2024-11-25
- 0.0.39 (ts4.8) — 2023-11-07
- 0.0.37 (ts4.3) — 2023-09-12
- 0.0.36 (ts4.2) — 2021-07-02
- 0.0.35 (ts3.4) — 2018-11-15
- 0.0.32 (ts2.5) — 2017-08-21
- 0.0.38 — 2023-10-18
- 0.0.34 — 2018-10-04
- 0.0.33 — 2018-06-01
- 0.0.31 — 2017-06-26
- 0.0.30 — 2016-09-19
- 0.0.29 — 2016-08-25
- 0.0.28 — 2016-08-19
- 0.0.27 — 2016-08-02
- 0.0.26 — 2016-07-14
- … 9 more at https://npm.io/package/@types/text-encoding/versions

## README

# Installation
> `npm install --save @types/text-encoding`

# Summary
This package contains type definitions for text-encoding (https://github.com/inexorabletash/text-encoding).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/text-encoding.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/text-encoding/index.d.ts)
````ts
declare namespace TextEncoding {
    interface TextEncoderOptions {
        NONSTANDARD_allowLegacyEncoding?: boolean | undefined;
    }
    interface TextEncoderStatic {
        (utfLabel?: string, options?: TextEncoderOptions): TextEncoder;
        new(utfLabel?: string, options?: TextEncoderOptions): TextEncoder;
    }

    export var TextEncoder: {
        new(utfLabel?: string, options?: TextEncoderOptions): TextEncoder;
        (utfLabel?: string, options?: TextEncoderOptions): TextEncoder;
        encoding: string;
    };

    export var TextDecoder: {
        (label?: string, options?: TextDecoderOptions): TextDecoder;
        new(label?: string, options?: TextDecoderOptions): TextDecoder;
        encoding: string;
    };
}

interface TextEncodeOptions {
    stream?: boolean | undefined;
}

interface TextDecoderOptions {
    stream?: boolean | undefined;
    fatal?: boolean;
    ignoreBOM?: boolean;
}

interface TextEncoder {
    readonly encoding: string;
    encode(input?: string, options?: TextEncodeOptions): Uint8Array;
}

interface TextDecoder {
    readonly encoding: string;
    readonly fatal: boolean;
    readonly ignoreBOM: boolean;
    decode(input?: Uint8Array, options?: TextDecoderOptions): string;
}

declare module "text-encoding" {
    export = TextEncoding;
}

````

### Additional Details
 * Last updated: Mon, 25 Nov 2024 01:29:50 GMT
 * Dependencies: none

# Credits
These definitions were written by [Pine Mizune](https://github.com/pine), [Mohsen Azimi](https://github.com/mohsen1), and [Thomas Nicollet](https://github.com/nwmqpa).

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