@uiw/react-xml-reader
Version:
React component that handles xml file input and its parsing.
18 lines (17 loc) • 677 B
TypeScript
/// <reference types="react" />
import { X2jOptionsOptional } from 'fast-xml-parser';
export interface IFileInfo {
name: string;
size: number;
type: string;
modifiedAt: number;
}
export interface XMLReaderProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'onError'> {
strict?: boolean;
encoding?: string;
parserOptions?: X2jOptionsOptional;
onError?: (error: Error) => void;
onFileLoaded: (data: any, fileInfo: IFileInfo, originalFile: File, text: string) => void;
}
declare const XMLReader: import("react").ForwardRefExoticComponent<XMLReaderProps & import("react").RefAttributes<HTMLInputElement>>;
export default XMLReader;