0.1.2 • Published 6 months ago

@types/jconv v0.1.2

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

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

// Type definitions for jconv 0.1
// Project: https://github.com/narirou/jconv
// Definitions by: Martijn Saly <https://github.com/thany>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

/// <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: Wed, 11 Aug 2021 15:01:26 GMT
  • Dependencies: @types/node
  • Global values: none

Credits

These definitions were written by Martijn Saly.

0.1.2

6 months ago

0.1.1

7 months ago

0.1.0

3 years ago