// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

#include "DocString.h"
import "IReactPropertyBag.idl";

namespace Microsoft.ReactNative {

  [webhosthidden]
  interface ITimer
  {
    Windows.Foundation.TimeSpan Interval;
    void Start();
    void Stop();

    event Windows.Foundation.EventHandler<Object> Tick;
  }

  [default_interface]
  [webhosthidden]
  DOC_STRING(
    "Used to create timers.")
  runtimeclass Timer
  {
    DOC_STRING(
      "Creates a UI timer.  Must be called on the UI thread.  Using this rather than "
      "System/Windows.DispatcherQueue.CreateTimer works when applications have provided "
      "custom Timer implementations using @ReactCoreInjection.SetTimerFactory")
    static ITimer Create(IReactPropertyBag properties);
  }

} // namespace Microsoft.ReactNative
