DownloadOptions
Adds request headers to a download and follows its progress.
Verwendung
Load an optional font
Dieser Typ wird verwendet von fileSystem.download
import { fileSystem, fonts } from 'kuito';
const LATO = 'https://raw.githubusercontent.com/google/fonts/main/ofl/lato/';
const regular = fileSystem.cache + 'Lato-Regular.ttf';
const bold = fileSystem.cache + 'Lato-Bold.ttf';
await fileSystem.download(LATO + 'Lato-Regular.ttf', regular);
await fileSystem.download(LATO + 'Lato-Bold.ttf', bold);
await fonts.load({ Lato: [regular, { uri: bold, weight: 'bold' }] });
fonts.loaded('Lato'); // true: bundled or loadedTypdeklaration
export type DownloadOptions = {
headers?: Record<string, string>;
onProgress?: (progress: TransferProgress) => void;
};Mitglieder 2
| Name | Typ | Erforderlich | Beschreibung |
|---|---|---|---|
headers | Record<string, string> | Nein | — |
onProgress | (progress: TransferProgress) => void | Nein | — |
onProgress — Methodensignaturen
Signaturen
(progress: TransferProgress): voidParameter
| Name | Typ | Erforderlich | Beschreibung |
|---|---|---|---|
progress | TransferProgress | Ja | — |
Rückgabe
void
Generiert aus den öffentlichen TypeScript-Deklarationen: Signaturen, Props und Standardwerte stammen aus der geprüften Quelle, Beschreibungen aus deren JSDoc. Kein Standardwert ist erfunden.