Comparing version
@@ -55,6 +55,20 @@ export const MAGICNUMBER: number; | ||
// 0: Return value of compressStream2/decompressStream | ||
// 1: Bytes produced to dstBuf (output.pos) | ||
// 2: Bytes consumed from srcBuf (input.pos) | ||
type StreamResult = [number, number, number]; | ||
export class CCtx { | ||
compress(dstBuf: Uint8Array, srcBuf: Uint8Array, level: number): number; | ||
compressUsingDict(dstBuf: Uint8Array, srcBuf: Uint8Array, dictBuf: Uint8Array, level: number): number; | ||
compressUsingCDict(dstBuf: Uint8Array, srcBuf: Uint8Array, dict: CDict): number; | ||
compressUsingDict( | ||
dstBuf: Uint8Array, | ||
srcBuf: Uint8Array, | ||
dictBuf: Uint8Array, | ||
level: number, | ||
): number; | ||
compressUsingCDict( | ||
dstBuf: Uint8Array, | ||
srcBuf: Uint8Array, | ||
dict: CDict, | ||
): number; | ||
setParameter(param: CParameter, value: number): void; | ||
@@ -64,2 +78,7 @@ setPledgedSrcSize(size: number): void; | ||
compress2(dstBuf: Uint8Array, srcBuf: Uint8Array): number; | ||
compressStream2( | ||
dstBuf: Uint8Array, | ||
srcBuf: Uint8Array, | ||
endOp: EndDirective, | ||
): StreamResult; | ||
loadDictionary(dictBuf: Uint8Array): void; | ||
@@ -74,4 +93,13 @@ } | ||
decompress(dstBuf: Uint8Array, srcBuf: Uint8Array): number; | ||
decompressUsingDict(dstBuf: Uint8Array, srcBuf: Uint8Array, dictBuf: Uint8Array): number; | ||
decompressUsingDDict(dstBuf: Uint8Array, srcBuf: Uint8Array, dict: DDict): number; | ||
decompressStream(dstBuf: Uint8Array, srcBuf: Uint8Array): StreamResult; | ||
decompressUsingDict( | ||
dstBuf: Uint8Array, | ||
srcBuf: Uint8Array, | ||
dictBuf: Uint8Array, | ||
): number; | ||
decompressUsingDDict( | ||
dstBuf: Uint8Array, | ||
srcBuf: Uint8Array, | ||
dict: DDict, | ||
): number; | ||
setParameter(param: DParameter, value: number): void; | ||
@@ -94,3 +122,7 @@ reset(reset: ResetDirective): void; | ||
export function versionString(): string; | ||
export function compress(dstBuf: Uint8Array, srcBuf: Uint8Array, level: number): number; | ||
export function compress( | ||
dstBuf: Uint8Array, | ||
srcBuf: Uint8Array, | ||
level: number, | ||
): number; | ||
export function decompress(dstBuf: Uint8Array, srcBuf: Uint8Array): number; | ||
@@ -104,3 +136,7 @@ export function getFrameContentSize(frameBuf: Uint8Array): number | null; | ||
export function dParamGetBounds(param: DParameter): Bounds; | ||
export function cStreamInSize(): number; | ||
export function cStreamOutSize(): number; | ||
export function dStreamInSize(): number; | ||
export function dStreamOutSize(): number; | ||
export function getDictIDFromDict(dictBuf: Uint8Array): number; | ||
export function getDictIDFromFrame(frameBuf: Uint8Array): number; |
@@ -1,4 +0,4 @@ | ||
const buildType = process.config.target_defaults ? | ||
process.config.target_defaults.default_configuration : | ||
'Release'; | ||
const buildType = process.config.target_defaults | ||
? process.config.target_defaults.default_configuration | ||
: /* istanbul ignore next */ 'Release'; | ||
module.exports = require(`./build/${buildType}/binding`); |
{ | ||
"name": "zstd-napi", | ||
"version": "0.0.4", | ||
"version": "0.0.5", | ||
"description": "zstd bindings with N-API", | ||
@@ -14,5 +14,8 @@ "repository": { | ||
"build-prebuild": "prebuild -r napi --all", | ||
"clang-format": "clang-format -i src/*", | ||
"install": "prebuild-install -r napi || node-gyp rebuild", | ||
"lint": "eslint --ext .js,.ts .", | ||
"prettier": "prettier -l --write '**/*.{js,json,ts,yml}'", | ||
"test": "jest", | ||
"test-lcov": "jest --coverage --coverageReporters=lcovonly" | ||
"test-coverage": "jest --coverage --coverageReporters=json" | ||
}, | ||
@@ -23,4 +26,10 @@ "author": "Andrew Drake <adrake@adrake.org>", | ||
"@types/jest": "^25.1.1", | ||
"@typescript-eslint/eslint-plugin": "^2.19.0", | ||
"@typescript-eslint/parser": "^2.19.0", | ||
"eslint": "^6.8.0", | ||
"eslint-config-prettier": "^6.10.0", | ||
"eslint-plugin-jest": "^23.7.0", | ||
"jest": "^25.1.0", | ||
"prebuild": "^10.0.0", | ||
"prettier": "^1.19.1", | ||
"ts-jest": "^25.1.0", | ||
@@ -27,0 +36,0 @@ "typescript": "^3.7.5" |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
1222125
0.27%134
35.35%11
120%