import type { ArrayProperty, StringProperty } from "@rebasepro/types"; import { EntityValues, StorageConfig, StorageSource, StorageSourceRegistry } from "@rebasepro/types"; export type StorageFieldSize = "smallest" | "small" | "medium" | "large" | number; /** * Internal representation of an item in the storage * It can have two states, having a storagePathOrDownloadUrl set, * which means the file has been uploaded, and it is rendered as a preview * Or have a pending file being uploaded. */ export interface StorageFieldItem { id: number; storagePathOrDownloadUrl?: string; file?: File; fileName?: string; metadata?: Record; size: StorageFieldSize; } export declare function useStorageUploadController>({ entityId, entityValues, path, value, property, propertyKey, storageSource, storageSourceRegistry, disabled, onChange }: { entityId?: string | number; entityValues: EntityValues; value: string | string[] | null; path?: string; propertyKey: string; property: StringProperty | ArrayProperty | StringProperty | ArrayProperty; storageSource: StorageSource; /** Optional explicit registry. When omitted, the hook reads from the * `StorageSourcesContext` provided by ``. */ storageSourceRegistry?: StorageSourceRegistry; disabled: boolean; onChange: (value: string | string[] | null) => void; }): { internalValue: StorageFieldItem[]; setInternalValue: import("react").Dispatch>; storage: StorageConfig; fileNameBuilder: (file: File) => Promise; storagePathBuilder: (file: File) => string; onFileUploadComplete: (uploadedPath: string, entry: StorageFieldItem, metadata?: Record, uploadedUrl?: string) => Promise; onFileUploadError: (entry: StorageFieldItem) => void; onFilesAdded: (acceptedFiles: File[]) => Promise; multipleFilesSupported: boolean; /** The resolved StorageSource for this property — may differ from the * default context source when `StorageConfig.storageSource` is set. */ resolvedStorageSource: StorageSource; };