Android:use webview to execute js

This commit is contained in:
pengfei.zhou
2021-11-05 15:14:32 +08:00
committed by osborn
parent 196497f3bd
commit bb17b74b99
7 changed files with 367 additions and 42 deletions

View File

@@ -1,4 +1,6 @@
declare module NativeClient {
function log(message: string): void;
function returnNative(ret: string): void;
function callNative(name: string, args: string): string;
}
declare type RawValue = number | string | boolean | object | undefined;
@@ -6,7 +8,21 @@ declare type WrappedValue = {
type: "number" | "string" | "boolean" | "object" | "array" | "null";
value: RawValue;
};
declare function _binaryValue(v: RawValue): {
type: string;
value: number;
} | {
type: string;
value: string;
} | {
type: string;
value: boolean;
} | {
type: string;
value: undefined;
};
declare function _wrappedValue(v: RawValue): WrappedValue;
declare function _rawValue(v: WrappedValue): RawValue;
declare function __injectGlobalObject(name: string, args: string): void;
declare function _injectGlobalObject(name: string, args: string): void;
declare function __injectGlobalFunction(name: string): void;
declare function __invokeMethod(objectName: string, functionName: string, stringifiedArgs: string): void;