expo-screen-capture
Advanced tools
Comparing version 3.2.0 to 4.0.0
@@ -1,2 +0,2 @@ | ||
declare const _default: import("@unimodules/core").ProxyNativeModule; | ||
declare const _default: import("expo-modules-core").ProxyNativeModule; | ||
export default _default; |
@@ -1,3 +0,3 @@ | ||
import { NativeModulesProxy } from '@unimodules/core'; | ||
import { NativeModulesProxy } from 'expo-modules-core'; | ||
export default NativeModulesProxy.ExpoScreenCapture; | ||
//# sourceMappingURL=ExpoScreenCapture.js.map |
@@ -1,84 +0,71 @@ | ||
import { Subscription } from '@unimodules/core'; | ||
import { Subscription } from 'expo-modules-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. | ||
* @returns A promise that resolves to a `boolean` indicating whether the Screen Capture API is available on the current | ||
* device. Currently, this resolves to `true` on Android and iOS only. | ||
*/ | ||
export declare function isAvailableAsync(): Promise<boolean>; | ||
/** | ||
* Prevents screenshots and screen recordings. If you are | ||
* already preventing screen capture, this method does nothing. | ||
* Prevents screenshots and screen recordings until `allowScreenCaptureAsync` is called or the app is restarted. If you are | ||
* already preventing screen capture, this method does nothing (unless you pass a new and unique `key`). | ||
* | ||
* On iOS, this will only prevent screen recordings, and is only | ||
* available on iOS 11 and newer. On older iOS versions, this method | ||
* does nothing. | ||
* > Please note that on iOS, this will only prevent screen recordings, and is only available on | ||
* iOS 11 and newer. On older iOS versions, this method does nothing. | ||
* | ||
* @param key Optional. This will prevent multiple instances of the | ||
* preventScreenCaptureAsync and allowScreenCaptureAsync methods | ||
* from conflicting with each other. If provided, you will need to call | ||
* allowScreenCaptureAsync with the same key in order to re-enable | ||
* screen capturing. Defaults to 'default'. | ||
* | ||
* @example | ||
* ```typescript | ||
* preventScreenCaptureAsync(); | ||
* ``` | ||
* @param key Optional. If provided, this will help prevent multiple instances of the `preventScreenCaptureAsync` | ||
* and `allowScreenCaptureAsync` methods (and `usePreventScreenCapture` hook) from conflicting with each other. | ||
* When using multiple keys, you'll have to re-allow each one in order to re-enable screen capturing. | ||
* Defaults to `'default'`. | ||
*/ | ||
export declare function preventScreenCaptureAsync(key?: string): Promise<void>; | ||
/** | ||
* Reallows screenshots and recordings. If you haven't called | ||
* Re-allows the user to screen record or screenshot your app. If you haven't called | ||
* `preventScreenCapture()` yet, this method does nothing. | ||
* | ||
* @param key Optional. This will prevent multiple instances of the | ||
* preventScreenCaptureAsync and allowScreenCaptureAsync methods | ||
* from conflicting with each other. If provided, must be the same as the key | ||
* passed to preventScreenCaptureAsync in order to re-enable | ||
* screen capturing. Defaults to 'default'. | ||
* | ||
* @example | ||
* ```typescript | ||
* allowScreenCaptureAsync(); | ||
* ``` | ||
* @param key This will prevent multiple instances of the `preventScreenCaptureAsync` and | ||
* `allowScreenCaptureAsync` methods from conflicting with each other. If provided, the value must | ||
* be the same as the key passed to `preventScreenCaptureAsync` in order to re-enable screen | ||
* capturing. Defaults to 'default'. | ||
*/ | ||
export declare function allowScreenCaptureAsync(key?: string): Promise<void>; | ||
/** | ||
* React hook for preventing screenshots and screen recordings | ||
* while the component is mounted. | ||
* A React hook to prevent screen capturing for as long as the owner component is mounted. | ||
* | ||
* @param key Optional. If provided, this will prevent multiple instances of | ||
* this hook or the preventScreenCaptureAsync and allowScreenCaptureAsync | ||
* methods from conflicting with each other. Defaults to 'default'. | ||
* | ||
* @example | ||
* ```typescript | ||
* usePreventScreenCapture(); | ||
* ``` | ||
* @param key. If provided, this will prevent multiple instances of this hook or the | ||
* `preventScreenCaptureAsync` and `allowScreenCaptureAsync` methods from conflicting with each other. | ||
* This argument is useful if you have multiple active components using the `allowScreenCaptureAsync` | ||
* hook. Defaults to `'default'`. | ||
*/ | ||
export declare function usePreventScreenCapture(key?: string): void; | ||
/** | ||
* Adds a listener that will fire whenever the user takes a screenshot. | ||
* Adds a listener that will fire whenever the user takes a screenshot while the app is foregrounded. | ||
* On Android, this method requires the `READ_EXTERNAL_STORAGE` permission. You can request this | ||
* with [`MediaLibrary.requestPermissionsAsync()`](../media-library/#medialibraryrequestpermissionsasync). | ||
* | ||
* @param listener Callback executed when a screenshot occurs. | ||
* @param listener The function that will be executed when the user takes a screenshot. | ||
* This function accepts no arguments. | ||
* | ||
* @example | ||
* ```typescript | ||
* addScreenshotListener(() => { | ||
* alert('Screenshots are fun!'); | ||
* }); | ||
* ``` | ||
* @return A `Subscription` object that you can use to unregister the listener, either by calling | ||
* `remove()` or passing it to `removeScreenshotListener`. | ||
*/ | ||
export declare function addScreenshotListener(listener: () => void): Subscription; | ||
/** | ||
* Removes the listener added by addScreenshotListener | ||
* Removes the subscription you provide, so that you are no longer listening for screenshots. | ||
* | ||
* @param subscription The subscription to remove (created by addScreenshotListener). | ||
* If you prefer, you can also call `remove()` on that `Subscription` object, for example: | ||
* | ||
* @example | ||
* ```typescript | ||
* const subscription = addScreenshotListener(() => { | ||
* alert('Screenshots are fun!'); | ||
* ```ts | ||
* let mySubscription = addScreenshotListener(() => { | ||
* console.log("You took a screenshot!"); | ||
* }); | ||
* removeScreenshotListener(subscription); | ||
* ... | ||
* mySubscription.remove(); | ||
* // OR | ||
* removeScreenshotListener(mySubscription); | ||
* ``` | ||
* | ||
* @param subscription Subscription returned by `addScreenshotListener`. | ||
*/ | ||
export declare function removeScreenshotListener(subscription: Subscription): void; | ||
export { Subscription }; |
@@ -1,2 +0,2 @@ | ||
import { EventEmitter, UnavailabilityError } from '@unimodules/core'; | ||
import { EventEmitter, UnavailabilityError } from 'expo-modules-core'; | ||
import { useEffect } from 'react'; | ||
@@ -7,6 +7,8 @@ import ExpoScreenCapture from './ExpoScreenCapture'; | ||
const onScreenshotEventName = 'onScreenshot'; | ||
// @needsAudit | ||
/** | ||
* 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. | ||
* @returns A promise that resolves to a `boolean` indicating whether the Screen Capture API is available on the current | ||
* device. Currently, this resolves to `true` on Android and iOS only. | ||
*/ | ||
@@ -16,20 +18,14 @@ export async function isAvailableAsync() { | ||
} | ||
// @needsAudit | ||
/** | ||
* Prevents screenshots and screen recordings. If you are | ||
* already preventing screen capture, this method does nothing. | ||
* Prevents screenshots and screen recordings until `allowScreenCaptureAsync` is called or the app is restarted. If you are | ||
* already preventing screen capture, this method does nothing (unless you pass a new and unique `key`). | ||
* | ||
* On iOS, this will only prevent screen recordings, and is only | ||
* available on iOS 11 and newer. On older iOS versions, this method | ||
* does nothing. | ||
* > Please note that on iOS, this will only prevent screen recordings, and is only available on | ||
* iOS 11 and newer. On older iOS versions, this method does nothing. | ||
* | ||
* @param key Optional. This will prevent multiple instances of the | ||
* preventScreenCaptureAsync and allowScreenCaptureAsync methods | ||
* from conflicting with each other. If provided, you will need to call | ||
* allowScreenCaptureAsync with the same key in order to re-enable | ||
* screen capturing. Defaults to 'default'. | ||
* | ||
* @example | ||
* ```typescript | ||
* preventScreenCaptureAsync(); | ||
* ``` | ||
* @param key Optional. If provided, this will help prevent multiple instances of the `preventScreenCaptureAsync` | ||
* and `allowScreenCaptureAsync` methods (and `usePreventScreenCapture` hook) from conflicting with each other. | ||
* When using multiple keys, you'll have to re-allow each one in order to re-enable screen capturing. | ||
* Defaults to `'default'`. | ||
*/ | ||
@@ -45,16 +41,11 @@ export async function preventScreenCaptureAsync(key = 'default') { | ||
} | ||
// @needsAudit | ||
/** | ||
* Reallows screenshots and recordings. If you haven't called | ||
* Re-allows the user to screen record or screenshot your app. If you haven't called | ||
* `preventScreenCapture()` yet, this method does nothing. | ||
* | ||
* @param key Optional. This will prevent multiple instances of the | ||
* preventScreenCaptureAsync and allowScreenCaptureAsync methods | ||
* from conflicting with each other. If provided, must be the same as the key | ||
* passed to preventScreenCaptureAsync in order to re-enable | ||
* screen capturing. Defaults to 'default'. | ||
* | ||
* @example | ||
* ```typescript | ||
* allowScreenCaptureAsync(); | ||
* ``` | ||
* @param key This will prevent multiple instances of the `preventScreenCaptureAsync` and | ||
* `allowScreenCaptureAsync` methods from conflicting with each other. If provided, the value must | ||
* be the same as the key passed to `preventScreenCaptureAsync` in order to re-enable screen | ||
* capturing. Defaults to 'default'. | ||
*/ | ||
@@ -70,14 +61,10 @@ export async function allowScreenCaptureAsync(key = 'default') { | ||
} | ||
// @needsAudit | ||
/** | ||
* React hook for preventing screenshots and screen recordings | ||
* while the component is mounted. | ||
* A React hook to prevent screen capturing for as long as the owner component is mounted. | ||
* | ||
* @param key Optional. If provided, this will prevent multiple instances of | ||
* this hook or the preventScreenCaptureAsync and allowScreenCaptureAsync | ||
* methods from conflicting with each other. Defaults to 'default'. | ||
* | ||
* @example | ||
* ```typescript | ||
* usePreventScreenCapture(); | ||
* ``` | ||
* @param key. If provided, this will prevent multiple instances of this hook or the | ||
* `preventScreenCaptureAsync` and `allowScreenCaptureAsync` methods from conflicting with each other. | ||
* This argument is useful if you have multiple active components using the `allowScreenCaptureAsync` | ||
* hook. Defaults to `'default'`. | ||
*/ | ||
@@ -92,13 +79,13 @@ export function usePreventScreenCapture(key = 'default') { | ||
} | ||
// @needsAudit | ||
/** | ||
* Adds a listener that will fire whenever the user takes a screenshot. | ||
* Adds a listener that will fire whenever the user takes a screenshot while the app is foregrounded. | ||
* On Android, this method requires the `READ_EXTERNAL_STORAGE` permission. You can request this | ||
* with [`MediaLibrary.requestPermissionsAsync()`](../media-library/#medialibraryrequestpermissionsasync). | ||
* | ||
* @param listener Callback executed when a screenshot occurs. | ||
* @param listener The function that will be executed when the user takes a screenshot. | ||
* This function accepts no arguments. | ||
* | ||
* @example | ||
* ```typescript | ||
* addScreenshotListener(() => { | ||
* alert('Screenshots are fun!'); | ||
* }); | ||
* ``` | ||
* @return A `Subscription` object that you can use to unregister the listener, either by calling | ||
* `remove()` or passing it to `removeScreenshotListener`. | ||
*/ | ||
@@ -108,14 +95,19 @@ export function addScreenshotListener(listener) { | ||
} | ||
// @needsAudit | ||
/** | ||
* Removes the listener added by addScreenshotListener | ||
* Removes the subscription you provide, so that you are no longer listening for screenshots. | ||
* | ||
* @param subscription The subscription to remove (created by addScreenshotListener). | ||
* If you prefer, you can also call `remove()` on that `Subscription` object, for example: | ||
* | ||
* @example | ||
* ```typescript | ||
* const subscription = addScreenshotListener(() => { | ||
* alert('Screenshots are fun!'); | ||
* ```ts | ||
* let mySubscription = addScreenshotListener(() => { | ||
* console.log("You took a screenshot!"); | ||
* }); | ||
* removeScreenshotListener(subscription); | ||
* ... | ||
* mySubscription.remove(); | ||
* // OR | ||
* removeScreenshotListener(mySubscription); | ||
* ``` | ||
* | ||
* @param subscription Subscription returned by `addScreenshotListener`. | ||
*/ | ||
@@ -122,0 +114,0 @@ export function removeScreenshotListener(subscription) { |
@@ -13,2 +13,16 @@ # Changelog | ||
## 4.0.0 — 2021-09-28 | ||
### 🛠 Breaking changes | ||
- Dropped support for iOS 11.0 ([#14383](https://github.com/expo/expo/pull/14383) by [@cruzach](https://github.com/cruzach)) | ||
### 🐛 Bug fixes | ||
- Fix building errors from use_frameworks! in Podfile. ([#14523](https://github.com/expo/expo/pull/14523) by [@kudo](https://github.com/kudo)) | ||
### 💡 Others | ||
- Export missing `Subscription` type. ([#13352](https://github.com/expo/expo/pull/13352) by [@Simek](https://github.com/Simek)) | ||
## 3.2.0 — 2021-06-16 | ||
@@ -15,0 +29,0 @@ |
{ | ||
"name": "expo-screen-capture", | ||
"version": "3.2.0", | ||
"version": "4.0.0", | ||
"description": "ExpoScreenCapture standalone module", | ||
@@ -31,5 +31,8 @@ "main": "build/ScreenCapture.js", | ||
"license": "MIT", | ||
"homepage": "https://docs.expo.io/versions/latest/sdk/screen-capture", | ||
"homepage": "https://docs.expo.dev/versions/latest/sdk/screen-capture", | ||
"jest": { | ||
"preset": "expo-module-scripts" | ||
}, | ||
"dependencies": { | ||
"@unimodules/core": "~7.1.1" | ||
"expo-modules-core": "~0.4.0" | ||
}, | ||
@@ -39,6 +42,3 @@ "devDependencies": { | ||
}, | ||
"jest": { | ||
"preset": "expo-module-scripts" | ||
}, | ||
"gitHead": "b33f5e224578564c3e4b1b467f258cc119b3b786" | ||
"gitHead": "1fffde73411ee7a642b98f1506a8de921805d52b" | ||
} |
@@ -1,3 +0,3 @@ | ||
import { NativeModulesProxy } from '@unimodules/core'; | ||
import { NativeModulesProxy } from 'expo-modules-core'; | ||
export default NativeModulesProxy.ExpoScreenCapture; |
@@ -1,2 +0,2 @@ | ||
import { EventEmitter, Subscription, UnavailabilityError } from '@unimodules/core'; | ||
import { EventEmitter, Subscription, UnavailabilityError } from 'expo-modules-core'; | ||
import { useEffect } from 'react'; | ||
@@ -11,6 +11,8 @@ | ||
// @needsAudit | ||
/** | ||
* 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. | ||
* @returns A promise that resolves to a `boolean` indicating whether the Screen Capture API is available on the current | ||
* device. Currently, this resolves to `true` on Android and iOS only. | ||
*/ | ||
@@ -21,20 +23,14 @@ export async function isAvailableAsync(): Promise<boolean> { | ||
// @needsAudit | ||
/** | ||
* Prevents screenshots and screen recordings. If you are | ||
* already preventing screen capture, this method does nothing. | ||
* Prevents screenshots and screen recordings until `allowScreenCaptureAsync` is called or the app is restarted. If you are | ||
* already preventing screen capture, this method does nothing (unless you pass a new and unique `key`). | ||
* | ||
* On iOS, this will only prevent screen recordings, and is only | ||
* available on iOS 11 and newer. On older iOS versions, this method | ||
* does nothing. | ||
* > Please note that on iOS, this will only prevent screen recordings, and is only available on | ||
* iOS 11 and newer. On older iOS versions, this method does nothing. | ||
* | ||
* @param key Optional. This will prevent multiple instances of the | ||
* preventScreenCaptureAsync and allowScreenCaptureAsync methods | ||
* from conflicting with each other. If provided, you will need to call | ||
* allowScreenCaptureAsync with the same key in order to re-enable | ||
* screen capturing. Defaults to 'default'. | ||
* | ||
* @example | ||
* ```typescript | ||
* preventScreenCaptureAsync(); | ||
* ``` | ||
* @param key Optional. If provided, this will help prevent multiple instances of the `preventScreenCaptureAsync` | ||
* and `allowScreenCaptureAsync` methods (and `usePreventScreenCapture` hook) from conflicting with each other. | ||
* When using multiple keys, you'll have to re-allow each one in order to re-enable screen capturing. | ||
* Defaults to `'default'`. | ||
*/ | ||
@@ -52,16 +48,11 @@ export async function preventScreenCaptureAsync(key: string = 'default'): Promise<void> { | ||
// @needsAudit | ||
/** | ||
* Reallows screenshots and recordings. If you haven't called | ||
* Re-allows the user to screen record or screenshot your app. If you haven't called | ||
* `preventScreenCapture()` yet, this method does nothing. | ||
* | ||
* @param key Optional. This will prevent multiple instances of the | ||
* preventScreenCaptureAsync and allowScreenCaptureAsync methods | ||
* from conflicting with each other. If provided, must be the same as the key | ||
* passed to preventScreenCaptureAsync in order to re-enable | ||
* screen capturing. Defaults to 'default'. | ||
* | ||
* @example | ||
* ```typescript | ||
* allowScreenCaptureAsync(); | ||
* ``` | ||
* @param key This will prevent multiple instances of the `preventScreenCaptureAsync` and | ||
* `allowScreenCaptureAsync` methods from conflicting with each other. If provided, the value must | ||
* be the same as the key passed to `preventScreenCaptureAsync` in order to re-enable screen | ||
* capturing. Defaults to 'default'. | ||
*/ | ||
@@ -79,14 +70,10 @@ export async function allowScreenCaptureAsync(key: string = 'default'): Promise<void> { | ||
// @needsAudit | ||
/** | ||
* React hook for preventing screenshots and screen recordings | ||
* while the component is mounted. | ||
* A React hook to prevent screen capturing for as long as the owner component is mounted. | ||
* | ||
* @param key Optional. If provided, this will prevent multiple instances of | ||
* this hook or the preventScreenCaptureAsync and allowScreenCaptureAsync | ||
* methods from conflicting with each other. Defaults to 'default'. | ||
* | ||
* @example | ||
* ```typescript | ||
* usePreventScreenCapture(); | ||
* ``` | ||
* @param key. If provided, this will prevent multiple instances of this hook or the | ||
* `preventScreenCaptureAsync` and `allowScreenCaptureAsync` methods from conflicting with each other. | ||
* This argument is useful if you have multiple active components using the `allowScreenCaptureAsync` | ||
* hook. Defaults to `'default'`. | ||
*/ | ||
@@ -103,13 +90,13 @@ export function usePreventScreenCapture(key: string = 'default'): void { | ||
// @needsAudit | ||
/** | ||
* Adds a listener that will fire whenever the user takes a screenshot. | ||
* Adds a listener that will fire whenever the user takes a screenshot while the app is foregrounded. | ||
* On Android, this method requires the `READ_EXTERNAL_STORAGE` permission. You can request this | ||
* with [`MediaLibrary.requestPermissionsAsync()`](../media-library/#medialibraryrequestpermissionsasync). | ||
* | ||
* @param listener Callback executed when a screenshot occurs. | ||
* @param listener The function that will be executed when the user takes a screenshot. | ||
* This function accepts no arguments. | ||
* | ||
* @example | ||
* ```typescript | ||
* addScreenshotListener(() => { | ||
* alert('Screenshots are fun!'); | ||
* }); | ||
* ``` | ||
* @return A `Subscription` object that you can use to unregister the listener, either by calling | ||
* `remove()` or passing it to `removeScreenshotListener`. | ||
*/ | ||
@@ -120,14 +107,19 @@ export function addScreenshotListener(listener: () => void): Subscription { | ||
// @needsAudit | ||
/** | ||
* Removes the listener added by addScreenshotListener | ||
* Removes the subscription you provide, so that you are no longer listening for screenshots. | ||
* | ||
* @param subscription The subscription to remove (created by addScreenshotListener). | ||
* If you prefer, you can also call `remove()` on that `Subscription` object, for example: | ||
* | ||
* @example | ||
* ```typescript | ||
* const subscription = addScreenshotListener(() => { | ||
* alert('Screenshots are fun!'); | ||
* ```ts | ||
* let mySubscription = addScreenshotListener(() => { | ||
* console.log("You took a screenshot!"); | ||
* }); | ||
* removeScreenshotListener(subscription); | ||
* ... | ||
* mySubscription.remove(); | ||
* // OR | ||
* removeScreenshotListener(mySubscription); | ||
* ``` | ||
* | ||
* @param subscription Subscription returned by `addScreenshotListener`. | ||
*/ | ||
@@ -137,1 +129,3 @@ export function removeScreenshotListener(subscription: Subscription) { | ||
} | ||
export { Subscription }; |
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
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
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
38772
326
+ Addedexpo-modules-core@~0.4.0
+ Addedexpo-modules-core@0.4.10(transitive)
+ Addedinvariant@2.2.4(transitive)
+ Addedjs-tokens@4.0.0(transitive)
+ Addedloose-envify@1.4.0(transitive)
- Removed@unimodules/core@~7.1.1
- Removed@unimodules/core@7.1.2(transitive)