UNPKG

stackpress

Version:

Incept is a content management framework.

17 lines (16 loc) 856 B
import type { StatusResponse, UnknownNest } from '@stackpress/lib/types'; export type CSVParseError = { code: string; message: string; row: number; type: string; }; export type CSVParseResults = { data: Record<string, any>[]; errors: CSVParseError[]; }; export type BatchSendResults<M extends UnknownNest = UnknownNest> = Partial<StatusResponse<Partial<M>>>[]; export type BatchSendResponse<M extends UnknownNest = UnknownNest> = StatusResponse<BatchSendResults<M>>; export declare function csvToFormData(file: File): Promise<FormData>; export declare function batchImportSend<M extends UnknownNest = UnknownNest>(url: string, token: string, data: FormData): Promise<BatchSendResults<M>>; export declare function batchAndSend(url: string, token: string, file: File, notify?: (type: string, message: string) => void): Promise<void>;