react-native-executorch
Version:
An easy way to run AI models in React Native with ExecuTorch
55 lines • 1.85 kB
TypeScript
import { ResourceSource } from '../types/common';
/**
* @internal
*/
import { type DownloadResumable } from 'expo-file-system/legacy';
export declare const enum HTTP_CODE {
OK = 200,
PARTIAL_CONTENT = 206
}
export declare const enum DownloadStatus {
ONGOING = 0,
PAUSED = 1
}
export declare const enum SourceType {
OBJECT = 0,
LOCAL_FILE = 1,
RELEASE_MODE_FILE = 2,
DEV_MODE_FILE = 3,
REMOTE_FILE = 4
}
export interface ResourceSourceExtended {
source: ResourceSource;
sourceType: SourceType;
callback?: (downloadProgress: number) => void;
results: string[];
uri?: string;
fileUri?: string;
cacheFileUri?: string;
next?: ResourceSourceExtended;
}
export interface DownloadResource {
downloadResumable: DownloadResumable;
status: DownloadStatus;
extendedInfo: ResourceSourceExtended;
}
export declare namespace ResourceFetcherUtils {
function getType(source: ResourceSource): SourceType;
function getFilesSizes(sources: ResourceSource[]): Promise<{
results: {
source: ResourceSource;
type: SourceType;
length: number;
previousFilesTotalLength: number;
}[];
totalLength: number;
}>;
function removeFilePrefix(uri: string): string;
function hashObject(jsonString: string): string;
function calculateDownloadProgress(totalLength: number, previousFilesTotalLength: number, currentFileLength: number, setProgress: (downloadProgress: number) => void): (progress: number) => void;
function triggerHuggingFaceDownloadCounter(uri: string): Promise<void>;
function createDirectoryIfNoExists(): Promise<void>;
function checkFileExists(fileUri: string): Promise<boolean>;
function getFilenameFromUri(uri: string): string;
}
//# sourceMappingURL=ResourceFetcherUtils.d.ts.map