import * as react_jsx_runtime from 'react/jsx-runtime'; import * as React$1 from 'react'; import React__default from 'react'; interface FileItem { id: number | string; filename: string; uploader_id: string; filepath: string; created_at: string; download_count: number; download_limit: number | null; shareable: boolean; needsPassword: boolean; share_password: string | null; password_str: string | null; } interface ApiRow { id: number | string; filename: string; uploader_id: string; filepath: string; created_at: string; download_count: number; download_limit: number | null; shareable: boolean; needsPassword: boolean; share_password: string; password_str: string | null; } interface FileTableProps { files: FileItem[]; loading: boolean; error: Error | null; onDownload(id: any): Promise; onToggleShare(id: any): Promise; onPatchShare(id: any): Promise; onDelete(id: any): Promise; } interface ShareModalProps { file: FileItem | null; onClose(): void; onSave(patch: Partial): Promise; } interface UploadProps { /** Called *after* a successful upload */ onUploaded: () => Promise; } interface FileRowProps { file: FileItem; onDownload: () => Promise; onSettings: () => void; onToggleShare: () => Promise; onDelete: () => any; } interface QueuedFile { file: File; relPath: string; progress: number; } interface InputProps { label?: any; type?: any; value?: any; onChange?: any; disabled?: any; placeholder?: any; error?: string; } interface FileInputExtra { directory?: boolean; multiple?: boolean; accept?: string; } /** keep other InputProps fields … */ type EnhancedInputProps = InputProps & FileInputExtra; declare function Button({ children, color, variant, className, ...rest }: React.ButtonHTMLAttributes & { color?: 'gray' | 'green' | 'blue'; variant?: 'default' | 'icon' | 'primary' | 'secondary'; className?: string; }): react_jsx_runtime.JSX.Element; declare function Checkbox({ label, ...rest }: React__default.InputHTMLAttributes & { label: string; }): react_jsx_runtime.JSX.Element; declare function Input({ label, trailing, ...rest }: React__default.InputHTMLAttributes & { label: string; trailing?: React__default.ReactNode; }): react_jsx_runtime.JSX.Element; declare function Spinner(): react_jsx_runtime.JSX.Element; declare function fetchSharePatch(opts: any): Promise; /** * Makes a secure fetch through your API gateway. */ declare function secureFetchIt(endpoint: any, body?: any, method?: any, headers?: Record | null, blob?: boolean, noApi?: boolean, withCredentials?: boolean, returnJson?: boolean, returnResult?: boolean): Promise; interface AppConfig { API_BASE_URL?: string; BASE_API_URL?: string; } interface EndpointInfo { endpoint: string; methods: string[]; url: string; } /** * Get API base URL from /assets/config.json, or fall back. */ declare function getBaseUrl(): Promise; /** * Always resolves a usable base URL. */ declare function getUrl(baseUrl?: string | null): Promise; /** * Fetch the endpoint list from /endpoints. */ declare function getEndpoints(baseUrl?: string | null): Promise; /** * Fetch and cache endpoint slug/url map. */ declare function getUrls(): Promise>; /** * Find best-matching endpoint by slug, endpoint name, or URL. */ declare function getEndpoint(keyword: string): Promise; /** Non-React “direct download” used by some old links (kept for parity) */ declare function directDownload(item: FileItem): Promise; declare function downloadFile(item: FileItem): Promise; declare function downloadSelect(item: FileItem): Promise; /** Given a checkbox inside a table-row → download that row’s file. */ declare function downloadRow(cb: HTMLInputElement): Promise; /** Bulk download: pass a NodeList or array of checkboxes. */ declare function downloadSelected(checkboxes: Iterable): Promise; /** Helper function to trigger file download */ declare function triggerDownload(blob: Blob, filename: string): void; /** Wire up header + row checkboxes once the table is in the DOM. */ declare function initSelectAll(): void; /** * Classic “select all rows” logic (still handy in non-React views * such as the admin dashboard). */ declare function syncHeaderCheckbox(): void; /** Utility for other screens: toggle a list of checkboxes on/off. */ declare function toggleCheckboxes(cbs: HTMLInputElement[]): void; /** Generic PATCH helper kept for other admin forms */ declare function patchFileSetting(fileId: string, field: string, value: unknown): Promise>; /** Classic file-upload for the fallback HTML page. */ declare function uploadFile(file: any, subdir: any): Promise; interface UploadResponse { filepath: string; } declare function uploadFiles(file: File, subdir?: string): Promise; declare function removeFile(item: any): Promise; /** Bulk download: pass a NodeList or array of checkboxes. */ declare function removeSelected(checkboxes: Iterable): Promise; /** Given a checkbox inside a table-row → download that row’s file. */ declare function removeRow(cb: HTMLInputElement): Promise; /** GET /secure-list */ declare function listFiles(setFiles?: any): Promise; declare function getToggleShare(file: any): boolean; declare function updateFileShare(file: any): FileItem; /** * Custom hook to toggle share settings on a file item */ declare function toggleShare(file: FileItem): Promise; /** * Custom hook that returns a memoized loadFiles callback */ declare const useLoadFiles: (setLoading: React__default.Dispatch>, setError: React__default.Dispatch>, setFiles: React__default.Dispatch>) => () => Promise; /** * Custom hook to toggle share settings on a file item */ declare const useToggleShare: (setFiles: React__default.Dispatch>) => (file: FileItem) => Promise; /** * Custom hook to toggle share settings on a file item */ declare const usePatchShareSettings: (setFiles: React__default.Dispatch>) => (file: any) => Promise; declare function useFiles(): { files: FileItem[]; loading: boolean; error: Error | null; load: () => Promise; toggleShare: (file: FileItem) => Promise; patchShareSettings: (updated: any) => Promise; deleteFile: (file: FileItem) => Promise; setFiles: React$1.Dispatch>; setLoading: React$1.Dispatch>; setError: React$1.Dispatch>; }; /** * Custom hook to toggle share settings on a file item */ declare const useDeleteFile: (setFiles: React__default.Dispatch>) => (file: FileItem) => Promise; declare const useSaveShareSettings: (setFiles: React__default.Dispatch>) => (updated: any) => Promise; declare function FileRow({ file, onDownload, onSettings, onToggleShare, onDelete, }: FileRowProps): react_jsx_runtime.JSX.Element; declare function ShareModal({ file, onClose, onSave }: ShareModalProps): React$1.ReactPortal | null; declare function FileTable({ files, loading, error, onToggleShare, onPatchShare, onDelete }: FileTableProps): react_jsx_runtime.JSX.Element; declare function Upload({ onUploaded }: UploadProps): react_jsx_runtime.JSX.Element; export { Button, Checkbox, FileRow, FileTable, Input, ShareModal, Spinner, Upload, directDownload, downloadFile, downloadRow, downloadSelect, downloadSelected, fetchSharePatch, getBaseUrl, getEndpoint, getEndpoints, getToggleShare, getUrl, getUrls, initSelectAll, listFiles, patchFileSetting, removeFile, removeRow, removeSelected, secureFetchIt, syncHeaderCheckbox, toggleCheckboxes, toggleShare, triggerDownload, updateFileShare, uploadFile, uploadFiles, useDeleteFile, useFiles, useLoadFiles, usePatchShareSettings, useSaveShareSettings, useToggleShare }; export type { ApiRow, AppConfig, EndpointInfo, EnhancedInputProps, FileItem, FileRowProps, FileTableProps, QueuedFile, ShareModalProps, UploadProps };