import React from 'react' import {StyleProp, ViewStyle} from 'react-native' import {requireNativeModule, requireNativeViewManager} from 'expo-modules-core' import {HLSDownloadViewProps} from './types' const NativeModule = requireNativeModule('ExpoHLSDownload') const NativeView: React.ComponentType< HLSDownloadViewProps & { ref: React.RefObject style: StyleProp } > = requireNativeViewManager('ExpoHLSDownload') export default class HLSDownloadView extends React.PureComponent { private nativeRef: React.RefObject = React.createRef() constructor(props: HLSDownloadViewProps) { super(props) } static isAvailable(): boolean { return NativeModule.isAvailable() } async startDownloadAsync(sourceUrl: string): Promise { return await this.nativeRef.current.startDownloadAsync(sourceUrl) } render() { return ( ) } }