import type { ModalSlideoutBase } from './cosmoz-modal-slideout'; import type { SlideoutBase } from './cosmoz-slideout'; /** Props of ``; all attributes/properties are optional. */ export interface Props { /** Show/hide the slideout (reactive, two-way; removing the attribute closes it). */ opened?: boolean; /** Cover the whole document (attribute `full-screen`). */ fullScreen?: boolean; /** Disable Escape-to-close (attribute `no-escape`). */ noEscape?: boolean; /** Show the slideout (a no-op when already open). */ open: () => void; /** Hide the slideout (a no-op when already closed). */ close: () => void; /** Toggle the `full-screen` state. */ toggleFullScreen: () => void; /** Label for the dialog (observed + mirrored onto the surface). */ 'aria-label'?: string; /** IDREF label for the dialog (observed + mirrored onto the surface). */ 'aria-labelledby'?: string; } /** Imperative controls the hooks register on the base element. */ export interface SlideoutControls { open(): void; close(): void; toggleFullScreen(): void; } /** Partially-filled controls during hook wiring (each hook adds its part). */ export type PartialControls = { [K in keyof SlideoutControls]?: SlideoutControls[K]; }; /** The `` element. */ export type SlideoutElement = HTMLElement & Props; /** The `` element. */ export type ModalElement = ModalSlideoutBase & Omit; /** Props of `` (property-free by design). */ export type PanelProps = Record; /** The `` element. */ export type PanelElement = HTMLElement & PanelProps; declare global { interface HTMLElementTagNameMap { 'cosmoz-slideout': SlideoutBase & Props; 'cosmoz-modal-slideout': ModalSlideoutBase & Props; 'cosmoz-slideout-panel': HTMLElement & PanelProps; } } /** Props accepted by the `slideout()` render helper. */ export interface SlideoutProps { /** Whether the slideout is open. */ opened?: boolean; /** Cover the whole document. */ fullScreen?: boolean; /** Disable Escape-to-close. */ noEscape?: boolean; /** Label for the dialog. */ ariaLabel?: string; /** IDREF label for the dialog. */ ariaLabelledby?: string; /** Class attribute for the host element. */ class?: string; /** Inline style for the host element. */ style?: string; /** Two-way binding handler for `opened`. */ onOpenedChanged?: (e: CustomEvent<{ value: boolean; }>) => void; /** Full-screen flip handler. */ onFullScreenChanged?: (e: CustomEvent<{ value: boolean; }>) => void; }