feat: Add slashcommand api

This commit is contained in:
2026-06-05 17:12:26 +02:00
parent 4070ef6caf
commit 8ecfc9a1fe
101 changed files with 3526 additions and 147 deletions
@@ -0,0 +1,28 @@
import type { RuntimePlatform } from './platform-detection.rules';
export type MobileMediaPermissionState = 'granted' | 'denied' | 'prompt' | string;
export interface MobileCapturePermissionResult {
microphone?: MobileMediaPermissionState;
camera?: MobileMediaPermissionState;
}
/** Whether a Capacitor permission alias was granted by the native shell. */
export function isMobileCapturePermissionGranted(state: MobileMediaPermissionState | undefined): boolean {
return state === 'granted';
}
/** Native Android/iOS shells need an explicit runtime grant before WebRTC capture works reliably. */
export function shouldPreflightMobileCapturePermissions(runtime: RuntimePlatform): boolean {
return runtime === 'capacitor';
}
/** Resolve whether voice capture can proceed after a native permission request. */
export function isVoiceCaptureAllowed(result: MobileCapturePermissionResult): boolean {
return isMobileCapturePermissionGranted(result.microphone);
}
/** Resolve whether camera capture can proceed after a native permission request. */
export function isCameraCaptureAllowed(result: MobileCapturePermissionResult): boolean {
return isMobileCapturePermissionGranted(result.camera);
}