import type { As, Component, Props, Options } from 'ariakit-react-utils';
import React, { Fragment } from 'react';
import { Link, Version } from 'multiformats';
import { CARMetadata, UploaderContextState, UploaderContextActions } from '@w3ui/uploader-core';
export declare enum Status {
    Idle = "idle",
    Uploading = "uploading",
    Failed = "failed",
    Succeeded = "succeeded"
}
export type UploaderComponentContextState = UploaderContextState & {
    /**
     * A string indicating the status of this component - can be 'uploading', 'done' or ''.
     */
    status: Status;
    /**
     * Error thrown by upload process.
     */
    error?: Error;
    /**
     * a File to be uploaded
     */
    file?: File;
    /**
     * A callback that can be passed to an `onSubmit` handler to
     * upload `file` to web3.storage via the w3up API
     */
    handleUploadSubmit?: (e: Event) => Promise<void>;
    /**
     * The CID of a successful upload
     */
    dataCID?: Link<unknown, number, number, Version>;
    /**
     * Shards of a DAG uploaded to web3.storage
     */
    storedDAGShards: CARMetadata[];
};
export type UploaderComponentContextActions = UploaderContextActions & {
    /**
     * Set a file to be uploaded to web3.storage. The file will be uploaded
     * when `handleUploadSubmit` is called.
     */
    setFile: (file?: File) => void;
};
export type UploaderComponentContextValue = [
    state: UploaderComponentContextState,
    actions: UploaderComponentContextActions
];
interface OnUploadCompleteProps {
    file?: File;
    dataCID?: Link<unknown, number, number, Version>;
}
export type OnUploadComplete = (props: OnUploadCompleteProps) => void;
export type UploaderRootOptions<T extends As = typeof Fragment> = Options<T> & {
    onUploadComplete?: OnUploadComplete;
};
export type UploaderRootProps<T extends As = typeof Fragment> = Props<UploaderRootOptions<T>>;
/**
 * Top level component of the headless Uploader.
 *
 * Designed to be used with Uploader.Form and Uploader.Input
 * to easily create a custom component for uploading files to
 * web3.storage.
 */
export declare const UploaderRoot: Component<UploaderRootProps>;
export type InputOptions<T extends As = 'input'> = Options<T>;
export type InputProps<T extends As = 'input'> = Props<InputOptions<T>>;
/**
 * Input component for the headless Uploader.
 *
 * A file `input` designed to work with `Uploader`. Any passed props will
 * be passed along to the `input` component.
 */
export declare const Input: Component<InputProps>;
export type FormOptions<T extends As = 'form'> = Options<T>;
export type FormProps<T extends As = 'form'> = Props<FormOptions<T>>;
/**
 * Form component for the headless Uploader.
 *
 * A `form` designed to work with `Uploader`. Any passed props will
 * be passed along to the `form` component.
 */
export declare const Form: Component<FormProps>;
/**
 * Use the scoped uploader context state from a parent `Uploader`.
 */
export declare function useUploaderComponent(): UploaderComponentContextValue;
export declare const Uploader: Component<UploaderRootProps<React.ExoticComponent<{
    children?: React.ReactNode;
}>>> & {
    Input: Component<InputProps<"input">>;
    Form: Component<FormProps<"form">>;
};
export {};
