import abilityAccessCtrl from "@ohos.abilityAccessCtrl"; import bundleManager from "@ohos.bundle.bundleManager"; export var CameraPermission; (function (a) { async function b() { try { let h = bundleManager.BundleFlag.GET_BUNDLE_INFO_WITH_APPLICATION; let i = await bundleManager.getBundleInfoForSelf(h); let j = i.appInfo.accessTokenId; let k = 'ohos.permission.CAMERA'; let l = abilityAccessCtrl.createAtManager(); let m = await l.checkAccessToken(j, k); return m == abilityAccessCtrl.GrantStatus.PERMISSION_GRANTED; } catch (g) { } return false; } a.checkCameraPermission = b; async function c(d) { let e = abilityAccessCtrl.createAtManager(); let f = await e.requestPermissionsFromUser(d, ['ohos.permission.CAMERA']); if (f != undefined && f.permissions.length > 0) { return f.permissions.pop() == "ohos.permission.CAMERA"; } return false; } a.requestCameraPermission = c; })(CameraPermission || (CameraPermission = {})); 