lzma1 0.0.1 → 0.0.2

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 CHANGED
@@ -21,6 +21,9 @@ npm install xseman/lzma1#master
21
21
 
22
22
  # latest unreleased changes
23
23
  npm install xseman/lzma1#develop
24
+
25
+ # specific tag version
26
+ npm install xseman/lzma1#0.0.1
24
27
  ```
25
28
 
26
29
  ## API
@@ -35,7 +38,7 @@ decompress(bytearray: Uint8Array): Int8Array
35
38
  Compress and decompress a string with compression level 1.
36
39
 
37
40
  ```js
38
- import { compress, decompress } from "xseman/lzma1"
41
+ import { compress, decompress } from "lzma1"
39
42
 
40
43
  const data = "Hello World!"
41
44
  const compressed = compress(data, 1)
@@ -0,0 +1,61 @@
1
+ /**
2
+ * s - dictionary size
3
+ * f - fb
4
+ * m - matchFinder
5
+ *
6
+ * NOTE: Because some values are always the same, they have been removed.
7
+ * lc is always 3
8
+ * lp is always 0
9
+ * pb is always 2
10
+ */
11
+ declare const ModeMap: {
12
+ readonly 1: {
13
+ readonly s: 16;
14
+ readonly f: 64;
15
+ readonly m: 0;
16
+ };
17
+ readonly 2: {
18
+ readonly s: 20;
19
+ readonly f: 64;
20
+ readonly m: 0;
21
+ };
22
+ readonly 3: {
23
+ readonly s: 19;
24
+ readonly f: 64;
25
+ readonly m: 1;
26
+ };
27
+ readonly 4: {
28
+ readonly s: 20;
29
+ readonly f: 64;
30
+ readonly m: 1;
31
+ };
32
+ readonly 5: {
33
+ readonly s: 21;
34
+ readonly f: 128;
35
+ readonly m: 1;
36
+ };
37
+ readonly 6: {
38
+ readonly s: 22;
39
+ readonly f: 128;
40
+ readonly m: 1;
41
+ };
42
+ readonly 7: {
43
+ readonly s: 23;
44
+ readonly f: 128;
45
+ readonly m: 1;
46
+ };
47
+ readonly 8: {
48
+ readonly s: 24;
49
+ readonly f: 255;
50
+ readonly m: 1;
51
+ };
52
+ readonly 9: {
53
+ readonly s: 25;
54
+ readonly f: 255;
55
+ readonly m: 1;
56
+ };
57
+ };
58
+ type Modes = keyof typeof ModeMap;
59
+ export declare function compress(data: string | Uint8Array | ArrayBuffer, mode?: Modes): Int8Array;
60
+ export declare function decompress(bytearray: Uint8Array | ArrayBuffer): Int8Array | string;
61
+ export {};