type SpyRegister = { [index: number]: { obj: any; method: (...args: any[]) => any; methodName: string; }; }; export declare class SpyRegistry { register: SpyRegister; persReg: SpyRegister; registerCount: number; /** * The SpyRegistry is a class to handle the * correct restoration of spied objects. * * You may push an objects information about * a spied method to store it and be able to * restore it at any time. * Consider the SpyRegistry as information storage * for spied objects. * * @constructor */ constructor(); /** * If called, the SypRegistry will be resetting to its initial state. * Exception: the unique register count will not be touched. * Meaning that all stored object information will be restored * to their individual previous state. */ restoreAll(): void; /** * If called, the SpyRegistry will restore the object, * which was registered at given index and is getting lose * of the stored information. * * If the registry entry for the given index does not exist, * nothing will happen. * * @param {number} index -> the unique identifier of stored information. */ restore(index: number): void; /** * If called, the SpyRegistry will store the given information. * The unique identifier index will be returned. * * @param obj -> The related object, which will be spied. * @param methodName -> The name of the mocked method. * @return {number} -> The unique store index. */ push(obj: Record, methodName: keyof typeof obj): number; /** * If called, the stored method for the corresponding index * will be returned. If the registry entry does not exist, * undefined will be returned. * * @param index -> the unique identifier of stored information. * @return {any} -> Any stored information can be returned. * BUT: Usually this method returns a function or * undefined. */ getOriginalMethod(index: number): ((...args: any[]) => any) | void; /** * If called, the stored method will be moved from the standard * registry into the persistent registry or vice versa. * This can make restore and restoreAll having no effect anymore. * * @param index -> the unique identifier of stored information. * @param intoPersReg -> boolean to determine the moving direction. */ persist(index: number, intoPersReg: boolean): void; } export {};