/** * Created by Ying on 2017/12/9. **/ import { Subject } from "rxjs"; /** * 引用计数的对象基类 * 当一个对象被创建出来,它拥有引用计数 1,如果没有被 ref,那么当前loop的末尾它会被自动 unref,从而被 '销毁' */ export declare abstract class RcObject extends Subject { static debug: boolean; static unref_laters: any[]; _rc: number; private static _scheduled; constructor(); /**@private*/ static _unrefLater(): void; private unref; protected onRcClear(): void; protected onResurrected(): void; resurrect(): void; } /** * 增加引用计数 * @param {T} o * @returns {T} */ export declare function ref(o: T): T; /** * 减少引用计数 * @param {RcObject} o */ export declare function unref(o: RcObject): void;