FilesConfig
Definition
import type { FilesConfig } from '@aionbuilders/nabu';interface FilesConfig {
autoRetry?: false | AutoRetryConfig;
importRemote?: boolean;
maxFileSize?: number;
maxInlineSize?: number;
onAssetReleased?: (ref: string) => void | Promise<void>;
onBeforePersist?: (file: File, ctx: { onProgress?: (p: number) => void; signal?: AbortSignal }) => Promise<void | { ref: string }>;
outbox?: Outbox;
releaseGraceMs?: number;
resolve?: (ref: string) => string;
store?: AssetStore;
}Properties
| Property | Type | Description |
|---|---|---|
autoRetryoptional | false | AutoRetryConfig | Retry on open (P-97), only meaningful with a host and a persisted editor:
the uploads the outbox lists when the document is opened (interrupted, or failed earlier) are sent again by themselves, in the
background, with a growing delay ( |
importRemoteoptional | boolean | Opt-in, default |
maxFileSizeoptional | number | Largest file (bytes) accepted; default none. A bigger file is REFUSED: the block that would
have shown it is created with |
maxInlineSizeoptional | number | Byte threshold for embedding files in a COPY / export ( |
onAssetReleasedoptional | (ref: string) => void | Promise<void> | Host mode, called with the host |
onBeforePersistoptional | (file: File, ctx: { onProgress?: (p: number) => void; signal?: AbortSignal }) => Promise<void | { ref: string }> | Host storage (ADR 014 §3.4). The file is always written to the local store first and the block keeps its
|
outboxoptional | Outbox | Where the uploads still to do are listed (ADR 014 §3.4), scoped to this document. Default: in
memory ( |
releaseGraceMsoptional | number | Default 10 minutes. A release (compaction, |
resolveoptional | (ref: string) => string | Turn a stored ref into a display URL. |
storeoptional | AssetStore | Where the BYTES of the files live (ADR 014). Default: a |
Source: src/lib/files/files.svelte.js:35