DefinitelyTyped

Index

Variables

Variables

LZString: LZStringStatic

LZStringStatic: LZStringStatic

LZ-based compression algorithm for JavaScript.

public compress(uncompressed: string): string

Compresses input string producing an instance of an "invalid" UTF-16 string. Such string could be stored in localStorage only on webkit browsers (tested on Android, Chrome, Safari).

Parameters

  • uncompressed: string

    A string which should be compressed.

Returns

string

public compressToBase64(uncompressed: string): string

Compresses input string producing an instance of a ASCII UTF-16 string, which represents the original string encoded in Base64. The result can be safely transported outside the browser with a guarantee that none of the characters produced need to be URL-encoded.

Parameters

  • uncompressed: string

    A string which should be compressed.

Returns

string

public compressToUTF16(uncompressed: string): string

Compresses input string producing an instance of a "valid" UTF-16 string, in the sense that all browsers can store them safely.

Parameters

  • uncompressed: string

    A string which should be compressed.

Returns

string

public decompress(compressed: string): string

Decompresses "invalid" input string created by the method compress().

Parameters

  • compressed: string

    A string obtained from a call to compress().

Returns

string

public decompressFromBase64(compressed: string): string

Decompresses ASCII UTF-16 input string created by the method compressToBase64().

Parameters

  • compressed: string

    A string obtained from a call to compressToBase64().

Returns

string

public decompressFromUTF16(compressed: string): string

Decompresses "valid" input string created by the method compressToUTF16().

Parameters

  • compressed: string

    A string obtained from a call to compressToUTF16().

Returns

string