diff --git a/index.d.ts b/index.d.ts new file mode 100644 index 0000000..5fb8614 --- /dev/null +++ b/index.d.ts @@ -0,0 +1,14 @@ +import { TextInputProps as RNTextInputProps } from "react-native"; +declare module "react-native" { + export type ImageChangeEventData = { + uri: string; + data: string; + linkUri?: string; + mime?: string; + }; + export type ImageChangeEvent = NativeSyntheticEvent; + + export interface TextInputProps extends RNTextInputProps { + onImageChange?(event: ImageChangeEvent): void; + } +} diff --git a/package.json b/package.json index 35948b0..8199947 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,7 @@ "version": "2.0.1", "description": "Enables clipboard image pasting and GIFs from TextInput.", "main": "index.js", + "types": "index.d.ts", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" },