import type { ModuleHandler, ModuleHandlerCtx, ModuleManifest, ModuleRouteDef } from '../../typings/ext/module';
type LoadedModule = {
    manifest: ModuleManifest;
    handlers: Record<string, ModuleHandler>;
    routes: ModuleRouteDef[];
};
export declare const ModuleRegistry: {
    get(key: string): LoadedModule | undefined;
    list(): {
        key: string;
        manifest: ModuleManifest;
        routes: ModuleRouteDef[];
    }[];
    /**
     * 加载已落盘模块到内存；无 routes 时可无 handlers（纯页面 / 仅钩子）
     * 加载前强制目录验签/license（防直接拷贝 modules/）
     */
    load(key: string, opts?: {
        marketPublicKey?: string | Uint8Array;
        skipMarketCheck?: boolean;
    }): LoadedModule;
    unload(key: string): void;
    /** 匹配 method + 子路径，调用对应 handler */
    dispatch(key: string, method: string, subPath: string, ctx: ModuleHandlerCtx): Promise<{
        ok: false;
        status: number;
        message: string;
        data?: undefined;
        route?: undefined;
    } | {
        ok: true;
        data: unknown;
        route: ModuleRouteDef;
        status?: undefined;
        message?: undefined;
    } | {
        ok: false;
        status: number;
        message: string;
        route: ModuleRouteDef;
        data?: undefined;
    }>;
    /** 扫描 modules/ 下已安装目录并 load */
    bootstrap(): void;
};
export {};
