From 5c5e63e29e17a7353b6b3a3d7b5091911e4ba06c Mon Sep 17 00:00:00 2001 From: Gustavo Parreira Date: Sun, 20 Feb 2022 18:42:38 +0000 Subject: [PATCH] feat: added TS declaration file --- index.d.ts | 14 ++++++++++++++ package.json | 1 + 2 files changed, 15 insertions(+) create mode 100644 index.d.ts 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" },