From e9f611e325ea6c8cc596fe79ff1bcca5b1dc70b7 Mon Sep 17 00:00:00 2001 From: PalmDevs Date: Tue, 14 Oct 2025 21:49:55 +0700 Subject: [PATCH] feat(lib/modules/native/fs): add additional methods --- lib/modules/src/native/fs.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/lib/modules/src/native/fs.ts b/lib/modules/src/native/fs.ts index 29feb8b..2bb7cce 100644 --- a/lib/modules/src/native/fs.ts +++ b/lib/modules/src/native/fs.ts @@ -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]