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

0.7.1 • Public • Published

Installation

npm install --save @types/snappyjs

Summary

This package contains type definitions for snappyjs (https://github.com/zhipeng-jia/snappyjs).

Details

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

// Note: Although the library does specify that Node.js Buffers are allowed,
// they extend Uint8Array and therefore do not need to be mentioned explicitly in the types

export as namespace SnappyJS;

/**
 * @param input The byte stream to compress
 * @returns The compressed byte stream, of the same type as the input
 */
export function compress<T extends ArrayBuffer | Uint8Array = ArrayBuffer | Uint8Array>(input: T): T;

/**
 * @param input The compressed input
 * @param [maxLength] If provided, throws an exception if the data length in the header
 * exceeds the specified value
 * @returns The decmopressed byte stream, of the same type as the input
 * @throws {Error} If `maxLength` is provided and the length exceeds it
 */
export function uncompress<T extends ArrayBuffer | Uint8Array = ArrayBuffer | Uint8Array>(
    input: T,
    maxLength?: number,
): T;

Additional Details

  • Last updated: Fri, 22 Mar 2024 13:06:43 GMT
  • Dependencies: none

Credits

These definitions were written by Adam Thompson-Sharpe.

/@types/snappyjs/

    Package Sidebar

    Install

    npm i @types/snappyjs

    Weekly Downloads

    1,435

    Version

    0.7.1

    License

    MIT

    Unpacked Size

    4.3 kB

    Total Files

    5

    Last publish

    Collaborators

    • types