@htmlbricks/hb-bundle
Version:
Single IIFE loader for all HTML Bricks hb-* web components from the jsDelivr CDN, with optional Subresource Integrity; includes agent/LLM docs and theme CSS variables.
72 lines (65 loc) • 2.35 kB
TypeScript
/**
* DOM typings for `hb-paginate`. Attribute values are strings (objects/arrays as JSON strings).
* Generated — do not edit by hand.
*/
import type { Component, Events } from "./webcomponent.type";
/**
* Host properties already on `HTMLElement` (no `svelte/elements` here — DOM typings stay
* usable without Svelte). Custom `Component` keys that collide stay on the native typing.
*/
type DomKeys = keyof HTMLElement;
type HbComponentAttrs = {
[K in keyof Component as K extends DomKeys ? never : K]?: string;
};
type HbHtmlElementWithoutListeners = Omit<
HTMLElement,
"addEventListener" | "removeEventListener"
>;
/**
* Re-declare listener methods so custom `Events` overloads are compatible with
* `HTMLElement` (subclass methods must remain assignable to the base signatures).
*
* Like `svelte-elements.d.ts`, we `Omit` keys we define on `HbComponentAttrs` from the DOM
* base, then add them back: avoids `extends A, B` merging the same key with incompatible types
* if a name slips past `DomKeys`.
*/
export interface HbPaginateElement
extends Omit<HbHtmlElementWithoutListeners, keyof HbComponentAttrs>,
HbComponentAttrs {
addEventListener<K extends keyof HTMLElementEventMap>(
type: K,
listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any,
options?: boolean | AddEventListenerOptions
): void;
addEventListener<K extends keyof Events & string>(
type: K,
listener: (this: this, ev: CustomEvent<Events[K]>) => void,
options?: boolean | AddEventListenerOptions
): void;
addEventListener(
type: string,
listener: EventListenerOrEventListenerObject,
options?: boolean | AddEventListenerOptions
): void;
removeEventListener<K extends keyof HTMLElementEventMap>(
type: K,
listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any,
options?: boolean | EventListenerOptions
): void;
removeEventListener<K extends keyof Events & string>(
type: K,
listener: (this: this, ev: CustomEvent<Events[K]>) => void,
options?: boolean | EventListenerOptions
): void;
removeEventListener(
type: string,
listener: EventListenerOrEventListenerObject,
options?: boolean | EventListenerOptions
): void;
}
declare global {
interface HTMLElementTagNameMap {
"hb-paginate": HbPaginateElement;
}
}
export {};