@types/pako
- Version 2.0.3
- Published
- 7.8 kB
- No dependencies
- MIT license
Install
npm i @types/pako
yarn add @types/pako
pnpm add @types/pako
Overview
TypeScript definitions for pako
Index
Functions
Classes
Interfaces
Enums
Type Aliases
Functions
function deflate
deflate: (data: Data | string, options?: DeflateFunctionOptions) => Uint8Array;
Compress data with deflate algorithm and options.
function deflateRaw
deflateRaw: ( data: Data | string, options?: DeflateFunctionOptions) => Uint8Array;
The same as deflate, but creates raw data, without wrapper (header and adler32 crc).
function gzip
gzip: (data: Data | string, options?: DeflateFunctionOptions) => Uint8Array;
The same as deflate, but create gzip wrapper instead of deflate one.
function inflate
inflate: { (data: Data, options: InflateFunctionOptions & { to: 'string' }): string; (data: Data, options?: InflateFunctionOptions): Uint8Array;};
Decompress data with inflate/ungzip and options. Autodetect format via wrapper header by default. That's why we don't provide separate ungzip method.
function inflateRaw
inflateRaw: { (data: Data, options: InflateFunctionOptions & { to: 'string' }): string; (data: Data, options?: InflateFunctionOptions): Uint8Array;};
The same as inflate, but creates raw data, without wrapper (header and adler32 crc).
function ungzip
ungzip: { (data: Data, options: InflateFunctionOptions & { to: 'string' }): string; (data: Data, options?: InflateFunctionOptions): Uint8Array;};
Just shortcut to inflate, because it autodetects format by header.content. Done for convenience.
Classes
class Deflate
class Deflate {}
constructor
constructor(options?: DeflateOptions);
property err
err: ReturnCodes;
property msg
msg: string;
property result
result: Uint8Array;
method onData
onData: (chunk: Data) => void;
method onEnd
onEnd: (status: number) => void;
method push
push: (data: Data | string, mode?: FlushValues | boolean) => boolean;
class Inflate
class Inflate {}
constructor
constructor(options?: InflateOptions);
property err
err: ReturnCodes;
property header
header?: Header;
property msg
msg: string;
property result
result: string | Uint8Array;
method onData
onData: (chunk: Data) => void;
method onEnd
onEnd: (status: number) => void;
method push
push: (data: Data, mode?: FlushValues | boolean) => boolean;
Interfaces
interface DeflateFunctionOptions
interface DeflateFunctionOptions {}
property dictionary
dictionary?: any;
property level
level?: -1 | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | undefined;
property memLevel
memLevel?: number | undefined;
property raw
raw?: boolean | undefined;
property strategy
strategy?: StrategyValues | undefined;
property windowBits
windowBits?: number | undefined;
interface DeflateOptions
interface DeflateOptions {}
property chunkSize
chunkSize?: number | undefined;
property dictionary
dictionary?: any;
property gzip
gzip?: boolean | undefined;
property header
header?: Header | undefined;
property level
level?: -1 | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | undefined;
property memLevel
memLevel?: number | undefined;
property raw
raw?: boolean | undefined;
property strategy
strategy?: StrategyValues | undefined;
property windowBits
windowBits?: number | undefined;
interface Header
interface Header {}
interface InflateFunctionOptions
interface InflateFunctionOptions {}
property raw
raw?: boolean | undefined;
property to
to?: 'string' | undefined;
property windowBits
windowBits?: number | undefined;
interface InflateOptions
interface InflateOptions {}
property chunkSize
chunkSize?: number | undefined;
property dictionary
dictionary?: any;
property raw
raw?: boolean | undefined;
property to
to?: 'string' | undefined;
property windowBits
windowBits?: number | undefined;
Enums
enum constants
enum constants { Z_NO_FLUSH = 0, Z_PARTIAL_FLUSH = 1, Z_SYNC_FLUSH = 2, Z_FULL_FLUSH = 3, Z_FINISH = 4, Z_BLOCK = 5, Z_TREES = 6, Z_FILTERED = 1, Z_HUFFMAN_ONLY = 2, Z_RLE = 3, Z_FIXED = 4, Z_DEFAULT_STRATEGY = 0, Z_OK = 0, Z_STREAM_END = 1, Z_NEED_DICT = 2, Z_ERRNO = -1, Z_STREAM_ERROR = -2, Z_DATA_ERROR = -3, Z_BUF_ERROR = -5,}
member Z_BLOCK
Z_BLOCK = 5
member Z_BUF_ERROR
Z_BUF_ERROR = -5
member Z_DATA_ERROR
Z_DATA_ERROR = -3
member Z_DEFAULT_STRATEGY
Z_DEFAULT_STRATEGY = 0
member Z_ERRNO
Z_ERRNO = -1
member Z_FILTERED
Z_FILTERED = 1
member Z_FINISH
Z_FINISH = 4
member Z_FIXED
Z_FIXED = 4
member Z_FULL_FLUSH
Z_FULL_FLUSH = 3
member Z_HUFFMAN_ONLY
Z_HUFFMAN_ONLY = 2
member Z_NEED_DICT
Z_NEED_DICT = 2
member Z_NO_FLUSH
Z_NO_FLUSH = 0
member Z_OK
Z_OK = 0
member Z_PARTIAL_FLUSH
Z_PARTIAL_FLUSH = 1
member Z_RLE
Z_RLE = 3
member Z_STREAM_END
Z_STREAM_END = 1
member Z_STREAM_ERROR
Z_STREAM_ERROR = -2
member Z_SYNC_FLUSH
Z_SYNC_FLUSH = 2
member Z_TREES
Z_TREES = 6
Type Aliases
type Data
type Data = Uint8Array | ArrayBuffer;
type FlushValues
type FlushValues = | constants.Z_NO_FLUSH | constants.Z_PARTIAL_FLUSH | constants.Z_SYNC_FLUSH | constants.Z_FINISH | constants.Z_BLOCK | constants.Z_TREES;
type ReturnCodes
type ReturnCodes = | constants.Z_OK | constants.Z_STREAM_END | constants.Z_NEED_DICT | constants.Z_ERRNO | constants.Z_STREAM_ERROR | constants.Z_DATA_ERROR | constants.Z_BUF_ERROR | constants.Z_DEFAULT_STRATEGY;
type StrategyValues
type StrategyValues = | constants.Z_FILTERED | constants.Z_HUFFMAN_ONLY | constants.Z_RLE | constants.Z_FIXED | constants.Z_DEFAULT_STRATEGY;
Package Files (1)
Dependencies (0)
No dependencies.
Dev Dependencies (0)
No dev dependencies.
Peer Dependencies (0)
No peer dependencies.
Badge
To add a badge like this oneto your package's README, use the codes available below.
You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@types/pako
.
- Markdown[![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/@types/pako)
- HTML<a href="https://www.jsdocs.io/package/@types/pako"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>
- Updated .
Package analyzed in 4266 ms. - Missing or incorrect documentation? Open an issue for this package.