BundledImageSource
An image shipped inside the app, as importing a PNG or JPEG makes it, so an Image shows it with no request.
Utilização
Type an image packaged with the app.
// Type an image packaged with the app.
import { Image, type BundledImageSource } from 'kuito';
import cover from './assets/cover.png';
function Cover(props: { source: BundledImageSource }) {
// An imported image knows its size, so the view keeps its aspect ratio.
return (
<Image src={props.source} width="100%" aspectRatio={props.source.width / props.source.height} />
);
}
<Cover source={cover} />;Declaração do tipo
export interface BundledImageSource {
asset: string;
width: number;
height: number;
}Membros 3
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
asset | string | Sim | — |
width | number | Sim | — |
height | number | Sim | — |
Gerado a partir das declarações TypeScript públicas: assinaturas, props e predefinições vêm da fonte verificada, as descrições da sua JSDoc. Nenhuma predefinição é inventada.