fix: Properly type Format Templates
(#2499)
add PredefinedTemplates type
This commit is contained in:
parent
d8c95c901f
commit
cd5fdd4924
@ -1,9 +1,17 @@
|
|||||||
import { Dimensions } from 'react-native'
|
import { Dimensions } from 'react-native'
|
||||||
import { FormatFilter } from './getCameraFormat'
|
import { FormatFilter } from './getCameraFormat'
|
||||||
|
|
||||||
type TTemplates = {
|
type PredefinedTemplates =
|
||||||
[key: string]: FormatFilter[]
|
| 'Video'
|
||||||
}
|
| 'Video60Fps'
|
||||||
|
| 'VideoSlowMotion'
|
||||||
|
| 'VideoStabilized'
|
||||||
|
| 'Photo'
|
||||||
|
| 'PhotoPortrait'
|
||||||
|
| 'FrameProcessingYUV'
|
||||||
|
| 'FrameProcessingRGB'
|
||||||
|
| 'Snapchat'
|
||||||
|
| 'Instagram'
|
||||||
|
|
||||||
const SnapchatResolution = { width: 1920, height: 1080 }
|
const SnapchatResolution = { width: 1920, height: 1080 }
|
||||||
const InstagramResolution = { width: 3840, height: 2160 }
|
const InstagramResolution = { width: 3840, height: 2160 }
|
||||||
@ -16,7 +24,7 @@ const ScreenAspectRatio = Dimensions.get('window').height / Dimensions.get('wind
|
|||||||
* const format = useCameraFormat(device, Templates.Snapchat)
|
* const format = useCameraFormat(device, Templates.Snapchat)
|
||||||
* ```
|
* ```
|
||||||
*/
|
*/
|
||||||
export const Templates: TTemplates = {
|
export const Templates: Record<PredefinedTemplates, FormatFilter[]> = {
|
||||||
/**
|
/**
|
||||||
* Highest resolution video recordings (e.g. 4k)
|
* Highest resolution video recordings (e.g. 4k)
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user