UNPKG

@mui/internal-docs-infra

Version:

MUI Infra - internal documentation creation tools.

16 lines 800 B
import type { Nodes } from 'hast'; /** * Returns the set of 1-indexed source line numbers that are visible when * the rendered code block is collapsed (i.e. the user hasn't clicked * "expand"). Mirrors the visibility rule applied at runtime by `<Pre>`: * * - Frames whose `data-frame-type` is `'highlighted'`, `'focus'`, * `'padding-top'`, or `'padding-bottom'` are visible. * - When no such emphasis frame exists, only the first frame is shown * (this matches `getInitialVisibleFrames` in `<Pre>`). * * `tree` must be the output of `parseSource` (a `Root` whose top-level * children are frame `Element`s with `'line'` `Element` descendants). * Returns an empty set for an empty/invalid tree. */ export declare function getInitialVisibleSourceLines(tree: Nodes): Set<number>;