feat(lib/modules/native/fs): add additional methods
This commit is contained in:
parent
7775e25e4c
commit
e9f611e325
1 changed files with 16 additions and 0 deletions
|
|
@ -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]
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue