@openzim/libzim
Advanced tools
+8
-0
@@ -185,2 +185,10 @@ export class IntegrityCheck { | ||
| get hasNewNamespaceScheme(): boolean; | ||
| getClusterCacheMaxSize(): number; | ||
| getClusterCacheCurrentSize(): number; | ||
| setClusterCacheMaxSize(nbClusters: number): void; | ||
| getDirentCacheMaxSize(): number; | ||
| getDirentCacheCurrentSize(): number; | ||
| setDirentCacheMaxSize(nbDirents: number): void; | ||
| getDirentLookupCacheMaxSize(): number; | ||
| setDirentLookupCacheMaxSize(nbRanges: number): void; | ||
@@ -187,0 +195,0 @@ static validate(zimPath: string, checksToRun: symbol[]): boolean; // list of IntegrityCheck |
+1
-1
@@ -5,3 +5,3 @@ { | ||
| "types": "dist/index.d.js", | ||
| "version": "3.3.0", | ||
| "version": "3.4.0", | ||
| "description": "Libzim bindings for NodeJS", | ||
@@ -8,0 +8,0 @@ "type": "module", |
+95
-0
@@ -414,2 +414,81 @@ #pragma once | ||
| Napi::Value getClusterCacheMaxSize(const Napi::CallbackInfo &info) { | ||
| try { | ||
| return Napi::Value::From(info.Env(), archive_->getClusterCacheMaxSize()); | ||
| } catch (const std::exception &err) { | ||
| throw Napi::Error::New(info.Env(), err.what()); | ||
| } | ||
| } | ||
| Napi::Value getClusterCacheCurrentSize(const Napi::CallbackInfo &info) { | ||
| try { | ||
| return Napi::Value::From(info.Env(), | ||
| archive_->getClusterCacheCurrentSize()); | ||
| } catch (const std::exception &err) { | ||
| throw Napi::Error::New(info.Env(), err.what()); | ||
| } | ||
| } | ||
| void setClusterCacheMaxSize(const Napi::CallbackInfo &info) { | ||
| try { | ||
| if (!info[0].IsNumber()) { | ||
| throw Napi::Error::New(info.Env(), "Expected a number"); | ||
| } | ||
| auto nbClusters = info[0].As<Napi::Number>().Uint32Value(); | ||
| archive_->setClusterCacheMaxSize(nbClusters); | ||
| } catch (const std::exception &err) { | ||
| throw Napi::Error::New(info.Env(), err.what()); | ||
| } | ||
| } | ||
| Napi::Value getDirentCacheMaxSize(const Napi::CallbackInfo &info) { | ||
| try { | ||
| return Napi::Value::From(info.Env(), archive_->getDirentCacheMaxSize()); | ||
| } catch (const std::exception &err) { | ||
| throw Napi::Error::New(info.Env(), err.what()); | ||
| } | ||
| } | ||
| Napi::Value getDirentCacheCurrentSize(const Napi::CallbackInfo &info) { | ||
| try { | ||
| return Napi::Value::From(info.Env(), | ||
| archive_->getDirentCacheCurrentSize()); | ||
| } catch (const std::exception &err) { | ||
| throw Napi::Error::New(info.Env(), err.what()); | ||
| } | ||
| } | ||
| void setDirentCacheMaxSize(const Napi::CallbackInfo &info) { | ||
| try { | ||
| if (!info[0].IsNumber()) { | ||
| throw Napi::Error::New(info.Env(), "Expected a number"); | ||
| } | ||
| auto nbDirents = info[0].As<Napi::Number>().Uint32Value(); | ||
| archive_->setDirentCacheMaxSize(nbDirents); | ||
| } catch (const std::exception &err) { | ||
| throw Napi::Error::New(info.Env(), err.what()); | ||
| } | ||
| } | ||
| Napi::Value getDirentLookupCacheMaxSize(const Napi::CallbackInfo &info) { | ||
| try { | ||
| return Napi::Value::From(info.Env(), | ||
| archive_->getDirentLookupCacheMaxSize()); | ||
| } catch (const std::exception &err) { | ||
| throw Napi::Error::New(info.Env(), err.what()); | ||
| } | ||
| } | ||
| void setDirentLookupCacheMaxSize(const Napi::CallbackInfo &info) { | ||
| try { | ||
| if (!info[0].IsNumber()) { | ||
| throw Napi::Error::New(info.Env(), "Expected a number"); | ||
| } | ||
| auto nbRanges = info[0].As<Napi::Number>().Uint32Value(); | ||
| archive_->setDirentLookupCacheMaxSize(nbRanges); | ||
| } catch (const std::exception &err) { | ||
| throw Napi::Error::New(info.Env(), err.what()); | ||
| } | ||
| } | ||
| static Napi::Value validate(const Napi::CallbackInfo &info) { | ||
@@ -489,2 +568,18 @@ Napi::Env env = info.Env(); | ||
| InstanceMethod<&Archive::checkIntegrity>("checkIntegrity"), | ||
| InstanceMethod<&Archive::getClusterCacheMaxSize>( | ||
| "getClusterCacheMaxSize"), | ||
| InstanceMethod<&Archive::getClusterCacheCurrentSize>( | ||
| "getClusterCacheCurrentSize"), | ||
| InstanceMethod<&Archive::setClusterCacheMaxSize>( | ||
| "setClusterCacheMaxSize"), | ||
| InstanceMethod<&Archive::getDirentCacheMaxSize>( | ||
| "getDirentCacheMaxSize"), | ||
| InstanceMethod<&Archive::getDirentCacheCurrentSize>( | ||
| "getDirentCacheCurrentSize"), | ||
| InstanceMethod<&Archive::setDirentCacheMaxSize>( | ||
| "setDirentCacheMaxSize"), | ||
| InstanceMethod<&Archive::getDirentLookupCacheMaxSize>( | ||
| "getDirentLookupCacheMaxSize"), | ||
| InstanceMethod<&Archive::setDirentLookupCacheMaxSize>( | ||
| "setDirentLookupCacheMaxSize"), | ||
| InstanceAccessor<&Archive::isMultiPart>("isMultiPart"), | ||
@@ -491,0 +586,0 @@ InstanceAccessor<&Archive::hasNewNamespaceScheme>( |
+8
-0
@@ -185,2 +185,10 @@ export class IntegrityCheck { | ||
| get hasNewNamespaceScheme(): boolean; | ||
| getClusterCacheMaxSize(): number; | ||
| getClusterCacheCurrentSize(): number; | ||
| setClusterCacheMaxSize(nbClusters: number): void; | ||
| getDirentCacheMaxSize(): number; | ||
| getDirentCacheCurrentSize(): number; | ||
| setDirentCacheMaxSize(nbDirents: number): void; | ||
| getDirentLookupCacheMaxSize(): number; | ||
| setDirentLookupCacheMaxSize(nbRanges: number): void; | ||
@@ -187,0 +195,0 @@ static validate(zimPath: string, checksToRun: symbol[]): boolean; // list of IntegrityCheck |
Sorry, the diff of this file is not supported yet
171482
2.57%660
2.48%