/** * How `sink` is applied on {@link KUBACoverElement}, within its `on` * attribute. */ type KUBACoverOnAttributeSink = 'method' | 'attribute' | 'setter' /** * Shape of the `on` attribute of {@link KUBACoverElement} — an arc string * in the form `source/event:type/sink`, optionally followed by one or more * `|filter=value` pairs. Inherited from the `Echo` mixin. * * This only constrains the shape (the four `/`/`:`-separated segments and * the `type` segment); `source`, `event`, `sink`, and filter contents remain * free-form strings, since TypeScript cannot validate the full grammar (e.g. * arbitrary characters, filter repetition) through a template literal type. * The check only applies to string literals — a value assigned from a plain * `string` variable falls back to unchecked `string`. */ type KUBACoverOnAttribute = `${string}/${string}:${KUBACoverOnAttributeSink}/${string}${'' | `|${string}`}` /** * Custom element `` — renders a cropped, aspect-ratio-constrained * cover image. * * @example * ```html * * ``` */ export default class KUBACoverElement extends HTMLElement { /** * Alternative text for the underlying `` (reflects the `alt` * attribute). * @default '' */ alt: string /** * Whether the cover is hidden (reflects the `hidden` attribute). The * attribute value `"false"` or `"0"` (or the attribute being absent) * reads as `false`; any other value — including `""`, as in * `