This repository has been archived on 2024-07-22. You can view files and clone it, but cannot push or open issues or pull requests.
Doric/doric-js/lib/src/runtime/sandbox.d.ts

30 lines
1.3 KiB
TypeScript
Raw Normal View History

2020-01-03 14:44:51 +08:00
import "reflect-metadata";
export declare function jsCallResolve(contextId: string, callbackId: string, args?: any): void;
export declare function jsCallReject(contextId: string, callbackId: string, args?: any): void;
export declare class Context {
entity: any;
id: string;
callbacks: Map<string, {
resolve: Function;
reject: Function;
}>;
hookBeforeNativeCall(): void;
hookAfterNativeCall(): void;
constructor(id: string);
callNative(namespace: string, method: string, args?: any): Promise<any>;
register(instance: Object): void;
2020-01-08 19:44:24 +08:00
function2Id(func: Function): string;
removeFuncById(funcId: string): void;
2020-01-03 14:44:51 +08:00
}
export declare function jsObtainContext(id: string): Context | undefined;
export declare function jsReleaseContext(id: string): void;
export declare function __require__(name: string): any;
export declare function jsRegisterModule(name: string, moduleObject: any): void;
export declare function jsCallEntityMethod(contextId: string, methodName: string, args?: any): any;
export declare function jsObtainEntry(contextId: string): <T extends new (...args: any[]) => {}>(constructor: T) => {
new (...args: any[]): {
context: Context | undefined;
};
} & T;
export declare function jsCallbackTimer(timerId: number): void;