expo-screen-capture
Advanced tools
Comparing version 3.0.0 to 3.1.0
declare const _default: { | ||
readonly name: string; | ||
preventScreenCaptureAsync(tag?: string): Promise<null>; | ||
allowScreenCaptureAsync(tag?: string): Promise<null>; | ||
usePreventScreenCapture(tag?: string): Promise<null>; | ||
}; | ||
export default _default; |
@@ -5,12 +5,3 @@ export default { | ||
}, | ||
async preventScreenCaptureAsync(tag = 'default') { | ||
return null; | ||
}, | ||
async allowScreenCaptureAsync(tag = 'default') { | ||
return null; | ||
}, | ||
async usePreventScreenCapture(tag = 'default') { | ||
return null; | ||
}, | ||
}; | ||
//# sourceMappingURL=ExpoScreenCapture.web.js.map |
import { Subscription } from '@unimodules/core'; | ||
/** | ||
* Returns whether the Screen Capture API is available on the current device. | ||
* | ||
* @returns Async `boolean`, indicating whether the Screen Capture API is available on the current device. Currently this resolves `true` on iOS and Android only. | ||
*/ | ||
export declare function isAvailableAsync(): Promise<boolean>; | ||
/** | ||
* Prevents screenshots and screen recordings. If you are | ||
@@ -4,0 +10,0 @@ * already preventing screen capture, this method does nothing. |
@@ -1,2 +0,2 @@ | ||
import { EventEmitter } from '@unimodules/core'; | ||
import { EventEmitter, UnavailabilityError } from '@unimodules/core'; | ||
import { useEffect } from 'react'; | ||
@@ -8,2 +8,10 @@ import ExpoScreenCapture from './ExpoScreenCapture'; | ||
/** | ||
* Returns whether the Screen Capture API is available on the current device. | ||
* | ||
* @returns Async `boolean`, indicating whether the Screen Capture API is available on the current device. Currently this resolves `true` on iOS and Android only. | ||
*/ | ||
export async function isAvailableAsync() { | ||
return !!ExpoScreenCapture.preventScreenCapture && !!ExpoScreenCapture.allowScreenCapture; | ||
} | ||
/** | ||
* Prevents screenshots and screen recordings. If you are | ||
@@ -28,2 +36,5 @@ * already preventing screen capture, this method does nothing. | ||
export async function preventScreenCaptureAsync(key = 'default') { | ||
if (!ExpoScreenCapture.preventScreenCapture) { | ||
throw new UnavailabilityError('ScreenCapture', 'preventScreenCaptureAsync'); | ||
} | ||
if (!activeTags.has(key)) { | ||
@@ -50,2 +61,5 @@ activeTags.add(key); | ||
export async function allowScreenCaptureAsync(key = 'default') { | ||
if (!ExpoScreenCapture.preventScreenCapture) { | ||
throw new UnavailabilityError('ScreenCapture', 'allowScreenCaptureAsync'); | ||
} | ||
activeTags.delete(key); | ||
@@ -52,0 +66,0 @@ if (activeTags.size === 0) { |
@@ -11,6 +11,9 @@ # Changelog | ||
## 3.0.0 — 2021-01-15 | ||
## 3.1.0 — 2021-03-10 | ||
_This version does not introduce any user-facing changes._ | ||
### 🎉 New features | ||
- Updated Android build configuration to target Android 11 (added support for Android SDK 30). ([#11647](https://github.com/expo/expo/pull/11647) by [@bbarthec](https://github.com/bbarthec)) | ||
- Added `isAvailableAsync` method. ([#12121](https://github.com/expo/expo/pull/12121) by [@bycedric](https://github.com/bycedric)) | ||
## 3.0.0 — 2021-01-15 | ||
@@ -17,0 +20,0 @@ |
{ | ||
"name": "expo-screen-capture", | ||
"version": "3.0.0", | ||
"version": "3.1.0", | ||
"description": "ExpoScreenCapture standalone module", | ||
@@ -33,6 +33,6 @@ "main": "build/ScreenCapture.js", | ||
"dependencies": { | ||
"@unimodules/core": "~7.0.0" | ||
"@unimodules/core": "~7.1.0" | ||
}, | ||
"devDependencies": { | ||
"expo-module-scripts": "~1.2.0" | ||
"expo-module-scripts": "^2.0.0" | ||
}, | ||
@@ -42,3 +42,3 @@ "jest": { | ||
}, | ||
"gitHead": "e362887ddc6ba4e3518efd623d64b3cbd301a6a9" | ||
"gitHead": "5b57d1fd0a20294c1dec7c43b5df34dd6425d1a5" | ||
} |
@@ -5,11 +5,2 @@ export default { | ||
}, | ||
async preventScreenCaptureAsync(tag = 'default'): Promise<null> { | ||
return null; | ||
}, | ||
async allowScreenCaptureAsync(tag = 'default'): Promise<null> { | ||
return null; | ||
}, | ||
async usePreventScreenCapture(tag = 'default'): Promise<null> { | ||
return null; | ||
}, | ||
}; |
@@ -1,2 +0,2 @@ | ||
import { EventEmitter, Subscription } from '@unimodules/core'; | ||
import { EventEmitter, Subscription, UnavailabilityError } from '@unimodules/core'; | ||
import { useEffect } from 'react'; | ||
@@ -12,2 +12,11 @@ | ||
/** | ||
* Returns whether the Screen Capture API is available on the current device. | ||
* | ||
* @returns Async `boolean`, indicating whether the Screen Capture API is available on the current device. Currently this resolves `true` on iOS and Android only. | ||
*/ | ||
export async function isAvailableAsync(): Promise<boolean> { | ||
return !!ExpoScreenCapture.preventScreenCapture && !!ExpoScreenCapture.allowScreenCapture; | ||
} | ||
/** | ||
* Prevents screenshots and screen recordings. If you are | ||
@@ -32,2 +41,6 @@ * already preventing screen capture, this method does nothing. | ||
export async function preventScreenCaptureAsync(key: string = 'default'): Promise<void> { | ||
if (!ExpoScreenCapture.preventScreenCapture) { | ||
throw new UnavailabilityError('ScreenCapture', 'preventScreenCaptureAsync'); | ||
} | ||
if (!activeTags.has(key)) { | ||
@@ -55,2 +68,6 @@ activeTags.add(key); | ||
export async function allowScreenCaptureAsync(key: string = 'default'): Promise<void> { | ||
if (!ExpoScreenCapture.preventScreenCapture) { | ||
throw new UnavailabilityError('ScreenCapture', 'allowScreenCaptureAsync'); | ||
} | ||
activeTags.delete(key); | ||
@@ -57,0 +74,0 @@ if (activeTags.size === 0) { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
35597
354
+ Added@unimodules/core@7.1.2(transitive)
- Removed@unimodules/core@7.0.0(transitive)
Updated@unimodules/core@~7.1.0