JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 155389
  • Score
    100M100P100Q164493F
  • License MIT

TypeScript definitions for utf8

Package Exports

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@types/utf8) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    Installation

    npm install --save @types/utf8

    Summary

    This package contains type definitions for utf8 (https://github.com/mathiasbynens/utf8.js).

    Details

    Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/utf8.

    index.d.ts

    export as namespace utf8;
    
    /**
     * A string representing the semantic version number.
     */
    export const version: string;
    /**
     * Encodes any given JavaScript string (string) as UTF-8, and returns the UTF-8-encoded version of the string.
     * It throws an error if the input string contains a non-scalar value, i.e. a lone surrogate.
     * @param inputString
     */
    export function encode(inputString: string): string;
    
    /**
     * Decodes any given UTF-8-encoded string (byteString) as UTF-8, and returns the UTF-8-decoded version of the string.
     * It throws an error when malformed UTF-8 is detected.
     * @param byteString
     */
    export function decode(byteString: string): string;
    

    Additional Details

    • Last updated: Tue, 07 Nov 2023 15:11:36 GMT
    • Dependencies: none

    Credits

    These definitions were written by Piotr Błażejewicz.