/** * Returns a proxy object that provides access to the methods of the given instance's parent class. * The returned proxy object behaves like `super` keyword in that it allows accessing parent class instance methods. * * @param {object} instance - The instance to get the parent class instance methods from. * @param {WeakMap|boolean} [cache] - An optional WeakMap object to cache the proxy object for better performance. defaults to false * @returns {object} - A proxy object that provides access to the methods of the given instance's parent class. * @throws {TypeError} - If the given instance is not an object or is null. * * @example * class Creature { * walk() { * console.log('Creature walks'); * } * } * class Animal extends Creature { * walk() { * console.log('Animal walks'); * getSuper(this).walk(); // call the parent's walk method * } * } * * class Rabbit extends Animal { * walk() { * console.log('Rabbit hops'); * // super.walk(); * getSuper(this).walk(); // call the parent's walk method * } * } * * const rabbit = new Rabbit(); * const superRabbit = getSuper(rabbit); * superRabbit.walk(); // logs 'Animal walks' */ export function getSuper(instance: object, cache?: WeakMap | boolean): object; export default getSuper;