import { Class, IClassService } from "./i-class-service"; import { ClassDeclaration, ClassElement, ConstructorDeclaration, GetAccessorDeclaration, HeritageClause, MethodDeclaration, PropertyDeclaration, SetAccessorDeclaration, SourceFile, SyntaxKind } from "typescript"; import { ITypescriptASTUtil } from "@wessberg/typescript-ast-util"; import { IFormatter } from "../../formatter/i-formatter-getter"; import { IMethodService } from "../method/i-method-service"; import { IConstructorService } from "../constructor/i-constructor-service"; import { DecoratorExpression, IDecoratorService } from "../decorator/i-decorator-service"; import { IRemover } from "../../remover/i-remover-base"; import { IUpdater } from "../../updater/i-updater-getter"; import { IJoiner } from "../../joiner/i-joiner-getter"; import { NodeService } from "../node/node-service"; import { IModifierService } from "../modifier/i-modifier-service"; import { IResolver } from "../../resolver/i-resolver-getter"; import { IHeritageClauseService } from "../heritage-clause/i-heritage-clause-service"; import { IClassCtor } from "../../light-ast/ctor/class/i-class-ctor"; import { IConstructorCtor } from "../../light-ast/ctor/constructor/i-constructor-ctor"; import { IClassGetAccessorCtor, IClassSetAccessorCtor } from "../../light-ast/ctor/class-accessor/class-accessor-ctor"; import { IClassMethodCtor } from "../../light-ast/ctor/class-method/i-class-method-ctor"; import { IClassPropertyCtor } from "../../light-ast/ctor/class-property/i-class-property-ctor"; import { INameWithTypeArguments } from "../../light-ast/dict/name-with-type-arguments/i-name-with-type-arguments"; import { ITypescriptLanguageService } from "@wessberg/typescript-language-service"; import { IOwnOrInheritedMemberWithNameResult } from "./i-own-or-inherited-member-with-name-result"; import { IOwnOrInheritedPropertyWithNameResult } from "./i-own-or-inherited-property-with-name-result"; import { IOwnOrInheritedMethodWithNameResult } from "./i-own-or-inherited-method-with-name-result"; import { IOwnOrInheritedConstructorResult } from "./i-own-or-inherited-constructor-result"; import { IOwnOrInheritedGetterWithNameResult } from "./i-own-or-inherited-getter-with-name-result"; import { IOwnOrInheritedSetterWithNameResult } from "./i-own-or-inherited-setter-with-name-result"; import { IGetAccessorService } from "../get-accessor/i-get-accessor-service"; import { ISetAccessorService } from "../set-accessor/i-set-accessor-service"; import { IPlacement } from "../../placement/i-placement"; import { IPropertyService } from "../property/i-property-service"; import { INodeToDictMapper } from "../../node-to-dict-mapper/i-node-to-dict-mapper-getter"; import { IClassDict } from "../../light-ast/dict/class/i-class-dict"; /** * A class for working with classes */ export declare class ClassService extends NodeService implements IClassService { private readonly nodeToDictMapper; private readonly formatter; private readonly methodService; private readonly propertyService; private readonly modifierService; private readonly constructorService; private readonly heritageClauseService; private readonly getAccessorService; private readonly setAccessorService; private readonly resolver; /** * The allowed SyntaxKinds when parsing a SourceFile for relevant Expressions * @type {Iterable} */ protected readonly ALLOWED_KINDS: Iterable; constructor(nodeToDictMapper: INodeToDictMapper, formatter: IFormatter, methodService: IMethodService, propertyService: IPropertyService, modifierService: IModifierService, constructorService: IConstructorService, heritageClauseService: IHeritageClauseService, getAccessorService: IGetAccessorService, setAccessorService: ISetAccessorService, resolver: IResolver, updater: IUpdater, joiner: IJoiner, astUtil: ITypescriptASTUtil, remover: IRemover, languageService: ITypescriptLanguageService, decoratorService: IDecoratorService); /** * Returns the getter that matches the provided name, if it exists * @param {string} name * @param {Class} classDeclaration * @returns {GetAccessorDeclaration} */ getGetterWithName(name: string, classDeclaration: Class): GetAccessorDeclaration | undefined; /** * Returns the setter that matches the provided name, if it exists * @param {string} name * @param {Class} classDeclaration * @returns {SetAccessorDeclaration} */ getSetterWithName(name: string, classDeclaration: Class): SetAccessorDeclaration | undefined; /** * Returns the static getter that matches the provided name, if it exists * @param {string} name * @param {Class} classDeclaration * @returns {GetAccessorDeclaration} */ getStaticGetterWithName(name: string, classDeclaration: Class): GetAccessorDeclaration | undefined; /** * Returns the static setter that matches the provided name, if it exists * @param {string} name * @param {Class} classDeclaration * @returns {SetAccessorDeclaration} */ getStaticSetterWithName(name: string, classDeclaration: Class): SetAccessorDeclaration | undefined; /** * Gets all names of class members for the class - also those it inherits from its' parents * @param {Class} classDeclaration * @returns {Set} */ getOwnOrInheritedMemberNames(classDeclaration: Class): Set; /** * Gets all names of static class members for the class - also those it inherits from its' parents * @param {Class} classDeclaration * @returns {Set} */ getOwnOrInheritedStaticMemberNames(classDeclaration: Class): Set; /** * Gets all member names of the given ClassDeclaration * @param {Class} classDeclaration * @returns {Set} */ getMemberNames(classDeclaration: Class): Set; /** * Gets all member names of the given ClassDeclaration * @param {Class} classDeclaration * @returns {Set} */ getStaticMemberNames(classDeclaration: Class): Set; /** * Gets the name of the given member * @param {ClassElement} member * @returns {string|undefined} */ getNameOfMember(member: ClassElement): string | undefined; /** * Gets the getter matching the provided name, if it exists. Will resolve up through the inheritance chain * @param {string} name * @param {Class} classDeclaration * @returns {IOwnOrInheritedGetterWithNameResult} */ getOwnOrInheritedGetterWithName(name: string, classDeclaration: Class): IOwnOrInheritedGetterWithNameResult | undefined; /** * Returns the getter matching the provided name, if it exists. Will resolve up through the inheritance chain * @param {string} name * @param {Class} classDeclaration * @returns {IOwnOrInheritedSetterWithNameResult} */ getOwnOrInheritedSetterWithName(name: string, classDeclaration: Class): IOwnOrInheritedSetterWithNameResult | undefined; /** * Returns the getter matching the provided name, if it exists. Will resolve up through the inheritance chain * @param {string} name * @param {Class} classDeclaration * @returns {IOwnOrInheritedGetterWithNameResult} */ getOwnOrInheritedStaticGetterWithName(name: string, classDeclaration: Class): IOwnOrInheritedGetterWithNameResult | undefined; /** * Returns the setter matching the provided name, if it exists. Will resolve up through the inheritance chain. * @param {string} name * @param {Class} classDeclaration * @returns {IOwnOrInheritedSetterWithNameResult} */ getOwnOrInheritedStaticSetterWithName(name: string, classDeclaration: Class): IOwnOrInheritedSetterWithNameResult | undefined; /** * Returns the getters that are decorated with the given decorator * @param {DecoratorExpression} decorator * @param {Class} classDeclaration * @returns {GetAccessorDeclaration[]} */ getGettersWithDecorator(decorator: DecoratorExpression, classDeclaration: Class): GetAccessorDeclaration[]; /** * Returns the setters that are decorated with the given decorator * @param {DecoratorExpression} decorator * @param {Class} classDeclaration * @returns {SetAccessorDeclaration[]} */ getSettersWithDecorator(decorator: DecoratorExpression, classDeclaration: Class): SetAccessorDeclaration[]; /** * Returns the static getters that are decorated with the given decorator. * @param {DecoratorExpression} decorator * @param {Class} classDeclaration * @returns {GetAccessorDeclaration[]} */ getStaticGettersWithDecorator(decorator: DecoratorExpression, classDeclaration: Class): GetAccessorDeclaration[]; /** * Returns the static setters that are decorated with the given decorator * @param {DecoratorExpression} decorator * @param {Class} classDeclaration * @returns {SetAccessorDeclaration[]} */ getStaticSettersWithDecorator(decorator: DecoratorExpression, classDeclaration: Class): SetAccessorDeclaration[]; /** * Returns true if the class has a method matching the provided name * @param {string} name * @param {Class} classDeclaration * @returns {boolean} */ hasMethodWithName(name: string, classDeclaration: Class): boolean; /** * Returns true if the class has a property matching the provided name * @param {string} name * @param {Class} classDeclaration * @returns {boolean} */ hasPropertyWithName(name: string, classDeclaration: Class): boolean; /** * Returns true if the class has a static method matching the provided name * @param {string} name * @param {Class} classDeclaration * @returns {boolean} */ hasStaticMethodWithName(name: string, classDeclaration: Class): boolean; /** * Returns true if the class has a static property matching the provided name * @param {string} name * @param {Class} classDeclaration * @returns {boolean} */ hasStaticPropertyWithName(name: string, classDeclaration: Class): boolean; /** * Returns true if the class has a static getter matching the provided name * @param {string} name * @param {Class} classDeclaration * @returns {boolean} */ hasStaticGetterWithName(name: string, classDeclaration: Class): boolean; /** * Returns true if the class has a static setter matching the provided name * @param {string} name * @param {Class} classDeclaration * @returns {boolean} */ hasStaticSetterWithName(name: string, classDeclaration: Class): boolean; /** * Returns true if the class or any of the classes it extends has a getter matching the provided name * @param {string} name * @param {Class} classDeclaration * @returns {boolean} */ hasOwnOrInheritedGetterWithName(name: string, classDeclaration: Class): boolean; /** * Returns true if the class or any of the classes it extends has a setter matching the provided name * @param {string} name * @param {Class} classDeclaration * @returns {boolean} */ hasOwnOrInheritedSetterWithName(name: string, classDeclaration: Class): boolean; /** * Returns true if the class or any of the classes it extends has a static getter matching the provided name * @param {string} name * @param {Class} classDeclaration * @returns {boolean} */ hasOwnOrInheritedStaticGetterWithName(name: string, classDeclaration: Class): boolean; /** * Returns true if the class or any of the classes it extends has a static setter matching the provided name * @param {string} name * @param {Class} classDeclaration * @returns {boolean} */ hasOwnOrInheritedStaticSetterWithName(name: string, classDeclaration: Class): boolean; /** * Returns true if the given class has or inherits a constructor * @param {Class} classDeclaration * @returns {boolean} */ hasOwnOrInheritedConstructor(classDeclaration: Class): boolean; /** * Returns true if the given class has or inherits a member with the provided name * @param {string} name * @param {Class} classDeclaration * @returns {boolean} */ hasOwnOrInheritedMemberWithName(name: string, classDeclaration: Class): boolean; /** * Returns true if the given class has or inherits a static member with the provided name * @param {string} name * @param {Class} classDeclaration * @returns {boolean} */ hasOwnOrInheritedStaticMemberWithName(name: string, classDeclaration: Class): boolean; /** * Returns true if the given class has or inherits a property with the provided name * @param {string} name * @param {Class} classDeclaration * @returns {boolean} */ hasOwnOrInheritedPropertyWithName(name: string, classDeclaration: Class): boolean; /** * Returns true if the given class has or inherits a static property with the provided name * @param {string} name * @param {Class} classDeclaration * @returns {boolean} */ hasOwnOrInheritedStaticPropertyWithName(name: string, classDeclaration: Class): boolean; /** * Returns true if the given class has or inherits a method with the provided name * @param {string} name * @param {Class} classDeclaration * @returns {boolean} */ hasOwnOrInheritedMethodWithName(name: string, classDeclaration: Class): boolean; /** * Returns true if the given class has or inherits a static method with the provided name * @param {string} name * @param {Class} classDeclaration * @returns {boolean} */ hasOwnOrInheritedStaticMethodWithName(name: string, classDeclaration: Class): boolean; /** * Gets the constructor of the class, if it has any. Will check up through the inheritance chain * @param {Class} classDeclaration * @returns {IOwnOrInheritedConstructorResult} */ getOwnOrInheritedConstructor(classDeclaration: Class): IOwnOrInheritedConstructorResult | undefined; /** * Gets the class member with the provided name. Will check up through the inheritance chain * @param {string} name * @param {Class} classDeclaration * @returns {IOwnOrInheritedMemberWithNameResult} */ getOwnOrInheritedMemberWithName(name: string, classDeclaration: Class): IOwnOrInheritedMemberWithNameResult | undefined; /** * Gets the static class member with the provided name. Will check up through the inheritance chain * @param {string} name * @param {Class} classDeclaration * @returns {IOwnOrInheritedMemberWithNameResult} */ getOwnOrInheritedStaticMemberWithName(name: string, classDeclaration: Class): IOwnOrInheritedMemberWithNameResult | undefined; /** * Gets the class property with the provided name, if any exists. Will check up through the inheritance chain. * @param {string} name * @param {Class} classDeclaration * @returns {IOwnOrInheritedPropertyWithNameResult} */ getOwnOrInheritedPropertyWithName(name: string, classDeclaration: Class): IOwnOrInheritedPropertyWithNameResult | undefined; /** * Gets the static property with the provided name, if it exists. Will check up through the inheritance chain. * @param {string} name * @param {Class} classDeclaration * @returns {IOwnOrInheritedPropertyWithNameResult} */ getOwnOrInheritedStaticPropertyWithName(name: string, classDeclaration: Class): IOwnOrInheritedPropertyWithNameResult | undefined; /** * Gets the method with the provided name, if any exists. Will check up through the inheritance chain. * @param {string} name * @param {Class} classDeclaration * @returns {IOwnOrInheritedMethodWithNameResult} */ getOwnOrInheritedMethodWithName(name: string, classDeclaration: Class): IOwnOrInheritedMethodWithNameResult | undefined; /** * Gets the static method with the provided name. Will check up through the inheritance chain * @param {string} name * @param {Class} classDeclaration * @returns {IOwnOrInheritedMethodWithNameResult} */ getOwnOrInheritedStaticMethodWithName(name: string, classDeclaration: Class): IOwnOrInheritedMethodWithNameResult | undefined; /** * Gets the name of the class that the given class extends * @param {Class} classDeclaration * @returns {string} */ getNameOfExtendedClass(classDeclaration: Class): string | undefined; /** * Resolves the parent class of the given ClassDeclaration or ClassExpression * @param {Class} classDeclaration * @returns {Class | undefined} */ resolveExtendedClass(classDeclaration: Class): Class | undefined; /** * Returns true if the given SourceFile contains a ClassDeclaration or ClassExpression with the provided name * @param {string} name * @param {SourceFile} sourceFile * @param {boolean} deep * @returns {boolean} */ hasClassWithName(name: string, sourceFile: SourceFile, deep?: boolean): boolean; /** * Gets the ClassDeclaration or ClassExpression within the provided SourceFile with the provided name * @param {string} name * @param {SourceFile} sourceFile * @param {boolean} deep * @returns {Class} */ getClassWithName(name: string, sourceFile: SourceFile, deep?: boolean): Class | undefined; /** * Removes all getters that are decorated with the given decorator from the class. * @param {DecoratorExpression} decorator * @param {Class} classDeclaration * @returns {boolean} */ removeGettersWithDecorator(decorator: DecoratorExpression, classDeclaration: Class): boolean; /** * Removes all setters that are decorated with the given decorator from the class. * @param {DecoratorExpression} decorator * @param {Class} classDeclaration * @returns {boolean} */ removeSettersWithDecorator(decorator: DecoratorExpression, classDeclaration: Class): boolean; /** * Removes all static getters that are decorated with the given decorator from the class. * @param {DecoratorExpression} decorator * @param {Class} classDeclaration * @returns {boolean} */ removeStaticGettersWithDecorator(decorator: DecoratorExpression, classDeclaration: Class): boolean; /** * Removes all static setters that are decorated with the given decorator from the class. * @param {DecoratorExpression} decorator * @param {Class} classDeclaration * @returns {boolean} */ removeStaticSettersWithDecorator(decorator: DecoratorExpression, classDeclaration: Class): boolean; /** * Removes the ClassElement with the provided name, if any exists * @param {string} name * @param {Class} classDeclaration * @returns {boolean} */ removeMemberWithName(name: string, classDeclaration: Class): boolean; /** * Removes the static ClassElement with the provided name, if any exists * @param {string} name * @param {Class} classDeclaration * @returns {boolean} */ removeStaticMemberWithName(name: string, classDeclaration: Class): boolean; /** * Removes the PropertyDeclaration with the provided name, if any exists * @param {string} name * @param {Class} classDeclaration * @returns {boolean} */ removePropertyWithName(name: string, classDeclaration: Class): boolean; /** * Removes the static PropertyDeclaration with the provided name, if any exists * @param {string} name * @param {Class} classDeclaration * @returns {boolean} */ removeStaticPropertyWithName(name: string, classDeclaration: Class): boolean; /** * Removes the MethodDeclaration with the provided name, if any exists * @param {string} name * @param {Class} classDeclaration * @returns {boolean} */ removeMethodWithName(name: string, classDeclaration: Class): boolean; /** * Removes the static MethodDeclaration with the provided name, if any exists * @param {string} name * @param {Class} classDeclaration * @returns {boolean} */ removeStaticMethodWithName(name: string, classDeclaration: Class): boolean; /** * Removes all non-static class members that matches the provided decorator * @param {DecoratorExpression} decorator * @param {Class} classDeclaration * @returns {boolean} */ removeMembersWithDecorator(decorator: DecoratorExpression, classDeclaration: Class): boolean; /** * Removes all static class members that matches the provided decorator * @param {DecoratorExpression} decorator * @param {Class} classDeclaration * @returns {boolean} */ removeStaticMembersWithDecorator(decorator: DecoratorExpression, classDeclaration: Class): boolean; /** * Removes all non-static class properties that matches the provided decorator * @param {DecoratorExpression} decorator * @param {Class} classDeclaration * @returns {boolean} */ removePropertiesWithDecorator(decorator: DecoratorExpression, classDeclaration: Class): boolean; /** * Removes all static class properties that matches the provided decorator * @param {DecoratorExpression} decorator * @param {Class} classDeclaration * @returns {boolean} */ removeStaticPropertiesWithDecorator(decorator: DecoratorExpression, classDeclaration: Class): boolean; /** * Removes all non-static class methods that matches the provided decorator * @param {DecoratorExpression} decorator * @param {Class} classDeclaration * @returns {boolean} */ removeMethodsWithDecorator(decorator: DecoratorExpression, classDeclaration: Class): boolean; /** * Removes all static class methods that matches the provided decorator * @param {DecoratorExpression} decorator * @param {Class} classDeclaration * @returns {boolean} */ removeStaticMethodsWithDecorator(decorator: DecoratorExpression, classDeclaration: Class): boolean; /** * Returns all of the Class members that is decorated with the provided decorator * @param {DecoratorExpression} decorator * @param {Class} classDeclaration * @returns {ClassElement[]} */ getMembersWithDecorator(decorator: DecoratorExpression, classDeclaration: Class): ClassElement[]; /** * Returns all static members that is decorated with the provided decorator * @param {DecoratorExpression} decorator * @param {Class} classDeclaration * @returns {ClassElement[]} */ getStaticMembersWithDecorator(decorator: DecoratorExpression, classDeclaration: Class): ClassElement[]; /** * Returns all members that are decorated with the provided decorator and are non-static PropertyDeclarations * @param {DecoratorExpression} decorator * @param {Class} classDeclaration * @returns {PropertyDeclaration[]} */ getPropertiesWithDecorator(decorator: DecoratorExpression, classDeclaration: Class): PropertyDeclaration[]; /** * Returns all members that are decorated with the provided decorator and are static PropertyDeclarations * @param {DecoratorExpression} decorator * @param {Class} classDeclaration * @returns {PropertyDeclaration[]} */ getStaticPropertiesWithDecorator(decorator: DecoratorExpression, classDeclaration: Class): PropertyDeclaration[]; /** * Returns all members that are decorated with the provided decorator and are non-static MethodDeclarations * @param {DecoratorExpression} decorator * @param {Class} classDeclaration * @returns {MethodDeclaration[]} */ getMethodsWithDecorator(decorator: DecoratorExpression, classDeclaration: Class): MethodDeclaration[]; /** * Returns all members that are decorated with the provided decorator and are static MethodDeclarations * @param {DecoratorExpression} decorator * @param {Class} classDeclaration * @returns {MethodDeclaration[]} */ getStaticMethodsWithDecorator(decorator: DecoratorExpression, classDeclaration: Class): MethodDeclaration[]; /** * Gets the name of the provided class declaration, if it has any * @param {Class} classDeclaration * @returns {string} */ getNameOfClass(classDeclaration: Class): string | undefined; /** * Gets the extended class of the provided class, if it has any * @param {Class} classDeclaration * @returns {Class} */ getExtendedClass(classDeclaration: Class): HeritageClause | undefined; /** * Gets all implemented interfaces of the provided Class * @param {Class} classDeclaration * @returns {HeritageClause} */ getImplements(classDeclaration: Class): HeritageClause | undefined; /** * Gets the constructor of the provided Class * @param {Class} classDeclaration * @returns {ConstructorDeclaration} */ getConstructor(classDeclaration: Class): ConstructorDeclaration | undefined; /** * Gets the member of the class with the provided name. In case there are multiple (such as will * be the case with getters and setters, the first matched one will be returned). * @param {string} name * @param {Class} classDeclaration * @returns {ClassElement} */ getMemberWithName(name: string, classDeclaration: Class): ClassElement | undefined; /** * Gets the static member of the class with the provided name. In case there are multiple (such as will * be the case with getters and setters, the first matched one will be returned). * @param {string} name * @param {Class} classDeclaration * @returns {ClassElement} */ getStaticMemberWithName(name: string, classDeclaration: Class): ClassElement | undefined; /** * Gets the MethodDeclaration from the provided ClassDeclaration or ClassExpression that matches the provided name * @param {string} name * @param {Class} classDeclaration * @returns {MethodDeclaration} */ getMethodWithName(name: string, classDeclaration: Class): MethodDeclaration | undefined; /** * Gets the PropertyDeclaration from the provided ClassDeclaration or ClassExpression that matches the provided name * @param {string} name * @param {Class} classDeclaration * @returns {PropertyDeclaration} */ getPropertyWithName(name: string, classDeclaration: Class): PropertyDeclaration | undefined; /** * Gets the (static) MethodDeclaration from the provided ClassDeclaration or ClassExpression that matches the provided name * @param {string} name * @param {Class} classDeclaration * @returns {MethodDeclaration} */ getStaticMethodWithName(name: string, classDeclaration: Class): MethodDeclaration | undefined; /** * Gets the (static) PropertyDeclaration from the provided ClassDeclaration or ClassExpression that matches the provided name * @param {string} name * @param {Class} classDeclaration * @returns {PropertyDeclaration} */ getStaticPropertyWithName(name: string, classDeclaration: Class): PropertyDeclaration | undefined; /** * Returns true if the class doesn't extend any other class * @param {Class} classDeclaration * @returns {boolean} */ isBaseClass(classDeclaration: Class): boolean; /** * Returns true if the provided class extends a class with the provided name * @param {string} name * @param {ts.Class} classDeclaration * @returns {boolean} */ isExtendingClassWithName(name: string, classDeclaration: Class): boolean; /** * Returns true if the provided class implements an interface with a name equal to the provided one * @param {string} name * @param {ts.Class} classDeclaration * @returns {boolean} */ isImplementingInterfaceWithName(name: string, classDeclaration: Class): boolean; /** * Returns true if the provided class has a constructor * @param {ts.Class} classDeclaration * @returns {boolean} */ hasConstructor(classDeclaration: Class): boolean; /** * Returns true if the provided class has a member with a name equal to the provided one * @param {string} name * @param {Class} classDeclaration * @returns {boolean} */ hasMemberWithName(name: string, classDeclaration: Class): boolean; /** * Returns true if the provided class has a static member with a name equal to the provided one * @param {string} name * @param {Class} classDeclaration * @returns {boolean} */ hasStaticMemberWithName(name: string, classDeclaration: Class): boolean; /** * Returns true if the provided class has a getter with a name equal to the provided one * @param {string} name * @param {Class} classDeclaration * @returns {boolean} */ hasGetterWithName(name: string, classDeclaration: Class): boolean; /** * Returns true if the provided class has a setter with a name equal to the provided one * @param {string} name * @param {Class} classDeclaration * @returns {boolean} */ hasSetterWithName(name: string, classDeclaration: Class): boolean; /** * Appends one or more instructions to the getter on the class that matches the provided name * @param {string} getterName * @param {string} instructions * @param {Class} classDeclaration * @returns {Class} */ appendInstructionsToGetter(getterName: string, instructions: string, classDeclaration: Class): Class; /** * Appends one or more instructions to the setter on the class that matches the provided name * @param {string} setterName * @param {string} instructions * @param {Class} classDeclaration * @returns {Class} */ appendInstructionsToSetter(setterName: string, instructions: string, classDeclaration: Class): Class; /** * Appends one or more instructions to the method on the class that matches the provided name * @param {string} methodName * @param {string} instructions * @param {Class} classDeclaration * @returns {Class} */ appendInstructionsToMethod(methodName: string, instructions: string, classDeclaration: Class): Class; /** * Appends one or more instructions to the static method on the class that matches the provided name * @param {string} methodName * @param {string} instructions * @param {Class} classDeclaration * @returns {Class} */ appendInstructionsToStaticMethod(methodName: string, instructions: string, classDeclaration: Class): Class; /** * Appends one or more instructions to the constructor on the provide class * @param {string} instructions * @param {Class} classDeclaration * @returns {Class} */ appendInstructionsToConstructor(instructions: string, classDeclaration: Class): Class; /** * Creates a new ClassDeclaration * @param {IClassCtor} options * @returns {ClassDeclaration} */ createClassDeclaration(options: IClassCtor): ClassDeclaration; /** * Creates a ClassDeclaration and adds it to the provided SourceFile * @param {IClassCtor} options * @param {SourceFile} sourceFile * @param {IPlacement} [placement] * @returns {ClassDeclaration} */ createAndAddClassDeclarationToSourceFile(options: IClassCtor, sourceFile: SourceFile, placement?: IPlacement): ClassDeclaration; /** * Sets the name of a given Class * @param {string} name * @param {Class} classDeclaration * @returns {Class} */ setNameOfClass(name: string, classDeclaration: Class): Class; /** * Extends the provided class with the provided INameWithTypeArguments * @param {INameWithTypeArguments} name * @param {Class} classDeclaration * @returns {Class} */ extendClassWith(name: INameWithTypeArguments, classDeclaration: Class): Class; /** * Implements an interface with the provided INameWithTypeArguments on the provided class * @param {INameWithTypeArguments} name * @param {Class} classDeclaration * @returns {Class} */ implementInterfaceOnClass(name: INameWithTypeArguments, classDeclaration: Class): Class; /** * Adds a new property to the given class * @param {IClassPropertyCtor} property * @param {Class} classDeclaration * @returns {Class} */ addPropertyToClass(property: IClassPropertyCtor, classDeclaration: Class): Class; /** * Adds a Constructor to the given class * @param {IConstructorCtor} constructor * @param {Class} classDeclaration * @returns {Class} */ addConstructorToClass(constructor: IConstructorCtor, classDeclaration: Class): Class; /** * Adds a method to the given class * @param {IClassMethodCtor} method * @param {Class} classDeclaration * @returns {Class} */ addMethodToClass(method: IClassMethodCtor, classDeclaration: Class): Class; /** * Adds a setter to the provided class * @param {IClassSetAccessorCtor} method * @param {Class} classDeclaration * @returns {Class} */ addSetterToClass(method: IClassSetAccessorCtor, classDeclaration: Class): Class; /** * Adds a getter to the provided class * @param {IClassGetAccessorCtor} method * @param {Class} classDeclaration * @returns {Class} */ addGetterToClass(method: IClassGetAccessorCtor, classDeclaration: Class): Class; /** * Maps the provided class to an IClassDict * @param {Class} node * @returns {IClassDict} */ toLightAST(node: Class): IClassDict; /** * Returns true if provided member has the provided name * @param {string} name * @param {ClassElement} member * @returns {boolean} */ private matchesMemberName; /** * Returns true if provided static member has the provided name * @param {string} name * @param {ClassElement} member * @returns {boolean} */ private matchesStaticMemberName; /** * Returns true if the class has a modifier with the provided kind * @param {ts.SyntaxKind} kind * @param {Node} classMember * @returns {boolean} */ private hasModifierWithKind; }