View as Markdown

API reference: @salmonui/data-grid/engine/export-server

exportToResponsefunction

import { exportToResponse } from '@salmonui/data-grid/engine/export-server';
function exportToResponse<Row>(source: ServerExportSource<Row>, options: ServerExportOptions<Row>, handlers?: ServerExportHandlers<Row>, init?: {
    readonly status?: number;
    readonly headers?: Readonly<Record<string, string>>;
}): Promise<PlatformResponse | null>;

Exports to a Web Response whose body streams the file, with Content-Type and Content-Disposition set: return it from a Next.js route handler or any fetch-style server. Resolves to null when onBeforeExport prevents the export.