@yamada-ui/react
Version:
React UI components of the Yamada, by the Yamada, for the Yamada built with React and Emotion
67 lines (66 loc) • 3.42 kB
TypeScript
import { Dict } from "../../utils/index.js";
import { HTMLProps, PropGetter } from "../../core/components/index.types.js";
import "../../core/index.js";
import { FieldProps } from "../field/field.js";
import { UseClickableProps } from "../../hooks/use-clickable/index.js";
import "../../index.js";
import * as react865 from "react";
import { RefObject } from "react";
//#region src/components/file-input/use-file-input.d.ts
type UseFileInputProps<Y extends "button" | "input" = "input"> = FieldProps & Omit<HTMLProps<Y>, "defaultValue" | "onChange" | "ref" | "value"> & Pick<HTMLProps<"input">, "accept" | "multiple" | "ref"> & {
/**
* The initial value of the file input.
*/
defaultValue?: File[];
/**
* Ref to a reset function.
*/
resetRef?: RefObject<(() => void) | null>;
/**
* The value of the file input.
*/
value?: File[];
/**
* Function to be called when a file change event occurs.
*/
onChange?: (files: File[] | undefined) => void;
};
declare const useFileInput: <Y extends "button" | "input" = "input">(props: UseFileInputProps<Y>) => {
disabled: boolean | undefined;
interactive: boolean;
readOnly: boolean | undefined;
required: boolean | undefined;
values: File[] | undefined;
clickableProps: (Omit<UseClickableProps<HTMLElement, Dict<any>>, "disabled" | "ref" | "tabIndex" | "onKeyDown" | "onKeyUp" | "onClick" | "onMouseDown" | "onMouseLeave" | "onMouseOver" | "onMouseUp" | "clickOnEnter" | "clickOnSpace" | "disableTouchBehavior" | "focusable" | "focusOnClick"> & {
ref: (node: any) => void;
type: "button";
"aria-disabled": boolean | undefined;
disabled: boolean | undefined;
onClick: (ev: react865.MouseEvent<HTMLElement, MouseEvent>) => void;
onKeyDown: react865.KeyboardEventHandler<HTMLElement> | undefined;
onKeyUp: react865.KeyboardEventHandler<HTMLElement> | undefined;
onMouseDown: react865.MouseEventHandler<HTMLElement> | undefined;
onMouseLeave: react865.MouseEventHandler<HTMLElement> | undefined;
onMouseOver: react865.MouseEventHandler<HTMLElement> | undefined;
onMouseUp: react865.MouseEventHandler<HTMLElement> | undefined;
}) | (Omit<UseClickableProps<HTMLElement, Dict<any>>, "disabled" | "ref" | "tabIndex" | "onKeyDown" | "onKeyUp" | "onClick" | "onMouseDown" | "onMouseLeave" | "onMouseOver" | "onMouseUp" | "clickOnEnter" | "clickOnSpace" | "disableTouchBehavior" | "focusable" | "focusOnClick"> & {
ref: (node: any) => void;
"aria-disabled": "true" | undefined;
"data-active": string | undefined;
role: string;
tabIndex: number | undefined;
onClick: (ev: react865.MouseEvent<HTMLElement, MouseEvent>) => void;
onKeyDown: (ev: react865.KeyboardEvent<HTMLElement>) => void;
onKeyUp: (ev: react865.KeyboardEvent<HTMLElement>) => void;
onMouseDown: (ev: react865.MouseEvent<HTMLElement, MouseEvent>) => void;
onMouseLeave: (ev: react865.MouseEvent<HTMLElement, MouseEvent>) => void;
onMouseOver: (ev: react865.MouseEvent<HTMLElement, MouseEvent>) => void;
onMouseUp: (ev: react865.MouseEvent<HTMLElement, MouseEvent>) => void;
});
getFieldProps: PropGetter<"div", undefined, undefined>;
getInputProps: PropGetter<"input", undefined, undefined>;
};
type UseFileInputReturn = ReturnType<typeof useFileInput>;
//#endregion
export { UseFileInputProps, UseFileInputReturn, useFileInput };
//# sourceMappingURL=use-file-input.d.ts.map