/** * Finds and reads the `/** … *\/` comment that documents a declaration, in * the tag vocabulary the Custom Elements Manifest analyzer reads (`@fires`, * `@slot`, `@csspart`, `@cssprop`, `@cssstate`, `@summary`, `@deprecated`, * `@example`). * * Vite's `parseAst` drops comments, so the comment is found by looking back * from the declaration's first character (its first decorator, or the * `export` that wraps it). Only whitespace may sit between the two, which is * also what makes a comment a doc comment rather than a stray one above. */ import type { DocEntry, DocExample } from '../../types/component-docs.js'; interface JsDocTag { tag: string; /** The text after the tag name, continuation lines joined with `\n`. */ text: string; } export interface JsDoc { /** The text before the first tag. */ description?: string; tags: JsDocTag[]; } /** The comment ending right before `position`, parsed. */ export declare const jsDocBefore: (code: string, position: number) => JsDoc | undefined; /** The comment starting right after `position` (past a decorator), parsed. */ export declare const jsDocAfter: (code: string, position: number) => JsDoc | undefined; /** `true` for a bare `@deprecated`, else its reason; `undefined` without one. */ export declare const deprecationOf: (doc: JsDoc | undefined) => boolean | string | undefined; /** The first `@tag`'s text, trimmed. */ export declare const tagText: (doc: JsDoc | undefined, name: string) => string | undefined; /** Every `@example` tag, in order, with line breaks and indentation kept. */ export declare const examplesOf: (doc: JsDoc | undefined) => DocExample[]; /** * `{Type} name - description`, with the type and the dash both optional. A * missing name (`@slot - The content`) is the empty name of a default slot. */ export declare const namedEntry: (text: string) => DocEntry; /** `@cssprop [--name=default] - description`, or `--name - description`. */ export declare const cssPropertyEntry: (text: string) => DocEntry; export {}; //# sourceMappingURL=jsdoc.d.ts.map