import { SvelteComponentTyped } from "svelte"; import type { SvelteHTMLElements } from "svelte/elements"; /** Pass `role` or `aria-live` to override the status-derived defaults. */ type $RestProps = SvelteHTMLElements["div"]; type $Props = { /** * Set the loading status. * @default "active" */ status?: "active" | "inactive" | "finished" | "error"; /** * Set the loading description. */ description?: string | undefined; /** * Specify a description for the loading icon. * Defaults to the `status` prop for the "error" and "finished" states. */ iconDescription?: string | undefined; /** * Specify the timeout delay (ms) before the `success` event fires after `status` is set to "finished" * @default 1500 */ successDelay?: number; /** * Wait this many milliseconds after `status` turns `"active"` before * showing the spinner. Once shown, the spinner stays for at least 500 ms, * so fast work shows nothing and slow work never flashes. A status that * arrives inside that time waits for it. While it waits, the spinner is * in the page but hidden, so server HTML already holds it. `"inactive"`, * `"finished"` and `"error"` render at once. * Set to `0` to show the spinner at once. * @default 0 */ delay?: number; /** * Set the size: `"sm"` fits a line of small text, such as a "Saving…" * status in a toolbar or list row, with 12px text and no minimum height. * @default "md" */ size?: "sm" | "md"; [key: `data-${string}`]: unknown; }; export type InlineLoadingProps = Omit<$RestProps, keyof $Props> & $Props; export default class InlineLoading extends SvelteComponentTyped< InlineLoadingProps, { click: WindowEventMap["click"]; mouseenter: WindowEventMap["mouseenter"]; mouseleave: WindowEventMap["mouseleave"]; mouseover: WindowEventMap["mouseover"]; success: CustomEvent; }, Record > {}