add files listing
This commit is contained in:
@@ -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';
|
||||
Reference in New Issue
Block a user