mirror of
https://github.com/Drop-OSS/droplet.git
synced 2025-11-13 00:02:46 +10:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 4ac19b8be0 | |||
| 072a1584a0 |
1
index.d.ts
vendored
1
index.d.ts
vendored
@ -4,6 +4,7 @@
|
|||||||
/* auto-generated by NAPI-RS */
|
/* auto-generated by NAPI-RS */
|
||||||
|
|
||||||
export declare function hasBackendForPath(path: string): boolean
|
export declare function hasBackendForPath(path: string): boolean
|
||||||
|
export declare function listFiles(path: string): Array<string>
|
||||||
export declare function callAltThreadFunc(callback: (...args: any[]) => any): void
|
export declare function callAltThreadFunc(callback: (...args: any[]) => any): void
|
||||||
export declare function generateManifest(dir: string, progress: (...args: any[]) => any, log: (...args: any[]) => any, callback: (...args: any[]) => any): void
|
export declare function generateManifest(dir: string, progress: (...args: any[]) => any, log: (...args: any[]) => any, callback: (...args: any[]) => any): void
|
||||||
export declare function generateRootCa(): Array<string>
|
export declare function generateRootCa(): Array<string>
|
||||||
|
|||||||
3
index.js
3
index.js
@ -310,9 +310,10 @@ if (!nativeBinding) {
|
|||||||
throw new Error(`Failed to load native binding`)
|
throw new Error(`Failed to load native binding`)
|
||||||
}
|
}
|
||||||
|
|
||||||
const { hasBackendForPath, callAltThreadFunc, generateManifest, generateRootCa, generateClientCertificate, verifyClientCertificate, signNonce, verifyNonce } = nativeBinding
|
const { hasBackendForPath, listFiles, callAltThreadFunc, generateManifest, generateRootCa, generateClientCertificate, verifyClientCertificate, signNonce, verifyNonce } = nativeBinding
|
||||||
|
|
||||||
module.exports.hasBackendForPath = hasBackendForPath
|
module.exports.hasBackendForPath = hasBackendForPath
|
||||||
|
module.exports.listFiles = listFiles
|
||||||
module.exports.callAltThreadFunc = callAltThreadFunc
|
module.exports.callAltThreadFunc = callAltThreadFunc
|
||||||
module.exports.generateManifest = generateManifest
|
module.exports.generateManifest = generateManifest
|
||||||
module.exports.generateRootCa = generateRootCa
|
module.exports.generateRootCa = generateRootCa
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@drop-oss/droplet",
|
"name": "@drop-oss/droplet",
|
||||||
"version": "1.0.0",
|
"version": "1.1.1",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"types": "index.d.ts",
|
"types": "index.d.ts",
|
||||||
"napi": {
|
"napi": {
|
||||||
@ -42,6 +42,6 @@
|
|||||||
},
|
},
|
||||||
"packageManager": "yarn@4.7.0",
|
"packageManager": "yarn@4.7.0",
|
||||||
"repository": {
|
"repository": {
|
||||||
"url": "https://github.com/Drop-OSS/droplet"
|
"url": "git+https://github.com/Drop-OSS/droplet.git"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -110,3 +110,11 @@ pub fn has_backend_for_path(path: String) -> bool {
|
|||||||
|
|
||||||
has_backend
|
has_backend
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[napi]
|
||||||
|
pub fn list_files(path: String) -> Vec<String> {
|
||||||
|
let path = Path::new(&path);
|
||||||
|
let backend = create_backend_for_path(path).unwrap();
|
||||||
|
let files = backend.list_files(path);
|
||||||
|
files.into_iter().map(|e| e.relative_filename).collect()
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user