Sync frida-gum typings with Frida 12.6.14 (#37574)

Also fix some bugs in the existing typings, and bump the major version
to avoid breaking existing consumers that rely on these bugs.

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-13 22:32:59 +02:00 committed by Pranav Senthilnathan
parent c50af0ccba
commit 79ac56e605

View File

@ -1,4 +1,4 @@
// Type definitions for non-npm package frida-gum 13.1
// Type definitions for non-npm package frida-gum 14.0
// Project: https://github.com/frida/frida
// Definitions by: Ole André Vadla Ravnås <https://github.com/oleavr>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
@ -1525,9 +1525,11 @@ interface UnixSystemFunctionResult {
}
declare class NativeCallback extends NativePointer {
constructor(func: AnyFunction, retType: NativeType, argTypes: NativeType[]);
constructor(func: NativeCallbackImplementation, retType: NativeType, argTypes: NativeType[]);
}
type NativeCallbackImplementation = (this: InvocationContext | undefined, ...params: any[]) => any;
type NativeArgumentValue = NativePointerValue | UInt64 | Int64 | number | boolean | any[];
type NativeReturnValue = NativePointer | UInt64 | Int64 | number | boolean | any[];
@ -2667,24 +2669,24 @@ declare class DebugSymbol {
address: NativePointer;
/**
* Name of the symbol.
* Name of the symbol, or `null` if unknown.
*/
name: string;
name: string | null;
/**
* Module name owning this symbol.
* Module name owning this symbol, or `null` if unknown.
*/
moduleName: string;
moduleName: string | null;
/**
* File name owning this symbol.
* File name owning this symbol, or `null` if unknown.
*/
fileName: string;
fileName: string | null;
/**
* Line number in `fileName`.
* Line number in `fileName`, or `null` if unknown.
*/
lineNumber: number;
lineNumber: number | null;
/**
* Looks up debug information for `address`.
@ -3375,7 +3377,7 @@ declare namespace ObjC {
*
* You may replace it by assigning to this property. See `ObjC.implement()` for details.
*/
implementation: AnyFunction | NativePointer;
implementation: NativePointer;
/**
* Return type name.
@ -3980,6 +3982,11 @@ declare namespace Java {
*/
$className: string;
/**
* Instance used for chaining up to super-class method implementations.
*/
$super: Wrapper;
/**
* Methods and fields.
*/
@ -4025,9 +4032,11 @@ declare namespace Java {
handle: NativePointer;
/**
* Implementation. Assign to this property to replace it.
* Implementation. Assign a new implementation to this property to
* replace the original implementation. Assign `null` at a future point
* to revert back to the original implementation.
*/
implementation: (...params: any[]) => any;
implementation: MethodImplementation | null;
/**
* Method return type.
@ -4045,6 +4054,8 @@ declare namespace Java {
canInvokeWith: (...args: any[]) => boolean;
}
type MethodImplementation = (this: Wrapper, ...params: any[]) => any;
interface Field {
/**
* Current value of this field. Assign to update the field's value.
@ -4150,16 +4161,28 @@ declare namespace Java {
*/
name: string;
/**
* Super-class. Omit to inherit from `java.lang.Object`.
*/
superClass?: Wrapper;
/**
* Interfaces implemented by this class.
*/
implements?: Wrapper[];
/**
* Methods to implement.
* Name and type of each field to expose.
*/
fields?: {
[name: string]: string;
};
/**
* Methods to implement. Use the special name `$init` to define one or more constructors.
*/
methods?: {
[name: string]: AnyFunction | MethodSpec | MethodSpec[];
[name: string]: MethodImplementation | MethodSpec | MethodSpec[];
};
}
@ -4177,7 +4200,7 @@ declare namespace Java {
/**
* Implementation.
*/
implementation: AnyFunction;
implementation: MethodImplementation;
}
interface VM {