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/
This commit is contained in:
Ole André Vadla Ravnås
2019-08-20 13:45:52 -07:00
committed by Sheetal Nandi
parent 46705cfcad
commit 7ab623aa54
+9 -2
View File
@@ -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 <https://github.com/oleavr>
// 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