# @types/msgpack

> TypeScript definitions for msgpack

Latest version **0.0.34** (published 2023-11-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install @types/msgpack
pnpm add @types/msgpack
yarn add @types/msgpack
bun add @types/msgpack
```

## Health

**Score 45/100 (D)** — status: abandoned.

Positive: has types; no vulnerabilities; high maintenance score; popular repo; extremely popular.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 0.0.34 |
| Published | 2023-11-07 |
| First published | 2016-05-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 6.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51369 |
| Maintainers | types |

## Links

- npm: https://www.npmjs.com/package/@types/msgpack
- Repository: https://github.com/DefinitelyTyped/DefinitelyTyped
- Homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/msgpack
- npm.io page: https://npm.io/package/@types/msgpack

## Recent versions

- 0.0.34 (latest) — 2023-11-07
- 0.0.31 (ts3.6) — 2021-07-08
- 0.0.30 (ts2.0) — 2017-08-17
- 0.0.33 — 2023-10-18
- 0.0.32 — 2023-09-27
- 0.0.29 — 2017-03-27
- 0.0.28 — 2016-09-19
- 0.0.27 — 2016-07-14
- 0.0.26-alpha — 2016-07-08
- 0.0.25-alpha — 2016-07-04
- 0.0.24-alpha — 2016-07-02
- 0.0.23-alpha — 2016-07-01
- 0.0.22-alpha — 2016-07-01
- 0.0.21-alpha — 2016-05-25
- 0.0.20-alpha — 2016-05-20
- … 2 more at https://npm.io/package/@types/msgpack/versions

## README

# Installation
> `npm install --save @types/msgpack`

# Summary
This package contains type definitions for msgpack (https://github.com/uupaa/msgpack.js/).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/msgpack.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/msgpack/index.d.ts)
````ts
declare namespace msgpack {
    interface MsgPackStatic {
        /**
         * @param data string or ByteArray.
         * @param toString return string value if true.
         *
         * @return string or ByteArray or false. pack failed if false.
         */
        pack(data: any, toString?: boolean): any;

        /**
         * @param data string or ByteArray.
         *
         * @return string or ByteArray or undefined. unpack failed if undefined.
         */
        unpack(data: any): any;

        worker: string;

        upload(url: string, option: MsgPackUploadOption, callback: MsgPackUploadCallback): void;

        download(url: string, option: MsgPackDownloadOption, callback: MsgPackDownloadCallback): void;
    }

    interface MsgPackUploadOption {
        /**
         * string or ByteArray
         */
        data: any;

        /**
         * use WebWorker if true.
         */
        worker?: boolean | undefined;

        /**
         * timeout sec.
         */
        timeout?: number | undefined;

        before?: ((xhr: XMLHttpRequest, option: MsgPackUploadOption) => void) | undefined;

        after?: ((xhr: XMLHttpRequest, option: MsgPackUploadOption, result: MsgPackCallbackResult) => void) | undefined;
    }

    interface MsgPackUploadCallback {
        (data: string, option: MsgPackUploadOption, result: MsgPackCallbackResult): void;
    }

    interface MsgPackDownloadOption {
        /**
         * use WebWorker if true.
         */
        worker?: boolean | undefined;

        /**
         * timeout sec.
         */
        timeout?: number | undefined;

        before?: ((xhr: XMLHttpRequest, option: MsgPackDownloadOption) => void) | undefined;

        after?:
            | ((xhr: XMLHttpRequest, option: MsgPackDownloadOption, result: MsgPackCallbackResult) => void)
            | undefined;
    }

    interface MsgPackDownloadCallback {
        /**
         * @param data string or ByteArray
         */
        (data: any, option: MsgPackDownloadOption, result: MsgPackCallbackResult): void;
    }

    interface MsgPackCallbackResult {
        status: number;

        ok: boolean;
    }
}

declare var msgpack: msgpack.MsgPackStatic;

export = msgpack;
export as namespace msgpack;

````

### Additional Details
 * Last updated: Tue, 07 Nov 2023 09:09:39 GMT
 * Dependencies: none

# Credits
These definitions were written by [Shinya Mochizuki](https://github.com/enrapt-mochizuki).

---
_Source: https://npm.io/package/@types/msgpack · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
