/** * 绑定上下文工具函数的类型定义 */ /** * 可绑定方法的对象类型 */ export interface BindableObject { [key: string]: any; } /** * 绑定后的对象类型,保持原始对象的类型结构 */ export type BoundObject = { [K in keyof T]: T[K] extends (...args: infer A) => infer R ? (...args: A) => R : T[K]; }; /** * 绑定对象的所有方法,确保 getter 属性能正确访问原始对象的上下文 * @param obj 要绑定方法的对象 * @returns 绑定后的对象副本 */ export declare function bindAllMethods(obj: T): BoundObject;