import { UIElement } from "./ui-element.js"; import { PlayerController } from "../player/controller.js"; import { ButtonState, MediaButtonComponent, StateAttrMap } from "@videojs/core"; import { ButtonActivationSource, UIEvent } from "@videojs/core/dom"; import { PropertyDeclarationMap, PropertyValues } from "@videojs/element"; import { State } from "@videojs/store"; import { Text } from "@videojs/core/i18n"; //#region src/ui/media-button-element.d.ts type LabelParams = Record; /** The core a media button element drives: it reads `MediaState` and computes `ComponentState`. */ type MediaButtonCore = MediaButtonComponent & { setMedia(media: MediaState): void; getLabelParams?: (state: ComponentState) => LabelParams | undefined; /** Shorter text for the tooltip than the accessible name, when the two differ. */ getTooltipLabel?: (state: ComponentState) => Text | string; /** CSS custom properties the button publishes for skins. */ getCSSVars?: (state: ComponentState) => Record; }; /** * Abstract base for HTML custom elements that render a media-control button. `ComponentState` is the state the button * reflects to data attributes, and `MediaState` is the player state it reads and acts on. Pass both: a subclass that * omits them still compiles, but types `activate(state)` and `mediaState` as the `ButtonState` and `object` defaults. */ export declare abstract class MediaButtonElement extends UIElement { #private; static properties: PropertyDeclarationMap; disabled: boolean; label: Text | string; protected abstract readonly core: MediaButtonCore; protected abstract readonly stateAttrMap: StateAttrMap; protected abstract readonly mediaState: PlayerController; protected abstract activate(state: MediaState, event: UIEvent, source: ButtonActivationSource): void | Promise; protected getIsButtonDisabled(): boolean; protected handleActivate(event: UIEvent, source: ButtonActivationSource): void; /** Override to set the hotkey action name for `aria-keyshortcuts`. */ protected readonly hotkeyAction: string | undefined; /** Override to match hotkeys that use action values, such as seek steps. */ protected get hotkeyValue(): number | undefined; get $state(): State; connectedCallback(): void; disconnectedCallback(): void; /** Returns the button's current label derived from media state. */ getLabel(): string | undefined; getShortcut(): string | undefined; /** Resolved label for tooltips and other display surfaces. */ getResolvedLabel(): string | undefined; protected willUpdate(changed: PropertyValues): void; protected update(changed: PropertyValues): void; /** * Whether this button writes its core's `hidden` state to the `hidden` attribute. A subclass returns `false` while * another owner, such as a linked menu, manages its visibility. */ protected reflectsHidden(): boolean; } //#endregion //# sourceMappingURL=media-button-element.d.ts.map