js:compat es5,use context.sendNative to replace Proxy

This commit is contained in:
pengfei.zhou
2020-01-17 16:51:17 +08:00
committed by osborn
parent c813787318
commit b6f7588321
30 changed files with 461 additions and 414 deletions

View File

@@ -1,8 +1,30 @@
export * from 'reflect-metadata';
export declare type BridgeContext = {
[index: string]: {
[index: string]: (args?: any) => Promise<any>;
};
/**
* The identify of current context
*/
id: string;
/**
* In this case,It's current panel
*/
entity: any;
/**
* call native plugin
* @param namespace
* @param method
* @param args
*/
callNative(namespace: string, method: string, args?: any): Promise<any>;
/**
* Transform function to functionId as string
* @param func
*/
function2Id(func: Function): string;
/**
* Remove transformed functions
* @param funcId
*/
removeFuncById(funcId: string): void;
};
declare global {
const context: BridgeContext;