jb-image-input-react
Version:
react image input component
44 lines (43 loc) • 1.61 kB
TypeScript
import React from 'react';
import 'jb-image-input';
import { JBImageInputWebComponent } from 'jb-image-input';
import type { JBImageInputConfig, JBImageInputBridge } from 'jb-image-input/types.js';
export { JBImageInputConfig, JBImageInputBridge };
declare global {
namespace JSX {
interface IntrinsicElements {
'jb-image-input': JBImageInputType;
}
interface JBImageInputType extends React.DetailedHTMLProps<React.HTMLAttributes<JBImageInputWebComponent<TValue>>, JBImageInputWebComponent<TValue>> {
class?: string;
label?: string;
message?: string;
name?: string;
required?: string | boolean;
}
}
}
type TValue = any;
export declare const JBImageInput: React.ForwardRefExoticComponent<JBImageInputProps<any> & React.RefAttributes<unknown>>;
export type JBImageInputEventType<T, TValue> = T & {
target: JBImageInputWebComponent<TValue>;
};
type JBImageInputProps<TValue> = {
className?: string;
message?: string;
label?: string;
required?: boolean;
config?: JBImageInputConfig;
value?: any;
uploadType?: string;
onChange?: (e: JBImageInputEventType<Event, TValue>) => void;
onImageSelected?: (e: JBImageInputEventType<CustomEvent, TValue>) => void;
bridge?: JBImageInputBridge<TValue>;
multiple?: boolean;
file?: File;
acceptTypes?: string;
maxFileSize?: number;
onMaxSizeExceed?: (e: JBImageInputEventType<Event, TValue>) => void;
children?: React.ReactNode;
name?: string;
};