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.
declare namespace msgpack {
interface MsgPackStatic {
pack(data: any, toString?: boolean): any;
unpack(data: any): any;
worker: string;
upload(url: string, option: MsgPackUploadOption, callback: MsgPackUploadCallback): void;
download(url: string, option: MsgPackDownloadOption, callback: MsgPackDownloadCallback): void;
}
interface MsgPackUploadOption {
data: any;
worker?: boolean | undefined;
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 {
worker?: boolean | undefined;
timeout?: number | undefined;
before?: ((xhr: XMLHttpRequest, option: MsgPackDownloadOption) => void) | undefined;
after?:
| ((xhr: XMLHttpRequest, option: MsgPackDownloadOption, result: MsgPackCallbackResult) => void)
| undefined;
}
interface MsgPackDownloadCallback {
(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.