DownloadResult
Where a finished download is on disk and what the server answered.
Utilisation
Load an optional font
Ce type est utilisé par 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 loadedDéclaration du type
export type DownloadResult = {
uri: string;
status: number;
headers: Record<string, string>;
mimeType: string | null;
};Membres 4
| Nom | Type | Requis | Description |
|---|---|---|---|
uri | string | Oui | — |
status | number | Oui | — |
headers | Record<string, string> | Oui | — |
mimeType | string | Oui | — |
Généré depuis les déclarations TypeScript publiques : signatures, props et valeurs par défaut viennent de la source vérifiée, les descriptions de sa JSDoc. Aucune valeur par défaut n'est inventée.