/// <reference types="node" />
/// <reference types="node" />
import "reflect-metadata";
import { DocumentContentError } from "./Comprobante-to-XML";
import { Factura, InfoFactura } from "./Structures/Factura";
import { InfoNotaCredito, NotaCredito } from "./Structures/NotaCredito";
import { TablaCodigoDocumento, TablaFormasPago, TablaPorcentajeIVA, TablaTipoIdentificacion, TipoContribuyenteRimpe, TipoObligadoContabilidad, TablaImpuesto } from "./Structures/Utils/TablasSRI";
import CertificateRelatedError from "./Utils/CertificateRelatedError";
import EnvioComprobantesSRIError from "./Utils/EnvioComprobantesSRIError";
import { FacturaData, NotaCreditoData, VentaInfoTributaria } from "./data-interfaces";
import { WebServiceSRIError } from "./Utils/parseWebServiceResponse";
export type DocumentStatus = "XML_CREADO" | "XML_FIRMADO" | "DEVUELTA" | "RECIBIDA" | "NO AUTORIZADO" | "AUTORIZADO";
export type ComprobanteType = "factura" | "comprobanteRetencion" | "guiaRemision" | "notaCredito" | "liquidacionCompra";
export type ReportProgressFn = (info: {
    message: string;
    percentage: number;
    document_status: DocumentStatus;
    /** XML created or signed or  xml envelope, or xml authorized (authorization response) */
    result?: string;
}) => void;
export interface ContribuyenteData {
    ruc: string;
    razonSocial: string;
    dirMatriz: string;
    /** @typedef {[1|2]} 1=Pruebas, 2=Produccion */
    ambiente: 1 | 2;
    /**  @typedef {[1]} 1=Emision normal */
    tipoEmision: 1;
    /** Número de la resolución, omitiendo los ceros a la izquierda */
    agenteRetencion?: string;
    contribuyenteRimpe?: TipoContribuyenteRimpe;
    obligadoContabilidad: TipoObligadoContabilidad;
    contribuyenteEspecial?: number;
    nombreComercial: string;
    dirEstablecimiento?: string;
}
export interface ComprobanteAutorizadoResult<T> {
    document: T;
    spent_time_ms: number;
    fechaAutorizacion: Date;
    ambiente: "PRUEBAS" | "PRODUCCIÓN";
    document_status: "AUTORIZADO";
    xml_approved_document: string;
    xml_signed_document: string;
}
declare class EnvioComprobantesSRI {
    private contribuyente_data;
    private p12Cert;
    private _certInfo;
    CertInfo(): {
        razonSocialDiferente: boolean;
        validFrom: Date;
        validTo: Date;
        organizationName: string;
        organizationSerialNumber: string;
        emailAddress: string;
        subjectName: string;
        subjectSerialNumber: string;
        commonName: string;
        issuerCommonName: string;
    };
    ContribuyenteData(): {
        ruc: string;
        razonSocial: string;
        dirMatriz: string;
        /** @typedef {[1|2]} 1=Pruebas, 2=Produccion */
        ambiente: 2 | 1;
        /**  @typedef {[1]} 1=Emision normal */
        tipoEmision: 1;
        /** Número de la resolución, omitiendo los ceros a la izquierda */
        agenteRetencion?: string;
        contribuyenteRimpe?: TipoContribuyenteRimpe;
        obligadoContabilidad: TipoObligadoContabilidad;
        contribuyenteEspecial?: number;
        nombreComercial: string;
        dirEstablecimiento?: string;
    };
    constructor(cert: {
        path: string;
        password: string;
    } | {
        file: Buffer;
        password: string;
    }, contribuyente_data: ContribuyenteData);
    private add_contribuyente_data;
    /**
     * Cuando un comprobante ya ha sido subido, solicita al SRI que dicho comprobante sea autorizado.
     * Este proceso se debe realizar si en "AutorizacionComprobanteSRI" ocurre un error y el proceso se detiente
     * despues del estado RECIBIDA.
     * @param clave_acceso
     * @param ambiente
     * @param signal
     */
    SolicitarAutorizacionEnComprobanteSubido(clave_acceso: string, ambiente: number, signal?: AbortSignal): Promise<{
        fechaAutorizacion: Date;
        ambiente: "PRUEBAS" | "PRODUCCIÓN";
        document_status: "AUTORIZADO";
        xml_approved_document: any;
    }>;
    AutorizarComprobanteSRI(document_type: "factura", data: FacturaData, reportProgress?: ReportProgressFn, signal?: AbortSignal, time_between_sri_requests?: number): Promise<ComprobanteAutorizadoResult<Factura>>;
    AutorizarComprobanteSRI(document_type: "notaCredito", data: NotaCreditoData, reportProgress?: ReportProgressFn, signal?: AbortSignal, time_between_sri_requests?: number): Promise<ComprobanteAutorizadoResult<NotaCredito>>;
}
export { EnvioComprobantesSRIError, CertificateRelatedError, DocumentContentError, WebServiceSRIError, EnvioComprobantesSRI, FacturaData, InfoFactura, NotaCreditoData, InfoNotaCredito, VentaInfoTributaria, TablaCodigoDocumento, TablaFormasPago, TablaPorcentajeIVA, TablaTipoIdentificacion, TablaImpuesto };
