import{type PropertyValues,type TemplateResult}from'lit';import{LyraElement}from'../../../internal/lyra-element.js';import{type LyraAnchorTargetEventMap}from'../../../internal/anchor-target.js';import type{LyraAnchor,LyraAnchorKind}from'../document-viewer/anchors.js';import type{LyraSearchChangeDetail}from'../../../internal/text-viewer-target.js';export interface LyraCsvViewerEventMap extends Omit{'lr-render-error':CustomEvent<{error:unknown;}>; /** Fired whenever the search query, match count, or active match index changes, from * `search()`/`searchNext()`/`searchPrevious()`/`clearSearch()`. */ 'lr-search-change':CustomEvent;}declare class LyraCsvViewerBase extends LyraElement{}declare const LyraCsvViewer_base:Omit &(new(...args:ConstructorParameters)=>InstanceType &import("../../../lyra.js").LyraAnchorTarget&{renderAnchorLiveRegion():unknown;}); /** * Fetches CSV text, parses quoted fields with PapaParse, and virtualizes its rows. * * Adopts `DocumentAnchorTarget`: a `cell-range` anchor addresses the raw file grid, 1-based, with * the header row included whenever `has-header-row` is set (matching how a spreadsheet app itself * labels `A1`) -- `scrollToAnchor()` scrolls the addressed row into view via the virtualized list's * `active-item-id`, then scrolls the first addressed column horizontally into view. A `sheet`-qualified * anchor never resolves here -- this viewer has no sheets. `highlights` paint as a * `part="cell-highlight"` structural cell wrapping a native `part="cell-highlight-action"` button * on membership, recomputed per row inside `renderRow()` so a row scrolled out and back in * reconstructs its highlight for free, with no persistent DOM to keep in sync. * `search()` is a locale-aware case-insensitive substring match over the same stringified cell * values `cell()` already renders, ordered row then column. * * A quote-aware structural scan enforces the 10,000-raw-row, 1,000-column, 1,000,000-cell, and * 100-diagnostic ceilings before PapaParse can materialize an amplified result. The peer then runs * with streaming row callbacks and the same limits as a second boundary. * * @customElement lr-csv-viewer * @event lr-render-error - Fired when fetching or parsing fails, a parser is unavailable, the * bounded parse exceeds a resource ceiling, or PapaParse returns recoverable diagnostics. * @event lr-highlight-activate - A `highlights` cell was clicked, or activated via Enter/Space * while focused. `detail: { highlightId }`. * @event lr-anchor-result - Fired after an `anchor` property assignment or a `scrollToAnchor()` * call is applied. `detail: { found }`. * @event lr-search-change - Fired whenever the search query, match count, or active match index * changes, including source-reset and effective-locale re-evaluation. `detail: { query, * matchCount, matchCountExact, activeIndex }`. Search accepts at most 4,096 query code units, * scans at most 4,000,000 cell code units, and retains at most 1,000 matches; * `matchCountExact=false` identifies a ceiling-truncated lower bound. * @csspart base - The root wrapper with explicit `aria-busy` loading state. * @csspart body - The wrapper around the fetched-state content, capped by `max-height`; the nested * virtual-list remains the data-row scrollport within that allocation. * @csspart sheet - The named `role="table"` wrapper around the header row and virtualized body. * @csspart rows - The virtualized row list. * @csspart header-row - The persistent header above the virtualized row scrollport, rendered while * `has-header-row` is set. * @csspart data-row - One virtualized data row. * @csspart cell - One rendered cell. * @csspart cell-highlight - A structural cell covered by a `highlights` entry. * @csspart cell-highlight-action - The native button filling a highlighted cell; emits * `lr-highlight-activate` when activated. Its accessible name localizes the complete cell-value * and annotation message through separate `{value}` and `{label}` placeholders. * @csspart spinner - The visible tokenized loading treatment and ordinary text label. * @csspart error - The error message region. * @cssprop [--lr-csv-viewer-highlight-color=var(--lr-color-brand)] - Outline color of a highlighted * cell. The active highlight changes a private warning-color default; an inherited or direct * public value remains authoritative. * @cssprop [--lr-csv-viewer-max-height=none] - Maximum block size allocated to `[part="body"]`; * the nested virtual-list scrolls data rows within the remainder below the persistent header. * The `maxHeight` property sets this token inline on `[part="base"]`. * @status stable * @since 4.0.0 */ export declare class LyraCsvViewer extends LyraCsvViewer_base{static styles:import("lit").CSSResultGroup[]; /** URL to fetch and parse. */ src:string; /** Source filename or display name used on the shadow viewer owner when host `aria-label` is * absent. A non-empty host label remains on the host; an explicitly empty one is preserved on * the shadow owner. */ name:string; /** Whether the first parsed row is rendered as a sticky header. */ hasHeaderRow:boolean; /** CSS length that caps the scrollable body. */ /** A CSS `max-height`; invalid values are ignored. */ maxHeight:string; /** Anchor kinds this viewer resolves via `scrollToAnchor()`. */ readonly anchorKinds:readonly LyraAnchorKind[];private fetchState; /** The virtualized body row currently scrolled into view via `scrollToAnchor()` or search * navigation -- bound to ``'s own `active-item-id`. */ private activeRowKey;private searchMatches;private searchMatchCountExact;private searchActiveIndex;private searchQuery;private lastSearchLocale;private pendingSearchResetEvent;private loadTask;private loadLibrary;private lastLoadSrc;private readonly announcements;private readonly pendingAnimationFrames;connectedCallback():void;disconnectedCallback():void;adoptedCallback():void;private waitForOwnerAnimationFrame;private cancelPendingAnimationFrames;protected willUpdate(changed:PropertyValues):void;protected updated(changed:PropertyValues):void;private load; /** `rawRow` is 1-based, including the header row when present -- the same raw-file-grid * addressing convention every `cell-range` anchor uses. */ private cellHighlightsForRow;private renderCell;private renderRow; /** Scrolls raw-grid `(rawRow, col)` into view -- shared by `applyAnchor()` and every search * navigation method, so both stay byte-identical in how a coordinate becomes a scroll. */ private jumpToCell;protected applyAnchor(anchor:LyraAnchor):Promise;private scrollColumnIntoView; /** Case-insensitive substring search over every raw-grid cell's stringified value (the same * stringification `cell()` renders), ordered row then column -- the header row is included when * present, the same raw-grid convention `cell-range` anchors use. An empty/whitespace-only query * behaves like `clearSearch()` and resolves `0`. Returns at most 1,000 retained matches; * `lr-search-change.detail.matchCountExact=false` identifies that return as a lower bound. */ search(query:string):Promise; /** Advances to the next match, wrapping to the first after the last. Resolves `false` (no-op) * when there are no matches. */ searchNext():Promise; /** Moves to the previous match, wrapping to the last before the first. Resolves `false` (no-op) * when there are no matches. */ searchPrevious():Promise; /** Clears the query, matches, and active index, and resets `lr-search-change` to a * 0-match/no-active-index state. */ clearSearch():void;private emitSearchChange;private stopInternalEvent; /** Memoized `.items`/`.renderItem` inputs, keyed on the exact `rows` array * reference and `hasHeaderRow` -- a fresh `body` array and `renderItem` closure on every * render() (a search keystroke, active-row change, locale change, all unrelated to the data * itself) would otherwise defeat the virtual list's own offset-cache memoization on every one * of those, forcing its O(n) `recomputeOffsets()` and clearing measured row heights. `renderItem` * still reads live `this` state (highlights, etc.) on every call -- only its own identity is * cached, not its output. */ private virtualListInputsCache?;private virtualListInputs;render():TemplateResult;}declare global{interface HTMLElementTagNameMap{'lr-csv-viewer':LyraCsvViewer;}}export{};