import type { TooltipPlacement } from '../tooltip/tooltip.js'; import '../tooltip/tooltip.js'; import type { ExpandedDetail, CopyDetail } from '../shared/events.js'; import { UiElement } from '../shared/element.js'; export type CodeSnippetType = 'single' | 'multi' | 'inline'; declare const UiCodeSnippet_base: (new (...args: any[]) => import("../shared/align.ts").AlignAlias) & typeof UiElement; /** * Carbon `CodeSnippet`. `type="single"`: one 40px line that scrolls sideways, read-only textbox, * copy button at the end. `type="multi"`: a block collapsed to at most `max-collapsed-rows` * (15 × 16px) with a "Show more" / "Show less" button when longer, copy button top-right, * optional `wrap-text`. `type="inline"`: a `` chip that is itself the copy button * (or plain with `hide-copy-button`). The copied text is `text`, else the slotted content. * * As in `
`, one line break directly after the opening tag is dropped.
 *
 * @slot - The code
 * @fires ui-copy - detail: { text }; cancelable
 * @fires ui-toggle - detail: { expanded } when "Show more / less" is used
 * @csspart container - Scrolling container (single) / `
` wrapper (multi)
 * @csspart code - The `` element
 * @csspart copy-button - The `` (single / multi)
 * @csspart expand-button - The "Show more / less" button (multi)
 * @attr align - Carbon's name for `placement` (same values)
 * @cssprop --ui-code-background - Fill of the snippet (default `--ui-surface-1`; Kanok: a light grey on its white surfaces)
 * @cssprop --ui-code-radius - Corners of the single and multi-line snippets (default 0; Kanok: 8px; the inline chip keeps its 4px)
 * @cssprop --ui-focus-offset - `outline-offset` of its focus ring (default -2px: inside; Kanok: 2px outside)
 */
export declare class UiCodeSnippet extends UiCodeSnippet_base {
    /** `el.focus()` lands on the control inside. */
    static readonly shadowRootOptions: ShadowRootInit;
    static readonly styles: import("lit").CSSResult[];
    type: CodeSnippetType;
    private readonly localize;
    /** Text to copy instead of the slotted content. */
    text: string;
    /** Accessible name of the read-only textbox (single / multi); inline: the copy button's tooltip and description (the button is named by its code, WCAG 2.5.3). */
    label: string;
    /** Tooltip of the copy button (single / multi). */
    copyLabel: string;
    feedback: string;
    feedbackTimeout: number;
    placement: TooltipPlacement;
    hideCopyButton: boolean;
    wrapText: boolean;
    disabled: boolean;
    expanded: boolean;
    showMoreText: string;
    showLessText: string;
    /** Rows (16px) visible while collapsed; 0 = no limit. */
    maxCollapsedRows: number;
    /** Rows visible while expanded; 0 = no limit. */
    maxExpandedRows: number;
    minCollapsedRows: number;
    minExpandedRows: number;
    private canExpand;
    private copied;
    private readonly codeEl;
    private readonly inlineTooltip;
    private observer?;
    private timer?;
    connectedCallback(): void;
    disconnectedCallback(): void;
    protected firstUpdated(): void;
    protected updated(changed: Map): void;
    /** What gets copied: `text`, else the slotted code. */
    get copyText(): string;
    /** Carbon: the Show more / less button appears when the code is taller than the collapsed limit. */
    private measure;
    private get rows();
    /** Like `
`: drop one line break right after the opening tag. */
    private onSlotChange;
    private containerStyle;
    private copyInline;
    private renderInline;
    private renderCopyButton;
    private renderSingle;
    private renderExpandButton;
    private renderMulti;
    render(): import("lit-html").TemplateResult<1>;
}
export interface UiCodeSnippetEventMap extends HTMLElementEventMap {
    'ui-toggle': CustomEvent;
    'ui-copy': CustomEvent;
}
/** Typed listeners for UiCodeSnippet's events (declaration merging with the class). */
export interface UiCodeSnippet {
    addEventListener(type: K, listener: (this: UiCodeSnippet, event: UiCodeSnippetEventMap[K]) => unknown, options?: boolean | AddEventListenerOptions): void;
    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
    removeEventListener(type: K, listener: (this: UiCodeSnippet, event: UiCodeSnippetEventMap[K]) => unknown, options?: boolean | EventListenerOptions): void;
    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
}
declare global {
    interface HTMLElementTagNameMap {
        'ui-code-snippet': UiCodeSnippet;
    }
}
export {};