import { ChangeDetectorRef, ElementRef, EventEmitter } from '@angular/core';
import * as i0 from "@angular/core";
/**
* A borderless heading with a click-to-edit title and an optional
* click-to-edit description, plus a projected slot for actions.
*
* Layout: `[title] | [description] [actions]`
*
* - Click the title to rename; click the description (or the ghost
* "+ Add description" button when empty) to edit it.
* - Only one of title or description can be edited at a time.
* - While either is being edited, the `[actions]` slot is hidden so
* projected controls don't compete with the edit affordance.
*
* Commit semantics: `titleChange` / `descriptionChange` fire when the user
* commits — Enter, outside click, or the Check button — not on every
* keystroke, and always on commit (even when the value is unchanged). The
* "commit" framing over "change" is deliberate: consumers that persist on
* commit (analytics, PATCH) treat the gesture itself as the event; those
* that only care about diffs can compare `next === current` in the handler.
*
* Escape cancels: reverts the draft back to the current value and drops out
* of edit mode WITHOUT emitting a change. Outside-click still commits (to
* match `riv-date` / `riv-select`); Escape is the deliberate abandon path.
*
* Value handling follows the same convention as `riv-text-field`: `[title]`
* and `[description]` are treated as suggestions, not authoritative state.
* On commit, the component keeps displaying the user's committed value,
* and only overwrites its internal state when the parent explicitly sends
* a different value. That lets the component demo out of the box (e.g. in
* Storybook) without requiring a round trip through the parent.
*
* Programmatic entry into edit mode is available via `startEditingTitle()`
* and `startEditingDescription()` — obtain a reference with
* `@ViewChild(EditableHeadingComponent)`. Use these for secondary entry
* points like a kebab-menu "Rename" item, or to auto-open rename after
* creating a new entity.
*
* The component owns no border, background, or card chrome — consumers who
* want a bordered container should wrap it.
*
* ```html
*
*
*
*
*
*
*
*
*
*
* ```
*/
export declare class EditableHeadingComponent {
private readonly cdr;
private readonly host;
protected _title: string;
set title(v: string);
get title(): string;
protected _description: string;
set description(v: string);
get description(): string;
titleMaxLength: number;
descriptionMaxLength: number;
/**
* When true, the title and description are not clickable and cannot be
* edited. Any in-progress edit is dropped without emitting. Imperative
* `startEditing*` calls no-op. Useful for consumers that need to gate
* editing on a permission or a broader "actions disabled" state.
*/
protected _disabled: boolean;
set disabled(v: boolean);
get disabled(): boolean;
titleChange: EventEmitter;
descriptionChange: EventEmitter;
private titleInputRef?;
private descriptionInputRef?;
protected mode: 'view' | 'editingTitle' | 'editingDescription';
protected draftTitle: string;
protected draftDescription: string;
constructor(cdr: ChangeDetectorRef, host: ElementRef);
get isEditing(): boolean;
/**
* Enter title-edit mode programmatically. Same behavior as clicking the
* title — populates the edit buffer from the current value, focuses the
* input with the caret at the end, and hides the actions slot. No-op if
* already in an editing mode or when the component is disabled.
*
* Intended for consumers that offer a secondary entry point to renaming
* (e.g. a kebab menu item), or that want to auto-open rename after
* creating a new entity. Bind via `@ViewChild(EditableHeadingComponent)`.
*/
startEditingTitle(): void;
/**
* Enter description-edit mode programmatically. Same behavior as clicking
* the description (or the "+ Add description" button). No-op if already
* in an editing mode or when the component is disabled.
*/
startEditingDescription(): void;
protected commitTitle(): void;
protected commitDescription(): void;
/**
* Abandon the current edit and return to view mode. No change is emitted.
* Wired to the Escape key on both edit inputs; also called internally
* when `disabled` flips to true mid-edit.
*/
protected cancel(): void;
protected onDocumentMouseDown(target: EventTarget | null): void;
private focusEnd;
static ɵfac: i0.ɵɵFactoryDeclaration;
static ɵcmp: i0.ɵɵComponentDeclaration;
}