add cb function

This commit is contained in:
Hailey
2024-07-29 15:55:31 -07:00
parent 8d03297de6
commit f68114bd47
2 changed files with 10 additions and 4 deletions
@@ -2,8 +2,11 @@ import {requireNativeModule} from 'expo'
const NativeModule = requireNativeModule('ExpoHLSDownload') const NativeModule = requireNativeModule('ExpoHLSDownload')
export async function downloadAsync(sourceUrl: string): Promise<string> { export async function downloadAsync(
return NativeModule.downloadAsync(sourceUrl) sourceUrl: string,
progressCb: (progress: number) => void,
): Promise<string> {
return NativeModule.downloadAsync(sourceUrl, progressCb)
} }
export async function cancelAsync(sourceUrl: string): Promise<void> { export async function cancelAsync(sourceUrl: string): Promise<void> {
@@ -1,7 +1,10 @@
import {NotImplementedError} from '../NotImplemented' import {NotImplementedError} from '../NotImplemented'
export function downloadAsync(sourceUrl: string): Promise<string> { export function downloadAsync(
throw new NotImplementedError({sourceUrl}) sourceUrl: string,
progressCb: (progress: number) => void,
): Promise<string> {
throw new NotImplementedError({sourceUrl, progressCb})
} }
export function cancelAsync(sourceUrl: string): Promise<void> { export function cancelAsync(sourceUrl: string): Promise<void> {