@alizarin/napi 2.0.0-alpha.94 → 2.0.0-alpha.95
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/{alizarin-napi-2.0.0-alpha.94.tgz → alizarin-napi-2.0.0-alpha.95.tgz} +0 -0
- package/alizarin-napi.darwin-arm64.node +0 -0
- package/alizarin-napi.darwin-x64.node +0 -0
- package/alizarin-napi.linux-x64-gnu.node +0 -0
- package/alizarin-napi.win32-x64-msvc.node +0 -0
- package/index.d.ts +4 -0
- package/package.json +4 -4
- package/src/lib.rs +16 -0
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/index.d.ts
CHANGED
|
@@ -402,4 +402,8 @@ export declare class NapiStaticResourceRegistry {
|
|
|
402
402
|
getFull(resourceId: string): any | null
|
|
403
403
|
/** Get a summary for a resource (works for both summary and full entries), or null if unknown. */
|
|
404
404
|
getSummary(resourceId: string): any | null
|
|
405
|
+
/** Get diagnostic stats about registry contents (entry counts, tile counts, etc.) */
|
|
406
|
+
memoryStats(): any
|
|
407
|
+
/** Get detailed stats including estimated byte sizes (expensive — re-serializes all data) */
|
|
408
|
+
memoryStatsDetailed(): any
|
|
405
409
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alizarin/napi",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.95",
|
|
4
4
|
"license": "AGPL-3.0-or-later",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -30,8 +30,8 @@
|
|
|
30
30
|
"@napi-rs/cli": "^2.18.0"
|
|
31
31
|
},
|
|
32
32
|
"optionalDependencies": {
|
|
33
|
-
"@alizarin/napi-win32-x64-msvc": "2.0.0-alpha.
|
|
34
|
-
"@alizarin/napi-darwin-x64": "2.0.0-alpha.
|
|
35
|
-
"@alizarin/napi-linux-x64-gnu": "2.0.0-alpha.
|
|
33
|
+
"@alizarin/napi-win32-x64-msvc": "2.0.0-alpha.95",
|
|
34
|
+
"@alizarin/napi-darwin-x64": "2.0.0-alpha.95",
|
|
35
|
+
"@alizarin/napi-linux-x64-gnu": "2.0.0-alpha.95"
|
|
36
36
|
}
|
|
37
37
|
}
|
package/src/lib.rs
CHANGED
|
@@ -381,6 +381,22 @@ impl NapiStaticResourceRegistry {
|
|
|
381
381
|
None => Ok(None),
|
|
382
382
|
}
|
|
383
383
|
}
|
|
384
|
+
|
|
385
|
+
/// Get diagnostic stats about registry contents (entry counts, tile counts, etc.)
|
|
386
|
+
#[napi]
|
|
387
|
+
pub fn memory_stats(&self) -> Result<serde_json::Value> {
|
|
388
|
+
let stats = self.inner.memory_stats();
|
|
389
|
+
serde_json::to_value(&stats)
|
|
390
|
+
.map_err(|e| napi::Error::from_reason(format!("Serialization failed: {}", e)))
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
/// Get detailed stats including estimated byte sizes (expensive — re-serializes all data)
|
|
394
|
+
#[napi]
|
|
395
|
+
pub fn memory_stats_detailed(&self) -> Result<serde_json::Value> {
|
|
396
|
+
let stats = self.inner.memory_stats_detailed();
|
|
397
|
+
serde_json::to_value(&stats)
|
|
398
|
+
.map_err(|e| napi::Error::from_reason(format!("Serialization failed: {}", e)))
|
|
399
|
+
}
|
|
384
400
|
}
|
|
385
401
|
|
|
386
402
|
// ============================================================================
|