{
/** What gets copied instead of the code shown. */
text?: string;
/** Showing every row (controlled). */
expanded?: boolean;
defaultExpanded?: boolean;
/** Each expand or collapse (a press of `Toggle`, or the fold back). */
onExpandedChange?: (expanded: boolean) => void;
children?: ReactNode;
}
interface CodeSnippetContextValue {
/** `text`, else the code's text (one leading line break dropped, as `` does). */
copyText: string;
expanded: boolean;
/** The code is taller than the collapsed limit: `Toggle` shows. */
canExpand: boolean;
rows: SnippetRows;
/** The `Content` box's bounds in px (undefined: none). */
heights: {
max?: number;
min?: number;
};
code: RefObject;
setExpanded: (expanded: boolean) => void;
/** The parts' handlers. */
readCode: (text: string) => void;
setCanExpand: (canExpand: boolean) => void;
}
/** The state of the enclosing `CodeSnippet.Root` (expanded, canExpand, copyText …). */
export declare function useCodeSnippetContext(part?: string): CodeSnippetContextValue;
/** Holds the expanded state and the code's text; renders only its children. */
export declare function Root({ text, expanded: expandedProp, defaultExpanded, onExpandedChange, maxCollapsedRows, maxExpandedRows, minCollapsedRows, minExpandedRows, children, }: Readonly): import("react").JSX.Element;
/** The ``: its text is read back after every render (it can come from any children). */
export declare function Code({ ref, ...rest }: Readonly>): import("react").JSX.Element;
/**
* The multi-line snippet's box around the code, held between the row limits (`max-height` / `min-height`); it
* measures the code as it resizes, for `Toggle`, and folds an expanded snippet back when the code fits.
*/
export declare function Content({ style, ...rest }: Readonly>): import("react").JSX.Element;
/** "Show more / Show less": there only while the code is taller than the collapsed limit; a press expands or collapses. */
export declare function Toggle(props: Readonly, 'type'>>): import("react").JSX.Element | null;
export {};