mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
chore: update tslint rules (#7391)
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/**
|
||||
/**
|
||||
* Android specific timer functions implementation.
|
||||
*/
|
||||
let timeoutHandler;
|
||||
@@ -11,6 +11,7 @@ function createHandlerAndGetId(): number {
|
||||
}
|
||||
|
||||
timerId++;
|
||||
|
||||
return timerId;
|
||||
}
|
||||
|
||||
|
||||
@@ -4,20 +4,21 @@ let timerId = 0;
|
||||
|
||||
interface KeyValuePair<K, V> {
|
||||
k: K;
|
||||
v: V
|
||||
v: V;
|
||||
}
|
||||
|
||||
class TimerTargetImpl extends NSObject {
|
||||
private callback: Function;
|
||||
private disposed: boolean;
|
||||
private id: number
|
||||
private shouldRepeat: boolean
|
||||
private id: number;
|
||||
private shouldRepeat: boolean;
|
||||
|
||||
public static initWithCallback(callback: Function, id: number, shouldRepeat: boolean): TimerTargetImpl {
|
||||
let handler = <TimerTargetImpl>TimerTargetImpl.new();
|
||||
handler.callback = callback;
|
||||
handler.id = id;
|
||||
handler.shouldRepeat = shouldRepeat;
|
||||
|
||||
return handler;
|
||||
}
|
||||
|
||||
@@ -63,6 +64,7 @@ function createTimerAndGetId(callback: Function, milliseconds: number, shouldRep
|
||||
|
||||
export function setTimeout(callback: Function, milliseconds = 0, ...args): number {
|
||||
let invoke = () => callback(...args);
|
||||
|
||||
return createTimerAndGetId(zonedCallback(invoke), milliseconds, false);
|
||||
}
|
||||
|
||||
@@ -75,6 +77,7 @@ export function clearTimeout(id: number): void {
|
||||
|
||||
export function setInterval(callback: Function, milliseconds = 0, ...args): number {
|
||||
let invoke = () => callback(...args);
|
||||
|
||||
return createTimerAndGetId(zonedCallback(invoke), milliseconds, true);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user