import{type TemplateResult,type PropertyValues}from'lit';import{LyraElement}from'../../../internal/lyra-element.js';import type{LyraFrame}from'../../../internal/variants.js';import{type LyraClipboardWriteFailure,type LyraClipboardWriteSuccess}from'../../../internal/clipboard.js'; /** Visual chrome for ``'s root — the library's shared container-frame vocabulary. */ export type StackTraceAppearance=LyraFrame;export interface LyraStackTraceEventMap{'lr-frame-select':CustomEvent<{file:string;line:number;column?:number;raw:string;}>;'lr-copy':CustomEvent;'lr-error':CustomEvent;'lr-copy-error':CustomEvent;} /** * `` — parses common V8/JS-TS, Firefox/Safari, and Python stack traces into a * leading message plus activatable frames, splitting chained/caused-by errors into separate * groups. Frames matching `internalPatterns` (`node_modules/`, `node:internal`, * `site-packages/`, ... by default) fold behind a count-labeled toggle. Falls back to verbatim * raw text when nothing parses. A malformed or unsafe numeric location remains visible as raw, * non-activatable trace text rather than becoming an invalid navigation target. Parsing and raw * rendering are bounded by the exported `STACK_TRACE_LIMITS`; `[part="limit"]` makes any omitted * input explicit. First-party invention (no Web Awesome equivalent). * `internalPatterns` is a clone-owned, bounded readonly snapshot; create and reassign a new array * after changing the matcher sequence. * * @customElement lr-stack-trace * @event lr-frame-select - `detail: { file, line, column?, raw }` — a frame with a safe parsed * location was activated (`column` is always undefined for Python frames, which carry no column * information). Malformed or unsafe locations render as raw text and never emit this event. * @event lr-copy - `detail: { ok: true, text }` — the raw-trace clipboard write completed. * @event lr-error - The clipboard write failed; generic no-detail notification. * @event lr-copy-error - `detail: { ok: false, text, reason, error }` — typed clipboard failure. * @csspart base - The root wrapper; respects `max-height`. Tightens its padding under `compact` * and drops its card chrome under `frame="plain"`. * @csspart message - The leading error message text for a group. * @csspart group - One chained-error group of frames. * @csspart frame - A selectable frame button (carrying `data-internal` for internal frames), or a * non-activatable raw row when the source location is malformed or unsafe. * @csspart frame-function - The frame's function name. * @csspart frame-location - The frame's `file:line:col` text. * @csspart internal-toggle - The collapse/expand toggle for a run of internal frames. * @csspart raw - The verbatim `
` fallback when zero structured frames parsed.
* @csspart limit - Localized notice rendered when a parser resource ceiling omitted input.
* @csspart copy-button - The copy-to-clipboard button, only rendered while `copyable`.
* @cssprop [--lr-stack-trace-max-height=none] - Cap on how tall `[part="base"]` grows before it
*   scrolls internally. `none` lets the component grow with its content; the `max-height`
*   attribute sets this token.
* @cssprop [--lr-stack-trace-font=var(--lr-font-mono)] - Font family for the parsed frames and the
*   verbatim raw fallback.
* @cssprop [--lr-stack-trace-internal-frame-color=var(--lr-color-text-quiet)] - Internal frame foreground.
* @cssprop [--lr-stack-trace-interactive-color=var(--lr-color-brand)] - Interactive frame/toggle accent.
* @cssprop [--lr-stack-trace-compact-padding=var(--lr-space-2xs)] - `[part="base"]` padding while
*   `compact`. Overridden entirely by `frame="plain"`.
* @cssprop [--lr-stack-trace-compact-gap=var(--lr-space-2xs)] - Space below `[part="message"]` and
*   between `[part="group"]`s while `compact`.
* @cssprop [--lr-stack-trace-background=var(--lr-color-surface)] - Fill of the outer card
*   (`[part="base"]`) while `frame="card"`. `frame="plain"` still removes the fill entirely.
* @cssprop [--lr-stack-trace-border-color=var(--lr-color-border)] - Colour of the outer card's
*   border.
* @cssprop [--lr-stack-trace-radius=var(--lr-radius)] - Corner radius of the outer card.
*   `frame="plain"` still squares the corners.
* @status stable
* @since 4.0.0
*/
export declare class LyraStackTrace extends LyraElement{static styles:import("lit").CSSResultGroup[];
/** The raw stack trace text to parse and render. Removing the attribute clears its displayed text. */
trace:string;
/** Folds runs of internal frames (matching `internalPatterns`) behind a toggle. */
collapseInternal:boolean;
/** Clone-owned file-path substrings/`RegExp`s that mark a frame as internal. Defaults to
*  `DEFAULT_INTERNAL_PATTERNS` (common Node/browser/Python framework locations). Assignment
*  retains non-blank strings, clone-owns `RegExp`s, drops malformed entries without suppressing
*  valid later entries, bounds the result, and freezes it. Reassign a new array after changes. */
private _internalPatterns;get internalPatterns():readonly(string|RegExp)[];set internalPatterns(value:readonly(string|RegExp)[]);
/** Shows a copy-to-clipboard button for the raw trace text. */
copyable:boolean;
/** Visual chrome, in the library's shared container-frame vocabulary. `'card'` (the default)
*  keeps the bordered, filled, padded box. `'plain'` removes the border, background, padding and
*  corner radius so a trace nested inside an `lr-result-card`/`lr-agent-run` (which already draws
*  a border) doesn't double the box. `plain` wins over `compact` when both are set (nothing left
*  to tighten). The `max-height` scroll cap and the copy/stack-frame affordances are unaffected. */
frame:LyraFrame;
/** Tighter root padding and between-group spacing for dense contexts (a trace rendered as a row
*  in an error list, a side panel) -- same convention as ``'s and
*  ``'s `compact`, and the counterpart `frame` already had. Defaults to
*  `false`, i.e. the full card padding. Purely a density knob: the border, corner radius and
*  background stay, so use `frame="plain"` to drop the chrome entirely. */
compact:boolean;
/** Caps the rendered block size and enables an internal scrollbar once content exceeds it
*  (any valid CSS length, e.g. `'20rem'`). Empty string (the default) grows with content. */
maxHeight:string;private groups;private boundedSource;private parseTruncated;private expandedInternalRuns;private copyStatus;private copyTimer?;private copyGeneration;private limitAnnouncementSink?;private limitAnnouncementInitialized;private previouslyTruncated;connectedCallback():void;disconnectedCallback():void;adoptedCallback():void;private syncLimitAnnouncementSink;private cancelCopyTimer;private resetCopyFeedback;protected willUpdate(changed:PropertyValues):void;protected updated(changed:PropertyValues):void;private onCopy;private copyTrace;private isCurrentCopy;private showCopyStatus;private onFrameClick;private toggleInternalRun;private renderFrame;private renderGroup;render():TemplateResult;}declare global{interface HTMLElementTagNameMap{'lr-stack-trace':LyraStackTrace;}}