@d4l/react-native-mmfile
Version:
Fastest storage with encryption for React Native.
26 lines (25 loc) • 856 B
TypeScript
import { type HybridObject } from 'react-native-nitro-modules';
import type { Mmfile, EncryptedMmfile } from './Mmfile.nitro';
export interface ReadDirItem {
mtime: number;
name: string;
path: string;
size: number;
isFile: boolean;
isDirectory: boolean;
}
export interface MmfilePackage extends HybridObject<{
ios: 'c++';
android: 'c++';
}> {
baseDirectory: string;
openMmfile(path: string, readOnly?: boolean): Mmfile;
openEncryptedMmfile(path: string, key: ArrayBuffer, readOnly?: boolean): EncryptedMmfile;
fileExists(path: string): boolean;
getFileSize(path: string): number;
getEncryptedFileSize(path: string): number;
readDir(path: string): Promise<ReadDirItem[]>;
readDirSync(path: string): ReadDirItem[];
unlink(path: string): Promise<void>;
unlinkSync(path: string): void;
}