import { ICallExpressionService } from "./i-call-expression-service"; import { CallExpression, NodeArray, SourceFile, SyntaxKind } from "typescript"; import { IPrinter, ITypescriptASTUtil } from "@wessberg/typescript-ast-util"; import { NodeService } from "../node/node-service"; import { IDecoratorService } from "../decorator/i-decorator-service"; import { IRemover } from "../../remover/i-remover-base"; import { IFormatter } from "../../formatter/i-formatter-getter"; import { IUpdater } from "../../updater/i-updater-getter"; import { IJoiner } from "../../joiner/i-joiner-getter"; import { PropertyAccessCallExpression } from "./property-access-call-expression"; import { ITypescriptLanguageService } from "@wessberg/typescript-language-service"; import { ICallExpressionCtor } from "../../light-ast/ctor/call-expression/i-call-expression-ctor"; import { IPlacement } from "../../placement/i-placement"; /** * A class for working with CallExpressions */ export declare class CallExpressionService extends NodeService implements ICallExpressionService { private readonly printer; private readonly formatter; /** * The allowed SyntaxKinds when parsing a SourceFile for relevant Expressions * @type {Iterable} */ protected readonly ALLOWED_KINDS: Iterable; constructor(printer: IPrinter, formatter: IFormatter, updater: IUpdater, joiner: IJoiner, astUtil: ITypescriptASTUtil, languageService: ITypescriptLanguageService, decoratorService: IDecoratorService, remover: IRemover); /** * Returns an iterable of the stringified argument expressions * @param {CallExpression} callExpression * @returns {Iterable} */ getArguments(callExpression: CallExpression): Iterable; /** * Creates a new CallExpression * @param {ICallExpressionCtor} options * @returns {CallExpression} */ createCallExpression(options: ICallExpressionCtor): CallExpression; /** * Creates and adds a CallExpression to a SourceFile * @param {ICallExpressionCtor} options * @param {SourceFile} sourceFile * @param {IPlacement} [placement] * @returns {CallExpression} */ createAndAddCallExpression(options: ICallExpressionCtor, sourceFile: SourceFile, placement?: IPlacement): CallExpression; /** * Returns true if an argument is provided to the CallExpression on the provided index * @param {number} index * @param {CallExpression} callExpression * @returns {boolean} */ hasArgumentOnIndex(index: number, callExpression: CallExpression): boolean; /** * Sets the expression as an argument on the provided index position. * It fills out any index positions in between the last given argument and the position to fill out * with undefined * @param {number} argumentIndex * @param {string} expression * @param {CallExpression} callExpression * @returns {CallExpression} */ setArgumentExpressionOnArgumentIndex(argumentIndex: number, expression: string, callExpression: CallExpression): CallExpression; /** * Gets the names of the Type arguments provided to a CallExpression * @param {CallExpression} callExpression * @returns {string[]} */ getTypeArgumentNames(callExpression: CallExpression): string[]; /** * Gets the CallExpressions on PropertyAccessExpressions matching the provided identifier and property * @param {string} identifier * @param {string} property * @param {SourceFile} sourceFile * @param {boolean} deep * @returns {NodeArray} */ getCallExpressionsOnPropertyAccessExpressionMatching(identifier: string, property: string | undefined, sourceFile: SourceFile, deep?: boolean): NodeArray; /** * Returns all CallExpressions where the base matches the provided Regular Expression * @param {RegExp} match * @param {SourceFile} sourceFile * @param {boolean} deep * @returns {NodeArray} */ getCallExpressionsMatching(match: RegExp, sourceFile: SourceFile, deep?: boolean): NodeArray; /** * Gets all CallExpressions for the provided SourceFile * @param {SourceFile} sourceFile * @param {boolean} deep * @returns {NodeArray} */ getAll(sourceFile: SourceFile, deep?: boolean): NodeArray; }