revenge-bundle-next/lib/plugins/src/apis/index.ts

31 lines
713 B
TypeScript
Raw Normal View History

import * as patcher from '@revenge-mod/patcher'
import { modules } from './modules'
import { plugins } from './plugins'
import { react } from './react'
2025-06-03 16:24:58 +07:00
import type {
UnscopedInitPluginApi,
UnscopedPluginApi,
UnscopedPreInitPluginApi,
} from '../types'
2025-05-09 21:53:48 +07:00
// @ts-expect-error: This will be modified by libraries later
2025-07-05 13:12:57 +07:00
export const pUnscopedApi:
2025-06-03 16:24:58 +07:00
| UnscopedPreInitPluginApi
| UnscopedInitPluginApi
| UnscopedPluginApi = {
modules,
patcher,
plugins,
react,
2025-05-09 21:53:48 +07:00
}
export function spreadDescriptors<T extends object, U extends object>(
from: T,
to: U,
): T & U {
return Object.defineProperties(
to,
Object.getOwnPropertyDescriptors(from),
) as T & U
}