ccxt-ir 4.24.0 → 4.24.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/dist/ccxt.browser.min.js +3 -3
- package/dist/cjs/ccxt.js +262 -262
- package/dist/cjs/package.json +1 -1
- package/dist/cjs/src/abstract/balinex.js +1 -1
- package/dist/cjs/src/balinex.js +217 -217
- package/dist/cjs/src/bitbarg.js +322 -322
- package/dist/cjs/src/bitpin.js +34 -24
- package/dist/cjs/src/nobitex.js +25 -26
- package/dist/cjs/src/swapwallet.js +209 -209
- package/dist/cjs/src/wallex.js +105 -18
- package/js/ccxt.d.ts +772 -772
- package/js/ccxt.js +557 -557
- package/js/src/abstract/balinex.d.ts +8 -8
- package/js/src/abstract/balinex.js +5 -5
- package/js/src/abstract/swapwallet.js +5 -5
- package/js/src/abstract/wallex.d.ts +2 -0
- package/js/src/balinex.d.ts +20 -20
- package/js/src/balinex.js +220 -220
- package/js/src/base/Exchange.d.ts +926 -926
- package/js/src/bitbarg.js +325 -325
- package/js/src/bitpin.d.ts +2 -2
- package/js/src/bitpin.js +34 -24
- package/js/src/coinbaseexchange.d.ts +334 -334
- package/js/src/nobitex.d.ts +2 -2
- package/js/src/nobitex.js +25 -26
- package/js/src/protobuf/mexc/compiled.d.cts +2 -8
- package/js/src/static_dependencies/fflake/browser.d.ts +222 -222
- package/js/src/static_dependencies/jsencrypt/lib/jsbn/jsbn.d.ts +101 -101
- package/js/src/static_dependencies/qs/formats.d.cts +8 -14
- package/js/src/static_dependencies/qs/index.d.cts +4 -10
- package/js/src/static_dependencies/qs/parse.d.cts +2 -8
- package/js/src/static_dependencies/qs/stringify.d.cts +2 -8
- package/js/src/static_dependencies/qs/utils.d.cts +9 -15
- package/js/src/static_dependencies/starknet/utils/calldata/parser/index.d.ts +5 -5
- package/js/src/swapwallet.js +212 -212
- package/js/src/wallex.d.ts +2 -2
- package/js/src/wallex.js +105 -18
- package/js/test.js +51 -62
- package/package.json +1 -1
package/js/src/nobitex.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Exchange from './abstract/nobitex.js';
|
|
2
|
-
import { Int, Market, OHLCV, OrderBook, Strings, Ticker, Tickers } from './base/types.js';
|
|
2
|
+
import { Int, Market, MarketType, OHLCV, OrderBook, Strings, Ticker, Tickers } from './base/types.js';
|
|
3
3
|
/**
|
|
4
4
|
* @class nobitex
|
|
5
5
|
* @augments Exchange
|
|
@@ -8,7 +8,7 @@ import { Int, Market, OHLCV, OrderBook, Strings, Ticker, Tickers } from './base/
|
|
|
8
8
|
export default class nobitex extends Exchange {
|
|
9
9
|
describe(): any;
|
|
10
10
|
fetchMarkets(params?: {}): Promise<Market[]>;
|
|
11
|
-
parseMarket(market: any): Market;
|
|
11
|
+
parseMarket(market: any, type?: MarketType): Market;
|
|
12
12
|
fetchTickers(symbols?: Strings, params?: {}): Promise<Tickers>;
|
|
13
13
|
fetchTicker(symbol: string, params?: {}): Promise<Ticker>;
|
|
14
14
|
parseTicker(ticker: any, market?: Market): Ticker;
|
package/js/src/nobitex.js
CHANGED
|
@@ -79,6 +79,7 @@ export default class nobitex extends Exchange {
|
|
|
79
79
|
'fetchTradingFee': false,
|
|
80
80
|
'fetchTradingFees': false,
|
|
81
81
|
'fetchWithdrawals': false,
|
|
82
|
+
'otc': true,
|
|
82
83
|
'setLeverage': false,
|
|
83
84
|
'setMarginMode': false,
|
|
84
85
|
'transfer': false,
|
|
@@ -138,9 +139,12 @@ export default class nobitex extends Exchange {
|
|
|
138
139
|
* @description retrieves data on all markets for nobitex
|
|
139
140
|
* @see https://apidocs.nobitex.ir/#6ae2dae4a2
|
|
140
141
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
142
|
+
* @param {string} [params.type] market type, 'spot' (default) or 'otc'; both use market/stats
|
|
141
143
|
* @returns {object[]} an array of objects representing market data
|
|
142
144
|
*/
|
|
143
|
-
const
|
|
145
|
+
const type = this.safeString(params, 'type', 'spot');
|
|
146
|
+
const request = this.omit(params, ['type']);
|
|
147
|
+
const response = await this.publicGetMarketStats(request);
|
|
144
148
|
const markets = this.safeDict(response, 'stats');
|
|
145
149
|
const marketKeys = Object.keys(markets);
|
|
146
150
|
const result = [];
|
|
@@ -149,13 +153,13 @@ export default class nobitex extends Exchange {
|
|
|
149
153
|
if (markets[symbol]['isClosed']) {
|
|
150
154
|
continue;
|
|
151
155
|
}
|
|
152
|
-
markets[symbol]
|
|
153
|
-
const market = this.parseMarket(
|
|
156
|
+
const data = this.extend(markets[symbol], { 'symbol': symbol });
|
|
157
|
+
const market = this.parseMarket(data, type);
|
|
154
158
|
result.push(market);
|
|
155
159
|
}
|
|
156
160
|
return result;
|
|
157
161
|
}
|
|
158
|
-
parseMarket(market) {
|
|
162
|
+
parseMarket(market, type = 'spot') {
|
|
159
163
|
// btc-rls: {
|
|
160
164
|
// isClosed: false,
|
|
161
165
|
// bestSell: "38820000000",
|
|
@@ -186,8 +190,8 @@ export default class nobitex extends Exchange {
|
|
|
186
190
|
'baseId': baseId,
|
|
187
191
|
'quoteId': quoteId,
|
|
188
192
|
'settleId': undefined,
|
|
189
|
-
'type':
|
|
190
|
-
'spot':
|
|
193
|
+
'type': type,
|
|
194
|
+
'spot': type === 'spot',
|
|
191
195
|
'margin': false,
|
|
192
196
|
'swap': false,
|
|
193
197
|
'future': false,
|
|
@@ -235,13 +239,16 @@ export default class nobitex extends Exchange {
|
|
|
235
239
|
* @see https://apidocs.nobitex.ir/#6ae2dae4a2
|
|
236
240
|
* @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
|
|
237
241
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
242
|
+
* @param {string} [params.type] market type, 'spot' (default) or 'otc'; both use market/stats
|
|
238
243
|
* @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
239
244
|
*/
|
|
240
|
-
|
|
245
|
+
const type = this.safeString(params, 'type', 'spot');
|
|
246
|
+
const request = this.omit(params, ['type']);
|
|
247
|
+
await this.loadMarkets(false, { 'type': type });
|
|
241
248
|
if (symbols !== undefined) {
|
|
242
249
|
symbols = this.marketSymbols(symbols);
|
|
243
250
|
}
|
|
244
|
-
const response = await this.publicGetMarketStats();
|
|
251
|
+
const response = await this.publicGetMarketStats(request);
|
|
245
252
|
const markets = this.safeDict(response, 'stats');
|
|
246
253
|
const marketKeys = Object.keys(markets);
|
|
247
254
|
const result = {};
|
|
@@ -250,8 +257,9 @@ export default class nobitex extends Exchange {
|
|
|
250
257
|
if (markets[symbol]['isClosed']) {
|
|
251
258
|
continue;
|
|
252
259
|
}
|
|
253
|
-
markets[symbol]
|
|
254
|
-
const
|
|
260
|
+
const data = this.extend(markets[symbol], { 'symbol': symbol });
|
|
261
|
+
const market = this.parseMarket(data, type);
|
|
262
|
+
const ticker = this.parseTicker(data, market);
|
|
255
263
|
symbol = ticker['symbol'];
|
|
256
264
|
result[symbol] = ticker;
|
|
257
265
|
}
|
|
@@ -265,10 +273,12 @@ export default class nobitex extends Exchange {
|
|
|
265
273
|
* @see https://apidocs.nobitex.ir/#6ae2dae4a2
|
|
266
274
|
* @param {string} symbol unified symbol of the market to fetch the ticker for
|
|
267
275
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
276
|
+
* @param {string} [params.type] market type, 'spot' (default) or 'otc'; both use market/stats
|
|
268
277
|
* @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
269
278
|
*/
|
|
270
|
-
const
|
|
271
|
-
|
|
279
|
+
const tickers = await this.fetchTickers([symbol], params);
|
|
280
|
+
const values = Object.values(tickers);
|
|
281
|
+
return this.safeValue(values, 0);
|
|
272
282
|
}
|
|
273
283
|
parseTicker(ticker, market = undefined) {
|
|
274
284
|
// {
|
|
@@ -286,19 +296,8 @@ export default class nobitex extends Exchange {
|
|
|
286
296
|
// dayClose: "112800000000",
|
|
287
297
|
// dayChange: "0.01"
|
|
288
298
|
// }
|
|
289
|
-
|
|
290
|
-
const
|
|
291
|
-
const parts = rawSymbol.split('-');
|
|
292
|
-
const baseId = parts[0];
|
|
293
|
-
let quoteId = parts[1];
|
|
294
|
-
if (quoteId === 'rls') {
|
|
295
|
-
quoteId = 'irt';
|
|
296
|
-
}
|
|
297
|
-
const base = this.safeCurrencyCode(baseId.toUpperCase());
|
|
298
|
-
const quote = this.safeCurrencyCode(quoteId.toUpperCase());
|
|
299
|
-
const marketId = base + '/' + quote;
|
|
300
|
-
const marketinfo = this.market(marketId);
|
|
301
|
-
const symbol = this.safeSymbol(marketId, market, undefined, marketType);
|
|
299
|
+
market = (market === undefined) ? this.parseMarket(ticker) : market;
|
|
300
|
+
const symbol = market['symbol'];
|
|
302
301
|
let high = this.safeFloat(ticker, 'dayHigh');
|
|
303
302
|
let low = this.safeFloat(ticker, 'dayLow');
|
|
304
303
|
let bid = this.safeFloat(ticker, 'bestBuy');
|
|
@@ -310,7 +309,7 @@ export default class nobitex extends Exchange {
|
|
|
310
309
|
let quoteVolume = this.safeFloat(ticker, 'volumeDst');
|
|
311
310
|
const baseVolume = this.safeFloat(ticker, 'volumeSrc');
|
|
312
311
|
// adjust Nobitex IRT scaling
|
|
313
|
-
if (
|
|
312
|
+
if (market['quote'] === 'IRT') {
|
|
314
313
|
high = high ? high / 10 : 0;
|
|
315
314
|
low = low ? low / 10 : 0;
|
|
316
315
|
bid = bid ? bid / 10 : 0;
|
|
@@ -1,8 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
// PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
|
|
4
|
-
// https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
|
|
5
|
-
// EDIT THE CORRESPONDENT .ts FILE INSTEAD
|
|
6
|
-
|
|
7
|
-
export = $root;
|
|
8
|
-
declare var $root: {};
|
|
1
|
+
export = $root;
|
|
2
|
+
declare var $root: {};
|
|
@@ -1,222 +1,222 @@
|
|
|
1
|
-
export function deflate(data: any, opts: any, cb: any): () => void;
|
|
2
|
-
/**
|
|
3
|
-
* Compresses data with DEFLATE without any wrapper
|
|
4
|
-
* @param data The data to compress
|
|
5
|
-
* @param opts The compression options
|
|
6
|
-
* @returns The deflated version of the data
|
|
7
|
-
*/
|
|
8
|
-
export function deflateSync(data: any, opts: any): Uint8Array |
|
|
9
|
-
export function inflate(data: any, opts: any, cb: any): () => void;
|
|
10
|
-
/**
|
|
11
|
-
* Expands DEFLATE data with no wrapper
|
|
12
|
-
* @param data The data to decompress
|
|
13
|
-
* @param out Where to write the data. Saves memory if you know the decompressed size and provide an output buffer of that length.
|
|
14
|
-
* @returns The decompressed version of the data
|
|
15
|
-
*/
|
|
16
|
-
export function inflateSync(data: any, out?: any): any;
|
|
17
|
-
export function gzip(data: any, opts: any, cb: any): () => void;
|
|
18
|
-
/**
|
|
19
|
-
* Compresses data with GZIP
|
|
20
|
-
* @param data The data to compress
|
|
21
|
-
* @param opts The compression options
|
|
22
|
-
* @returns The gzipped version of the data
|
|
23
|
-
*/
|
|
24
|
-
export function gzipSync(data: any, opts: any): Uint8Array |
|
|
25
|
-
export function gunzip(data: any, opts: any, cb: any): () => void;
|
|
26
|
-
/**
|
|
27
|
-
* Expands GZIP data
|
|
28
|
-
* @param data The data to decompress
|
|
29
|
-
* @param out Where to write the data. GZIP already encodes the output size, so providing this doesn't save memory.
|
|
30
|
-
* @returns The decompressed version of the data
|
|
31
|
-
*/
|
|
32
|
-
export function gunzipSync(data: any, out?: any): any;
|
|
33
|
-
export function zlib(data: any, opts: any, cb: any): () => void;
|
|
34
|
-
/**
|
|
35
|
-
* Compress data with Zlib
|
|
36
|
-
* @param data The data to compress
|
|
37
|
-
* @param opts The compression options
|
|
38
|
-
* @returns The zlib-compressed version of the data
|
|
39
|
-
*/
|
|
40
|
-
export function zlibSync(data: any, opts: any): Uint8Array |
|
|
41
|
-
export function unzlib(data: any, opts: any, cb: any): () => void;
|
|
42
|
-
/**
|
|
43
|
-
* Expands Zlib data
|
|
44
|
-
* @param data The data to decompress
|
|
45
|
-
* @param out Where to write the data. Saves memory if you know the decompressed size and provide an output buffer of that length.
|
|
46
|
-
* @returns The decompressed version of the data
|
|
47
|
-
*/
|
|
48
|
-
export function unzlibSync(data: any, out: any): any;
|
|
49
|
-
export function decompress(data: any, opts: any, cb: any): () => void;
|
|
50
|
-
/**
|
|
51
|
-
* Expands compressed GZIP, Zlib, or raw DEFLATE data, automatically detecting the format
|
|
52
|
-
* @param data The data to decompress
|
|
53
|
-
* @param out Where to write the data. Saves memory if you know the decompressed size and provide an output buffer of that length.
|
|
54
|
-
* @returns The decompressed version of the data
|
|
55
|
-
*/
|
|
56
|
-
export function decompressSync(data: any, out: any): any;
|
|
57
|
-
/**
|
|
58
|
-
* Converts a string into a Uint8Array for use with compression/decompression methods
|
|
59
|
-
* @param str The string to encode
|
|
60
|
-
* @param latin1 Whether or not to interpret the data as Latin-1. This should
|
|
61
|
-
* not need to be true unless decoding a binary string.
|
|
62
|
-
* @returns The string encoded in UTF-8/Latin-1 binary
|
|
63
|
-
*/
|
|
64
|
-
export function strToU8(str: any, latin1: any): Uint8Array |
|
|
65
|
-
/**
|
|
66
|
-
* Converts a Uint8Array to a string
|
|
67
|
-
* @param dat The data to decode to string
|
|
68
|
-
* @param latin1 Whether or not to interpret the data as Latin-1. This should
|
|
69
|
-
* not need to be true unless encoding to binary string.
|
|
70
|
-
* @returns The original UTF-8/Latin-1 string
|
|
71
|
-
*/
|
|
72
|
-
export function strFromU8(dat: any, latin1: any): string | Uint8Array |
|
|
73
|
-
export function zip(data: any, opts: any, cb: any): () => void;
|
|
74
|
-
/**
|
|
75
|
-
* Synchronously creates a ZIP file. Prefer using `zip` for better performance
|
|
76
|
-
* with more than one file.
|
|
77
|
-
* @param data The directory structure for the ZIP archive
|
|
78
|
-
* @param opts The main options, merged with per-file options
|
|
79
|
-
* @returns The generated ZIP archive
|
|
80
|
-
*/
|
|
81
|
-
export function zipSync(data: any, opts: any): Uint8Array;
|
|
82
|
-
export function unzip(data: any, opts: any, cb: any): () => void;
|
|
83
|
-
/**
|
|
84
|
-
* Synchronously decompresses a ZIP archive. Prefer using `unzip` for better
|
|
85
|
-
* performance with more than one file.
|
|
86
|
-
* @param data The raw compressed ZIP file
|
|
87
|
-
* @param opts The ZIP extraction options
|
|
88
|
-
* @returns The decompressed files
|
|
89
|
-
*/
|
|
90
|
-
export function unzipSync(data: any, opts: any): {};
|
|
91
|
-
export namespace FlateErrorCode {
|
|
92
|
-
const UnexpectedEOF: number;
|
|
93
|
-
const InvalidBlockType: number;
|
|
94
|
-
const InvalidLengthLiteral: number;
|
|
95
|
-
const InvalidDistance: number;
|
|
96
|
-
const StreamFinished: number;
|
|
97
|
-
const NoStreamHandler: number;
|
|
98
|
-
const InvalidHeader: number;
|
|
99
|
-
const NoCallback: number;
|
|
100
|
-
const InvalidUTF8: number;
|
|
101
|
-
const ExtraFieldTooLong: number;
|
|
102
|
-
const InvalidDate: number;
|
|
103
|
-
const FilenameTooLong: number;
|
|
104
|
-
const StreamFinishing: number;
|
|
105
|
-
const InvalidZipData: number;
|
|
106
|
-
const UnknownCompressionMethod: number;
|
|
107
|
-
}
|
|
108
|
-
/**
|
|
109
|
-
* Streaming DEFLATE compression
|
|
110
|
-
* @type Class
|
|
111
|
-
*/
|
|
112
|
-
export var Deflate: Class;
|
|
113
|
-
/**
|
|
114
|
-
* Asynchronous streaming DEFLATE compression
|
|
115
|
-
* @type Class
|
|
116
|
-
*/
|
|
117
|
-
export var AsyncDeflate: Class;
|
|
118
|
-
/**
|
|
119
|
-
* Streaming DEFLATE decompression
|
|
120
|
-
* @type Class
|
|
121
|
-
*/
|
|
122
|
-
export var Inflate: Class;
|
|
123
|
-
/**
|
|
124
|
-
* @type Class
|
|
125
|
-
* Asynchronous streaming DEFLATE decompression
|
|
126
|
-
*/
|
|
127
|
-
export var AsyncInflate: Class;
|
|
128
|
-
/**
|
|
129
|
-
* Streaming GZIP compression
|
|
130
|
-
* @type Class
|
|
131
|
-
*/
|
|
132
|
-
export var Gzip: Class;
|
|
133
|
-
export function AsyncGzip(opts: any, cb: any): void;
|
|
134
|
-
/**
|
|
135
|
-
* Streaming GZIP decompression
|
|
136
|
-
* @type Class
|
|
137
|
-
*/
|
|
138
|
-
export var Gunzip: Class;
|
|
139
|
-
/**
|
|
140
|
-
* @type Class
|
|
141
|
-
* Asynchronous streaming GZIP decompression
|
|
142
|
-
*/
|
|
143
|
-
export var AsyncGunzip: Class;
|
|
144
|
-
/**
|
|
145
|
-
* @type Class
|
|
146
|
-
* Streaming Zlib compression
|
|
147
|
-
*/
|
|
148
|
-
export var Zlib: Class;
|
|
149
|
-
export function AsyncZlib(opts: any, cb: any): void;
|
|
150
|
-
/**
|
|
151
|
-
* Streaming Zlib decompression
|
|
152
|
-
* @type Class
|
|
153
|
-
*/
|
|
154
|
-
export var Unzlib: Class;
|
|
155
|
-
/**
|
|
156
|
-
* @type Class
|
|
157
|
-
* Asynchronous streaming Zlib decompression
|
|
158
|
-
*/
|
|
159
|
-
export var AsyncUnzlib: Class;
|
|
160
|
-
/**
|
|
161
|
-
* @type Class
|
|
162
|
-
* Streaming GZIP, Zlib, or raw DEFLATE decompression
|
|
163
|
-
*/
|
|
164
|
-
export var Decompress: Class;
|
|
165
|
-
/**
|
|
166
|
-
* Asynchronous streaming GZIP, Zlib, or raw DEFLATE decompression
|
|
167
|
-
* @type Class
|
|
168
|
-
*/
|
|
169
|
-
export var AsyncDecompress: Class;
|
|
170
|
-
/**
|
|
171
|
-
* @type Class
|
|
172
|
-
* Streaming UTF-8 decoding
|
|
173
|
-
*/
|
|
174
|
-
export var DecodeUTF8: Class;
|
|
175
|
-
/**
|
|
176
|
-
* Streaming UTF-8 encoding
|
|
177
|
-
* @type Class
|
|
178
|
-
*/
|
|
179
|
-
export var EncodeUTF8: Class;
|
|
180
|
-
/**
|
|
181
|
-
* A pass-through stream to keep data uncompressed in a ZIP archive.
|
|
182
|
-
* @type Class
|
|
183
|
-
*/
|
|
184
|
-
export var ZipPassThrough: Class;
|
|
185
|
-
/**
|
|
186
|
-
* Streaming DEFLATE compression for ZIP archives. Prefer using AsyncZipDeflate
|
|
187
|
-
* for better performance
|
|
188
|
-
* @type Class
|
|
189
|
-
*/
|
|
190
|
-
export var ZipDeflate: Class;
|
|
191
|
-
/**
|
|
192
|
-
* Asynchronous streaming DEFLATE compression for ZIP archives
|
|
193
|
-
* @type Class
|
|
194
|
-
*/
|
|
195
|
-
export var AsyncZipDeflate: Class;
|
|
196
|
-
/**
|
|
197
|
-
* A zippable archive to which files can incrementally be added
|
|
198
|
-
* @type Class
|
|
199
|
-
*/
|
|
200
|
-
export var Zip: Class;
|
|
201
|
-
/**
|
|
202
|
-
* Streaming pass-through decompression for ZIP archives
|
|
203
|
-
* @type Class
|
|
204
|
-
*/
|
|
205
|
-
export var UnzipPassThrough: Class;
|
|
206
|
-
/**
|
|
207
|
-
* Streaming DEFLATE decompression for ZIP archives. Prefer AsyncZipInflate for
|
|
208
|
-
* better performance.
|
|
209
|
-
* @type Class
|
|
210
|
-
*/
|
|
211
|
-
export var UnzipInflate: Class;
|
|
212
|
-
/**
|
|
213
|
-
* @type Class
|
|
214
|
-
* Asynchronous streaming DEFLATE decompression for ZIP archives
|
|
215
|
-
*/
|
|
216
|
-
export var AsyncUnzipInflate: Class;
|
|
217
|
-
/**
|
|
218
|
-
* A ZIP archive decompression stream that emits files as they are discovered
|
|
219
|
-
* @type Class
|
|
220
|
-
*/
|
|
221
|
-
export var Unzip: Class;
|
|
222
|
-
export { gzip as compress, AsyncGzip as AsyncCompress, gzipSync as compressSync, Gzip as Compress };
|
|
1
|
+
export function deflate(data: any, opts: any, cb: any): () => void;
|
|
2
|
+
/**
|
|
3
|
+
* Compresses data with DEFLATE without any wrapper
|
|
4
|
+
* @param data The data to compress
|
|
5
|
+
* @param opts The compression options
|
|
6
|
+
* @returns The deflated version of the data
|
|
7
|
+
*/
|
|
8
|
+
export function deflateSync(data: any, opts: any): Uint8Array | Uint32Array | Uint16Array;
|
|
9
|
+
export function inflate(data: any, opts: any, cb: any): () => void;
|
|
10
|
+
/**
|
|
11
|
+
* Expands DEFLATE data with no wrapper
|
|
12
|
+
* @param data The data to decompress
|
|
13
|
+
* @param out Where to write the data. Saves memory if you know the decompressed size and provide an output buffer of that length.
|
|
14
|
+
* @returns The decompressed version of the data
|
|
15
|
+
*/
|
|
16
|
+
export function inflateSync(data: any, out?: any): any;
|
|
17
|
+
export function gzip(data: any, opts: any, cb: any): () => void;
|
|
18
|
+
/**
|
|
19
|
+
* Compresses data with GZIP
|
|
20
|
+
* @param data The data to compress
|
|
21
|
+
* @param opts The compression options
|
|
22
|
+
* @returns The gzipped version of the data
|
|
23
|
+
*/
|
|
24
|
+
export function gzipSync(data: any, opts: any): Uint8Array | Uint32Array | Uint16Array;
|
|
25
|
+
export function gunzip(data: any, opts: any, cb: any): () => void;
|
|
26
|
+
/**
|
|
27
|
+
* Expands GZIP data
|
|
28
|
+
* @param data The data to decompress
|
|
29
|
+
* @param out Where to write the data. GZIP already encodes the output size, so providing this doesn't save memory.
|
|
30
|
+
* @returns The decompressed version of the data
|
|
31
|
+
*/
|
|
32
|
+
export function gunzipSync(data: any, out?: any): any;
|
|
33
|
+
export function zlib(data: any, opts: any, cb: any): () => void;
|
|
34
|
+
/**
|
|
35
|
+
* Compress data with Zlib
|
|
36
|
+
* @param data The data to compress
|
|
37
|
+
* @param opts The compression options
|
|
38
|
+
* @returns The zlib-compressed version of the data
|
|
39
|
+
*/
|
|
40
|
+
export function zlibSync(data: any, opts: any): Uint8Array | Uint32Array | Uint16Array;
|
|
41
|
+
export function unzlib(data: any, opts: any, cb: any): () => void;
|
|
42
|
+
/**
|
|
43
|
+
* Expands Zlib data
|
|
44
|
+
* @param data The data to decompress
|
|
45
|
+
* @param out Where to write the data. Saves memory if you know the decompressed size and provide an output buffer of that length.
|
|
46
|
+
* @returns The decompressed version of the data
|
|
47
|
+
*/
|
|
48
|
+
export function unzlibSync(data: any, out: any): any;
|
|
49
|
+
export function decompress(data: any, opts: any, cb: any): () => void;
|
|
50
|
+
/**
|
|
51
|
+
* Expands compressed GZIP, Zlib, or raw DEFLATE data, automatically detecting the format
|
|
52
|
+
* @param data The data to decompress
|
|
53
|
+
* @param out Where to write the data. Saves memory if you know the decompressed size and provide an output buffer of that length.
|
|
54
|
+
* @returns The decompressed version of the data
|
|
55
|
+
*/
|
|
56
|
+
export function decompressSync(data: any, out: any): any;
|
|
57
|
+
/**
|
|
58
|
+
* Converts a string into a Uint8Array for use with compression/decompression methods
|
|
59
|
+
* @param str The string to encode
|
|
60
|
+
* @param latin1 Whether or not to interpret the data as Latin-1. This should
|
|
61
|
+
* not need to be true unless decoding a binary string.
|
|
62
|
+
* @returns The string encoded in UTF-8/Latin-1 binary
|
|
63
|
+
*/
|
|
64
|
+
export function strToU8(str: any, latin1: any): Uint8Array | Uint32Array | Uint16Array;
|
|
65
|
+
/**
|
|
66
|
+
* Converts a Uint8Array to a string
|
|
67
|
+
* @param dat The data to decode to string
|
|
68
|
+
* @param latin1 Whether or not to interpret the data as Latin-1. This should
|
|
69
|
+
* not need to be true unless encoding to binary string.
|
|
70
|
+
* @returns The original UTF-8/Latin-1 string
|
|
71
|
+
*/
|
|
72
|
+
export function strFromU8(dat: any, latin1: any): string | Uint8Array | Uint32Array | Uint16Array;
|
|
73
|
+
export function zip(data: any, opts: any, cb: any): () => void;
|
|
74
|
+
/**
|
|
75
|
+
* Synchronously creates a ZIP file. Prefer using `zip` for better performance
|
|
76
|
+
* with more than one file.
|
|
77
|
+
* @param data The directory structure for the ZIP archive
|
|
78
|
+
* @param opts The main options, merged with per-file options
|
|
79
|
+
* @returns The generated ZIP archive
|
|
80
|
+
*/
|
|
81
|
+
export function zipSync(data: any, opts: any): Uint8Array;
|
|
82
|
+
export function unzip(data: any, opts: any, cb: any): () => void;
|
|
83
|
+
/**
|
|
84
|
+
* Synchronously decompresses a ZIP archive. Prefer using `unzip` for better
|
|
85
|
+
* performance with more than one file.
|
|
86
|
+
* @param data The raw compressed ZIP file
|
|
87
|
+
* @param opts The ZIP extraction options
|
|
88
|
+
* @returns The decompressed files
|
|
89
|
+
*/
|
|
90
|
+
export function unzipSync(data: any, opts: any): {};
|
|
91
|
+
export namespace FlateErrorCode {
|
|
92
|
+
const UnexpectedEOF: number;
|
|
93
|
+
const InvalidBlockType: number;
|
|
94
|
+
const InvalidLengthLiteral: number;
|
|
95
|
+
const InvalidDistance: number;
|
|
96
|
+
const StreamFinished: number;
|
|
97
|
+
const NoStreamHandler: number;
|
|
98
|
+
const InvalidHeader: number;
|
|
99
|
+
const NoCallback: number;
|
|
100
|
+
const InvalidUTF8: number;
|
|
101
|
+
const ExtraFieldTooLong: number;
|
|
102
|
+
const InvalidDate: number;
|
|
103
|
+
const FilenameTooLong: number;
|
|
104
|
+
const StreamFinishing: number;
|
|
105
|
+
const InvalidZipData: number;
|
|
106
|
+
const UnknownCompressionMethod: number;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Streaming DEFLATE compression
|
|
110
|
+
* @type Class
|
|
111
|
+
*/
|
|
112
|
+
export var Deflate: Class;
|
|
113
|
+
/**
|
|
114
|
+
* Asynchronous streaming DEFLATE compression
|
|
115
|
+
* @type Class
|
|
116
|
+
*/
|
|
117
|
+
export var AsyncDeflate: Class;
|
|
118
|
+
/**
|
|
119
|
+
* Streaming DEFLATE decompression
|
|
120
|
+
* @type Class
|
|
121
|
+
*/
|
|
122
|
+
export var Inflate: Class;
|
|
123
|
+
/**
|
|
124
|
+
* @type Class
|
|
125
|
+
* Asynchronous streaming DEFLATE decompression
|
|
126
|
+
*/
|
|
127
|
+
export var AsyncInflate: Class;
|
|
128
|
+
/**
|
|
129
|
+
* Streaming GZIP compression
|
|
130
|
+
* @type Class
|
|
131
|
+
*/
|
|
132
|
+
export var Gzip: Class;
|
|
133
|
+
export function AsyncGzip(opts: any, cb: any): void;
|
|
134
|
+
/**
|
|
135
|
+
* Streaming GZIP decompression
|
|
136
|
+
* @type Class
|
|
137
|
+
*/
|
|
138
|
+
export var Gunzip: Class;
|
|
139
|
+
/**
|
|
140
|
+
* @type Class
|
|
141
|
+
* Asynchronous streaming GZIP decompression
|
|
142
|
+
*/
|
|
143
|
+
export var AsyncGunzip: Class;
|
|
144
|
+
/**
|
|
145
|
+
* @type Class
|
|
146
|
+
* Streaming Zlib compression
|
|
147
|
+
*/
|
|
148
|
+
export var Zlib: Class;
|
|
149
|
+
export function AsyncZlib(opts: any, cb: any): void;
|
|
150
|
+
/**
|
|
151
|
+
* Streaming Zlib decompression
|
|
152
|
+
* @type Class
|
|
153
|
+
*/
|
|
154
|
+
export var Unzlib: Class;
|
|
155
|
+
/**
|
|
156
|
+
* @type Class
|
|
157
|
+
* Asynchronous streaming Zlib decompression
|
|
158
|
+
*/
|
|
159
|
+
export var AsyncUnzlib: Class;
|
|
160
|
+
/**
|
|
161
|
+
* @type Class
|
|
162
|
+
* Streaming GZIP, Zlib, or raw DEFLATE decompression
|
|
163
|
+
*/
|
|
164
|
+
export var Decompress: Class;
|
|
165
|
+
/**
|
|
166
|
+
* Asynchronous streaming GZIP, Zlib, or raw DEFLATE decompression
|
|
167
|
+
* @type Class
|
|
168
|
+
*/
|
|
169
|
+
export var AsyncDecompress: Class;
|
|
170
|
+
/**
|
|
171
|
+
* @type Class
|
|
172
|
+
* Streaming UTF-8 decoding
|
|
173
|
+
*/
|
|
174
|
+
export var DecodeUTF8: Class;
|
|
175
|
+
/**
|
|
176
|
+
* Streaming UTF-8 encoding
|
|
177
|
+
* @type Class
|
|
178
|
+
*/
|
|
179
|
+
export var EncodeUTF8: Class;
|
|
180
|
+
/**
|
|
181
|
+
* A pass-through stream to keep data uncompressed in a ZIP archive.
|
|
182
|
+
* @type Class
|
|
183
|
+
*/
|
|
184
|
+
export var ZipPassThrough: Class;
|
|
185
|
+
/**
|
|
186
|
+
* Streaming DEFLATE compression for ZIP archives. Prefer using AsyncZipDeflate
|
|
187
|
+
* for better performance
|
|
188
|
+
* @type Class
|
|
189
|
+
*/
|
|
190
|
+
export var ZipDeflate: Class;
|
|
191
|
+
/**
|
|
192
|
+
* Asynchronous streaming DEFLATE compression for ZIP archives
|
|
193
|
+
* @type Class
|
|
194
|
+
*/
|
|
195
|
+
export var AsyncZipDeflate: Class;
|
|
196
|
+
/**
|
|
197
|
+
* A zippable archive to which files can incrementally be added
|
|
198
|
+
* @type Class
|
|
199
|
+
*/
|
|
200
|
+
export var Zip: Class;
|
|
201
|
+
/**
|
|
202
|
+
* Streaming pass-through decompression for ZIP archives
|
|
203
|
+
* @type Class
|
|
204
|
+
*/
|
|
205
|
+
export var UnzipPassThrough: Class;
|
|
206
|
+
/**
|
|
207
|
+
* Streaming DEFLATE decompression for ZIP archives. Prefer AsyncZipInflate for
|
|
208
|
+
* better performance.
|
|
209
|
+
* @type Class
|
|
210
|
+
*/
|
|
211
|
+
export var UnzipInflate: Class;
|
|
212
|
+
/**
|
|
213
|
+
* @type Class
|
|
214
|
+
* Asynchronous streaming DEFLATE decompression for ZIP archives
|
|
215
|
+
*/
|
|
216
|
+
export var AsyncUnzipInflate: Class;
|
|
217
|
+
/**
|
|
218
|
+
* A ZIP archive decompression stream that emits files as they are discovered
|
|
219
|
+
* @type Class
|
|
220
|
+
*/
|
|
221
|
+
export var Unzip: Class;
|
|
222
|
+
export { gzip as compress, AsyncGzip as AsyncCompress, gzipSync as compressSync, Gzip as Compress };
|