UNPKG

1.79 kBTypeScriptView Raw
1import * as bt from '@babel/types';
2import { NodePath } from 'ast-types/lib/node-path';
3import Documentation, { PropDescriptor } from '../Documentation';
4import type { ParseOptions } from '../types';
5export declare function getRawValueParsedFromFunctionsBlockStatementNode(blockStatementNode: bt.BlockStatement): string | null;
6/**
7 * Extract props information form an object-style VueJs component
8 * @param documentation
9 * @param path
10 */
11export default function propHandler(documentation: Documentation, path: NodePath, ast: bt.File, opt: ParseOptions): Promise<void>;
12export declare function describePropsFromValue(documentation: Documentation, propsValuePath: NodePath<bt.ObjectExpression, any> | NodePath<bt.ArrayExpression, any>, ast: bt.File, opt: ParseOptions, modelPropertyName?: string | null): Promise<void>;
13/**
14 * Deal with the description of the type
15 * @param propPropertiesPath
16 * @param propDescriptor
17 * @returns the unaltered type member of the prop object
18 */
19export declare function describeType(propPropertiesPath: NodePath<bt.ObjectProperty | bt.ObjectMethod>[], propDescriptor: PropDescriptor): string | undefined;
20export declare function getTypeFromTypePath(typePath: NodePath<bt.TSAsExpression | bt.Identifier | bt.ObjectProperty>): {
21 name: string;
22 func?: boolean;
23};
24export declare function getValuesFromTypeAnnotation(type: bt.TSType): string[] | undefined;
25export declare function describeRequired(propPropertiesPath: NodePath<bt.ObjectProperty | bt.ObjectMethod>[], propDescriptor: PropDescriptor): void;
26export declare function describeDefault(propPropertiesPath: NodePath<bt.ObjectProperty | bt.ObjectMethod>[], propDescriptor: PropDescriptor, propType: string): void;
27export declare function extractValuesFromTags(propDescriptor: PropDescriptor): void;