From 7ab623aa5445c70e8bbfdbc302fa9a975a3e8adc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ole=20Andr=C3=A9=20Vadla=20Ravn=C3=A5s?= Date: Tue, 20 Aug 2019 22:45:52 +0200 Subject: [PATCH] Sync frida-gum typings with Frida 12.6.17 (#37780) Also improve the type definition for Java.cast(). Changelog at: https://www.frida.re/news/2019/05/28/frida-12-6-released/ --- types/frida-gum/index.d.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/types/frida-gum/index.d.ts b/types/frida-gum/index.d.ts index bfc27a1f55..a6aa02f962 100644 --- a/types/frida-gum/index.d.ts +++ b/types/frida-gum/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for non-npm package frida-gum 14.0 +// Type definitions for non-npm package frida-gum 14.1 // Project: https://github.com/frida/frida // Definitions by: Ole André Vadla Ravnås // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -3859,6 +3859,13 @@ declare namespace Java { */ function choose(className: string, callbacks: ChooseCallbacks): void; + /** + * Duplicates a JavaScript wrapper for later use outside replacement method. + * + * @param handle An existing wrapper retrieved from `this` in replacement method. + */ + function retain(obj: Wrapper): Wrapper; + /** * Creates a JavaScript wrapper given the existing instance at `handle` of * given class `klass` as returned from `Java.use()`. @@ -3866,7 +3873,7 @@ declare namespace Java { * @param handle An existing wrapper or a JNI handle. * @param klass Class wrapper for type to cast to. */ - function cast(handle: any, klass: Wrapper): Wrapper; + function cast(handle: Wrapper | NativePointerValue, klass: Wrapper): Wrapper; /** * Creates a Java array with elements of the specified `type`, from a