feat(lib/modules/native/fs): add additional methods

This commit is contained in:
PalmDevs 2025-10-14 21:49:55 +07:00
parent 7775e25e4c
commit e9f611e325
No known key found for this signature in database
GPG key ID: 6FAE8F8677ACA8BA

View file

@ -19,6 +19,10 @@ export function rm(path: string) {
return callBridgeMethod('revenge.fs.delete', [path])
}
export function existsSync(path: string) {
return callBridgeMethodSync('revenge.fs.exists', [path])
}
export function readFileSync(path: string) {
return callBridgeMethodSync('revenge.fs.read', [path])
}
@ -35,8 +39,20 @@ export function deleteFileSync(path: string) {
return callBridgeMethodSync('revenge.fs.delete', [path])
}
export function getConstants() {
return callBridgeMethodSync('revenge.fs.getConstants', [])
}
declare module '@revenge-mod/modules/native' {
export interface Methods {
'revenge.fs.getConstants': [
[],
{
data: string
files: string
cache: string
},
]
'revenge.fs.read': [[path: string], string]
'revenge.fs.write': [[path: string, data: string], void]
'revenge.fs.exists': [[path: string], boolean]