PermissionResponse
Whether the app holds a permission, and whether asking again can still show the system prompt.
Verwendung
Turn a permission result into an actionable message.
// Turn a permission result into an actionable message.
import { permissions, type PermissionResponse, type PermissionStatus } from 'kuito';
export async function cameraAccess(): Promise<string> {
const result: PermissionResponse = await permissions.request('camera');
const status: PermissionStatus = result.status;
if (status === 'granted') return 'Camera ready';
return result.canAskAgain ? 'Camera access was declined' : 'Enable camera access in Settings';
}Typdeklaration
export type PermissionResponse = Response;Mitglieder 2
| Name | Typ | Erforderlich | Beschreibung |
|---|---|---|---|
status | PermissionStatus | Ja | — |
canAskAgain | boolean | Ja | False when request cannot show the system prompt; only Settings can change it (app.openSettings). |
Generiert aus den öffentlichen TypeScript-Deklarationen: Signaturen, Props und Standardwerte stammen aus der geprüften Quelle, Beschreibungen aus deren JSDoc. Kein Standardwert ist erfunden.