import { j as WalkedField, w as SchemaMeta } from "../../types-BBQaEPfE.mjs"; import { t as AllConstraints } from "../../renderer-ab9E52Bp.mjs"; import { r as LitRenderProps } from "../../types-BCy7K3nk.mjs"; import { LitElement, TemplateResult } from "lit"; //#region src/lit/renderers/baseElement.d.ts /** * Detail payload emitted on the `sc-change` Custom Event. * * The event bubbles and is composed so cross-Shadow-DOM listeners * (e.g. the orchestrating `` outside the child's * shadow tree) receive it without breaking encapsulation. */ interface ScChangeEventDetail { value: unknown; /** Path of the field that produced the change. */ path: string; } /** * Canonical Custom Event name emitted by every built-in `` * element when its user-facing input changes. * * The orchestrating `` listens for this internal * event, applies the resulting structural update to the root value, * and re-emits a public `change` Custom Event on its own host so * framework consumers observe a single, well-typed boundary event. */ declare const SC_CHANGE_EVENT = "sc-change"; /** * Base class for the built-in `` Custom Elements. * * Subclasses declare: * * 1. A `static properties` table extending `BaseScElement.properties`. * 2. A `render()` method returning the per-type `TemplateResult`. * * The class deliberately does not implement `render()` itself — a * `LitElement` without `render()` is still constructible, but its * default behaviour is to render nothing. Subclasses are required to * override. */ declare abstract class BaseScElement extends LitElement { /** * Property declarations shared by every built-in Custom Element. * * Subclasses spread this in: * * ```ts * static override properties = { * ...BaseScElement.properties, * ... * }; * ``` * * Every shared property uses `attribute: false` — none of the * payloads (`tree`, `value`, `meta`, `constraints`) round-trip * safely through HTML attribute strings. */ static readonly properties: { tree: { attribute: boolean; }; value: { attribute: boolean; }; readOnly: { attribute: boolean; }; writeOnly: { attribute: boolean; }; path: { attribute: boolean; }; meta: { attribute: boolean; }; constraints: { attribute: boolean; }; examples: { attribute: boolean; }; change: { attribute: boolean; }; renderChild: { attribute: boolean; }; }; tree: WalkedField; value: unknown; readOnly: boolean; writeOnly: boolean; path: string; meta: SchemaMeta; constraints: AllConstraints; examples?: unknown[]; change: (value: unknown) => void; renderChild: LitRenderProps["renderChild"]; constructor(); /** * Dispatch the canonical `sc-change` event. Renderers call this * inside DOM event handlers (`@input`, `@change`, `@click` on * add/remove controls) — the orchestrating ancestor catches the * event, propagates the structural update to the root value, and * re-emits a top-level `change` event on its own host. */ protected emitChange(value: unknown): void; } /** * Build a `renderChild` closure that delegates back to the * orchestrating resolver dispatch. Container renderers (object, array, * tuple, record, union, discriminatedUnion, conditional, negation) * call this to recursively render their children without re-running * the resolver dispatch loop themselves. * * The closure is stored on the parent's render props and forwarded to * the resolver render function, mirroring the `renderChild` signatures * on the React and HTML render-props (see `core/renderer.ts`). */ type LitRenderChild = LitRenderProps["renderChild"]; /** * Trivial pass-through helper used by renderers that need to emit a * `nothing` placeholder rather than a full `TemplateResult`. Keeps the * dispatch table strictly typed without forcing callers to import * `nothing` from Lit. */ declare const emptyTemplate: () => TemplateResult; //#endregion export { BaseScElement, LitRenderChild, SC_CHANGE_EVENT, ScChangeEventDetail, emptyTemplate };