import type { ExportSourceWire } from '../contracts/not-front-v2.wire'; export type ExportFormat = ExportSourceWire['formats'][number]; /** The JSON piper-lite's `POST /api/v1/exports/` accepts (task 06 contract). */ export type PiperLiteExportPayload = { format: ExportFormat; title: string; filters: { label: string; value: string; }[]; sheets: { title: string; pipeline_code: string; dataframe: string; args: Record; columns: { name: string; label: string; }[]; }[]; }; /** * Protocol mapping of the `piperLiteExport` kind (ADR-SVC-0011: the front knows * the piper-lite protocol). The wire is camelCase; piper-lite expects snake_case. * Only the known fields are forwarded, one by one: an extra field of the wire * never reaches the request. `args` passes through untouched because its keys * are dataset argument names, not wire fields. */ export declare const exportPayload: (source: ExportSourceWire, format: ExportFormat) => PiperLiteExportPayload; /** Why an export did not produce a file. `aborted` is never shown. */ export type ExportFailure = 'tooLarge' | 'empty' | 'forbidden' | 'misconfigured' | 'failed' | 'aborted'; export type ExportResult = { ok: true; blob: Blob; fileName: string; sizeBytes: number; } | { ok: false; failure: ExportFailure; }; /** Keeps the extension, drops what a file system or a header could misread. */ export declare const sanitizeFileName: (raw: string) => string | null; /** ` ยท .`, used when the server sends no usable name. */ export declare const fallbackFileName: (fileTitle: string, format: ExportFormat, timeZone: string, now?: Date) => string; /** * `POST` of the on-demand export. Sends the wire's url and only its `Tenant` * and `Authorization` headers; `userFlow` rides in the config so a 401 reaches * the token-refresh interceptor V1 uses. Resolves to the file or a typed * failure; it never throws and never exposes the server's error text. */ export declare const requestExport: (source: ExportSourceWire, format: ExportFormat, userFlow: string | undefined, signal: AbortSignal, timeZone?: string) => Promise;