Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@types/msgpack

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/msgpack

TypeScript definitions for msgpack

ts4.5
ts4.6
ts4.7
ts4.8
ts4.9
ts5.0
ts5.1
ts5.2
ts5.3
ts5.4
ts5.5
ts5.6
ts5.7
ts5.8
ts5.9
ts6.0
latest
Source
npmnpm
Version
0.0.34
Version published
Weekly downloads
4.7K
-33.94%
Maintainers
1
Weekly downloads
 
Created
Source

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

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.

FAQs

Package last updated on 07 Nov 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts