import ts from 'typescript'; import type { TSESTree } from '@typescript-eslint/utils'; export declare const DEFAULT_DECORATORS: string[]; /** * Normalizes decorator names into a set of clean, consistent identifiers. It trims whitespace, * removes empty entries, and strips a leading '@' from each name. It also falls back to the default decorators when * no list is provided. * * @param names The optional list of decorator names to normalize. * @returns A set containing the normalized decorator names. * * @example * ```tsx * const names = normalizeDecoratorNames([' @autobind ', 'custom']); * ``` */ export declare const normalizeDecoratorNames: (names?: string[]) => Set; /** * Extracts the decorator name from a TypeScript decorator node. It supports identifiers, call expressions, * and property access expressions. It returns null when no recognizable name can be derived from the decorator syntax. * * @param decorator The decorator node to inspect for a name. * @returns The resolved decorator name or null when it cannot be determined. * * @example * ```tsx * const name = getDecoratorName(node.decorators[0]); * ``` */ export declare const getDecoratorName: (decorator: ts.Decorator) => string | null; /** * Determines whether a TypeScript method declaration references the `this` keyword in its body. * It walks the method body nodes and stops early once a `this` keyword is found. It returns false when the method * has no body or when no `this` usage is detected. * * @param node The method declaration to inspect. * @returns True when the method body references `this`, otherwise false. * * @example * ```tsx * const usesThis = methodUsesThis(methodNode); * ``` */ export declare const methodUsesThis: (node: ts.MethodDeclaration) => boolean; /** * Unwraps nested TypeScript or optional chaining wrapper expressions until a concrete inner expression is reached. * It repeatedly peels off chain, non-null, and type assertion nodes while tracking the current expression. * It returns the first expression that is not one of the supported wrapper types. * * @param node The expression node to unwrap. * @returns The innermost expression after removing supported wrapper nodes. * * @example * ```tsx * const unwrapped = unwrapExpression(node); * ``` */ export declare const unwrapExpression: (node: TSESTree.Expression) => TSESTree.Expression; interface unWrapReturn { current: TSESTree.Expression; parent: TSESTree.Node | null; } /** * Unwraps a usage expression by walking up through supported wrapper nodes to find the effective parent. It tracks the * current expression as it traverses chain, non-null, and type assertion wrappers. It returns both the unwrapped * expression and the first parent that is not a supported wrapper. * * @param node The expression node to unwrap within its usage context. * @returns An object containing the unwrapped current expression and its first non-wrapper parent. * * @example * ```tsx * const {current, parent} = unwrapUsage(memberExpression); * ``` */ export declare const unwrapUsage: (node: TSESTree.Expression) => unWrapReturn; /** * Determines whether a member expression is used as a `this`-binding call on `bind`, `call`, or `apply`. * It checks the parent nodes to ensure the expression is part of a call expression and that the callee is the * binding method. It then verifies the first argument resolves to a `this` expression after unwrapping any * supported wrapper nodes. * * @param node The member expression to inspect for a `this` bind/call/apply usage. * @returns True when the member expression is a `bind`, `call`, or `apply` invocation whose first argument is `this`. * * @example * ```tsx * const isBind = isThisBindCall(memberExpression); * ``` */ export declare const isThisBindCall: (node: TSESTree.MemberExpression) => boolean; /** * Determines whether a member expression is used as a callback value in common usage contexts. It walks up through * wrapper nodes to find the effective parent and then checks a variety of parent node types to decide if the * expression is passed, assigned, or returned as a callback. It returns false when the expression is not used in a * supported callback position. * * @param node The member expression to inspect for callback usage contexts. * @returns True when the expression appears in a callback position, otherwise false. * * @example * ```tsx * const isCallback = isCallbackUsage(memberExpression); * ``` */ export declare const isCallbackUsage: (node: TSESTree.MemberExpression) => boolean; export {};