react-native-ping icon indicating copy to clipboard operation
react-native-ping copied to clipboard

@types added

Open KM8Oz opened this issue 3 years ago • 2 comments

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch [email protected] for the project I'm working on.

Here is the diff that solved my problem:

diff --git a/node_modules/react-native-ping/index.d.ts b/node_modules/react-native-ping/index.d.ts
new file mode 100644
index 0000000..25bd7a4
--- /dev/null
+++ b/node_modules/react-native-ping/index.d.ts
@@ -0,0 +1,17 @@
+class Ping {
+    /**
+     *
+     * Get RTT (Round-trip delay time)
+     * 
+     * @static
+     * @param {string} ipAddress - For example : 8.8.8.8
+     * @param {Object} option - Some optional operations
+     * @param {number} option.timeout - timeout
+     * @returns
+     * @memberof Ping
+     */
+    static async start(ipAddress:string, option:{timeout:number}|any):any
+    static async getTrafficStats():any
+}
+
+export default Ping;
\ No newline at end of file

This issue body was partially generated by patch-package.

KM8Oz avatar Jun 02 '22 01:06 KM8Oz

It's my result. It seems something is wrong. image

RoJoHub avatar Jul 28 '22 08:07 RoJoHub

It's my result. It seems something is wrong. image

@RoJoHub this is really not an issus as I said, just add an index.d.ts to package folder after installing it with yarn add react-native-ping then you can run npx patch-package react-native-ping to preserve those changes. the error you got just saying that you made no change in the package folder to patch.

KM8Oz avatar Dec 08 '22 06:12 KM8Oz