Socket
Socket
Sign inDemoInstall

@types/fast-text-encoding

Package Overview
Dependencies
0
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @types/fast-text-encoding

TypeScript definitions for fast-text-encoding


Version published
Weekly downloads
6.4K
decreased by-15.58%
Maintainers
1
Install size
5.66 kB
Created
Weekly downloads
 

Readme

Source

Installation

npm install --save @types/fast-text-encoding

Summary

This package contains type definitions for fast-text-encoding (https://github.com/samthor/fast-text-encoding#readme).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/fast-text-encoding.

index.d.ts

/**
 * fast-text-encoding does not export any members, but defines the global classes
 * 1) TextDecoder (https://developer.mozilla.org/en-US/docs/Web/API/TextDecoder)
 * 2) TextEncoder (https://developer.mozilla.org/en-US/docs/Web/API/TextEncoder)
 * if they are not already defined.
 *
 * We do not declare these globals here since they are already declared in "lib.dom.d.ts" and would
 * result in name collisions. Instead, we export the types so that `TextDecoder` and `TextEncoder`
 * can be manually declared in a non-DOM environment (see tests).
 */

declare namespace fastTextEncoding {
    /**
     * Options for `TextDecoder.decode` and `TextEncoder.encode`.
     */
    interface TextEncodingOptions {
        stream: boolean;
    }

    /**
     * Options for TextDecoder constructor.
     */
    interface TextDecoderOptions {
        fatal: boolean;
    }

    /**
     * TextDecoder instance.
     */
    class TextDecoderClass {
        encoding: string;
        fatal: boolean;
        ignoreBOM: boolean;

        constructor(utfLabel?: string, options?: TextDecoderOptions);

        decode(buffer: Uint8Array, options?: TextEncodingOptions): string;
    }

    /**
     * TextEncoder instance.
     */
    class TextEncoderClass {
        encoding: string;

        constructor(label?: string);

        encode(string: string, options?: TextEncodingOptions): Uint8Array;
    }

    /**
     * TextDecoder class.
     */
    type TextDecoder = typeof TextDecoderClass;

    /**
     * TextEncoder class.
     */
    type TextEncoder = typeof TextEncoderClass;
}

Additional Details

  • Last updated: Tue, 07 Nov 2023 03:09:37 GMT
  • Dependencies: none

Credits

These definitions were written by Ciarán Ingle.

FAQs

Last updated on 07 Nov 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc