import * as ts from "typescript"; import type { ComponentDoc, ComponentNameResolver, FileParser, JSDoc, Method, MethodParameter, PropFilter, PropItemType, Props, StaticPropFilter, StringIndexedObject } from "./types"; export interface ParserOptions { propFilter?: StaticPropFilter | PropFilter; componentNameResolver?: ComponentNameResolver; shouldExtractLiteralValuesFromEnum?: boolean; shouldRemoveUndefinedFromOptional?: boolean; shouldExtractValuesFromUnion?: boolean; skipChildrenPropWithoutDoc?: boolean; savePropValueAsString?: boolean; shouldIncludePropTagMap?: boolean; shouldIncludeExpression?: boolean; customComponentTypes?: string[]; } export declare function parse(filePathOrPaths: string | string[], parserOpts?: ParserOptions): ComponentDoc[]; /** * Constructs a parser for a default configuration. */ export declare function withDefaultConfig(parserOpts?: ParserOptions): FileParser; /** * Constructs a parser for a specified tsconfig file. */ export declare function withCustomConfig(tsconfigPath: string, parserOpts: ParserOptions): FileParser; /** * Constructs a parser for a specified set of TS compiler options. */ export declare function withCompilerOptions(compilerOptions: ts.CompilerOptions, parserOpts?: ParserOptions): FileParser; export declare class Parser { private readonly checker; private readonly propFilter; private readonly shouldRemoveUndefinedFromOptional; private readonly shouldExtractLiteralValuesFromEnum; private readonly shouldExtractValuesFromUnion; private readonly savePropValueAsString; private readonly shouldIncludePropTagMap; private readonly shouldIncludeExpression; constructor(program: ts.Program, opts: ParserOptions); private getComponentFromExpression; getComponentInfo(exp: ts.Symbol, source: ts.SourceFile, componentNameResolver?: ComponentNameResolver, customComponentTypes?: ParserOptions["customComponentTypes"]): ComponentDoc | null; extractPropsFromTypeIfStatelessComponent(type: ts.Type): ts.Symbol | null; extractPropsFromTypeIfStatefulComponent(type: ts.Type): ts.Symbol | null; extractMembersFromType(type: ts.Type): ts.Symbol[]; getMethodsInfo(type: ts.Type): Method[]; getModifiers(member: ts.Symbol): string[]; getParameterInfo(callSignature: ts.Signature): MethodParameter[]; getCallSignature(symbol: ts.Symbol): ts.Signature; isTaggedPublic(symbol: ts.Symbol): boolean; getReturnDescription(symbol: ts.Symbol): ts.SymbolDisplayPart[] | undefined; private getValuesFromUnionType; private getInfoFromUnionType; getDocgenType(propType: ts.Type, isRequired: boolean): PropItemType; getPropsInfo(propsObj: ts.Symbol, defaultProps?: StringIndexedObject): Props; findDocComment(symbol: ts.Symbol): JSDoc; /** * Extracts a full JsDoc comment from a symbol, even * though TypeScript has broken down the JsDoc comment into plain * text and JsDoc tags. */ getFullJsDocComment(symbol: ts.Symbol): JSDoc; getFunctionStatement(statement: ts.Statement): ts.FunctionDeclaration | ts.ArrowFunction | ts.FunctionExpression | undefined; extractDefaultPropsFromComponent(symbol: ts.Symbol, source: ts.SourceFile): {}; getLiteralValueFromImportSpecifier(property: ts.ImportSpecifier): string | boolean | number | null | undefined; getLiteralValueFromPropertyAssignment(property: ts.PropertyAssignment | ts.BindingElement): string | boolean | number | null | undefined; getPropMap(properties: ts.NodeArray): StringIndexedObject; }