resolveAttachedDatasets

Returns the document's datasets with every attached CSV's columns and rows filled in from the uploaded files.

@internote/canvas-sdkFunction
On this page
import { resolveAttachedDatasets } from '@internote/canvas-sdk';

Returns the input unchanged when there is nothing to do, with no attachments or the files not yet arrived, so a host does not hand environments a new object identity on every render. A dataset whose file is missing keeps its bare src, so its columns resolve to null rather than to an invented empty table. A URL dataset (D74) is read the same way: its response is a file keyed by the URL, read as JSON when its format says so.

#Signature

(
    datasets: Record<string, ChalkDataset> | undefined,
    files: AttachedFiles,
    fetchedAt?: Record<string, string> | null,
    pending?: readonly string[] | null,
): Record<string, ChalkDataset>

#Parameters

datasets
The document's data.
files
The uploaded text files by name, or null while they are still arriving.
fetchedAt
When each URL dataset's response was fetched, by URL; stamped onto the dataset for the footer.
pending
The URLs whose responses are on their way; a URL dataset with no response yet is stamped pending, so its scene can say it is waiting.

Declared in packages/canvas-sdk/src/data/attachments.ts:229.

Last updated