@rightcapital/php-parser
Version:
TypeScript types for PHP Parser JSON representation
25 lines (24 loc) • 1.34 kB
TypeScript
import type { VarTagValueNode } from '@rightcapital/phpdoc-parser';
import type { INode } from '../types/node';
import type { Class_ } from '../types/node/stmt/class';
import { NodeType, type NodeTypeInheritingFromNodeAbstract, type NodeTypeToInterfaceMap } from '../types/types';
import { type ITypeGenerationPackage } from './php-doc-helpers';
export type IUseFullQualifiedNameParts = string[];
export type IUses = {
[name: string]: IUseFullQualifiedNameParts;
};
export interface IProperty {
name: string;
commentText: string;
varTagValueNode: VarTagValueNode;
typeGenerationPackage: ITypeGenerationPackage;
}
export declare class NodeRetrieverHelpers {
static getRootClassNode(rootNode: NodeTypeInheritingFromNodeAbstract[]): Class_;
static getPropertiesFromClassNode(classNode: Class_, filePathParts: string[], fileRelativePath: string, uses: IUses): IProperty[];
static getUsesMap(rootNode: NodeTypeInheritingFromNodeAbstract[]): IUses;
static getGetTypeFunctionReturnValue(classNode: Class_): string | undefined;
static findNodeByNodeType<T extends NodeType>(nodes: INode[], nodeType: T): NodeTypeToInterfaceMap[T] | undefined;
static filterNodeByNodeType<T extends NodeType>(nodes: INode[], nodeType: T): NodeTypeToInterfaceMap[T][];
static getPartsByName(name: string): string[];
}