UNPKG

ranui

Version:

A framework-agnostic Web Components UI library built on native custom elements, with TypeScript types, light/dark theming, SSR and PWA support.

45 lines (44 loc) 1.64 kB
import { RanElement } from '@/utils/index'; import { EventManager } from '@/utils/builder'; export declare class Button extends RanElement { _btn: HTMLDivElement; _btnContent: HTMLDivElement; _iconElement?: HTMLElement; _slot: HTMLSlotElement; _shadowDom: ShadowRoot; _events: EventManager; debounceTimeId?: NodeJS.Timeout; static get observedAttributes(): string[]; constructor(); get sheet(): string; set sheet(value: string); get disabled(): boolean | string; set disabled(value: boolean | string | undefined | null); get iconSize(): string; set iconSize(value: string | undefined | null); get icon(): string; set icon(value: string | null); get effect(): string; set effect(value: string | null); /** Visual variant: `''` (default) | `'primary'` (monochrome) | `'warning'` | `'text'`. Drives the `:host([type=...])` styles. */ get type(): string; set type(value: string | null); /** * @description: 设置 button 的 icon */ setIcon: () => void; mousedown: (event: MouseEvent) => void; mouseup: () => void; keydown: (event: KeyboardEvent) => void; debounceMouseEvent: () => void; handlerExternalCss: () => void; syncA11yState: () => void; connectedCallback(): void; /** * @description: FIX: 修正拼写错误 disconnectCallback -> disconnectedCallback * 确保组件销毁时正确移除事件监听,彻底杜绝内存泄漏。 */ disconnectedCallback(): void; attributeChangedCallback(name: string, oldValue: string, newValue: string): void; } export default Button;