forked from google/u2f-ref-code
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcountdown.js
More file actions
56 lines (47 loc) · 1.63 KB
/
countdown.js
File metadata and controls
56 lines (47 loc) · 1.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
// Copyright 2014 Google Inc. All rights reserved
//
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file or at
// https://developers.google.com/open-source/licenses/bsd
/**
* @fileoverview Provides a countdown-based timer interface.
*/
'use strict';
/**
* A countdown timer.
* @interface
*/
function Countdown() {}
/**
* Sets a new timeout for this timer.
* @param {number} timeoutMillis how long, in milliseconds, the countdown lasts.
* @param {Function=} cb called back when the countdown expires.
* @return {boolean} whether the timeout could be set.
*/
Countdown.prototype.setTimeout = function(timeoutMillis, cb) {};
/** Clears this timer's timeout. Timers that are cleared become expired. */
Countdown.prototype.clearTimeout = function() {};
/**
* @return {number} how many milliseconds are remaining until the timer expires.
*/
Countdown.prototype.millisecondsUntilExpired = function() {};
/** @return {boolean} whether the timer has expired. */
Countdown.prototype.expired = function() {};
/**
* Constructs a new clone of this timer, while overriding its callback.
* @param {Function=} cb callback for new timer.
* @return {!Countdown} new clone.
*/
Countdown.prototype.clone = function(cb) {};
/**
* A factory to create countdown timers.
* @interface
*/
function CountdownFactory() {}
/**
* Creates a new timer.
* @param {number} timeoutMillis How long, in milliseconds, the countdown lasts.
* @param {function()=} opt_cb Called back when the countdown expires.
* @return {!Countdown} The timer.
*/
CountdownFactory.prototype.createTimer = function(timeoutMillis, opt_cb) {};