import { LitElement, PropertyValues, RenderOptions } from 'lit'; /** * `String(value)` for a value of unknown shape (field values, row cells, JSON data). * Primitives read as usual; anything else keeps `String()`'s own behaviour so display * never changes with the type — one funnel instead of a `no-base-to-string` at each use. */ /** * Runtime guards for rich props. The TS type says `T[]` / `Record`, but hosts assign * from JSON (`el.markers = json.markers`) and JS hosts pass `undefined` freely, so * every read goes through here instead of a `?? []` that the type-aware lint would * (rightly, for TS callers) flag as unnecessary. */ export declare function arr(value: T[] | null | undefined): T[]; export declare function obj(value: T | null | undefined): T | Record; export declare function stringOf(value: unknown): string; /** * True when a real DOM is present. Lit's own `isServer` is hard-coded to `true` in its * node build, which jsdom/happy-dom test runners also load, so guards that need "is there * a document to touch" feature-detect instead: the @lit-labs/ssr dom shim has no * `querySelector`. */ export declare function hasDom(): boolean; /** * Attribute converter for booleans that DEFAULT TO TRUE. Lit's own `type: Boolean` reads * `show-close="false"` as true (presence is all it checks), so a default-true switch could * never be turned off from HTML. With this: absent = default, bare = true, `="false"` = false. * * @property({ attribute: 'show-close', converter: boolOff }) showClose = true; */ export declare const boolOff: { fromAttribute: (value: string | null) => boolean; toAttribute: (value: boolean) => string | null; }; /** Signature of the light-DOM hydrate function installed by `bank20baht-ui/hydrate`. */ export type BahtHydrate = (value: unknown, host: HTMLElement, options?: RenderOptions) => void; /** * While a parent hydrates, the hydrate module parks each nested `baht-*` child's server * markup under this key so the parent's hydration walk does not see the child's part * markers. `hasSsrMarkup` treats a parked stash as "still server-rendered". */ export declare const SSR_STASH: unique symbol; /** True while the element's light DOM still holds un-hydrated server-rendered Lit markup. */ export declare function hasSsrMarkup(host: Element): boolean; /** Light-DOM Lit base: consumer CSS reaches every internal node (spec 01 §6). */ export declare class BahtElement extends LitElement { /** * Per-instance sequence for unique DOM ids (`for`/`id`/`aria-*` pairs). Stays `0` for the * server render and for the client's hydrating render so both produce identical markup. * The number is allocated at the first update — not in `connectedCallback`, which the * HTML parser can fire before the server-rendered children exist: plain client-side * mounts get it just before their first render (single render, as before), hydrated * ones right after hydration (one extra render that rewrites the ids). */ protected uid: number; protected createRenderRoot(): HTMLElement; static get observedAttributes(): string[]; attributeChangedCallback(name: string, old: string | null, value: string | null): void; connectedCallback(): void; protected update(changed: PropertyValues): void; /** Dispatch a bubbling, composed CustomEvent — crosses any light/shadow DOM boundary. */ protected emit(name: string, detail?: unknown): void; } /** * Light DOM has no . Call from firstUpdated() to move author-supplied * children into `slot` — everything that isn't the rendered `root` or a Lit * comment marker. (During HTML parsing children can land after * connectedCallback fires, so sweeping at first render is the reliable point.) */ export declare function adoptLightChildren(host: HTMLElement, slot: HTMLElement): void;