import { Client } from '../client'; import { BaseError } from '../errors'; import { UriHelper } from '../uri-helper'; import { ThBaseHandler } from '../base'; export interface DocumentsOptions { user?: string; base?: string; } export interface DocumentsMultipleResponse { data: Document[]; metadata?: Record; next?: () => Promise; } export interface Document { createdAt?: string; documentNumber: string; documentType: string; isSuccess: boolean; id: string; updatedAt?: string; } export interface DocumentsBulkPreviewBody { documentIds: string[]; } export interface DocumentsPreviewResponse { data: { subject?: string; body?: string; }; } export interface DocumentsSendBody { recipients: string[]; } export interface DocumentsBulkSendBody { recipients: string[]; documentIds: string[]; } export interface DocumentsSendResponse { data: { success: true; }; msg: string; } export interface DocumentsDownloadResponse { url?: string; data?: string; contentType?: string; filename?: string; correlationId?: string; } export interface DocumentsBulkDownloadBody { documentIds: string[]; } export declare class Documents extends ThBaseHandler { static baseEndpoint: string; endpoint: string; http: Client; options: DocumentsOptions; uriHelper: UriHelper; constructor(options: DocumentsOptions, http: Client); getAll(query?: Record): Promise; meta(query?: Record): Promise; preview(documentId: string): Promise; bulkPreview(body: DocumentsBulkPreviewBody): Promise; send(documentId: string, body: DocumentsSendBody): Promise; bulkSend(body: DocumentsBulkSendBody): Promise; download(documentId: string): Promise; bulkDownload(body: DocumentsBulkDownloadBody): Promise; } export declare class DocumentsGetFailed extends BaseError { message: string; name: string; constructor(message?: string, properties?: Record); } export declare class DocumentsMetaFailed extends BaseError { message: string; name: string; constructor(message?: string, properties?: Record); } export declare class DocumentsSendFailed extends BaseError { message: string; name: string; constructor(message?: string, properties?: Record); } export declare class DocumentsBulkSendFailed extends BaseError { message: string; name: string; constructor(message?: string, properties?: Record); } export declare class DocumentsDownloadFailed extends BaseError { message: string; name: string; constructor(message?: string, properties?: Record); } export declare class DocumentsBulkDownloadFailed extends BaseError { message: string; name: string; constructor(message?: string, properties?: Record); }