add files listing

This commit is contained in:
m
2026-07-27 20:50:23 +02:00
parent 0cc261105a
commit 5c85ffa5fe
25 changed files with 1312 additions and 32 deletions
@@ -0,0 +1,13 @@
export type FileDetectedEvent = {
id: string;
uri: string;
name: string;
mimeType: string;
size: number;
createdAt: number;
source: 'download' | 'mediastore' | 'startup';
};
export type ExpoDownloadDetectModuleEvents = {
onNewFile: (event: FileDetectedEvent) => void;
};
@@ -0,0 +1,10 @@
import { NativeModule, requireNativeModule } from 'expo';
import { ExpoDownloadDetectModuleEvents, FileDetectedEvent } from './ExpoDownloadDetect.types';
declare class ExpoDownloadDetectModule extends NativeModule<ExpoDownloadDetectModuleEvents> {
startWatching(): void;
stopWatching(): void;
getRecentDownloads(): Promise<FileDetectedEvent[]>;
}
export default requireNativeModule<ExpoDownloadDetectModule>('ExpoDownloadDetect');
@@ -0,0 +1,2 @@
export { default as ExpoDownloadDetectModule } from './ExpoDownloadDetectModule';
export type { FileDetectedEvent, ExpoDownloadDetectModuleEvents } from './ExpoDownloadDetect.types';