import type { ModuleAction, ModuleActionParam, ModuleActionRequestMediaType, ModuleDefinition } from '../types/index.js'; /** 导出的模块动作定义。 */ export type ExportedModuleAction = Omit & { bodyParams: ModuleActionParam[]; /** 请求体媒体类型;省略时为 `application/json`。 */ bodyMediaType?: ModuleActionRequestMediaType; }; /** 导出的模块定义。 */ export type ExportedModuleDefinition = Omit & { actions: ExportedModuleAction[]; }; /** {@link exportRegistry} 的选项。 */ export interface ExportRegistryOptions { /** 是否保留注册表中的原始模块定义。 */ raw?: boolean; /** 是否递归移除值为函数的属性;默认为 `true`。 */ jsonSafe?: boolean; } /** * 导出注册表。 * * 默认会把动作的 `requestBody` 转换成扁平的 `bodyParams`;传入 `raw: true` * 时则保留原始模块结构。默认还会递归移除函数属性,以便安全地序列化为 JSON; * 如需保留函数,可传入 `jsonSafe: false`。 * * @param options - 导出选项。 * @returns 以模块名为键的模块定义。 */ export declare function exportRegistry(options: ExportRegistryOptions & { raw: true; }): Record; export declare function exportRegistry(options?: ExportRegistryOptions & { raw?: false; }): Record; export declare function exportRegistry(options: ExportRegistryOptions): Record;