UNPKG

@rightcapital/phpdoc-parser

Version:

TypeScript version of PHPDoc parser with support for intersection types and generics

27 lines (26 loc) 938 B
import { type ImportDeclaration, type TypeNode } from 'typescript'; import type { TypeNode as PhpDocTypeNode } from '../ast/type/type-node'; export type NameNodePathResolver<T> = (this: T, nodeParts: string[]) => { path: string; importName: string; isTypeOnly: boolean; typeIdentifiers: string[]; }; export declare class PhpDocTypeNodeToTypescriptTypeNodeTranspiler { nameNodePathResolver: (nodeParts: string[]) => { path: string; importName: string; isTypeOnly: boolean; typeIdentifiers: string[]; }; constructor(nameNodePathResolver: (nodeParts: string[]) => { path: string; importName: string; isTypeOnly: boolean; typeIdentifiers: string[]; }); transpile(sourceTypeNode: PhpDocTypeNode): TypeNode; beforeTranspile(): void; getImportDeclarations(): ImportDeclaration[]; protected importDeclarations: ImportDeclaration[]; }