/// When v updates wait timeout and then return it. If v updates again
/// before timeout expires, reset the timeout and continue waiting. A numeric
/// timeout is a number of seconds. An invalid timeout is logged and leaves
/// any pending timer armed; without a pending timer, no value is produced.
val after_idle: fn(timeout: [duration, Number], v: 'a) -> 'a;
/// timer will wait timeout and then update with the current time.
/// If repeat is true, it will do this forever. If repeat is a number n,
/// it will do this n times and then stop. If repeat is false, it will do
/// this once. A numeric timeout is a number of seconds. Setting repeat to
/// zero stops the timer. An invalid timeout or repeat produces TimerError.
val timer: fn(timeout: [duration, Number], repeat: [bool, Number]) -> Result<datetime, `TimerError(string)>;
/// return the current time each time trigger updates
val now: fn(trigger: Any) -> datetime;
/// Add a duration to a datetime, saturating at the datetime range limits.
val add: fn(t: datetime, d: duration) -> datetime;
/// Subtract a duration from a datetime, saturating at the datetime range limits.
val sub: fn(t: datetime, d: duration) -> datetime;
/// Sum two durations. Overflow is a catchable error.
val add_dur: fn(a: duration, b: duration) -> Result<duration, `DurationError(string)>;
/// Subtract two durations, saturating at zero (durations are unsigned).
val sub_dur: fn(a: duration, b: duration) -> duration;
/// The time from `earlier` to `later`, saturating at zero when `later`
/// is not after `earlier` (durations are unsigned).
val diff: fn(later: datetime, earlier: datetime) -> duration;
/// Scale a duration by a float factor (divide by scaling with 1/x).
/// A negative, NaN, or overflowing result is a catchable error.
val scale: fn(d: duration, by: f64) -> Result<duration, `DurationError(string)>