npm.io
1.2.2 • Published 2 years ago

@types/passthrough-encoding

Licence
MIT
Version
1.2.2
Deps
1
Size
5 kB
Vulns
0
Weekly
0
Stars
51.4K

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 0939 GMT
  • Dependencies: @types/node

Credits

These definitions were written by BendingBender.