AdelRedaa97 / react-native-select-dropdown

react-native-select-dropdown is a highly customized dropdown | select | picker | menu for react native that works for andriod and iOS platforms.
MIT License
314 stars 134 forks source link

Update index.d.ts with selectIndex definition #141

Closed giovannilondero closed 1 year ago

giovannilondero commented 1 year ago

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch react-native-select-dropdown@3.3.3 for the project I'm working on.

SelectDropdown exposes a selectIndex method via useImperativeHandle, but it isn't available in the index.d.ts.

Here is the diff that solved my problem:

diff --git a/node_modules/react-native-select-dropdown/index.d.ts b/node_modules/react-native-select-dropdown/index.d.ts
index 384614a..2f7ab48 100644
--- a/node_modules/react-native-select-dropdown/index.d.ts
+++ b/node_modules/react-native-select-dropdown/index.d.ts
@@ -173,5 +173,9 @@ declare module 'react-native-select-dropdown' {
      * Close the dropdown.
      */
     closeDropdown(): void;
+    /**
+     * Select index.
+     */
+    selectIndex(index: number): void;
   }
 }

This issue body was partially generated by patch-package.