Refactor Bridge APIs, slim Bridge and reorder imports
Move and standardize API implementations under bridge/apis, slim down the Bridge class (remove inline action implementations, caches and large comment blocks) and relocate related types/exports. Clean up and reorder imports across many bridge/api modules, normalize constructors, add logger imports where needed, and adjust WebUI routing/import ordering. These changes centralize API logic, reduce Bridge surface area, and tidy module boundaries and imports.
This commit is contained in:
1 parent
a52a9724cb
commit
a49e507e15
22 files changed
+144
-452
No files matched your search
@@ -1,22 +1,5 @@
|
||||
// BridgeInterface — the public Bridge surface for OneBot-side
|
||||
// consumers. Slimmed down to BridgeContext + the few extra fields
|
||||
// OneBot reaches into directly (most notably `activePid`).
|
||||
//
|
||||
// Most OneBot code paths reach business methods through
|
||||
// `bridge.apis.<area>.method()` — those types come from `ApiHub`
|
||||
// inside `bridge-context.ts`. The remaining members below are the
|
||||
// non-Api state that doesn't fit into a typed Api hub.
|
||||
//
|
||||
// Internal Api implementations should depend on `BridgeContext`
|
||||
// instead (the narrower contract). `BridgeInterface` is for callers
|
||||
// that need the activePid hook or for backwards compatibility with
|
||||
// pre-#6 code that imported `BridgeInterface` as the bridge type.
|
||||
|
||||
import type { BridgeContext } from './bridge-context';
|
||||
|
||||
export interface BridgeInterface extends BridgeContext {
|
||||
/** Last-active process id — used by `OneBotManager` to thread
|
||||
* per-process state into the right instance. `null` when no
|
||||
* process has bound yet. */
|
||||
readonly activePid: number | null;
|
||||
}
|
||||
Reference in new issue
Block a user