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

1.2.2 • Public • Published

Installation

npm install --save @types/passthrough-encoding

Summary

This package contains type definitions for passthrough-encoding (https://github.com/mafintosh/passthrough-encoding).

Details

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

index.d.ts

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

/**
 * An encoder that encodes buffers/strings to a buffer and is
 * [abstract-encoding](https://github.com/mafintosh/abstract-encoding) compatible.
 *
 * @example
 * import * as codec from 'passthrough-encoding'
 *
 * console.log(codec.encode(Buffer.from('hello'))) // prints Buffer('hello')
 * console.log(codec.encode('hello')) // prints Buffer('hello')
 */
export function encode(value: Buffer | string | null | undefined, buffer?: Buffer, offset?: number): Buffer;
export namespace encode {
    const bytes: number;
}

/**
 * An decoder that decodes a buffer to a buffer and is
 * [abstract-encoding](https://github.com/mafintosh/abstract-encoding) compatible.
 *
 * @example
 * import * as codec from 'passthrough-encoding'
 *
 * console.log(codec.decode(Buffer.from('hello'))) // prints Buffer('hello')
 */
export function decode(buffer: Buffer, offset?: number, end?: number): Buffer;
export namespace decode {
    const bytes: number;
}

export function encodingLength(buf: Buffer | string | null | undefined): number;

Additional Details

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

Credits

These definitions were written by BendingBender.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/passthrough-encoding

Weekly Downloads

0

Version

1.2.2

License

MIT

Unpacked Size

4.85 kB

Total Files

5

Last publish

Collaborators

  • types