3.4.6 • Published 6 months ago

@types/msgpack5 v3.4.6

Weekly downloads
6,567
License
MIT
Repository
github
Last release
6 months ago

Installation

npm install --save @types/msgpack5

Summary

This package contains type definitions for msgpack5 (https://github.com/mcollina/msgpack5/).

Details

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

index.d.ts

// Type definitions for msgpack5 v3.4.0
// Project: https://github.com/mcollina/msgpack5/
// Definitions by: Wonshik Kim <https://github.com/wokim>, Kei Son <https://github.com/heycalmdown>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

import stream = require('stream');
import bl = require('bl');
  
interface MsgPackOptions {
  forceFloat64?: boolean | undefined;
  compatibilityMode?: boolean | undefined;
}

declare namespace msgpack5 {
  interface EncodeDecodeOptions {
    header?: boolean | undefined;
  }

  class Base extends stream.Transform {}  
  class Encoder extends Base {}
  class Decoder extends Base {}

  interface MessagePack {
    encode(obj: any): bl;
    decode(buf: Buffer): any;
    decode(buf: bl): any;
    register<T>(type: number, $constructor: any, encode: (obj: T) => Buffer, decode: (data: Buffer) => T): MessagePack;
    registerEncoder<T>(check: (obj: T) => boolean, encode: (obj: T) => Buffer): MessagePack;
    registerDecoder(type: number, decode: (data: Buffer) => any): MessagePack;
    encoder(opts?: EncodeDecodeOptions): Encoder;
    decoder(opts?: EncodeDecodeOptions): Decoder;
  }
}

declare function msgpack5(opts?: MsgPackOptions): msgpack5.MessagePack;

export = msgpack5;

Additional Details

  • Last updated: Thu, 08 Jul 2021 18:51:02 GMT
  • Dependencies: @types/bl
  • Global values: none

Credits

These definitions were written by Wonshik Kim, and Kei Son.

3.4.4

7 months ago

3.4.6

6 months ago

3.4.5

7 months ago

3.4.3

2 years ago

3.4.2

3 years ago

3.4.1

7 years ago

3.4.0

7 years ago