// Camera permission, host-gated: hosts expose it as `_creatorUtils.requestCamera`. Hosts without
// that bridge resolve immediately — their view factory prompts on its own (e.g. getUserMedia on
// the web). Shared by ARScene.prepare, QRScanner and CameraView.
export const _requestCameraPermission = (): Promise<void> =>
  typeof _creatorUtils.requestCamera === "function"
    ? new Promise<void>((res, rej) => _creatorUtils.requestCamera!(res, rej))
    : Promise.resolve()
