import type { JSX } from "@solidjs/web"; import { type Accessor } from "solid-js"; import { type MaybeAccessor } from "../internals/maybe-accessor.js"; import type { ProgressStatus } from "./progress-root-context.js"; export type { ProgressStatus }; /** * Options for {@link createProgress}. Every reactive input is a * `MaybeAccessor`; pass an accessor for live updates. * * Headless primitive — no Label/track/value/indicator parts. The wrapper * `` layers the label-id registry, the NVDA-pump span, and * the per-part adapters on top. */ export interface CreateProgressOptions { /** Current value (`null` = indeterminate). */ value: MaybeAccessor; /** Minimum value. @default 0 */ min?: MaybeAccessor; /** Maximum value. @default 100 */ max?: MaybeAccessor; /** `Intl.NumberFormat` options forwarded to {@link formatNumberValue}. */ format?: MaybeAccessor; /** Locale for {@link Intl.NumberFormat}. Defaults to runtime locale. */ locale?: MaybeAccessor; /** * Compute `aria-valuetext`. Receives the formatted value (empty string * when indeterminate) and the raw numeric value. Default returns * `"indeterminate progress"` when null, otherwise the formatted string * (or `"%"` if no `format` given). */ getAriaValueText?: (formattedValue: string | null, value: number | null) => string; } /** Slot bag for the `
` element. */ export interface ProgressRootSlotProps { role: "progressbar"; "aria-valuemin": number; "aria-valuemax": number; "aria-valuenow": number | undefined; "aria-valuetext": string; } /** Public api returned by {@link createProgress}. */ export interface ProgressApi { /** Current value (`null` = indeterminate). */ value: Accessor; /** Minimum (defaults to 0). */ min: Accessor; /** Maximum (defaults to 100). */ max: Accessor; /** Formatted value string (empty string when null). */ formattedValue: Accessor; /** `"indeterminate" | "progressing" | "complete"`. */ status: Accessor; /** Resolved `aria-valuetext`. */ ariaValueText: Accessor; /** Slot bag for the root element. */ root: (userProps?: U) => ProgressRootSlotProps & (U extends object ? U : object); /** * Context provider. Wrap a subtree to make the api discoverable via * `useProgress()`. */ Provider: (props: { children: JSX.Element; }) => JSX.Element; } /** * Read the nearest {@link ProgressApi} provided by `c.Provider`. Throws if * called outside a Provider. */ export declare function useProgress(): ProgressApi; /** * Solid-native headless progress primitive. Pure derivations from the input * value/min/max — no internal state. Pair with `` for the * structural wrapper, or use `c.root()` directly for a fully custom shell. */ export declare function createProgress(options: CreateProgressOptions): ProgressApi; //# sourceMappingURL=create-progress.d.ts.map