UNPKG

native-fn

Version:
35 lines (29 loc) 852 B
declare interface NativePlugin<Key extends string, Module, Constants extends Record<string, any> = Record<string, any>, Errors extends Record<string, ErrorConstructor> = Record<string, ErrorConstructor>> { installed: boolean; name: Key; module: Module; Constants: Constants; Errors: Errors; } declare enum CameraType { Image = "image", Video = "video" } declare interface CameraInstance { open(type: CameraType): void; } declare module 'native-fn' { interface NativePlugins { Camera: CameraInstance; } interface NativeConstants { CameraType: CameraType; } interface NativeErrors { } } declare const NativeMediaPlugin: NativePlugin<'Camera', CameraInstance, { CameraType: typeof CameraType; }, {}>; export { NativeMediaPlugin as default }; export type { CameraInstance };