AppearancePreferences
The user's display preferences together, for tests and code that need both at once.
Utilização
Read the system display preferences.
// Read the system display preferences.
import { Text, appearance, type AppearancePreferences } from 'kuito';
function describe(preferences: AppearancePreferences): string {
const scheme = preferences.colorScheme ?? 'no preference';
return `${scheme}, text at ${Math.round(preferences.fontScale * 100)}%`;
}
<Text>
{describe({ colorScheme: appearance.colorScheme.value, fontScale: appearance.fontScale.value })}
</Text>;Declaração do tipo
export type AppearancePreferences = {
colorScheme: ColorSchemeName | null;
fontScale: number;
};Membros 2
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
colorScheme | Scheme | Sim | — |
fontScale | 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.