import { DocComment } from '@microsoft/tsdoc'; import type { CategoryDescription, ConfigPropertyWidget } from '@o3r/core'; import * as ts from 'typescript'; /** Configuration information extracted from the TSDoc */ export interface ConfigDocInformation { /** Description */ description: string; /** Title (taken from `@title` tag) */ title?: string; /** label (taken from `@label` tag) */ label?: string; /** Tags (taken from `@tags` tag) */ tags?: string[]; /** Restriction keys (taken from `@o3rRestrictionKey` tag) */ restrictionKeys?: string[]; /** Category (taken from `@o3rCategory` tag) */ category?: string; /** Category (taken from `@o3rCategories` tag) */ categories?: CategoryDescription[]; /** Widget information (taken from `@o3rWidget` and `@o3rWidgetParam` tag) */ widget?: ConfigPropertyWidget; /** `@o3rRequired` tag presence */ required?: boolean; } /** * Get description from a given DocComment. * @param docComment The DocComment to get description from */ export declare function getDescriptionFromDocComment(docComment: DocComment): string; /** * Get title from a given DocComment. * * The title is extracted from `@title` tag. * @param docComment The DocComment to get title from */ export declare function getTitleFromDocComment(docComment: DocComment): string | undefined; /** * Get widget information from a given DocComment. * * The widget information are extracted from `@o3rWidget` and `@o3rWidgetParam` tag. * @param docText The tsdoc text to get widget information from */ export declare function getWidgetInformationFromDocComment(docText: string): ConfigPropertyWidget | undefined; /** * Get tags from a given DocComment. * * The tags are extracted from `@tags` tag. * The following format should be matched. * @param docComment The DocComment to get tags from * @example * ```typescript * /** * ... * @tags [booking, ssci, servicing * upSell, pax_page] * \/ * ``` */ export declare function getTagsFromDocComment(docComment: DocComment): string[] | undefined; /** * Is the tag `@o3rRequired` present in `docText` * @param docText */ export declare function isO3rRequiredTagPresent(docText: string): boolean; /** * Get restriction keys from a given DocComment. * * The restriction keys extracted from `@o3rRestrictionKey` tag. * @param docComment The DocComment to get restriction keys from */ export declare function getRestrictionKeysFromDocText(docComment: string): string[]; /** * Get categories from a given DocComment. * * The categories are extracted from the `@o3rCategories` tags. * @param docComment The DocComment to get categories from */ export declare function getCategoriesFromDocText(docComment: string): CategoryDescription[] | undefined; /** * TSDocParser wrapper with a custom TSDoc configuration compatible with configuration doc. */ export declare class ConfigDocParser { /** TSDoc parser */ private readonly tsDocParser; constructor(); /** * Parse the configuration information from a given node. * @param source Typescript SourceFile node of the file * @param node Node to get the TSDoc text from */ parseConfigDocFromNode(source: ts.SourceFile, node: ts.Node): ConfigDocInformation | undefined; } //# sourceMappingURL=config-doc.d.ts.map