mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 19:07:08 +00:00
Allow null and undefined as start parameter. (#34896)
According to the documentation, this indicates "now".
This commit is contained in:
parent
3d4299e6a9
commit
212ea87fbb
@ -6,6 +6,9 @@ let interval: number;
|
||||
ts = <countdown.Timespan>countdown(new Date());
|
||||
ts = <countdown.Timespan>countdown(150);
|
||||
|
||||
ts = <countdown.Timespan>countdown(undefined, Date.now() + 60000);
|
||||
ts = <countdown.Timespan>countdown(Date.now() - 60000, null);
|
||||
|
||||
interval = <number>countdown(new Date(),
|
||||
function (ts: countdown.Timespan) {
|
||||
document.getElementById('pageTimer').innerHTML = ts.toHTML('strong');
|
||||
|
||||
4
types/countdown/index.d.ts
vendored
4
types/countdown/index.d.ts
vendored
@ -1,11 +1,11 @@
|
||||
// Type definitions for countdown.js
|
||||
// Project: http://countdownjs.org/
|
||||
// Definitions by: Gabriel Juchault <https://github.com/gjuchault>
|
||||
// Definitions by: Gabriel Juchault <https://github.com/gjuchault>, Ionaru <https://github.com/Ionaru>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare namespace countdown {
|
||||
type DateFunction = (timespan: Timespan) => void;
|
||||
type DateTime = number | Date | DateFunction;
|
||||
type DateTime = number | Date | DateFunction | null | undefined;
|
||||
|
||||
interface Timespan {
|
||||
start?: Date;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user