imports.ts (831B) - raw
1 import { Config } from "./types"; 2 3 declare var _getImportsFunctionName: string; 4 declare var _runtimeName: boolean; 5 export const runtimeName = _runtimeName; 6 7 const remoteImports = require(_runtimeName + '_core/src/DeviceBridge')[_getImportsFunctionName](); 8 9 function callRemoteFunction(method: string, ...args: any[]): any | null { 10 return remoteImports[method](...args); 11 } 12 13 14 export const log = (logLevel: string, message: string) => callRemoteFunction("log", logLevel, message); 15 16 export const getConfig = () => callRemoteFunction("getConfig") as Config; 17 18 export const downloadLastOperaMedia = (isLongPress: boolean) => callRemoteFunction("downloadLastOperaMedia", isLongPress); 19 20 export function getFriendOriginalUsername(username: string): string | null { 21 return callRemoteFunction("getFriendOriginalUsername", username); 22 }