import * as tsModule from "typescript"; import { Declaration, Identifier, InterfaceDeclaration, Node, PropertyDeclaration, PropertySignature, SetAccessorDeclaration, Symbol, SyntaxKind, TypeChecker } from "typescript"; import { ModifierKind } from "./chunk-modifier-kind-d7983be2"; import { VisibilityKind } from "./chunk-visibility-kind-8314091f"; interface AstContext { ts: typeof tsModule; checker: TypeChecker; } /** * Resolves all relevant declarations of a specific node. * @param node * @param context */ declare function resolveDeclarations(node: Node, context: { checker: TypeChecker; ts: typeof tsModule; }): Declaration[]; /** * Returns the symbol of a node. * This function follows aliased symbols. * @param node * @param context */ declare function getSymbol(node: Node, context: { checker: TypeChecker; ts: typeof tsModule; }): Symbol | undefined; /** * Resolves the declarations of a symbol. A valueDeclaration is always the first entry in the array * @param symbol */ declare function resolveSymbolDeclarations(symbol: Symbol): Declaration[]; /** * Resolve a declaration by trying to find the real value by following assignments. * @param node * @param context */ declare function resolveDeclarationsDeep(node: Node, context: { checker: TypeChecker; ts: typeof tsModule; }): Node[]; /** * Returns if the symbol has "alias" flag * @param symbol * @param ts */ declare function isAliasSymbol(symbol: Symbol, ts: typeof tsModule): boolean; /** * Returns a set of modifiers on a node * @param node * @param ts */ declare function getModifiersFromNode(node: Node, ts: typeof tsModule): Set | undefined; /** * Returns if a number has a flag * @param num * @param flag */ declare function hasFlag(num: number, flag: number): boolean; /** * Returns if a node has a specific modifier. * @param node * @param modifierKind */ declare function hasModifier(node: Node, modifierKind: SyntaxKind): boolean; /** * Returns the visibility of a node */ declare function getMemberVisibilityFromNode(node: PropertyDeclaration | PropertySignature | SetAccessorDeclaration | Node, ts: typeof tsModule): VisibilityKind | undefined; /** * Returns all keys and corresponding interface/class declarations for keys in an interface. * @param interfaceDeclaration * @param context */ declare function getInterfaceKeys(interfaceDeclaration: InterfaceDeclaration, context: AstContext): { key: string; keyNode: Node; identifier?: Node; declaration?: Node; }[]; declare function isPropertyRequired(property: PropertySignature | PropertyDeclaration, checker: TypeChecker): boolean; /** * Find a node recursively walking up the tree using parent nodes. * @param node * @param test */ declare function findParent(node: Node | undefined, test: (node: Node) => node is T): T | undefined; /** * Find a node recursively walking down the children of the tree. Depth first search. * @param node * @param test */ declare function findChild(node: Node | undefined, test: (node: Node) => node is T): T | undefined; /** * Find multiple children by walking down the children of the tree. Depth first search. * @param node * @param test * @param emit */ declare function findChildren(node: Node | undefined, test: (node: Node) => node is T, emit: (node: T) => void): void; /** * Returns the language of the node's source file * @param node */ declare function getNodeSourceFileLang(node: Node): "js" | "ts"; /** * Returns if a node is in a declaration file * @param node */ declare function isNodeInDeclarationFile(node: Node): boolean; /** * Returns the leading comment for a given node * @param node * @param ts */ declare function getLeadingCommentForNode(node: Node, ts: typeof tsModule): string | undefined; /** * Returns the declaration name of a given node if possible. * @param node * @param context */ declare function getNodeName(node: Node, context: { ts: typeof tsModule; }): string | undefined; /** * Returns the declaration name of a given node if possible. * @param node * @param context */ declare function getNodeIdentifier(node: Node, context: { ts: typeof tsModule; }): Identifier | undefined; export { AstContext, resolveDeclarations, getSymbol, resolveSymbolDeclarations, resolveDeclarationsDeep, isAliasSymbol, getModifiersFromNode, hasFlag, hasModifier, getMemberVisibilityFromNode, getInterfaceKeys, isPropertyRequired, findParent, findChild, findChildren, getNodeSourceFileLang, isNodeInDeclarationFile, getLeadingCommentForNode, getNodeName, getNodeIdentifier }; //# sourceMappingURL=chunk-ast-util-a227271c.d.ts.map