UNPKG

@mui/internal-docs-infra

Version:

MUI Infra - internal documentation creation tools.

17 lines 1.02 kB
import type { ElementContent } from 'hast'; /** * Scans forward through sibling nodes to determine if `=>` or a function body `{` * follows after the matching `)` for the current `(`. This confirms that a * parenthesized expression is actually a function parameter list. * * Starts scanning from `charIndex` within the text node at `siblings[siblingIndex]`, * with an initial paren depth of 1 (the opening `(` has been consumed). */ export declare function hasArrowAfterParens(siblings: ElementContent[], siblingIndex: number, charIndex: number): boolean; /** * After finding the matching `)`, checks subsequent siblings for `=>` (pl-k span or text). * Bare `{` is NOT accepted — that pattern is a function declaration handled by case 3 * (sawFunctionKeyword). Accepting `{` here would false-classify `if(cond){}` as a function. * Skips whitespace text nodes and return-type annotations (`: Type`). */ export declare function checkSiblingsForArrow(siblings: ElementContent[], startIndex: number): boolean;