Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Type definitions for Livestamp.js

  • Loading branch information...
commit 5c7b6cceb4d670c61a44bc634b1f5da716904b63 1 parent 051d75e
Vincent Bortone vbortone authored
15 jquery.livestampjs/jquery.livestampjs-tests.ts
View
@@ -0,0 +1,15 @@
+// Tests for Livestamp.js type definitions
+/// <reference path="../jquery/jquery.d.ts"/>
+/// <reference path="../moment/moment.d.ts"/>
+/// <reference path="jquery.livestampjs.d.ts"/>
+
+$('#test1').livestamp(new Date('June 18, 1987'));
+$('#test2').livestamp(1362282933);
+$('#test3').livestamp('destroy');
+$('#test4').livestamp(moment(new Date('June 18, 1987')));
+
+$.livestamp.update();
+$.livestamp.pause();
+$.livestamp.resume();
+$.livestamp.interval(340);
+var result:number = $.livestamp.interval();
27 jquery.livestampjs/jquery.livestampjs.d.ts
View
@@ -0,0 +1,27 @@
+// Type definitions for Livestamp.js
+// A simple, unobtrusive jQuery plugin that provides auto-updating timeago text to your timestamped HTML elements using Moment.js.
+// Project: http://http://mattbradley.github.com/livestampjs/
+// Definitions by: Vincent Bortone <https://github.com/vbortone/>
+// Definitions: https://github.com/borisyankov/DefinitelyTyped
+
+/// <reference path="../jquery/jquery.d.ts"/>
+/// <reference path="../moment/moment.d.ts"/>
+
+interface LivestampGlobal {
+ update(): void;
+ pause(): void;
+ resume(): void;
+ interval(): number;
+ interval(interval: number): void;
+}
+
+interface JQueryStatic {
+ livestamp: LivestampGlobal;
+}
+
+interface JQuery {
+ livestamp(date: Date): JQuery;
+ livestamp(moment: Moment): JQuery;
+ livestamp(timestamp: number): JQuery;
+ livestamp(timestamp: string): JQuery;
+}
Please sign in to comment.
Something went wrong with that request. Please try again.