import * as Shift from 'shift-ast'; import Scope from '../../scope/scope'; export default class ProxyFunction { id: string; node: Shift.Node; parentNode: Shift.Node; scope: Scope; name: string; params: Shift.BindingIdentifier[]; expression: Shift.Expression; /** * Creates a new proxy function. * @param node The function node. * @param parentNode The parent node. * @param scope The scope the function is within. * @param name The name of the proxy function. * @param params The parameters of the proxy function. * @param expression The expression returned by the proxy function. */ constructor(node: Shift.Node, parentNode: Shift.Node, scope: Scope, name: string, params: Shift.BindingIdentifier[], expression: Shift.Expression); /** * Returns the replacement for a call of the proxy function. * @param args The arguments of the proxy function call. */ getReplacement(args: Shift.Expression[]): Shift.Expression; /** * Finds all usages of the proxy function's parameters within a given * expression. * @param expression The expression node. */ private findParameterUsages; /** * Returns a copy of an expression. * @param node The expression node. */ private duplicateExpression; }