import { XanFetchOptions } from 'xanfetch/types'; import { UploadFileMeta } from '../server/types.js'; type HandshakeInfo = { dev: boolean; timeDiffarenc: number; signeture: string; maxFileSize: number | null; checkFileType: boolean; chunkSize?: number; }; type SecurequClientConfig = { url: string; secret: string; defaultOptions?: XanFetchOptions; hooks?: { beforeHandshake?: () => Promise | void; afterHandshake?: (info: HandshakeInfo) => Promise | void; beforeRequest?: (url: string, init?: HttpRequestInit) => Promise | void; afterResponse?: (response: Response) => Promise | void; beforeUpload?: (file: File, fileId: string) => Promise | void; afterUpload?: (response: SecurequClientResponse, file: File) => Promise | void; beforeUploadChunk?: (chunk: Blob, filemeta: UploadFileMeta) => Promise | void; afterUploadChunk?: (response: SecurequClientResponse, filemeta: UploadFileMeta) => Promise | void; }; }; type SecurequClientResponse = { success: boolean; message: string; data: any; code: number; }; type HTTPMethods = "GET" | "POST" | "PUT" | "DELETE"; type HttpRequestInit = Omit & { body?: { [key: string]: any; }; }; type FileUploadArgs = File | { chunk: Uint8Array; meta: UploadFileMeta; }; export type { FileUploadArgs, HTTPMethods, HandshakeInfo, HttpRequestInit, SecurequClientConfig, SecurequClientResponse };