fix: global declarations fix (#10247)

This commit is contained in:
farfromrefuge
2023-03-23 17:55:38 +00:00
committed by GitHub
parent 7edd21a688
commit 2f4c318276
16 changed files with 118 additions and 119 deletions

View File

@@ -2,13 +2,13 @@
declare let __startCPUProfiler: any;
declare let __stopCPUProfiler: any;
export function uptime() {
return global.android ? (<any>org).nativescript.Process.getUpTime() : (<any>global).__tns_uptime();
export function uptime(): number {
return global.android ? (<any>org).nativescript.Process.getUpTime() : global.__tns_uptime();
}
export function log(message: string, ...optionalParams: any[]): void {
if ((<any>global).__nslog) {
(<any>global).__nslog('CONSOLE LOG: ' + message);
if (global.__nslog) {
global.__nslog('CONSOLE LOG: ' + message);
}
console.log(message, ...optionalParams);
}
@@ -31,7 +31,7 @@ const timers: { [index: string]: TimerInfo } = {};
const anyGlobal = <any>global;
const profileNames: string[] = [];
export const time = (<any>global).__time || Date.now;
export const time = (global.__time || Date.now) as () => number;
export function start(name: string): void {
let info = timers[name];