/** @jsxImportSource react */ import { Field, FieldConfig, FieldInstance } from "./Field"; import type { RenderingContext } from "../../ui/RenderingContext"; import type { Instance } from "../../ui/Instance"; import { StringProp } from "../../ui/Prop"; export interface UploadButtonConfig extends FieldConfig { /** Set to `true` to allow multiple file selection. Default is `false`. */ multiple?: boolean; /** HTTP method used for upload. Default is `POST`. */ method?: string; /** Set to `true` to abort uploads when the component is destroyed. Default is `false`. */ abortOnDestroy?: boolean; /** Text displayed while upload is in progress. */ uploadInProgressText?: string; /** URL to upload files to. */ url?: StringProp; /** Text displayed on the button. */ text?: StringProp; /** Name or configuration of the icon to be displayed on the button. */ icon?: StringProp; /** File types accepted for upload. E.g. `image/*`, `.pdf`, etc. */ accept?: StringProp; /** Base CSS class to be applied to the button. Defaults to `uploadbutton`. */ baseClass?: string; /** Callback to resolve the upload URL for each file. */ onResolveUrl?: string | ((file: File, instance: Instance) => string | Promise); /** Callback invoked before upload starts. Return `false` to cancel the upload. */ onUploadStarting?: string | ((xhr: XMLHttpRequest, instance: Instance, file: File, formData: FormData) => boolean | Promise); /** Callback invoked when upload completes successfully. */ onUploadComplete?: string | ((xhr: XMLHttpRequest, instance: Instance, file: File, formData: FormData) => void); /** Callback invoked to report upload progress. */ onUploadProgress?: string | ((event: ProgressEvent, instance: Instance, file: File, formData: FormData) => void); /** Callback invoked when an upload error occurs. */ onUploadError?: string | ((error: unknown, instance: Instance, file: File, formData: FormData) => void); } export declare class UploadButton extends Field { multiple: boolean; method: string; abortOnDestroy: boolean; uploadInProgressText: string; onResolveUrl?: string | ((file: File, instance: Instance) => string | Promise); onUploadStarting?: string | ((xhr: XMLHttpRequest, instance: Instance, file: File, formData: FormData) => boolean | Promise); onUploadComplete?: string | ((xhr: XMLHttpRequest, instance: Instance, file: File, formData: FormData) => void); onUploadProgress?: string | ((event: ProgressEvent, instance: Instance, file: File, formData: FormData) => void); onUploadError?: string | ((error: unknown, instance: Instance, file: File, formData: FormData) => void); constructor(config?: UploadButtonConfig); declareData(...args: Record[]): void; renderInput(context: RenderingContext, instance: FieldInstance, key: string): React.ReactNode; } //# sourceMappingURL=UploadButton.d.ts.map