@types/jconv
TypeScript icon, indicating that this package has built-in type declarations

0.1.2 • Public • Published

Installation

npm install --save @types/jconv

Summary

This package contains type definitions for jconv (https://github.com/narirou/jconv).

Details

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

index.d.ts

/// <reference types="node" />

declare function jconv(buf: Buffer, from: string, to: string): Buffer;

declare namespace jconv {
    interface Encoding {
        name: string;
        convert: (buf: Buffer) => Buffer;
    }

    /*
     * Adds a new encoding. Already used internally with SJIS, JIS and EUCJP.
     */
    function defineEncoding(obj: Encoding): void;

    /*
     * Converts a Buffer from one encoding straight to another, and returns a new Buffer.
     */
    function convert(buf: Buffer, from: string, to: string): Buffer;

    /*
     * Decodes a Buffer with the given encoding to a string.
     */
    function decode(buf: Buffer, from: string): string;

    /*
     * Encodes a string to a Buffer with a given encoding.
     */
    function encode(str: string, to: string): Buffer;

    /*
     * Checks whether an encoding exists.
     */
    function encodingExists(encoding: string): boolean;
}

export = jconv;

Additional Details

  • Last updated: Tue, 07 Nov 2023 03:09:37 GMT
  • Dependencies: @types/node

Credits

These definitions were written by Martijn Saly.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/jconv

Weekly Downloads

601

Version

0.1.2

License

MIT

Unpacked Size

4.45 kB

Total Files

5

Last publish

Collaborators

  • types