2026-07-09 23:09:29 +07:00
|
|
|
import { callNativeMethodSync } from '@revenge-mod/modules/native'
|
|
|
|
|
|
2025-07-21 14:45:03 +07:00
|
|
|
/**
|
|
|
|
|
* The plugin status.
|
|
|
|
|
*/
|
2025-05-01 01:18:36 +07:00
|
|
|
export const PluginStatus = {
|
2025-05-18 22:24:48 +07:00
|
|
|
PreIniting: 1 << 0,
|
|
|
|
|
PreInited: 1 << 1,
|
|
|
|
|
Initing: 1 << 2,
|
|
|
|
|
Inited: 1 << 3,
|
|
|
|
|
Starting: 1 << 4,
|
|
|
|
|
Started: 1 << 5,
|
|
|
|
|
Stopping: 1 << 6,
|
2025-04-29 21:38:14 +07:00
|
|
|
}
|
2025-05-22 02:45:38 +07:00
|
|
|
|
2026-07-09 23:09:29 +07:00
|
|
|
const { storageRootPath } = callNativeMethodSync(
|
|
|
|
|
'revenge.plugins.getConstants',
|
|
|
|
|
[],
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Per-plugin storage directory, relative to app data directory.
|
|
|
|
|
*/
|
|
|
|
|
// TODO: is it best to share this with the native side, or should we let native side be the sole source of truth?
|
|
|
|
|
export const pluginStorageDirFor = (id: string) => `${storageRootPath}/${id}`
|