/**
 * Official Type definitions for JSS Parser
 * https://jspreadsheet.com/products/parser
 * Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
 */

import jspreadsheet from './jspreadsheet';

declare function parser(options?: parser.options): void;

declare namespace parser {

    interface options {
        /** Load the XLSX from a remote URL. Bear in mind any potential CORS restrictions using this property. */
        url?: string;
        /** Define the decimal and a thousand separator based on a locale. */
        locale?: string;
        /** Try to import embed cell style as HTML */
        parseHTML?: boolean;
        /** Enable or disable the loading spin. Default: true */
        loadingSpin?: boolean;
        /** load from a local file. This property is used along input type='file' */
        file?: object;
        /** When the file is loaded. */
        onload?: (config: jspreadsheet.Spreadsheet) => void;
        /** Method to be called when something is wrong. */
        onerror?: (error: object) => void;
    }
}

export default parser;
