import type { FileValidationResult, FileValidationRule, FileValidationRuleSets } from '../../core/files'; import type { ButtonSize, ButtonVariant } from '../button'; import type { IconProp } from '../icon'; import type { Snippet } from 'svelte'; type Props = { /** @default 'md' */ size?: ButtonSize; /** @default 'secondary' */ variant?: ButtonVariant; disabled?: boolean; multiple?: boolean; /** Optional file-picker capture hint (mobile camera / mic). */ capture?: 'user' | 'environment'; /** * Rules applied to picked files — a single set (`FileValidationRule[]`) or several sets * (`FileValidationRule[][]`). With several sets, each file is validated by the first set * whose `accept` matches it (a set with no `accept` rule matches anything; a file matching * none is rejected). The native picker `accept` filter is auto-derived from every set's * `FileRules.Mime(...)` rule — pass the MIME pattern once via the rule. */ validationRules?: FileValidationRule[] | FileValidationRuleSets; /** Icon — forwarded to the underlying Button. */ icon?: IconProp; /** Icon position. @default 'leading' */ iconPosition?: 'leading' | 'trailing'; children?: Snippet; /** Required when no `children` (icon-only mode). */ 'aria-label'?: string; on?: { /** * Fires after the user picks files. Every result is delivered — consumer reads * `isValid` / `errors` to decide what to do (toast / proceed / mix valid + invalid). */ select?: (results: FileValidationResult[]) => void; }; }; /** * Programmatic file-picker button — clicking opens a native file dialog, applies * `validationRules` (if any), and emits `on.select(results: FileValidationResult[])`. * A thin wrapper around `Button` and the `openFile()` helper from `core/files`. Same selector * semantics as `FileUploader`, just exposed as a button instead of a drop zone. * * Error UX is consumer-owned — read `result.isValid` / `result.errors` and surface them via * `Toastr`, a `Banner`, or anything else. The component does not render error UI. */ declare const Cmp: import("svelte").Component; type Cmp = ReturnType; export default Cmp;